Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
2.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1992.
  5. //
  6. // File: secmisc.h
  7. //
  8. // Contents: Helper functions and macros for security packages
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 10-Dec-91 Richardw Created
  15. //
  16. //--------------------------------------------------------------------------
  17. #ifndef __SECMISC_H__
  18. #define __SECMISC_H__
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. ///////////////////////////////////////////////////////////////////////////
  23. //
  24. // Common TimeStamp Manipulation Functions
  25. //
  26. ///////////////////////////////////////////////////////////////////////////
  27. // Functions to get/set current local time, or time in UTC:
  28. void GetCurrentTimeStamp(PLARGE_INTEGER);
  29. // Some convenient "functions"
  30. //
  31. // BOOL
  32. // TSIsZero(PLARGE_INTEGER pTS)
  33. //
  34. #define TSIsZero(pTS) ((pTS)->QuadPart == 0)
  35. #define SetMaxTimeStamp(ts) \
  36. (ts).HighPart = 0x7FFFFFFF; \
  37. (ts).LowPart = 0xFFFFFFFF;
  38. #define SetZeroTimeStamp(ts) \
  39. (ts).QuadPart = 0;
  40. void AddSecondsToTimeStamp(PLARGE_INTEGER, ULONG);
  41. BOOLEAN TSIsNearlyLessThan(PLARGE_INTEGER, PLARGE_INTEGER, PLARGE_INTEGER, LONG);
  42. ULONG TimeStampDiffInSeconds( PLARGE_INTEGER t1, PLARGE_INTEGER t2);
  43. #define TS_NO_TEND 0
  44. #define TS_TEND_TO_FALSE 1
  45. #define TS_TEND_TO_TRUE 2
  46. // RPC transport constants and routines
  47. #define TRANS_NB 0
  48. #define TRANS_XNS 1
  49. #define TRANS_TCPIP 2
  50. #define TRANS_NP 3
  51. NTSTATUS
  52. GetRpcTransports(PDWORD pTransports);
  53. NTSTATUS
  54. NewQueryValue( HKEY hKey,
  55. LPWSTR Key,
  56. PBYTE * pValue,
  57. PULONG pcbValue);
  58. NTSTATUS
  59. GetMachineName( LPWSTR * pszMachName);
  60. NTSTATUS
  61. GetLocalDomain( LPWSTR * pszLocalDomain);
  62. typedef enum _MACHINE_STATE {
  63. Standalone,
  64. Workstation,
  65. StandardServer,
  66. BackupDomainController,
  67. DomainController
  68. } MACHINE_STATE;
  69. MACHINE_STATE
  70. GetMachineState(VOID);
  71. //
  72. // Misc. checking routines
  73. //
  74. void
  75. SRtlCheckSecBufferDesc( PSecBufferDesc pData);
  76. void
  77. SRtlCheckSecBuffer( PSecBuffer pBuffer);
  78. #ifdef __cplusplus
  79. }
  80. #endif
  81. #endif // __SECMISC_H__