Leaked source code of windows server 2003
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.

90 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name :
  4. tsnutl.h
  5. Abstract:
  6. Contains TS Notification DLL Utilities
  7. Author:
  8. TadB
  9. Revision History:
  10. --*/
  11. #ifndef _TSNUTL_
  12. #define _TSNUTL_
  13. //
  14. // Memory Allocation Macros
  15. //
  16. #define REALLOCMEM(pointer, newsize) HeapReAlloc(RtlProcessHeap(), \
  17. 0, pointer, newsize)
  18. #define FREEMEM(pointer) HeapFree(RtlProcessHeap(), 0, \
  19. pointer)
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif // __cplusplus
  23. __inline LPVOID ALLOCMEM(SIZE_T size)
  24. {
  25. LPVOID ret = HeapAlloc(RtlProcessHeap(), 0, size);
  26. if (ret == NULL) {
  27. SetLastError(ERROR_OUTOFMEMORY);
  28. }
  29. return ret;
  30. }
  31. //
  32. // Fetch a registry value.
  33. //
  34. BOOL TSNUTL_FetchRegistryValue(
  35. IN HKEY regKey,
  36. IN LPWSTR regValueName,
  37. IN OUT PBYTE *buf
  38. );
  39. //
  40. // Returns TRUE if the protocol is RDP for this Winstation
  41. //
  42. BOOL TSNUTL_IsProtocolRDP();
  43. //
  44. // Get a textual representation of a user SID.
  45. //
  46. BOOL TSNUTL_GetTextualSid(
  47. IN PSID pSid,
  48. IN OUT LPTSTR textualSid,
  49. IN OUT LPDWORD pSidSize
  50. );
  51. //
  52. // Allocates memory for psid and returns the psid for the current user
  53. // The caller should call FREEMEM to free the memory.
  54. //
  55. PSID TSNUTL_GetUserSid(
  56. IN HANDLE hTokenForLoggedOnUser
  57. );
  58. //
  59. // Allocates memory for psid and returns the psid for the current TS session.
  60. // The caller should call FREEMEM to free the memory.
  61. //
  62. PSID TSNUTL_GetLogonSessionSid(
  63. IN HANDLE hTokenForLoggedOnUser
  64. );
  65. #ifdef __cplusplus
  66. }
  67. #endif // __cplusplus
  68. #endif //#ifndef _RDPPRUTL_