Click here to Skip to main content
15,905,071 members
Home / Discussions / COM
   

COM

 
GeneralRe: HOW CAN I ADD dll to windows .net application Pin
Stuart Dootson6-Jul-09 22:04
professionalStuart Dootson6-Jul-09 22:04 
AnswerRe: HOW CAN I ADD dll to windows .net application Pin
Sonhospa12-Jun-09 1:29
Sonhospa12-Jun-09 1:29 
QuestionRedirecting JavaScript Function Calls to My C++ Code Pin
kochikoo5-Jun-09 2:29
kochikoo5-Jun-09 2:29 
AnswerRe: Redirecting JavaScript Function Calls to My C++ Code Pin
kochikoo15-Jun-09 21:44
kochikoo15-Jun-09 21:44 
GeneralRe: Redirecting JavaScript Function Calls to My C++ Code Pin
nat32_support21-Jun-09 13:43
nat32_support21-Jun-09 13:43 
QuestionQuerying WMI from inside WMI Provider Pin
krishiyengar4-Jun-09 9:23
krishiyengar4-Jun-09 9:23 
AnswerRe: Querying WMI from inside WMI Provider Pin
Baltoro4-Jun-09 14:02
Baltoro4-Jun-09 14:02 
GeneralRe: Querying WMI from inside WMI Provider Pin
krishiyengar5-Jun-09 5:46
krishiyengar5-Jun-09 5:46 
In my code for WMI Provider, I am trying access a different namespace. My current namespace is "TLV2" and I need to read the disk values from "CIMV2". The method Next() of object IEnumWbemClassObject returns me an WBEM_E_ACCESS_DENIED.

Both the providers hosting model is same "NetworkServiceHost", within my provider source I am initialzing WMI for calls to "CIMV2". I figure this is something to do with the impersonation or security, though the hosting models are same but the windows processes are different. The code for initializing WMI is as follows;

bool CWMI::InitializeWMI(IWbemContext *pCtx)
{
      HRESULT hr;
      IsConnected = false;

      hr = CoCreateInstance(CLSID_WbemLocator, 0, CLSCTX_INPROC_SERVER, IID_IWbemLocator, (LPVOID *) &WbemLocator);
      if (FAILED(hr)) {
            CoUninitialize();
      }
      else{
            if(SUCCEEDED(hr) && WbemLocator != NULL){
                  hr = WbemLocator->ConnectServer( BSTR(L"root\\cimv2"), NULL, NULL, 0, NULL, 0,pCtx, &WbemServices);
                  if (FAILED(hr)){
                        WbemLocator->Release();
                        CoUninitialize();
                  }
                  else{
                        if(SUCCEEDED(hr))
                        {
                              hr = CoSetProxyBlanket(WbemServices, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE,NULL, RPC_C_AUTHN_LEVEL_CALL, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE);
                              if (FAILED(hr)) {
                                    WbemServices->Release();
                                    WbemLocator->Release();     
                                    CoUninitialize();
                              }
                              else{
                                    IsConnected = true;
                              }
                        }
                  }
            }
      }
      return(IsConnected);
}
GeneralRe: Querying WMI from inside WMI Provider Pin
Baltoro6-Jun-09 8:35
Baltoro6-Jun-09 8:35 
GeneralRe: Querying WMI from inside WMI Provider Pin
krishiyengar8-Jun-09 3:04
krishiyengar8-Jun-09 3:04 
GeneralRe: Querying WMI from inside WMI Provider Pin
krishiyengar8-Jun-09 6:02
krishiyengar8-Jun-09 6:02 
QuestionPROBLEM IN MDAC version2.6 Pin
RAJAGOPALMS762-Jun-09 0:08
RAJAGOPALMS762-Jun-09 0:08 
QuestionHow to get Defalut interface of CoClass Pin
vibindia1-Jun-09 23:55
vibindia1-Jun-09 23:55 
AnswerRe: How to get Defalut interface of CoClass Pin
«_Superman_»2-Jun-09 0:21
professional«_Superman_»2-Jun-09 0:21 
AnswerRe: How to get Defalut interface of CoClass Pin
vibindia2-Jun-09 0:37
vibindia2-Jun-09 0:37 
AnswerRe: How to get Defalut interface of CoClass [modified] Pin
Lim Bio Liong6-Jun-09 5:32
Lim Bio Liong6-Jun-09 5:32 
QuestionHow to customise the window xp print dialog. Pin
manjari kar30-May-09 1:23
manjari kar30-May-09 1:23 
QuestionDebugging WMI Providers Pin
krishiyengar28-May-09 7:26
krishiyengar28-May-09 7:26 
AnswerRe: Debugging WMI Providers Pin
Stuart Dootson28-May-09 8:08
professionalStuart Dootson28-May-09 8:08 
GeneralRe: Debugging WMI Providers Pin
krishiyengar29-May-09 2:10
krishiyengar29-May-09 2:10 
GeneralRe: Debugging WMI Providers Pin
Stuart Dootson29-May-09 2:12
professionalStuart Dootson29-May-09 2:12 
GeneralRe: Debugging WMI Providers Pin
krishiyengar29-May-09 2:49
krishiyengar29-May-09 2:49 
GeneralRe: Debugging WMI Providers Pin
Stuart Dootson29-May-09 2:53
professionalStuart Dootson29-May-09 2:53 
GeneralRe: Debugging WMI Providers Pin
krishiyengar29-May-09 3:03
krishiyengar29-May-09 3:03 
GeneralRe: Debugging WMI Providers Pin
Stuart Dootson29-May-09 3:18
professionalStuart Dootson29-May-09 3:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.