why is the error ---10104?

  • Thread starter Thread starter chaozhou
  • Start date Start date
C

chaozhou

I want to develop a NSP(NameSpaceProvider), and in my NSP I use
NS_NDS(system's DNS NSP) to communicate .My code like that:
HINSTANCE hInstance = LoadLibrary(lpsName);//lpsName is
"%SystemRoot%\System32\mswsock.dll" under XP,under Windows2000 is
""%SystemRoot%\System32\rnr20.dll"

NspStartup = (NSPSTARTUP)GetProcAddress(hInstance ,"NSPStartup");

lpnspRoutines = (LPNSP_ROUTINE)malloc(sizeof(NSP_ROUTINE));
memset(lpnspRoutines,0,sizeof(NSP_ROUTINE));

ret = NspStartup(&nsinfo->NSProviderId,lpnspRoutines);//nsinfo->NSProviderId
is the GUID of DNS NSP which is read form register.

The code is run correct under Win2000,but under XP when run to
NspStartup(...) this is error, error code is 10104(the meaning is "The
procedure call table is invalid.").Checked under softice ,I find
hInstance/NspStartup/lpnspRoutines's point are all correct(not NULL)!
why is that , anybody can tall me ? thanks !
 
Try filling in the basic elements of the Routines structure, namely:

lpnspRoutines->cbSize = sizeof(NSP_ROUTINE);
lpnspRoutines->dwMajorVersion = 2;
lpnspRoutines->dwMinorVersion = 2;

And the call should succeed now, but even this does not seem to
guarantee that your routines will be called. There seems to be
something still missing and no documentation anywhere, plus no
references either.

Good luck and you're encourage to share any positive (or negative)
results with the group.

-KSeeker.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top