mario semo
2009-05-04 15:59:24 UTC
Hello,
I try to read some BIOS informations with sample code from microsoft.
( http://msdn.microsoft.com/en-us/library/aa390423(VS.85).aspx )
this works fine, except... when i try to call my code in a DLLMain
(InitTerm) routine and the operating System is Windows VISTA.
in this case the connect server call simple does not return anymore.
trace1
hres = pLoc->ConnectServer(
_bstr_t(L"ROOT\\CIMV2"), // WMI namespace
NULL, // User name
NULL, // User password
0, // Locale
NULL, // Security flags
0, // Authority
0, // Context object
&pSvc // IWbemServices proxy
);
trace2
i see trace1 but not trace2.
when
a) i call the code from a global static var constructor inside .exe -> no
problem
or
b) when OS!=VISTA : no problem
or
c) when i call the code from anywhere after main() -> no problem
any ideas whats the problem or what i can do against it?
(yes, i know ... global variables are never a good programming technique and
should be avoided, but i would like to understand the problem).
any ideas?
I try to read some BIOS informations with sample code from microsoft.
( http://msdn.microsoft.com/en-us/library/aa390423(VS.85).aspx )
this works fine, except... when i try to call my code in a DLLMain
(InitTerm) routine and the operating System is Windows VISTA.
in this case the connect server call simple does not return anymore.
trace1
hres = pLoc->ConnectServer(
_bstr_t(L"ROOT\\CIMV2"), // WMI namespace
NULL, // User name
NULL, // User password
0, // Locale
NULL, // Security flags
0, // Authority
0, // Context object
&pSvc // IWbemServices proxy
);
trace2
i see trace1 but not trace2.
when
a) i call the code from a global static var constructor inside .exe -> no
problem
or
b) when OS!=VISTA : no problem
or
c) when i call the code from anywhere after main() -> no problem
any ideas whats the problem or what i can do against it?
(yes, i know ... global variables are never a good programming technique and
should be avoided, but i would like to understand the problem).
any ideas?
--
mit freundlichen Grüßen
mario semo
mit freundlichen Grüßen
mario semo