ldapAuthnt4.h
2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the AUTH_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// AUTH_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
#ifdef LDAPAUTHNT4_EXPORTS
#define LDAPAUTHNT4_API __declspec(dllexport)
#else
#define LDAPAUTHNT4_API __declspec(dllimport)
#endif
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
#include <wchar.h>
#include <math.h>
#include <objbase.h>
#include <activeds.h>
#include <Dsgetdc.h>
#include <sddl.h>
#include <assert.h>
#define MAXLEN 256
//#define MAX_PREFERRED_LENGTH ((DWORD) -1)
//#define NERR_Success 0
//#define LG_INCLUDE_INDIRECT 1
#define BUFSIZE 1024
#define FETCH_NUM 100
void PrintBanner(LPOLESTR pwszBanner);
HRESULT GetObjectGuid(IDirectoryObject * pDO,BSTR &bsGuid);
BOOL RecursiveIsMember(IADsGroup * pADsGroup,LPWSTR pwszMemberGUID,LPWSTR pwszMemberPath,
BOOL bVerbose, LPOLESTR pwszUser, LPOLESTR pwszPassword);
HRESULT FindUserByName(IDirectorySearch *pSearchBase, //Container to search
LPOLESTR szFindUser, //Name of user to find.
IADs **ppUser); //Return a pointer to the user
HRESULT FindGroup(IDirectorySearch *pSearchBase, //Container to search
LPOLESTR szFindUser, //Name of user to find.
IADs **ppUser,LPOLESTR szGroup); //Return a pointer to the user
BSTR gbsGroup = NULL; // <Group to check> This is the LDAP path for the group to check
BSTR gbsMember = NULL; // <Member to check>
BSTR gbsUSER = NULL;
BSTR gbsPASS = NULL; // <Password used for binding to the DC>
LDAPAUTHNT4_API BOOL CUGP(char * userin,char *password,char *machine,char *group,int locdom);