home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / secext.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  4KB  |  141 lines

  1. //+-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) Microsoft Corporation 1991 - 1998
  6. //
  7. // File:        secext.h
  8. //
  9. // Contents:    Security function prototypes for functions not part of
  10. //              the security support provider interface (secsuppr.h)
  11. //
  12. //
  13. // History:     22 Dec 92   RichardW    Created
  14. //
  15. //------------------------------------------------------------------------
  16.  
  17. #ifndef __SECEXT_H__
  18. #define __SECEXT_H__
  19.  
  20.  
  21. typedef struct _SecurityUserData {
  22.     SECURITY_STRING UserName;           // User name
  23.     SECURITY_STRING LogonDomainName;    // Domain the user logged on to
  24.     SECURITY_STRING LogonServer;        // Server that logged the user on
  25.     PSID            pSid;               // SID of user
  26. } SecurityUserData, * PSecurityUserData;
  27.  
  28. #define UNDERSTANDS_LONG_NAMES  1
  29. #define NO_LONG_NAMES           2
  30.  
  31.  
  32. HRESULT SEC_ENTRY
  33. GetSecurityUserInfo(
  34.     IN PLUID LogonId,
  35.     IN ULONG Flags,
  36.     OUT PSecurityUserData * UserInformation
  37.     );
  38.  
  39.  
  40.  
  41. SECURITY_STATUS SEC_ENTRY
  42. IsLogonOkay(unsigned long   fBlock);
  43.  
  44.  
  45.  
  46. //
  47. // Credential Management types and APIs
  48. //
  49.  
  50. //
  51. // SaveCredentials
  52. //
  53.  
  54. SECURITY_STATUS SEC_ENTRY
  55. SaveCredentials (
  56.     PCredHandle     pCredHandle,
  57.     unsigned long   cbCredentials,
  58.     unsigned char * pbCredentials
  59.     );
  60.  
  61.  
  62. //
  63. // GetCredentials
  64. //
  65.  
  66. SECURITY_STATUS SEC_ENTRY
  67. GetCredentials (
  68.     PCredHandle      pCredHandle,
  69.     unsigned long *  pcbCredentials,
  70.     unsigned char *  ppbCredentials
  71.     );
  72.  
  73.  
  74. //
  75. // DeleteCredentials
  76. //
  77.  
  78. SECURITY_STATUS SEC_ENTRY
  79. DeleteCredentials (
  80.     PCredHandle      pCredHandle,
  81.     unsigned long    cbKey,
  82.     unsigned char *  pbKey
  83.     );
  84.  
  85.  
  86. //
  87. // FormatCredentials
  88. //
  89.  
  90. SECURITY_STATUS SEC_ENTRY
  91. FormatCredentials(
  92.     LPWSTR          pszPackageName,
  93.     ULONG           cbCredentials,
  94.     PUCHAR          pbCredentials,
  95.     PULONG          pcbFormattedCreds,
  96.     PUCHAR *        ppbFormattedCreds);
  97.  
  98. typedef enum _SecStateDelta {
  99.     SecStateStatic,             // The state is not changing
  100.     SecStateChange,             // Req:  change state
  101.     SecStateComplete,           // Req:  complete state change
  102.     SecStateAbort,              // Req:  abort state change (revert)
  103.     SecStateChanging            // The state is changing
  104. } SecStateDelta, * PSecStateDelta;
  105.  
  106. typedef enum _SecState {
  107.     SecStateStandalone,         // Not connected to a domain
  108.     SecStateDisconnected,       // Joined, but no active connection
  109.     SecStateJoined,             // Joined, active connection
  110.     SecStateDC                  // Domain controller
  111. } SecurityState, * PSecurityState;
  112.  
  113. SECURITY_STATUS SEC_ENTRY
  114. SecChangeState(
  115.     PWSTR           pszDomainName,  // Domain (for SecStateDelta)
  116.     SecStateDelta   StateChange,    // State change type
  117.     SecurityState   State);         // State type
  118.  
  119. SECURITY_STATUS SEC_ENTRY
  120. SecQueryState(
  121.     PSecurityState  pState,
  122.     PSecStateDelta  pStateChange);
  123.  
  124. #define SECURITY_CONTROL_NAME                       L"SPMgr"
  125. #define SECURITY_CONTROL_REFRESH                    100
  126. #define SECURITY_CONTROL_UPDATE_MACHINE_JP_PROPS    101
  127. #define SECURITY_CONTROL_RELOAD_LOCAL_POLICY        102
  128.  
  129.  
  130.  
  131. //
  132. // this should map a SECURITY_STATUS to an NTSTATUS, but there is
  133. // no guarantee that NTSTATUS is defined. MMS 10/38/94
  134. //
  135.  
  136. SECURITY_STATUS SEC_ENTRY
  137. MapSecurityError( SECURITY_STATUS hrValue );
  138.  
  139.  
  140. #endif // __SECEXT_H__
  141.