This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Segmentation fault in NetUserGetInfo call


Hi,
I am using gcc to compile my code. I am linking to windows netapi32 library.

This is the error I am getting when NetUserGetInfo call is executed
Program received signal SIGSEGV, Segmentation fault.
0x77d7bf5c in RPCRT4!NdrCorrelationFree () from /cygdrive/c/WINNT/system32/rpcrt4.dll


The code works fine if I use windows compiler.

This is the code snippet
LPWSTR domaincontroller = NULL;
LPUSER_INFO_3 buffer = NULL;
NET_API_STATUS nStatus;
WCHAR *uni_domain = NULL;
WCHAR *uni_username = NULL;
uni_domain=L"foo";
uni_username=L"bar";
nStatus = NetGetDCName(NULL, uni_domain, (LPBYTE *)&domaincontroller);
if(nStatus != NERR_Success){
retval = NULL;
goto cleanup;
}
if(domaincontroller == NULL){
retval = NULL;
goto cleanup;
}
nStatus = NetUserGetInfo(domaincontroller, uni_username, 3, (LPBYTE*)&buffer);
if(nStatus != NERR_Success){
retval = NULL;
goto cleanup;
}


NetGetDCName call is successful.
It is dumping core for NetUserGetInfo
I even hardcoded uni_username to a valid username. It doesn't help
If I specify the 1st argument to NetGetUserInfo() as NULL and give a local user name it works.
Is there anything I am missing?
Thanks,
Vishal



_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail



-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]