summaryrefslogtreecommitdiffstats
path: root/private/nw/convert/nwconv/ntnetapi.h
blob: b2e3c6da63552822fa9351a6cd90e03549702e08 (plain) (blame)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*+-------------------------------------------------------------------------+
  | Copyright 1993-1994 (C) Microsoft Corporation - All rights reserved.    |
  +-------------------------------------------------------------------------+*/

#ifndef _HNTNETAPI_
#define _HNTNETAPI_

#ifdef __cplusplus
extern "C"{
#endif

#ifndef NTSTATUS
typedef LONG NTSTATUS;
#endif

DWORD NTSAMConnect(LPTSTR FileServer, LPTSTR DomainName);
void NTSAMClose();
DWORD NTSAMParmsSet(LPTSTR ObjectName, FPNW_INFO fpnw, LPTSTR Password, BOOL ForcePasswordChange);
DWORD NTObjectIDGet( LPTSTR ObjectName );

DWORD NTShareAdd(LPTSTR ShareName, LPTSTR Path);
DWORD FPNWShareAdd(LPTSTR ShareName, LPTSTR Path);
void NTUseDel(LPTSTR ServerName);

DWORD NTServerEnum(LPTSTR Container, SERVER_BROWSE_LIST **ServList);
DWORD NTDomainEnum(SERVER_BROWSE_LIST **lpServList);
DWORD NTGroupsEnum(GROUP_LIST **lpGroupList);
DWORD NTUsersEnum(USER_LIST **lpUserList);

DWORD NTGroupSave(LPTSTR Name);
DWORD NTUserInfoSave(NT_USER_INFO *NT_UInfo, PFPNW_INFO fpnw);
void NTServerInfoReset(HWND hWnd, DEST_SERVER_BUFFER *DServ, BOOL ResetDomain);
DWORD NTUserInfoSet(NT_USER_INFO *NT_UInfo, PFPNW_INFO fpnw);
DWORD NTGroupUserAdd(LPTSTR GroupName, LPTSTR UserName, BOOL Local);

void NTUserRecInit(LPTSTR UserName, NT_USER_INFO *NT_UInfo);
void NTUserRecLog(NT_USER_INFO NT_UInfo);

DWORD NTSharesEnum(SHARE_LIST **lpShares, DRIVE_LIST *Drives);

void NTUseDel(LPTSTR ServerName);
void NTConnListDeleteAll();

DWORD NTServerSet(LPTSTR FileServer);
void NTServerInfoSet(HWND hWnd, LPTSTR ServerName, DEST_SERVER_BUFFER *DServ);
BOOL NTServerValidate(HWND hWnd, LPTSTR ServerName);
void NTServerGetInfo(LPTSTR ServerName);
void NTDomainSynch(DEST_SERVER_BUFFER *DServ);
BOOL NTDomainInSynch(LPTSTR Server);

// #define these so they can be changed easily. these macros
// should be used to free the memory allocated by the routines in
// this module.
#define NW_ALLOC(x) ((LPBYTE)LocalAlloc(LPTR,x))
#define NW_FREE(p)  ((void)LocalFree((HLOCAL)p))


NTSTATUS NwAddRight( PSECURITY_DESCRIPTOR pSD, PSID pSid, ACCESS_MASK AccessMask, PSECURITY_DESCRIPTOR *ppNewSD ) ;
NTSTATUS CreateNewSecurityDescriptor( PSECURITY_DESCRIPTOR *ppNewSD, PSECURITY_DESCRIPTOR pSD, PACL pAcl) ;

typedef struct _TRUSTED_DOMAIN_LIST {
   ULONG Count;
   TCHAR Name[][MAX_DOMAIN_NAME_LEN + 1];
} TRUSTED_DOMAIN_LIST;


BOOL NTDomainGet(LPTSTR ServerName, LPTSTR Domain);
BOOL IsNTAS(LPTSTR Server);
void NTTrustedDomainsEnum(LPTSTR ServerName, TRUSTED_DOMAIN_LIST **pTList);
DOMAIN_BUFFER *NTTrustedDomainSet(HWND hWnd, LPTSTR Server, LPTSTR TrustedDomain);

SID *NTSIDGet(LPTSTR ServerName, LPTSTR pUserName);
BOOL NTFile_AccessRightsAdd(LPTSTR ServerName, LPTSTR pUserName, LPTSTR pFileName, ACCESS_MASK AccessMask, BOOL Dir);
LPTSTR NTAccessLog(ACCESS_MASK AccessMask);

void NTUserDefaultsGet(NT_DEFAULTS **UDefaults);
DWORD NTUserDefaultsSet(NT_DEFAULTS UDefaults);
void NTUserDefaultsLog(NT_DEFAULTS UDefaults);
BOOL IsFPNW(LPTSTR ServerName);

#ifdef __cplusplus
}
#endif

#endif