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.

110 lines
3.2 KiB

  1. #ifndef __WTSUTIL_H__
  2. #define __WTSUTIL_H__
  3. /*---------------------------------------------------------------------------
  4. File: WtsUtil.h
  5. Comments: Functions to use the new WTSAPI functions exposed in
  6. Terminal Server, SP4, to read and write the user configuration properties.
  7. (c) Copyright 1999, Mission Critical Software, Inc., All Rights Reserved
  8. Proprietary and confidential to Mission Critical Software, Inc.
  9. REVISION LOG ENTRY
  10. Revision By: Christy Boles
  11. Revised on 03/08/99 13:22:49
  12. ---------------------------------------------------------------------------
  13. */
  14. #include "EaLen.hpp"
  15. #include <wtsapi32.h>
  16. #define WTS_DLL_NAME (L"WTSAPI32.DLL")
  17. #define WTS_QUERY_FUNCTION_NAME ("WTSQueryUserConfigW")
  18. #define WTS_SET_FUNCTION_NAME ("WTSSetUserConfigW")
  19. #define WTS_FREE_FUNCTION_NAME ("WTSFreeMemory")
  20. #define WTS_OPEN_SERVER_FUNCTION_NAME ("WTSOpenServerW")
  21. #define WTS_CLOSE_SERVER_FUNCTION_NAME ("WTSCloseServer")
  22. #define WTS_ENUM_SESSIONS_FUNCTION_NAME ("WTSEnumerateSessionsW")
  23. DWORD // ret-0 or OS return code
  24. WtsUserGetInfo(
  25. WCHAR const * pDomCtrlName, // in -name of domain controller to read from
  26. WCHAR const * pUserName, // in -username of account to read properties for
  27. DWORD fieldmask, // in -which fields to read
  28. EaWtsUserInfo * pInfo // out-structure containing requested property values
  29. );
  30. DWORD // ret-0 or OS return code
  31. WtsUserSetInfo(
  32. WCHAR const * pDomCtrlName, // in -name of domain controller to read from
  33. WCHAR const * pUserName, // in -username of account to read properties for
  34. DWORD fieldmask, // in -which fields to read
  35. EaWtsUserInfo * pInfo // in -structure containing properties to update
  36. );
  37. // Tries to determine if a server is running WTS
  38. BOOL // ret-TRUE-server is online and running WTS
  39. WtsTryServer(
  40. WCHAR * serverName // in -name of server
  41. );
  42. // typedefs for the WTSAPI32 functions we will use
  43. typedef BOOL
  44. WINAPI
  45. WTSQUERYUSERCONFIGW(
  46. IN LPWSTR pServerName,
  47. IN LPWSTR pUserName,
  48. IN WTS_CONFIG_CLASS WTSConfigClass,
  49. OUT LPWSTR * ppBuffer,
  50. OUT DWORD * pBytesReturned
  51. );
  52. typedef BOOL
  53. WINAPI
  54. WTSSETUSERCONFIGW(
  55. IN LPWSTR pServerName,
  56. IN LPWSTR pUserName,
  57. IN WTS_CONFIG_CLASS WTSConfigClass,
  58. IN LPWSTR pBuffer,
  59. IN DWORD DataLength
  60. );
  61. typedef VOID
  62. WINAPI
  63. WTSFREEMEMORY(
  64. IN PVOID pMemory
  65. );
  66. typedef HANDLE
  67. WINAPI
  68. WTSOPENSERVERW(
  69. IN LPWSTR pServerName
  70. );
  71. typedef VOID
  72. WINAPI
  73. WTSCLOSESERVER(
  74. IN HANDLE hServer
  75. );
  76. extern DllAccess gWtsDll;
  77. extern WTSQUERYUSERCONFIGW * gpWtsQueryUserConfig;
  78. extern WTSSETUSERCONFIGW * gpWtsSetUserConfig;
  79. extern WTSFREEMEMORY * gpWtsFreeMemory;
  80. extern WTSOPENSERVERW * gpWtsOpenServer;
  81. extern WTSCLOSESERVER * gpWtsCloseServer;
  82. #endif //__WTSUTIL_H__