source: filezilla/trunk/fuentes/src/putty/windows/winsecur.h @ 3185

Last change on this file since 3185 was 3185, checked in by jrpelegrina, 2 years ago

Update new version: 3.15.02

File size: 2.2 KB
Line 
1/*
2 * winsecur.h: some miscellaneous security-related helper functions,
3 * defined in winsecur.c, that use the advapi32 library. Also
4 * centralises the machinery for dynamically loading that library.
5 */
6
7#if !defined NO_SECURITY
8
9#include <aclapi.h>
10
11#ifndef WINSECUR_GLOBAL
12#define WINSECUR_GLOBAL extern
13#endif
14
15/*
16 * Functions loaded from advapi32.dll.
17 */
18DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, BOOL, OpenProcessToken,
19                      (HANDLE, DWORD, PHANDLE));
20DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, BOOL, GetTokenInformation,
21                      (HANDLE, TOKEN_INFORMATION_CLASS,
22                       LPVOID, DWORD, PDWORD));
23DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, BOOL, InitializeSecurityDescriptor,
24                      (PSECURITY_DESCRIPTOR, DWORD));
25DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, BOOL, SetSecurityDescriptorOwner,
26                      (PSECURITY_DESCRIPTOR, PSID, BOOL));
27DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, DWORD, GetSecurityInfo,
28                      (HANDLE, SE_OBJECT_TYPE, SECURITY_INFORMATION,
29                       PSID *, PSID *, PACL *, PACL *,
30                       PSECURITY_DESCRIPTOR *));
31DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, DWORD, SetSecurityInfo,
32                      (HANDLE, SE_OBJECT_TYPE, SECURITY_INFORMATION,
33                       PSID, PSID, PACL, PACL));
34DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, DWORD, SetEntriesInAclA,
35                      (ULONG, PEXPLICIT_ACCESS, PACL, PACL *));
36int got_advapi(void);
37
38/*
39 * Find the SID describing the current user. The return value (if not
40 * NULL for some error-related reason) is smalloced.
41 */
42PSID get_user_sid(void);
43
44/*
45 * Construct a PSECURITY_DESCRIPTOR of the type used for named pipe
46 * servers, i.e. allowing access only to the current user id and also
47 * only local (i.e. not over SMB) connections.
48 *
49 * If this function returns TRUE, then 'psd' and 'acl' will have been
50 * filled in with memory allocated using LocalAlloc (and hence must be
51 * freed later using LocalFree). If it returns FALSE, then instead
52 * 'error' has been filled with a dynamically allocated error message.
53 */
54int make_private_security_descriptor(DWORD permissions,
55                                     PSECURITY_DESCRIPTOR *psd,
56                                     PACL *acl,
57                                     char **error);
58
59int setprocessacl(char *error);
60
61#endif
Note: See TracBrowser for help on using the repository browser.