Re: GINA - never ending story

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: hs (nospam_at_dev.null)
Date: 08/13/04


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



Relevant Pages

  • Re: No Connection on some xp clients
    ... > System error 51 has occurred. ... There is such an error in Win2000/XP for DNS names ... That looks like the Server service is NOT running. ... > installed a new server Everything is good with the XP clients now but. ...
    (microsoft.public.win2000.networking)
  • Re: "System error 1240 has occurred"
    ... System Error 1240 - The account is not authorized to login from this ... this Station" when attempting to browse the workgroup from a networking ... Digitally sign server communications - disabled ... Networking, Internet, Routing, VPN, Anti-Virus, Tips & Troubleshooting on ...
    (microsoft.public.windows.server.networking)
  • Re: System Error 53, network path not found
    ... System error 53 - The network path was not found. ... > I have managed to setup rras on my W2K3 server to be used as a vpn server> and use WinXP as a vpn client to test the vpn connection. ... the vpn client> can connect to the server. ...
    (microsoft.public.win2000.ras_routing)
  • Re: This account is not authorized to log in from this station...
    ... System Error 1240 - The account is not authorized to login from this ... this Station" when attempting to browse the workgroup from a networking ... Digitally sign server communications - disabled ...
    (microsoft.public.windows.server.networking)
  • Re: Cant connect to UNC share
    ... Using the net view command, I actually get a System error 53 has occurred. ... > an Alias Name: ... > When a client computer connects to a Windows 2000-based server by using an ...
    (microsoft.public.windows.server.general)