Re: GINA - never ending story
From: hs (nospam_at_dev.null)
Date: 08/13/04
- Next message: vipin: "Re: Desperately want GDIINFO, how can I obtain this structure?"
- Previous message: Aaron Margosis [MS]: "Re: How can I tell if I'm running as a service"
- In reply to: Aaron Margosis [MS]: "Re: GINA - never ending story"
- Next in thread: Aaron Margosis [MS]: "Re: GINA - never ending story"
- Reply: Aaron Margosis [MS]: "Re: GINA - never ending story"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 13 Aug 2004 09:22:11 +0200
"Aaron Margosis [MS]" <aaron.margosis.ms@online.microsoft.com> wrote in
message news:ezTjWdNgEHA.3928@TK2MSFTNGP11.phx.gbl...
> Did you include the \\ in front of the server name for the first
parameter?
> (In C++, that's \\\\). And Unicode, of course...
yes, of course.
here is the complete code
#include "stdafx.h"
#define UNICODE
#include <windows.h>
#define INCL_NET
#include <stdio.h>
#include <lm.h>
#include <time.h>
#define USERNAME TEXT("hs")
#define SERVER TEXT("\\\\signum")
int main()
{
DWORD dwLevel = 10;
LPUSER_INFO_10 pBuf = NULL;
NET_API_STATUS nStatus;
nStatus = NetUserGetInfo(SERVER, USERNAME, dwLevel, (LPBYTE *)&pBuf);
//
// If the call succeeds, print the user information.
//
if (nStatus == NERR_Success)
{
if (pBuf != NULL)
{
wprintf(L"\n\tAccount: %s\n", pBuf->usri10_name);
wprintf(L"\tComment: %s\n", pBuf->usri10_comment);
wprintf(L"\tUser comment: %s\n", pBuf->usri10_usr_comment);
wprintf(L"\tFull name: %s\n", pBuf->usri10_full_name);
}
}
// Otherwise, print the system error.
//
else
{
fprintf(stderr, "A system error has occurred: %d\n", nStatus);
switch (nStatus)
{
case ERROR_ACCESS_DENIED:
fprintf (stderr, "The user does not have access to the requested
information\n");
break;
case NERR_InvalidComputer:
fprintf (stderr, "The computer name is invalid.\n");
break;
case NERR_UserNotFound:
fprintf (stderr, "The user name could not be found.\n");
break;
case ERROR_BAD_NETPATH:
fprintf (stderr, "error bad netpath.\n");
break;
default:
fprintf (stderr, "other error, not recognized\n");
}
}
//
// Free the allocated memory.
//
if (pBuf != NULL)
NetApiBufferFree(pBuf);
return 0;
}
I was trying with every LPUSER_INFO_* structure and the error code is the
same.
>
> -- Aaron
>
> "hs" <nospam@dev.null> wrote in message news:cff3f3$9k2$1@news.onet.pl...
> >
> > "Steve Dispensa [MVP]" <dispensa@positivenetworks.net> wrote in message
> > news:uerOuO9fEHA.1984@TK2MSFTNGP10.phx.gbl...
> >> hs wrote:
> >>
> >> > I am looking for a complete implementation of GINA.
> >>
> >> This may be of some help.
> >>
> >> http://sourceforge.net/projects/pgina
> >>
> > thanks, I had found this project before, but it also does not use
> > LsaLogonUser function.
> > AFAIK there only way to check password expiration is to use Lsa
> > functions.I
> > tried with
> > NetUserGetInfo but I get error code 53.
> >
> > regards,
> > hs
> >
> >
>
>
- Next message: vipin: "Re: Desperately want GDIINFO, how can I obtain this structure?"
- Previous message: Aaron Margosis [MS]: "Re: How can I tell if I'm running as a service"
- In reply to: Aaron Margosis [MS]: "Re: GINA - never ending story"
- Next in thread: Aaron Margosis [MS]: "Re: GINA - never ending story"
- Reply: Aaron Margosis [MS]: "Re: GINA - never ending story"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|