mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 03:52:49 -05:00
Move the dynamic loading of advapi into its own module.
There's now a winsecur.[ch], which centralises helper functions using the Windows security stuff in advapi.h (currently just get_user_sid), and also centralises the run-time loading of those functions and checking they're all there. [originally from svn r10082]
This commit is contained in:
32
windows/winsecur.h
Normal file
32
windows/winsecur.h
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* winsecur.h: some miscellaneous security-related helper functions,
|
||||
* defined in winsecur.c, that use the advapi32 library. Also
|
||||
* centralises the machinery for dynamically loading that library.
|
||||
*/
|
||||
|
||||
#if !defined NO_SECURITY
|
||||
|
||||
#include <aclapi.h>
|
||||
|
||||
#ifndef WINSECUR_GLOBAL
|
||||
#define WINSECUR_GLOBAL extern
|
||||
#endif
|
||||
|
||||
DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, BOOL, OpenProcessToken,
|
||||
(HANDLE, DWORD, PHANDLE));
|
||||
DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, BOOL, GetTokenInformation,
|
||||
(HANDLE, TOKEN_INFORMATION_CLASS,
|
||||
LPVOID, DWORD, PDWORD));
|
||||
DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, BOOL, InitializeSecurityDescriptor,
|
||||
(PSECURITY_DESCRIPTOR, DWORD));
|
||||
DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, BOOL, SetSecurityDescriptorOwner,
|
||||
(PSECURITY_DESCRIPTOR, PSID, BOOL));
|
||||
DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, DWORD, GetSecurityInfo,
|
||||
(HANDLE, SE_OBJECT_TYPE, SECURITY_INFORMATION,
|
||||
PSID *, PSID *, PACL *, PACL *,
|
||||
PSECURITY_DESCRIPTOR *));
|
||||
|
||||
int got_advapi(void);
|
||||
PSID get_user_sid(void);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user