Re: "Access is denied" on local machine



The one thing that strikes me right away is your AuthnLevel:6. This is the
highest level of authentication you can use.
Try using 3.

> All these calls are returning correctly, and the code actually fails
> with the appropriate error when I try to enumerate the results of a
> query.

Yep. That is exactly what every other programmer in every other language
will get if the permissions aren't correct.
That's when it happens.

hth.


"rbgibbons" <rbgibbons@xxxxxxxxx> wrote in message
news:1127866800.325250.231760@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I have a problem that is eluding me. We have windows service WMI
> application. Thus, it's accessing the local machine using the local
> system account. On most machines it works nicely. On one particular
> machine, it fails with the "Access is denied" error code (0x80070005).
>
> I've run CoQueryProxyBlanket, and received the following results,
> identical to the results that I get from a working machine:
> AuthnSvc: 10
> AuthzSvc: 0
> ServerPrincName: NT AUTHORITY\SYSTEM
> AuthnLevel: 6
> ImpLevel: 3
> Capabilities: 0
>
> One distinguishing feature of the machine is that, while it is
> WindowsXP, it does not have any of the Windows XP service packs
> installed.
>
> The relevant code (with error handling removed):
>
> hr = ::CoCreateInstance(CLSID_WbemLocator, 0,
> CLSCTX_INPROC_SERVER,
> IID_IWbemLocator,
> (LPVOID *) &pLoc);
>
>
> // Connect to the root\default namespace with the current user.
> hr = pLoc->ConnectServer(_bstr_t(L"ROOT\\CIMV2"),
> NULL, NULL, 0, NULL, 0, 0, &m_WBEMService);
>
> hr = CoQueryProxyBlanket(m_WBEMService,
> &dwAuthService,
> &dwAuthZService,
> &name,
> &dwAuthLevel,
> &dwImpLevel,
> NULL,
> &dwCapabilities);
>
> hr = CoSetProxyBlanket(m_WBEMService,
> RPC_C_AUTHN_DEFAULT,
> RPC_C_AUTHZ_NONE,
> NULL,
> dwAuthLevel,
> RPC_C_IMP_LEVEL_IMPERSONATE,
> NULL,
> EOAC_NONE);
>
> All these calls are returning correctly, and the code actually fails
> with the appropriate error when I try to enumerate the results of a
> query.
>
> I'm baffled as to why this isn't working, and am looking for thoughts
> about ways to diagnose this programmatically. Since this is software
> intended for end users, I have to be able to identify the problem
> programmatically, and either fix it, or tell the end user what the
> problem is, and so that they can install whatever patch is required to
> fix it.
>
> Any assistance would be appreciated.
>
> Thanks,
> Richard
>


.



Relevant Pages

  • Error LNK2019: unresolved external symbol CompleteAuthToken referenced in function
    ... When I trying to link a source that calls CompleteAuthToken it fails. ... Reading MSDN Library it tell me that CompleteAuthToken is supported on Windows CE 2.10 and later and I should link against Secur32.lib, but adding that library didn't fix the unresolved symbol error. ...
    (microsoft.public.pocketpc.developer)
  • Unable to access system restore on vista
    ... I have been having problems with vista the last few days. ... take me to the windows start up screen. ... disk but as I can not get into start up it fails to do anything. ... If anyone has any ideas on how to fix this please post asap ...
    (microsoft.public.windows.vista.general)
  • Re: search
    ... Click Start, Run, then type in: regsvr32 /i browseui.dll ... If the above fails to fix the problem, then consider the following links for ... Troubleshooting Search Issues in Windows XP ...
    (microsoft.public.windowsxp.accessibility)
  • Re: Ethereal with Intel 2200BG card
    ... program launches OK but it fails to capture packets. ... What is the fix for this? ... Under Windows XP, "Capture packets in promiscuous mode" doesn't work ...
    (alt.internet.wireless)
  • Re: The Microsoft Way (OT)
    ... > yet there isn't one single original thing about Windows that didn't appear ... MS did in the beginning, and cash in on support, and later improvements? ... Its left to the programmer. ... This card stated, ...
    (alt.lang.asm)