Function at 0x40eec0
Capabilities:
Connect pipe
Read pipe
Write pipe

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc84
mov eax, dword [0x49a0e8]
test eax, eax
push esi
mov esi, dword [ebp + 8]
push edi
mov byte [ebp - 1], 0
je 0x40eee9
push esi
push str.WinMainClient_WtsStateProcessing_is_called_with_state__u
call fcn.0040acd0
add esp, 8
xor eax, eax
mov ecx, 0x188
lea edi, [ebp - 0x664]
rep stosd dword es:[edi], eax
lea eax, [esi - 1]
cmp eax, 7
ja case.0x40ef04.3
jmp dword [eax*4 + 0x40f278]
mov ecx, 0x4a88b8
call fcn.00416110
cmp dword [0x49b638], 8
jb case.0x40ef04.3
call fcn.0040a070
mov eax, dword [0x49b618]
test eax, eax
je case.0x40ef04.3
mov byte [ebp - 1], 1
jmp case.0x40ef04.3
cmp esi, 8
jne 0x40ef4c
mov ecx, 0x4a88b8
call fcn.00416110
mov ecx, dword [0x49b678]
test ecx, ecx
je 0x40ef5b
call fcn.00417c10
cmp esi, 8
jne 0x40ef6d
call fcn.0044fd00
test eax, eax
je case.0x40ef04.3
xor eax, eax
mov ecx, 0x188
lea edi, [ebp - 0xc84]
rep stosd dword es:[edi], eax
mov eax, dword [0x49b704]
mov dword [ebp - 0xc74], eax
xor eax, eax
push eax
mov ecx, 0xb
mov dword [ebp - 0xc7c], ecx
lea edi, [ebp - 0x44]
rep stosd dword es:[edi], eax
lea ecx, [ebp + 8]
push ecx
push 0x2c
lea edx, [ebp - 0x44]
push edx
push 0x620
lea eax, [ebp - 0xc84]
push eax
push str..pipeExtEventPipe_Service
mov dword [ebp - 0xc84], 0x8001
mov dword [ebp - 0xc80], 0x620
call dword [sym.imp.KERNEL32.dll_CallNamedPipeA]
test eax, eax
je 0x40efd9
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, 1
jne 0x40efed
mov dword [0x49b718], 0
call fcn.0040ec60
mov eax, dword [0x49b718]
test eax, eax
jne 0x40f012
cmp esi, 8
jne 0x40f012
test dword [0x49b63c], 0x8000000
je 0x40f012
mov ecx, dword [0x49a0f4]
call fcn.00437240
cmp dword [0x49b638], 8
jb case.0x40ef04.3
cmp esi, 1
jne 0x40f029
call fcn.0040a070
xor ecx, ecx
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x10], ecx
lea edx, [ebp - 0x18]
mov dword [ebp - 0xc], ecx
push edx
mov dword [ebp - 8], ecx
mov dword [ebp - 0x18], 7
call fcn.0044baa0
mov eax, dword [0x49b638]
add esp, 4
cmp eax, 8
jb case.0x40ef04.3
jmp 0x40ef27
mov ecx, 0x4a88b8
call fcn.00416130
cmp esi, 2
mov dword [0x4a8ae0], esi
je 0x40f097
cmp esi, 6
je 0x40f097
mov ecx, 0x4a88b8
call fcn.00416130
mov ecx, dword [0x49b678]
test ecx, ecx
je 0x40f0c1
push 0
call fcn.00417c50
jmp 0x40f0c1
mov ecx, dword [0x49b678]
test ecx, ecx
mov dword [0x49b718], 1
je 0x40f0b2
push 1
call fcn.00417c50
mov ecx, dword [0x49b658]
test ecx, ecx
je 0x40f0c1
call fcn.00401b80
cmp esi, 7
jne 0x40f10a
call fcn.0044fd00
test eax, eax
je 0x40f10a
mov eax, dword [0x49b704]
mov dword [ebp - 0x654], eax
xor eax, eax
push 1
mov ecx, 0xb
lea edi, [ebp - 0x44]
rep stosd dword es:[edi], eax
lea ecx, [ebp + 8]
push ecx
push 0x2c
lea edx, [ebp - 0x44]
push edx
push 0x620
lea eax, [ebp - 0x664]
mov dword [ebp - 0x65c], 0xd
push eax
jmp 0x40f153
mov ecx, dword [0x49b678]
test ecx, ecx
je 0x40f119
call fcn.00417a80
mov ecx, dword [0x49b704]
push 1
mov dword [ebp - 0x654], ecx
xor eax, eax
lea edx, [ebp + 8]
push edx
mov ecx, 0xb
lea edi, [ebp - 0x44]
rep stosd dword es:[edi], eax
push 0x2c
lea eax, [ebp - 0x44]
push eax
push 0x620
lea ecx, [ebp - 0x664]
mov dword [ebp - 0x65c], 0xc
push ecx
push str..pipeExtEventPipe_Service
mov dword [ebp - 0x660], 0x620
mov dword [ebp - 0x664], 0x8001
call dword [sym.imp.KERNEL32.dll_CallNamedPipeA]
test eax, eax
je 0x40f17c
call dword [sym.imp.KERNEL32.dll_GetLastError]
call fcn.00429270
mov al, byte [ebp - 1]
test al, al
mov dword [0x4a8ae0], esi
je 0x40f257
mov eax, dword [0x4aac54]
test eax, eax
je 0x40f257
xor edx, edx
mov dword [ebp - 0x14], edx
xor eax, eax
mov dword [ebp - 0x10], edx
mov ecx, 0x188
lea edi, [ebp - 0xc84]
rep stosd dword es:[edi], eax
mov dword [ebp - 0xc], edx
push edx
mov ecx, 0xb
lea edi, [ebp - 0x44]
rep stosd dword es:[edi], eax
mov eax, dword [0x49b704]
lea ecx, [ebp - 0x44]
mov dword [ebp - 8], edx
push ecx
lea edx, [ebp - 0xc84]
push edx
push str..pipeExtEventPipe_Service
mov dword [ebp - 0x18], 0
mov dword [ebp - 0xc7c], 0x3f
mov dword [ebp - 0xc74], eax
call fcn.00409e90
add esp, 0x10
test eax, eax
jne 0x40f21a
test dword [0x49a0e8], 0x10000
je 0x40f238
push str.PowerXpressSwitch:_get_defer_switch_from_global_service_fails__n
call fcn.0040acd0
add esp, 4
jmp 0x40f238
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x34]
mov edx, dword [ebp - 0x30]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp - 0x28]
mov dword [ebp - 0x10], edx
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], ecx
mov eax, dword [ebp - 0x14]
cmp eax, 2
je 0x40f245
cmp eax, 1
jne 0x40f270
lea edx, [ebp - 0x18]
push edx
call fcn.00443650
add esp, 4
pop edi
pop esi
mov esp, ebp
pop ebp
ret
test dword [0x49a0e8], 0x10000
je 0x40f270
push str.Not_ready_to_switch_yet__will_switch_later_when_iGPU_driver_initialized__n
call fcn.0040acd0
add esp, 4
pop edi
pop esi
mov esp, ebp
pop ebp
ret