Function at 0x40d860
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x39c
mov eax, dword [str.__wine_clipboard_]
mov dword [ebp - 0x244], eax
mov eax, dword [0x4188c4]
mov dword [ebp - 0x240], eax
mov eax, dword [0x4188c8]
mov dword [ebp - 0x23c], eax
mov eax, dword [0x4188cc]
mov dword [ebp - 0x238], eax
mov eax, dword [0x4188d0]
mov dword [ebp - 0x234], eax
mov eax, dword [0x4188d4]
mov dword [ebp - 0x230], eax
mov eax, dword [0x4188d8]
mov dword [ebp - 0x22c], eax
mov eax, dword [0x4188dc]
mov dword [ebp - 0x228], eax
mov eax, dword [0x4188e0]
mov dword [ebp - 0x224], eax
call dword [sym.imp.user32.dll_GetProcessWindowStation]
lea edx, [ebp - 0x222]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0x208
mov dword [esp + 8], edx
mov dword [esp + 4], 2
mov dword [esp], eax
call dword [sym.imp.user32.dll_GetUserObjectInformationW]
sub esp, 0x14
test eax, eax
jne 0x40d920
mov edi, eax
test byte [0x4120c4], 2
jne 0x40d988
lea esp, [ebp - 0xc]
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
lea ebx, [ebp - 0x244]
mov dword [esp + 4], 1
mov edi, 1
mov dword [esp + 8], ebx
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_CreateMutexW]
sub esp, 0xc
mov esi, eax
mov eax, dword fs:[0x18]
cmp dword [eax + 0x34], 0xb7
jne 0x40d912
test byte [0x4120c4], 8
jne 0x40d9c0
mov dword [esp], esi
mov edi, 1
mov dword [esp + 4], 0xffffffff
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov eax, edi
sub esp, 8
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0xc], str.failed_to_get_winstation_name_n
mov dword [esp + 8], str.wait_clipboard_mutex
mov dword [esp + 4], 0x4120c4
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0_1
lea esp, [ebp - 0xc]
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, ebx
shr eax, 0x10
je 0x40daa8
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, 0x4132b7
test ecx, ecx
jne 0x40dabb
movzx eax, word [ebp - 0x244]
test ax, ax
je 0x40dbc8
nop
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x40da00
mov ecx, 0x224c
mov dword [ebp - 0x37c], ebx
mov word [ebp - 0x370], cx
lea ecx, [ebp - 0x36e]
jmp 0x40da74
cmp ax, 9
je 0x40db78
cmp ax, 0xa
jne 0x40db0e
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea edi, [edx - 1]
test edx, edx
jle 0x40db90
lea eax, [ebp - 0x24e]
cmp ecx, eax
ja 0x40db90
mov eax, dword [ebp - 0x37c]
mov edx, edi
movzx eax, word [eax]
add dword [ebp - 0x37c], 2
cmp ax, 0xd
je 0x40daf0
jbe 0x40da30
cmp ax, 0x22
je 0x40db60
cmp ax, 0x5c
jne 0x40db01
mov eax, 0x5c5c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x40da50
movzx ebx, bx
mov dword [esp], 0x4132c1
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf_1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.waiting_for_mutex__s_n
mov dword [esp + 8], str.wait_clipboard_mutex
mov dword [esp + 4], 0x4120c4
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x40d961
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x40da50
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x40dbc0
mov edi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + 0x418884]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [edi + 0x418884]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + 0x418884]
and edi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [edi + 0x418884]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x40da50
mov eax, 0x225c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x40da50
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x40da50
mov byte [ecx], 0x22
test edi, edi
jle 0x40dbe1
mov edi, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], di
mov byte [eax], 0
lea eax, [ebp - 0x370]
mov dword [esp], eax
call sym.___wine_dbg_strdup
jmp 0x40dabb
mov byte [ecx], al
inc ecx
jmp 0x40da50
mov ebx, 0x224c
mov byte [ebp - 0x36e], 0x22
lea ecx, [ebp - 0x36e]
mov word [ebp - 0x370], bx
lea eax, [ecx + 1]
jmp 0x40dba7