Ticket #5392: win32_api.hpp.#5392.patch
File win32_api.hpp.#5392.patch, 2.2 KB (added by , 11 years ago) |
---|
-
win32_api.hpp
160 160 static unsigned long key_query_value = 0x0001; 161 161 162 162 //COM API 163 const long RPC_C_AUTHZ_NONE_IG = 0; 164 const long RPC_C_AUTHN_LEVEL_CALL_IG = 3; 163 165 const long RPC_C_AUTHN_LEVEL_PKT_IG = 4; 166 const long RPC_C_AUTHN_WINNT_IG = 10; 164 167 const long RPC_C_IMP_LEVEL_IMPERSONATE_IG = 3; 165 168 const long EOAC_NONE_IG = 0; 166 169 const long CLSCTX_INPROC_SERVER_IG = 0x1; … … 858 861 extern "C" __declspec(dllimport) long __stdcall CoCreateInstance(const GUID_IG & rclsid, IUnknown_IG *pUnkOuter, 859 862 unsigned long dwClsContext, const GUID_IG & riid, void** ppv); 860 863 extern "C" __declspec(dllimport) void __stdcall CoUninitialize(void); 864 extern "C" __declspec(dllimport) long __stdcall CoSetProxyBlanket( 865 IUnknown_IG *pProxy, 866 DWORD dwAuthnSvc, 867 DWORD dwAuthzSvc, 868 OLECHAR *pServerPrincName, 869 DWORD dwAuthnLevel, 870 DWORD dwImpLevel, 871 RPC_AUTH_IDENTITY_HANDLE pAuthInfo, 872 DWORD dwCapabilities 873 ); 861 874 862 875 863 864 876 //API function typedefs 865 877 //Pointer to functions 866 878 typedef long (__stdcall *NtDeleteFile_t)(object_attributes_t *ObjectAttributes); … … 1516 1528 1517 1529 com_releaser<IWbemServices_IG> IWbemServices_releaser(pWbemServices); 1518 1530 1531 // addition to fix ticket #5392 1532 // @see http://support.microsoft.com/kb/948829 1533 // @see http://msdn.microsoft.com/en-us/library/ms692692%28v=vs.85%29.aspx 1534 // ignoring the return value, because the following lines may work anyway 1535 CoSetProxyBlanket( 1536 pWbemServices, // Indicates the proxy to set 1537 RPC_C_AUTHN_WINNT_IG, // RPC_C_AUTHN_xxx 1538 RPC_C_AUTHZ_NONE_IG, // RPC_C_AUTHZ_xxx 1539 NULL, // Server principal name 1540 RPC_C_AUTHN_LEVEL_CALL_IG, // RPC_C_AUTHN_LEVEL_xxx 1541 RPC_C_IMP_LEVEL_IMPERSONATE_IG, // RPC_C_IMP_LEVEL_xxx 1542 NULL, // client identity 1543 EOAC_NONE_IG // proxy capabilities 1544 ); 1545 1519 1546 strValue.clear(); 1520 1547 strValue += L"Select "; 1521 1548 strValue += wmi_class_var;