src/jdk.jpackage/windows/native/libjpackage/WinSysInfo.cpp
branchJDK-8200758-branch
changeset 57909 c7de06ed4b54
parent 57444 91e9d4691e5e
equal deleted inserted replaced
57908:9a005146bc1c 57909:c7de06ed4b54
   103 HMODULE getCurrentModuleHandle()
   103 HMODULE getCurrentModuleHandle()
   104 {
   104 {
   105     // get module handle for the address of this function
   105     // get module handle for the address of this function
   106     LPCWSTR address = reinterpret_cast<LPCWSTR>(getCurrentModuleHandle);
   106     LPCWSTR address = reinterpret_cast<LPCWSTR>(getCurrentModuleHandle);
   107     HMODULE hmodule = NULL;
   107     HMODULE hmodule = NULL;
   108     if (!GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
   108     if (!GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
   109                             address, &hmodule))
   109             | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, address, &hmodule))
   110     {
   110     {
   111         JP_THROW(SysError(tstrings::any() << "GetModuleHandleExW failed", GetModuleHandleExW));
   111         JP_THROW(SysError(tstrings::any() << "GetModuleHandleExW failed",
       
   112                 GetModuleHandleExW));
   112     }
   113     }
   113     return hmodule;
   114     return hmodule;
   114 }
   115 }
   115 
   116 
   116 tstring getCurrentModulePath()
   117 tstring getCurrentModulePath()