NPAddConnection Access violation

Hi,

I am writing a simple network provider.
I get the error “0xC0000005: Access Violation” when i run my network
provider calling NPAddConnection, both in debug mode and runtime.
Even the simplest of functions written for NPAddConnection fails.

The following is the code,
SPIENTRY NPAddConnection( HWND hwndOwner, LPNETRESOURCE lpNetResource, LPTSTR lpUserID, LPTSTR lpPassword, DWORD dwFlags, LPTSTR lpAccessName, LPDWORD lpBufferSize, LPDWORD lpResult){ OutputDebugString("Entered IBNP NPAddconnection\n"); return WN_SUCCESS; // or WN_BAD_NETNAME}

Any ideas why it happens so? Please help…

I am on Windows 2000 and using the header ‘netspi.h’ from the 98DDK.

Please help…

Regards,
Chaitanya