X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwinsecur.h;h=bd64982768aaf3d18f4add9c15c88730928f08cf;hb=a063e522970946bf7d5dc052079d7773c0dee76d;hp=9844afc8a3a57a13c4550ddb64993b003532f42b;hpb=f6f78f835543099d4b5e342ba34f91104862803b;p=PuTTY.git diff --git a/windows/winsecur.h b/windows/winsecur.h index 9844afc8..bd649827 100644 --- a/windows/winsecur.h +++ b/windows/winsecur.h @@ -12,6 +12,9 @@ #define WINSECUR_GLOBAL extern #endif +/* + * Functions loaded from advapi32.dll. + */ DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, BOOL, OpenProcessToken, (HANDLE, DWORD, PHANDLE)); DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, BOOL, GetTokenInformation, @@ -25,8 +28,36 @@ DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, DWORD, GetSecurityInfo, (HANDLE, SE_OBJECT_TYPE, SECURITY_INFORMATION, PSID *, PSID *, PACL *, PACL *, PSECURITY_DESCRIPTOR *)); - +DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, DWORD, SetEntriesInAclA, + (ULONG, PEXPLICIT_ACCESS, PACL, PACL *)); int got_advapi(void); + +/* + * Functions loaded from crypt32.dll. + */ +DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, BOOL, CryptProtectMemory, + (LPVOID, DWORD, DWORD)); +int got_crypt(void); + +/* + * Find the SID describing the current user. The return value (if not + * NULL for some error-related reason) is smalloced. + */ PSID get_user_sid(void); +/* + * Construct a PSECURITY_DESCRIPTOR of the type used for named pipe + * servers, i.e. allowing access only to the current user id and also + * only local (i.e. not over SMB) connections. + * + * If this function returns TRUE, then 'psd' and 'acl' will have been + * filled in with memory allocated using LocalAlloc (and hence must be + * freed later using LocalFree). If it returns FALSE, then instead + * 'error' has been filled with a dynamically allocated error message. + */ +int make_private_security_descriptor(DWORD permissions, + PSECURITY_DESCRIPTOR *psd, + PACL *acl, + char **error); + #endif