This code is bad:
call InitCommonControlsEx
call InitCommonControls
it would have been written like this:
mov rax,OFFSET SomeWhere
push rax
mov rax,OFFSET InitCommonControls
push rax
jmp InitCommonControlsEx
SomeWhere :
"InitCommonControlsEx" must be the last because I initialize RCX register with a pointer on a structure.
In theory it's good, but in practice it crashes without me having any idea of the cause! So if anyone has an idea I accept it.
InitCommonControlsEx takes one parameter, a pointer to the structure, and in 64-bit code you must pass it in rcx, not on the stack.
The RCX register is initialized before any push
I suppose the RSP register is not in the form the function is waiting for.
What for is that InitCommonControls() when InitCommonControlsEx() was used?
InitCommonControls() only load that COMCTL32.dll ?
For common controls and for themes.
Quote
Registers and initializes certain common control window classes. This function is obsolete. New applications should use the InitCommonControlsEx (https://msdn.microsoft.com/en-us/library/windows/desktop/bb775697(v=vs.85).aspx)
InitCommonControls() is only a stub function for reference comctl32.dll.
You don't have to call it, if that dll is already referenced by import library.
InitCommonControls:
ret
nop
nop
...