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]

RE: Perl 5.7.2 (GDB breaks in 1.3.3-2 on certain Win2000 machines)


>
>Let's try and at least document what systems are exhibiting this 
>behavior.  My setup:
>
>-Win2k workstation with Service pack 1
Yes.
>-Logged into NT domain (NOT ActiveDirectory!)
Yes.
>-Running Novell Client against Netware 5.1 server(s)
No.
>-Running lots of services (Watchguard, Rational ClearCaseLT, etc.)
No.

I have administrator privledges on the local box, but not on the
network, and I am not logged in as administrator (although Cygwin
has always set the USER to administrator -- which may give a hint
to why the old version was working).  However, the NetUserGetInfo
is calling with 'kris' the right user name...

I wrote a quick and dirty MSVC app that made the same call, and it
didn't crash, however it returned an error. 
(see http://www.cygwin.com/ml/cygwin/2001-10/msg00489.html)

I get error 2221 (but no crash or anything), when it is run...
Perhaps other people who have the same problem can compile this
with MSVC or ming and see what they get...

Note:  You have to add the library netapi32.lib to get it to link. 

------------------------

#ifndef UNICODE
#define UNICODE
#endif

#include <stdio.h>
#include <windows.h> 
#include <lm.h>

#define LEVEL 3

int wmain(int argc, wchar_t *argv[]) { 
   LPUSER_INFO_3 res = NULL;
   NET_API_STATUS error;

   if (argc == 2) {
       error = NetUserGetInfo(NULL, argv[1], LEVEL, (LPBYTE *)&res);
   } else if (argc == 3) {
       error = NetUserGetInfo(argv[1], argv[2], LEVEL, (LPBYTE *)&res);
   } else {
       wprintf(L"\nUsage:\n%s [servername] username\n", argv[0]);
	   return 0;
   }
   if (error == NERR_Success){
    if (res != NULL) {
         wprintf(L"\n\tAccount:      %s\n", res->usri3_name);
         wprintf(L"\tComment:      %s\n", res->usri3_comment);
         wprintf(L"\tUser comment: %s\n", res->usri3_usr_comment);
         wprintf(L"\tFull name:    %s\n", res->usri3_full_name);
      }
   } else {
      fprintf(stderr, "A system error has occurred: %d\n", error);
   }

   if (res != NULL) {
      NetApiBufferFree(res); 
   }

   return 0;
}

--
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]