Dmytro Sheyko wrote:
:

Why we obtain HMODULE for kernel32 this way:

     // get handle to kernel32
     if (GetModuleHandleExW((GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT),
                            (LPCWSTR)&CreateFileW, &h) != 0)
     {
         ...


instead of

     handle = GetModuleHandle("kernel32");
GetModuleHandleExW allows you to provide the address of a function in the library that you need the handle for and so you avoid issues when multiple libraries with the same name are loaded.

:

Also according to MSDN GetModuleHandleEx requires at minimum "Windows XP" or "Windows Server 2003". It means that we do not support "Windows 2000", right?
I don't think it's been possible to install or run jdk7 on Windows 2000 for some time.

-Alan

Reply via email to