delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/03/13/20:51:45

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Originating-IP: [66.206.205.2]
From: "Vishal Jain" <vxj45 AT hotmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Segmentation fault in NetUserGetInfo call
Date: Thu, 13 Mar 2003 17:51:39 -0800
Mime-Version: 1.0
Message-ID: <F88DhT6pF69P0oG0k7Y0003c7c2@hotmail.com>
X-OriginalArrivalTime: 14 Mar 2003 01:51:39.0690 (UTC) FILETIME=[413CD0A0:01C2E9CC]
Note-from-DJ: This may be spam

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019