What's goings-on calling WZCEnumInterfaces return error 1008 under WinXP

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi There,

I'm trying to get Wireless NICs for Enable/Disable WZC by calling
WZCEnumInterfaces in my app. program but failed. It returns error code
1008 (0xc0000005) ERROR_NO_TOKEN. I am very grateful who has any ideal
to help me.

////// Type Definition /////////////////////////////////////////////

typedef struct
{
#if defined(MIDL_PASS)
[unique, string] LPWSTR wszGuid;
#else
LPWSTR wszGuid;
#endif
} INTF_KEY_ENTRY, *PINTF_KEY_ENTRY;

typedef struct
{
DWORD dwNumIntfs;
#if defined(MIDL_PASS)
[size_is(dwNumIntfs)] PINTF_KEY_ENTRY pIntfs;
#else
PINTF_KEY_ENTRY pIntfs;
#endif
} INTFS_KEY_TABLE, *PINTFS_KEY_TABLE;


//////// Implementation
//////////////////////////////////////////////////////////

DWORD LoadWZCLibrary()
{
m_hWZCLib = LoadLibrary ("wzcsapi.dll");
if (!m_hWZCLib)
{
return GetLastError();
}

pfnWZCEnum=(pfnWZC_EnumInterfaces)GetProcAddress
(m_hWZCLib, "WZCEnumInterfaces");

...........................
}

DWORD WZCStatus(LPWSTR pcDevName, BOOL& bEnable)
{
INTFS_KEY_TABLE ikt;
PINTF_KEY_ENTRY pke;
INTF_ENTRY ie;
DWORD dwStatus;
DWORD dwOutFlags= 0;

dwStatus= pfnWZCEnum(NULL, &ikt);
if (dwStatus != ERROR_SUCCESS)
{
TRACE("WZCEnumeration Error 0x%X", dwStatus);
return GetLastError();
}

....................................
}

dwStatus return 0xc0000005
GetLastError return 1008 (ERROR_NO_TOKEN)

.



Relevant Pages

  • Re: Adding C code to my C# application
    ... dwStatus = myCreateIpForwardEntry; ... I would say that specifying the gateway (the only part of the copied ... typedef DWORD (PMIB_IPFORWARDTABLE, PULONG, ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Adding C code to my C# application
    ... dwStatus = myCreateIpForwardEntry; ... I would say that specifying the gateway (the only part of the copied ... typedef DWORD (PMIB_IPFORWARDTABLE, PULONG, ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Starting a Dial Up connection?
    ... > From the Function I had I recieved this error code "30064771159" how ... C: DWORD InternetDial( ... indicates that a ANSI version (i.e. InternetDialA) will be used on Win9x ... It takes 4 bytes so you can declare it as Integer but all ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Issue with LINEAGENTGROUPENTRY -> Name
    ... > Andreas - Oops, I was using DWORD instead of LONG for Status. ... In TAPI.H error code ... I have authored a tool to dump all TAPI error codes / messages: ...
    (microsoft.public.win32.programmer.tapi)
  • Re: AzMan Access Check
    ... I have got your Win32 version sample project. ... DWORD dwsid, dwdomain; ... printf("ConvertSidToStringSid failed with error code %d", ... Are you sure we need Domain Admin rights to run the code? ...
    (microsoft.public.platformsdk.security)