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.

3502 lines
89 KiB

  1. /***************************************************************************
  2. *
  3. * WINSTA.H
  4. *
  5. * This module contains external window station defines and structures
  6. *
  7. * Copyright Microsoft Corporation, 1998
  8. *
  9. *
  10. ****************************************************************************/
  11. #ifndef _INC_WINSTAH
  12. #define _INC_WINSTAH
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #ifndef WINAPI
  17. #define WINAPI __stdcall
  18. #endif
  19. #ifndef BYTE
  20. #define BYTE unsigned char
  21. #endif
  22. #include <hydrix.h>
  23. #include <ctxdef.h>
  24. /***********
  25. * Defines
  26. ***********/
  27. #define PROTOCOL_DISCONNECT 0xffff // disconnected session.
  28. #define PROTOCOL_CONSOLE 0 // local console
  29. #define PROTOCOL_ICA 1 // ICA Protocol
  30. #define PROTOCOL_TSHARE 2 // RDP Protocol (old name T.Share)
  31. #define PROTOCOL_RDP 2 // RDP protocol
  32. #define PDNAME_LENGTH 32
  33. #define WDNAME_LENGTH 32
  34. #define CDNAME_LENGTH 32
  35. #define DEVICENAME_LENGTH 128
  36. #define MODEMNAME_LENGTH DEVICENAME_LENGTH
  37. #define CALLBACK_LENGTH 50
  38. #define LICENSE_PASSWORD_LENGTH 16
  39. #define DLLNAME_LENGTH 32
  40. #define PRINTERNAME_LENGTH 32
  41. #define WINSTATIONCOMMENT_LENGTH 60
  42. #define APPSERVERNAME_LENGTH 17
  43. #define WDPREFIX_LENGTH 12
  44. #define CLIENT_PRODUCT_ID_LENGTH 32
  45. #define NASISPECIFICNAME_LENGTH 14
  46. #define NASIUSERNAME_LENGTH 47
  47. #define NASIPASSWORD_LENGTH 24
  48. #define NASISESSIONNAME_LENGTH 16
  49. #define NASIFILESERVER_LENGTH 47
  50. #define LOGONID_CURRENT ((ULONG)-1)
  51. #define LOGONID_NONE ((ULONG)-2)
  52. #define SERVERNAME_CURRENT ((HANDLE)NULL)
  53. #define MAX_PDCONFIG 10 // maximum number of PDs per WinStation
  54. #define MAX_UI_MODULES 5 // maximum client user interface modules
  55. #define PSZ_ANONYMOUS TEXT("Anonymous")
  56. #define WINFRAME_SOFTKEY_CLASS L"WinFrameSoftkey"
  57. #define WINFRAME_SOFTKEY_APPLICATION L"wfskey.exe"
  58. #define OEM_ID_LENGTH 3
  59. // TermSrv Counters
  60. #define TERMSRV_TOTAL_SESSIONS 1 // total number of sessions ever connected
  61. #define TERMSRV_DISC_SESSIONS 2 // total number of disconnected sessions
  62. #define TERMSRV_RECON_SESSIONS 3 // total number of reconnected sessions
  63. #define TERMSRV_CURRENT_ACTIVE_SESSIONS 4 // total of currently active sessions
  64. #define TERMSRV_CURRENT_DISC_SESSIONS 5 // total of currently disconnected sessions
  65. // Color depth setting
  66. #define TS_CLIENT_COMPAT_BPP_SUPPORT 0x3e7 // decimal 999
  67. #define TS_24BPP_SUPPORT 0x04
  68. #define TS_16BPP_SUPPORT 0x03
  69. #define TS_15BPP_SUPPORT 0x02
  70. #define TS_8BPP_SUPPORT 0x01
  71. /*********************************
  72. * WinStationOpen access values
  73. *********************************/
  74. #define WINSTATION_QUERY 0x00000001 // WinStationQueryInformation()
  75. #define WINSTATION_SET 0x00000002 // WinStationSetInformation()
  76. #define WINSTATION_RESET 0x00000004 // WinStationReset()
  77. #define WINSTATION_VIRTUAL 0x00000008 // read/write direct data
  78. #define WINSTATION_SHADOW 0x00000010 // WinStationShadow()
  79. #define WINSTATION_LOGON 0x00000020 // logon to WinStation
  80. #define WINSTATION_LOGOFF 0x00000040 // WinStationLogoff()
  81. #define WINSTATION_MSG 0x00000080 // WinStationMsg()
  82. #define WINSTATION_CONNECT 0x00000100 // WinStationConnect()
  83. #define WINSTATION_DISCONNECT 0x00000200 // WinStationDisconnect()
  84. #define WINSTATION_GUEST_ACCESS (WINSTATION_LOGON)
  85. #define WINSTATION_CURRENT_GUEST_ACCESS (WINSTATION_VIRTUAL | WINSTATION_LOGOFF)
  86. #define WINSTATION_USER_ACCESS (WINSTATION_GUEST_ACCESS | \
  87. WINSTATION_QUERY | WINSTATION_MSG | \
  88. WINSTATION_CONNECT )
  89. #define WINSTATION_CURRENT_USER_ACCESS (WINSTATION_SET | WINSTATION_RESET \
  90. WINSTATION_VIRTUAL | WINSTATION_LOGOFF \
  91. WINSTATION_DISCONNECT)
  92. #define WINSTATION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | WINSTATION_QUERY | \
  93. WINSTATION_SET | WINSTATION_RESET | \
  94. WINSTATION_VIRTUAL | WINSTATION_SHADOW | \
  95. WINSTATION_LOGON | \
  96. WINSTATION_MSG | \
  97. WINSTATION_CONNECT | WINSTATION_DISCONNECT)
  98. /************
  99. * Typedefs
  100. ************/
  101. #define LOGONIDW SESSIONIDW //externalized LogonID as SessionID in ctxapi.h
  102. #define PLOGONIDW PSESSIONIDW
  103. #define LOGONIDA SESSIONIDA
  104. #define PLOGONIDA PSESSIONIDA
  105. #ifdef UNICODE
  106. #define LOGONID LOGONIDW
  107. #define PLOGONID PLOGONIDW
  108. #else
  109. #define LOGONID LOGONIDA
  110. #define PLOGONID PLOGONIDA
  111. #endif /* UNICODE */
  112. /*------------------------------------------------*/
  113. typedef WCHAR PDNAMEW[ PDNAME_LENGTH + 1 ];
  114. typedef WCHAR * PPDNAMEW;
  115. typedef CHAR PDNAMEA[ PDNAME_LENGTH + 1 ];
  116. typedef CHAR * PPDNAMEA;
  117. #ifdef UNICODE
  118. #define PDNAME PDNAMEW
  119. #define PPDNAME PPDNAMEW
  120. #else
  121. #define PDNAME PDNAMEA
  122. #define PPDNAME PPDNAMEA
  123. #endif /* UNICODE */
  124. /*------------------------------------------------*/
  125. typedef WCHAR WDNAMEW[ WDNAME_LENGTH + 1 ];
  126. typedef WCHAR * PWDNAMEW;
  127. typedef CHAR WDNAMEA[ WDNAME_LENGTH + 1 ];
  128. typedef CHAR * PWDNAMEA;
  129. #ifdef UNICODE
  130. #define WDNAME WDNAMEW
  131. #define PWDNAME PWDNAMEW
  132. #else
  133. #define WDNAME WDNAMEA
  134. #define PWDNAME PWDNAMEA
  135. #endif /* UNICODE */
  136. /*------------------------------------------------*/
  137. typedef WCHAR CDNAMEW[ CDNAME_LENGTH + 1 ];
  138. typedef WCHAR * PCDNAMEW;
  139. typedef CHAR CDNAMEA[ CDNAME_LENGTH + 1 ];
  140. typedef CHAR * PCDNAMEA;
  141. #ifdef UNICODE
  142. #define CDNAME CDNAMEW
  143. #define PCDNAME PCDNAMEW
  144. #else
  145. #define CDNAME CDNAMEA
  146. #define PCDNAME PCDNAMEA
  147. #endif /* UNICODE */
  148. /*------------------------------------------------*/
  149. typedef WCHAR DEVICENAMEW[ DEVICENAME_LENGTH + 1 ];
  150. typedef WCHAR * PDEVICENAMEW;
  151. typedef CHAR DEVICENAMEA[ DEVICENAME_LENGTH + 1 ];
  152. typedef CHAR * PDEVICENAMEA;
  153. #ifdef UNICODE
  154. #define DEVICENAME DEVICENAMEW
  155. #define PDEVICENAME PDEVICENAMEW
  156. #else
  157. #define DEVICENAME DEVICENAMEA
  158. #define PDEVICENAME PDEVICENAMEA
  159. #endif /* UNICODE */
  160. /*------------------------------------------------*/
  161. typedef WCHAR MODEMNAMEW[ MODEMNAME_LENGTH + 1 ];
  162. typedef WCHAR * PMODEMNAMEW;
  163. typedef CHAR MODEMNAMEA[ MODEMNAME_LENGTH + 1 ];
  164. typedef CHAR * PMODEMNAMEA;
  165. #ifdef UNICODE
  166. #define MODEMNAME MODEMNAMEW
  167. #define PMODEMNAME PMODEMNAMEW
  168. #else
  169. #define MODEMNAME MODEMNAMEA
  170. #define PMODEMNAME PMODEMNAMEA
  171. #endif /* UNICODE */
  172. /*------------------------------------------------*/
  173. typedef WCHAR DLLNAMEW[ DLLNAME_LENGTH + 1 ];
  174. typedef WCHAR * PDLLNAMEW;
  175. typedef CHAR DLLNAMEA[ DLLNAME_LENGTH + 1 ];
  176. typedef CHAR * PDLLNAMEA;
  177. #ifdef UNICODE
  178. #define DLLNAME DLLNAMEW
  179. #define PDLLNAME PDLLNAMEW
  180. #else
  181. #define DLLNAME DLLNAMEA
  182. #define PDLLNAME PDLLNAMEA
  183. #endif /* UNICODE */
  184. /*------------------------------------------------*/
  185. typedef WCHAR PRINTERNAMEW[ PRINTERNAME_LENGTH + 1 ];
  186. typedef WCHAR * PPRINTERNAMEW;
  187. typedef CHAR PRINTERNAMEA[ PRINTERNAME_LENGTH + 1 ];
  188. typedef CHAR * PPRINTERNAMEA;
  189. #ifdef UNICODE
  190. #define PRINTERNAME PRINTERNAMEW
  191. #define PPRINTERNAME PPRINTERNAMEW
  192. #else
  193. #define PRINTERNAME PRINTERNAMEA
  194. #define PPRINTERNAME PPRINTERNAMEA
  195. #endif /* UNICODE */
  196. /*------------------------------------------------*/
  197. typedef WCHAR WDPREFIXW[ WDPREFIX_LENGTH + 1 ];
  198. typedef WCHAR * PWDPREFIXW;
  199. typedef CHAR WDPREFIXA[ WDPREFIX_LENGTH + 1 ];
  200. typedef CHAR * PWDPREFIXA;
  201. #ifdef UNICODE
  202. #define WDPREFIX WDPREFIXW
  203. #define PWDPREFIX PWDPREFIXW
  204. #else
  205. #define WDPREFIX WDPREFIXA
  206. #define PWDPREFIX PWDPREFIXA
  207. #endif /* UNICODE */
  208. /*------------------------------------------------*/
  209. #ifdef UNICODE
  210. #define NASISPECIFICNAME NASISPECIFICNAMEW
  211. #define PNASISPECIFICNAME PNASISPECIFICNAMEW
  212. #define NASIUSERNAME NASIUSERNAMEW
  213. #define PNASIUSERNAME PNASIUSERNAMEW
  214. #define NASIPASSWORD NASIPASSWORDW
  215. #define PNASIPASSWORD PNASIPASSWORDW
  216. #define NASISESSIONNAME NASISESSIONNAMEW
  217. #define PNASISESSIONNAME PNASISESSIONNAMEW
  218. #define NASIFILESERVER NASIFILESERVERW
  219. #define PNASIFILESERVER PNASIFILESERVERW
  220. #else
  221. #define NASISPECIFICNAME NASISPECIFICNAMEA
  222. #define PNASISPECIFICNAME PNASISPECIFICNAMEA
  223. #define NASIUSERNAME NASIUSERNAMEA
  224. #define PNASIUSERNAME PNASIUSERNAMEA
  225. #define NASIPASSWORD NASIPASSWORDA
  226. #define PNASIPASSWORD PNASIPASSWORDA
  227. #define NASISESSIONNAME NASISESSIONNAMEA
  228. #define PNASISESSIONNAME PNASISESSIONNAMEA
  229. #define NASIFILESERVER NASIFILESERVERA
  230. #define PNASIFILESERVER PNASIFILESERVERA
  231. #endif /* UNICODE */
  232. typedef WCHAR NASISPECIFICNAMEW[ NASISPECIFICNAME_LENGTH + 1 ];
  233. typedef WCHAR NASIUSERNAMEW[ NASIUSERNAME_LENGTH + 1 ];
  234. typedef WCHAR NASIPASSWORDW[ NASIPASSWORD_LENGTH + 1 ];
  235. typedef WCHAR NASISESIONNAMEW[ NASISESSIONNAME_LENGTH + 1 ];
  236. typedef WCHAR NASIFILESERVERW[ NASIFILESERVER_LENGTH + 1 ];
  237. typedef CHAR NASISPECIFICNAMEA[ NASISPECIFICNAME_LENGTH + 1 ];
  238. typedef CHAR NASIUSERNAMEA[ NASIUSERNAME_LENGTH + 1 ];
  239. typedef CHAR NASIPASSWORDA[ NASIPASSWORD_LENGTH + 1 ];
  240. typedef CHAR NASISESIONNAMEA[ NASISESSIONNAME_LENGTH + 1 ];
  241. typedef CHAR NASIFILESERVERA[ NASIFILESERVER_LENGTH + 1 ];
  242. /*------------------------------------------------*/
  243. #define STACK_ADDRESS_LENGTH 128
  244. /*
  245. * Stack address structure
  246. */
  247. typedef struct _ICA_STACK_ADDRESS {
  248. BYTE Address[ STACK_ADDRESS_LENGTH ]; // bytes 0,1 family, 2-n address
  249. } ICA_STACK_ADDRESS, *PICA_STACK_ADDRESS;
  250. // Support for long Username, Password and Domain during autologon
  251. #define EXTENDED_USERNAME_LEN 255
  252. #define EXTENDED_PASSWORD_LEN 255
  253. #define EXTENDED_DOMAIN_LEN 255
  254. /*
  255. * Structure to hold the longer UserName and Password
  256. */
  257. typedef struct _ExtendedClientCredentials {
  258. WCHAR UserName[EXTENDED_USERNAME_LEN + 1];
  259. WCHAR Password[EXTENDED_PASSWORD_LEN + 1];
  260. WCHAR Domain[EXTENDED_DOMAIN_LEN + 1] ;
  261. }ExtendedClientCredentials, *pExtendedClientCredentials;
  262. // Type of info queried from TermSrv to RdpWsx via WlxEscape
  263. // add more to this INFO_TYPE as need arises later on
  264. typedef enum
  265. {
  266. GET_LONG_USERNAME,
  267. GET_CLIENT_RANDOM,
  268. GET_CS_AUTORECONNECT_INFO, //arc verifier
  269. GET_SC_AUTORECONNECT_INFO, //arc random
  270. } INFO_TYPE ;
  271. /*********************************
  272. * User Configuration structures
  273. *********************************/
  274. /*------------------------------------------------*/
  275. typedef WCHAR APPLICATIONNAMEW[ MAX_BR_NAME ];
  276. typedef WCHAR *PAPPLICATIONNAMEW;
  277. typedef CHAR APPLICATIONNAMEA[ MAX_BR_NAME ];
  278. typedef CHAR *PAPPLICATIONNAMEA;
  279. #ifdef UNICODE
  280. #define APPLICATIONNAME APPLICATIONNAMEW
  281. #define PAPPLICATIONNAME PAPPLICATIONNAMEW
  282. #else
  283. #define APPLICATIONNAME APPLICATIONNAMEA
  284. #define PAPPLICATIONNAME PAPPLICATIONNAMEA
  285. #endif /* UNICODE */
  286. /*------------------------------------------------*/
  287. /*
  288. * Shadow options
  289. */
  290. typedef enum _SHADOWCLASS {
  291. Shadow_Disable,
  292. Shadow_EnableInputNotify,
  293. Shadow_EnableInputNoNotify,
  294. Shadow_EnableNoInputNotify,
  295. Shadow_EnableNoInputNoNotify,
  296. } SHADOWCLASS;
  297. /*------------------------------------------------*/
  298. /*
  299. * Callback options
  300. */
  301. typedef enum _CALLBACKCLASS {
  302. Callback_Disable,
  303. Callback_Roving,
  304. Callback_Fixed,
  305. } CALLBACKCLASS;
  306. /*------------------------------------------------*/
  307. //
  308. // These are flags that if set, then data from the policy tree is avalible.
  309. // If flag is not set, then there was no corresponding data item from the policy tree.
  310. //
  311. // At this time, the actual data is stored in a copy of userconfigw used as a scrath pad
  312. // for the values found under group policy. The debate of what belongs to group policy has not
  313. // been fully settled, and once that is resolved, I will probably move the data into this struct too.
  314. // AraBern, March 29, 2000 (2 days away from code complete !)
  315. //
  316. //
  317. typedef struct _POLICY_TS_USER {
  318. // ------------------------------------------------------------------------------
  319. // Some notes, March 11, 2000
  320. //
  321. //
  322. // fInheritAutoLogon
  323. // fPromptForPassword
  324. // UserName
  325. // Domain
  326. // Password
  327. // Used in WsxInitializeClientData()
  328. // of \\index1\src\newnt\termsrv\rdpwsx\rdpex\tsrvwsx.c
  329. // This is NOT exposed thru Group Policy
  330. // fInheritAutoClient
  331. // There are 3 items which are individually being set thru Group Policy
  332. // fDisableEncryption
  333. // MinEncryptionLevel;
  334. // The policy for these is set thru fPolicyInheritSecurity, but no UI for these...
  335. // fWorkDirectory
  336. // fInitialProgram
  337. // fPolicyInheritInitialProgram
  338. // will take care of these:
  339. // These seem to be used without being overriden by machine wide data
  340. // KeyboardLayout
  341. // fMaximize
  342. // fHideTitleBar
  343. // used in
  344. // \\index1\src\newnt\termsrv\rdpwsx\rdpex\tsrvwsx.c
  345. // These seem to be used by RDP, but are not overriden by any
  346. // Potentially stale WTS API stuff:
  347. // PublishedName
  348. // used by WTSQuerySessionInformationW(), in response to
  349. // request of WTSApplicationName. It's not used elsewhere!
  350. // These are set and retrieved, but play no meaningful roles.
  351. // fUseDefaultGina
  352. // fRequireEncryption
  353. // These are probably meaningless
  354. // fHomeDirectoryMapRoot
  355. // NWLogonServer
  356. // \\index1\src\newnt\termsrv\tsuserex\tsusrsht.cpp
  357. // and NETWARE ifdef'd in \\index1\src\newnt\termsrv\wtsapi\config.c
  358. // These are not used AT ALL, are only present in .w or .h files
  359. // fPublishedApp
  360. //
  361. // ULONG fPolicyDisableCpm : 1; // Printer, exposed thru TSCC
  362. // // Equivalent to ClientLptDef
  363. //
  364. // ULONG fPolicyDisableCdm : 1; // Drive, exposed thru TSCC
  365. // // Equivalent to ClientDrives.
  366. //
  367. // ULONG fPolicyDisableLPT : 1; // LPTPort, exposed thru TSCC
  368. // // Equivalent to ClientLPT
  369. //
  370. // Protocol wide in NT2195 for Ccm, Clip, and Cam
  371. // Make these machine policy
  372. // ULONG fPolicyDisableCcm : 1; // ComPort, exposed thru TSCC
  373. //
  374. // ULONG fPolicyDisableClip: 1; // Clipboad, exposed thru TSCC
  375. //
  376. // ULONG fPolicyDisableCam : 1; // Audio, exposed thru TSCC
  377. //
  378. // OLD.....................................
  379. // ULONG fPolicyDisableExe : 1; // not exposed thru TSCC, OLD tsCFG had it
  380. // ........................................
  381. ULONG fPolicyResetBroken : 1 ;
  382. ULONG fPolicyReconnectSame : 1 ;
  383. ULONG fPolicyInitialProgram : 1 ;
  384. ULONG fPolicyCallback : 1 ;
  385. ULONG fPolicyCallbackNumber : 1 ;
  386. ULONG fPolicyShadow : 1 ;
  387. ULONG fPolicyMaxSessionTime : 1 ;
  388. ULONG fPolicyMaxDisconnectionTime:1;
  389. ULONG fPolicyMaxIdleTime : 1 ;
  390. ULONG fPolicyAutoClientDrives : 1 ;
  391. ULONG fPolicyAutoClientLpts : 1 ;
  392. ULONG fPolicyForceClientLptDef : 1 ;
  393. } POLICY_TS_USER, * PPOLICY_TS_USER;
  394. //
  395. //
  396. // The USERCONFIGW struct contained both machine and user config data. We have split the
  397. // data into two kinds of policies, a user policy and a machine policy.
  398. //
  399. // The below struct is the machine policy, which includes both a flag to indicate the policy is
  400. // present, and a value for that policy.
  401. //
  402. //
  403. // And finally, why am I not using arays? Well I should have, but, originally, the design was
  404. // to user winstation->Config->User->User as the central repository for all data, which meant that all
  405. // I needed here were policy-present bits, not the policy data. However, the Product "feature" has
  406. // gone thru 3 mutations, and when it finally got to this point, I had very little time to make
  407. // any changes.
  408. //
  409. // I will consider to create a class that encapsulates all policy related bits.
  410. // AraBern, March 29, 2000 (2 days away from code complete !
  411. //
  412. typedef struct _POLICY_TS_MACHINE
  413. {
  414. ULONG fPolicyDisableClip : 1 ;
  415. ULONG fPolicyDisableCam : 1 ;
  416. ULONG fPolicyDisableCcm : 1 ;
  417. ULONG fPolicyDisableLPT : 1;
  418. ULONG fPolicyDisableCpm : 1;
  419. ULONG fPolicyPromptForPassword : 1 ;
  420. ULONG fPolicyMaxInstanceCount : 1;
  421. ULONG fPolicyMinEncryptionLevel : 1 ;
  422. ULONG fPolicyDisableAutoReconnect : 1;
  423. // These are new and used as machine-wide, so in a sense they are machine config data
  424. // especially that USERCONFIGW has entries for these
  425. ULONG fPolicyWFProfilePath: 1 ;
  426. ULONG fPolicyWFHomeDir: 1 ;
  427. ULONG fPolicyWFHomeDirDrive: 1 ;
  428. // this is new, and is present in here for the sake of consistancey. However, there is a special
  429. // func that is used by th's main connection loop to just look for this single item, in order
  430. // to save time.
  431. ULONG fPolicyDenyTSConnections : 1; // if set, TS is basically OFF in the sense that nobody can connect.
  432. // these are not part of TS machine config data struct, but winlogn does use these and treats
  433. // them as per machine type of a policy
  434. ULONG fPolicyTempFoldersPerSession : 1; // Use tmp folder per each session, instead of one common tmp folder
  435. ULONG fPolicyDeleteTempFoldersOnExit: 1; // on exit, do a cleanup of tmp folders
  436. ULONG fPolicyColorDepth : 1;
  437. ULONG fPolicySessionDirectoryActive : 1;
  438. ULONG fPolicySessionDirectoryLocation : 1;
  439. ULONG fPolicySessionDirectoryClusterName : 1;
  440. ULONG fPolicySessionDirectoryAdditionalParams : 1;
  441. ULONG fPolicySessionDirectoryExposeServerIP : 1;
  442. ULONG fPolicyPreventLicenseUpgrade : 1;
  443. ULONG fPolicyWritableTSCCPermissionsTAB : 1;
  444. ULONG fPolicyDisableCdm : 1;
  445. ULONG fPolicyForceClientLptDef : 1;
  446. ULONG fPolicyShadow : 1 ;
  447. ULONG fPolicyResetBroken : 1 ;
  448. ULONG fPolicyReconnectSame : 1 ;
  449. ULONG fPolicyMaxSessionTime : 1 ;
  450. ULONG fPolicyMaxDisconnectionTime:1;
  451. ULONG fPolicyMaxIdleTime : 1 ;
  452. ULONG fPolicyInitialProgram : 1 ;
  453. ULONG fPolicySingleSessionPerUser : 1;
  454. ULONG fPolicyDisableWallpaper : 1;
  455. ULONG fPolicyKeepAlive : 1;
  456. //
  457. // And now the data if policy is set. Not all items get data, some are just flags.
  458. //
  459. // Bit-fields first.
  460. //
  461. //
  462. ULONG fDisableClip : 1 ;
  463. ULONG fDisableCam : 1 ;
  464. ULONG fDisableCcm : 1 ;
  465. ULONG fDisableLPT : 1;
  466. ULONG fDisableCpm : 1;
  467. ULONG fPromptForPassword : 1 ;
  468. ULONG ColorDepth : 3;
  469. ULONG fDenyTSConnections : 1; // if set, TS is basically OFF in the sense that nobody can connect.
  470. // these are not part of TS machine config data struct, but winlogn does use these and treats
  471. // them as per machine type of a policy
  472. ULONG fTempFoldersPerSession : 1; // Use tmp folder per each session, instead of one common tmp folder
  473. ULONG fDeleteTempFoldersOnExit: 1; // on exit, do a cleanup of tmp folders
  474. ULONG fWritableTSCCPermissionsTAB : 1; // if set, then admins can change the per connection security descriptor.
  475. ULONG fDisableCdm : 1;
  476. ULONG fForceClientLptDef : 1;
  477. ULONG fResetBroken : 1 ;
  478. ULONG fReconnectSame : 1 ;
  479. ULONG fSingleSessionPerUser:1;
  480. ULONG fDisableWallpaper : 1;
  481. ULONG fKeepAliveEnable : 1;
  482. ULONG fPreventLicenseUpgrade:1;
  483. ULONG fDisableAutoReconnect : 1;
  484. //
  485. // Non bit-fields next
  486. //
  487. ULONG MaxInstanceCount;
  488. BYTE MinEncryptionLevel;
  489. WCHAR WFProfilePath[ DIRECTORY_LENGTH + 1 ];
  490. WCHAR WFHomeDir[ DIRECTORY_LENGTH + 1 ];
  491. WCHAR WFHomeDirDrive[ 4 ];
  492. ULONG SessionDirectoryActive;
  493. WCHAR SessionDirectoryLocation[DIRECTORY_LENGTH+1];
  494. WCHAR SessionDirectoryClusterName[DIRECTORY_LENGTH+1];
  495. WCHAR SessionDirectoryAdditionalParams[DIRECTORY_LENGTH+1];
  496. ULONG SessionDirectoryExposeServerIP;
  497. ULONG KeepAliveInterval;
  498. SHADOWCLASS Shadow;
  499. ULONG MaxConnectionTime;
  500. ULONG MaxDisconnectionTime;
  501. ULONG MaxIdleTime;
  502. // Start program Policy
  503. WCHAR WorkDirectory[ DIRECTORY_LENGTH + 1 ];
  504. WCHAR InitialProgram[ INITIALPROGRAM_LENGTH + 1 ];
  505. // these have nothing to do with the USERCONFIGW data structure , not sure if I will keep them here.
  506. // ULONG fHideUserTabInTaskMan : 1; // When set, the new Users TAB in task man is hidden.
  507. // ULONG fDenyTSCCUsage : 1; // When set, you can't use TSCC
  508. // ULONG fHideTSCCPermissionsTAB : 1; // allow TSCC to surface the permissions dialog, so that each connection
  509. // gets it's own permissions list
  510. // No UI for setting these in NT2195. Do we want to make these policies?
  511. // ULONG fPolicyInheritSecurity : 1 ;
  512. // ULONG fDisableEncryption : 1;
  513. //
  514. } POLICY_TS_MACHINE, *PPOLICY_TS_MACHINE;
  515. /*
  516. * User Configuration data
  517. */
  518. typedef struct _USERCONFIGW {
  519. /* if flag is set inherit parameter from user or client configuration */
  520. ULONG fInheritAutoLogon : 1;
  521. ULONG fInheritResetBroken : 1;
  522. ULONG fInheritReconnectSame : 1;
  523. ULONG fInheritInitialProgram : 1;
  524. ULONG fInheritCallback : 1;
  525. ULONG fInheritCallbackNumber : 1;
  526. ULONG fInheritShadow : 1;
  527. ULONG fInheritMaxSessionTime : 1;
  528. ULONG fInheritMaxDisconnectionTime : 1;
  529. ULONG fInheritMaxIdleTime : 1;
  530. ULONG fInheritAutoClient : 1;
  531. ULONG fInheritSecurity : 1;
  532. ULONG fPromptForPassword : 1; // fInheritAutoLogon
  533. ULONG fResetBroken : 1;
  534. ULONG fReconnectSame : 1;
  535. ULONG fLogonDisabled : 1;
  536. ULONG fWallPaperDisabled : 1;
  537. ULONG fAutoClientDrives : 1;
  538. ULONG fAutoClientLpts : 1;
  539. ULONG fForceClientLptDef : 1;
  540. ULONG fRequireEncryption : 1;
  541. ULONG fDisableEncryption : 1;
  542. ULONG fUnused1 : 1; // old fDisableIniFileMapping
  543. ULONG fHomeDirectoryMapRoot : 1;
  544. ULONG fUseDefaultGina : 1;
  545. ULONG fPublishedApp : 1;
  546. ULONG fHideTitleBar : 1;
  547. ULONG fMaximize : 1;
  548. ULONG fDisableCpm : 1;
  549. ULONG fDisableCdm : 1;
  550. ULONG fDisableCcm : 1;
  551. ULONG fDisableLPT : 1;
  552. ULONG fDisableClip : 1;
  553. ULONG fDisableExe : 1;
  554. ULONG fDisableCam : 1;
  555. ULONG fDisableAutoReconnect : 1;
  556. /* fInheritColorDepth */
  557. ULONG ColorDepth : 3;
  558. //NA 2/19/01
  559. ULONG fInheritColorDepth: 1;
  560. /* fInheritAutoLogon */
  561. WCHAR UserName[ USERNAME_LENGTH + 1 ];
  562. WCHAR Domain[ DOMAIN_LENGTH + 1 ];
  563. WCHAR Password[ PASSWORD_LENGTH + 1 ];
  564. /* fInheritInitialProgram */
  565. WCHAR WorkDirectory[ DIRECTORY_LENGTH + 1 ];
  566. WCHAR InitialProgram[ INITIALPROGRAM_LENGTH + 1 ];
  567. /* fInheritCallback */
  568. WCHAR CallbackNumber[ CALLBACK_LENGTH + 1 ];
  569. CALLBACKCLASS Callback;
  570. /* fInheritShadow */
  571. SHADOWCLASS Shadow;
  572. ULONG MaxConnectionTime;
  573. ULONG MaxDisconnectionTime;
  574. ULONG MaxIdleTime;
  575. ULONG KeyboardLayout; // 0 = inherit
  576. /* fInheritSecurity */
  577. BYTE MinEncryptionLevel;
  578. WCHAR NWLogonServer[ NASIFILESERVER_LENGTH + 1 ];
  579. APPLICATIONNAMEW PublishedName;
  580. /* WinFrame Profile Path - Overrides standard profile path */
  581. WCHAR WFProfilePath[ DIRECTORY_LENGTH + 1 ];
  582. /* WinFrame Home Directory - Overrides standard Home Directory */
  583. WCHAR WFHomeDir[ DIRECTORY_LENGTH + 1 ];
  584. /* WinFrame Home Directory Drive - Overrides standard Home Directory Drive*/
  585. WCHAR WFHomeDirDrive[ 4 ];
  586. } USERCONFIGW, * PUSERCONFIGW;
  587. typedef struct _USERCONFIGA {
  588. /* if flag is set inherit parameter from user or client configuration */
  589. ULONG fInheritAutoLogon : 1;
  590. ULONG fInheritResetBroken : 1;
  591. ULONG fInheritReconnectSame : 1;
  592. ULONG fInheritInitialProgram : 1;
  593. ULONG fInheritCallback : 1;
  594. ULONG fInheritCallbackNumber : 1;
  595. ULONG fInheritShadow : 1;
  596. ULONG fInheritMaxSessionTime : 1;
  597. ULONG fInheritMaxDisconnectionTime : 1;
  598. ULONG fInheritMaxIdleTime : 1;
  599. ULONG fInheritAutoClient : 1;
  600. ULONG fInheritSecurity : 1;
  601. ULONG fPromptForPassword : 1; // fInheritAutoLogon
  602. ULONG fResetBroken : 1;
  603. ULONG fReconnectSame : 1;
  604. ULONG fLogonDisabled : 1;
  605. ULONG fWallPaperDisabled : 1;
  606. ULONG fAutoClientDrives : 1;
  607. ULONG fAutoClientLpts : 1;
  608. ULONG fForceClientLptDef : 1;
  609. ULONG fRequireEncryption : 1;
  610. ULONG fDisableEncryption : 1;
  611. ULONG fUnused1 : 1; // old fDisableIniFileMapping
  612. ULONG fHomeDirectoryMapRoot : 1;
  613. ULONG fUseDefaultGina : 1;
  614. ULONG fPublishedApp : 1;
  615. ULONG fHideTitleBar : 1;
  616. ULONG fMaximize : 1;
  617. ULONG fDisableCpm : 1;
  618. ULONG fDisableCdm : 1;
  619. ULONG fDisableCcm : 1;
  620. ULONG fDisableLPT : 1;
  621. ULONG fDisableClip : 1;
  622. ULONG fDisableExe : 1;
  623. ULONG fDisableCam : 1;
  624. ULONG fDisableAutoReconnect : 1;
  625. /* fInheritAutoLogon */
  626. CHAR UserName[ USERNAME_LENGTH + 1 ];
  627. CHAR Domain[ DOMAIN_LENGTH + 1 ];
  628. CHAR Password[ PASSWORD_LENGTH + 1 ];
  629. /* fInheritInitialProgram */
  630. CHAR WorkDirectory[ DIRECTORY_LENGTH + 1 ];
  631. CHAR InitialProgram[ INITIALPROGRAM_LENGTH + 1 ];
  632. /* fInheritCallback */
  633. CHAR CallbackNumber[ CALLBACK_LENGTH + 1 ];
  634. CALLBACKCLASS Callback;
  635. /* fInheritShadow */
  636. SHADOWCLASS Shadow;
  637. ULONG MaxConnectionTime;
  638. ULONG MaxDisconnectionTime;
  639. ULONG MaxIdleTime;
  640. ULONG KeyboardLayout; // 0 = inherit
  641. /* fInheritSecurity */
  642. BYTE MinEncryptionLevel;
  643. CHAR NWLogonServer[ NASIFILESERVER_LENGTH + 1 ];
  644. APPLICATIONNAMEA PublishedName;
  645. /* WinFrame Profile Path - Overrides standard profile path */
  646. CHAR WFProfilePath[ DIRECTORY_LENGTH + 1 ];
  647. /* WinFrame Home Directory - Overrides standard Home Directory */
  648. CHAR WFHomeDir[ DIRECTORY_LENGTH + 1 ];
  649. /* WinFrame Home Directory Drive - Overrides standard Home Directory Drive*/
  650. CHAR WFHomeDirDrive[ 4 ];
  651. } USERCONFIGA, * PUSERCONFIGA;
  652. #ifdef UNICODE
  653. #define USERCONFIG USERCONFIGW
  654. #define PUSERCONFIG PUSERCONFIGW
  655. #else
  656. #define USERCONFIG USERCONFIGA
  657. #define PUSERCONFIG PUSERCONFIGA
  658. #endif /* UNICODE */
  659. /*------------------------------------------------*/
  660. /******************
  661. * PD structures
  662. ******************/
  663. typedef struct _PDCONFIG2W{
  664. PDNAMEW PdName; // descriptive name of PD
  665. SDCLASS SdClass; // type of PD
  666. DLLNAMEW PdDLL; // name of PD dll
  667. ULONG PdFlag; // PD flags
  668. ULONG OutBufLength; // optimal output buffer length
  669. ULONG OutBufCount; // optimal number of output buffers
  670. ULONG OutBufDelay; // write delay in msecs
  671. ULONG InteractiveDelay; // write delay during active input
  672. ULONG PortNumber; // network listen port number
  673. ULONG KeepAliveTimeout; // network watchdog frequence
  674. } PDCONFIG2W, * PPDCONFIG2W;
  675. typedef struct _PDCONFIG2A {
  676. PDNAMEA PdName;
  677. SDCLASS SdClass;
  678. DLLNAMEA PdDLL;
  679. ULONG PdFlag;
  680. ULONG OutBufLength;
  681. ULONG OutBufCount;
  682. ULONG OutBufDelay;
  683. ULONG InteractiveDelay;
  684. ULONG PortNumber;
  685. ULONG KeepAliveTimeout;
  686. } PDCONFIG2A, * PPDCONFIG2A;
  687. /*
  688. * PdFlag defines
  689. */
  690. #define PD_UNUSED 0x00000001 // <unused>
  691. #define PD_RELIABLE 0x00000002 // error free protocol already
  692. #define PD_FRAME 0x00000004 // frame orientated protocol
  693. #define PD_CONNECTION 0x00000008 // connection orientated protocol
  694. #define PD_CONSOLE 0x00000010 // directly connected console
  695. #define PD_LANA 0x00000020 // Network class uses LANAs (ie NetBIOS)
  696. #define PD_TRANSPORT 0x00000040 // transport driver (lowest level)
  697. #define PD_SINGLE_INST 0x00000080 // single instance only (async)
  698. #define PD_NOLOW_WATERMARK 0x00000100 //low water mark to resume transmission
  699. #ifdef UNICODE
  700. #define PDCONFIG2 PDCONFIG2W
  701. #define PPDCONFIG2 PPDCONFIG2W
  702. #else
  703. #define PDCONFIG2 PDCONFIG2A
  704. #define PPDCONFIG2 PPDCONFIG2A
  705. #endif /* UNICODE */
  706. /*------------------------------------------------*/
  707. typedef struct _PDCONFIG3W {
  708. PDCONFIG2W Data;
  709. PDNAMEW ServiceName; // Needed for non-LANA PdNetwork enum
  710. DLLNAMEW ConfigDLL; // helper dll for WinStation configuration
  711. ULONG RequiredPdCount;
  712. PDNAMEW RequiredPds[ MAX_PDCONFIG ];
  713. } PDCONFIG3W, * PPDCONFIG3W;
  714. typedef struct _PDCONFIG3A {
  715. PDCONFIG2A Data;
  716. PDNAMEA ServiceName; // Needed for non-LANA PdNetwork enum
  717. DLLNAMEA ConfigDLL; // helper dll for WinStation configuration
  718. ULONG RequiredPdCount;
  719. PDNAMEA RequiredPds[ MAX_PDCONFIG ];
  720. } PDCONFIG3A, * PPDCONFIG3A;
  721. #ifdef UNICODE
  722. #define PDCONFIG3 PDCONFIG3W
  723. #define PPDCONFIG3 PPDCONFIG3W
  724. #else
  725. #define PDCONFIG3 PDCONFIG3A
  726. #define PPDCONFIG3 PPDCONFIG3A
  727. #endif /* UNICODE */
  728. /*------------------------------------------------*/
  729. typedef enum _FLOWCONTROLCLASS {
  730. FlowControl_None,
  731. FlowControl_Hardware,
  732. FlowControl_Software,
  733. } FLOWCONTROLCLASS;
  734. typedef enum _RECEIVEFLOWCONTROLCLASS {
  735. ReceiveFlowControl_None,
  736. ReceiveFlowControl_RTS,
  737. ReceiveFlowControl_DTR,
  738. } RECEIVEFLOWCONTROLCLASS;
  739. typedef enum _TRANSMITFLOWCONTROLCLASS {
  740. TransmitFlowControl_None,
  741. TransmitFlowControl_CTS,
  742. TransmitFlowControl_DSR,
  743. } TRANSMITFLOWCONTROLCLASS;
  744. typedef struct _FLOWCONTROLCONFIG {
  745. ULONG fEnableSoftwareTx: 1;
  746. ULONG fEnableSoftwareRx: 1;
  747. ULONG fEnableDTR: 1;
  748. ULONG fEnableRTS: 1;
  749. CHAR XonChar;
  750. CHAR XoffChar;
  751. FLOWCONTROLCLASS Type;
  752. RECEIVEFLOWCONTROLCLASS HardwareReceive;
  753. TRANSMITFLOWCONTROLCLASS HardwareTransmit;
  754. } FLOWCONTROLCONFIG, * PFLOWCONTROLCONFIG;
  755. typedef enum _ASYNCCONNECTCLASS {
  756. Connect_CTS,
  757. Connect_DSR,
  758. Connect_RI,
  759. Connect_DCD,
  760. Connect_FirstChar,
  761. Connect_Perm,
  762. } ASYNCCONNECTCLASS;
  763. typedef struct _CONNECTCONFIG {
  764. ASYNCCONNECTCLASS Type;
  765. ULONG fEnableBreakDisconnect: 1;
  766. } CONNECTCONFIG, * PCONNECTCONFIG;
  767. /*------------------------------------------------*/
  768. typedef struct _ASYNCCONFIGW {
  769. DEVICENAMEW DeviceName;
  770. MODEMNAMEW ModemName;
  771. ULONG BaudRate;
  772. ULONG Parity;
  773. ULONG StopBits;
  774. ULONG ByteSize;
  775. ULONG fEnableDsrSensitivity: 1;
  776. ULONG fConnectionDriver: 1;
  777. FLOWCONTROLCONFIG FlowControl;
  778. CONNECTCONFIG Connect;
  779. } ASYNCCONFIGW, * PASYNCCONFIGW;
  780. typedef struct _ASYNCCONFIGA {
  781. DEVICENAMEA DeviceName;
  782. MODEMNAMEA ModemName;
  783. ULONG BaudRate;
  784. ULONG Parity;
  785. ULONG StopBits;
  786. ULONG ByteSize;
  787. ULONG fEnableDsrSensitivity: 1;
  788. ULONG fConnectionDriver: 1;
  789. FLOWCONTROLCONFIG FlowControl;
  790. CONNECTCONFIG Connect;
  791. } ASYNCCONFIGA, * PASYNCCONFIGA;
  792. #ifdef UNICODE
  793. #define ASYNCCONFIG ASYNCCONFIGW
  794. #define PASYNCCONFIG PASYNCCONFIGW
  795. #else
  796. #define ASYNCCONFIG ASYNCCONFIGA
  797. #define PASYNCCONFIG PASYNCCONFIGA
  798. #endif /* UNICODE */
  799. /*------------------------------------------------*/
  800. typedef struct _NETWORKCONFIGW {
  801. LONG LanAdapter;
  802. DEVICENAMEW NetworkName;
  803. ULONG Flags;
  804. } NETWORKCONFIGW, * PNETWORKCONFIGW;
  805. typedef struct _NETWORKCONFIGA {
  806. LONG LanAdapter;
  807. DEVICENAMEA NetworkName;
  808. ULONG Flags;
  809. } NETWORKCONFIGA, * PNETWORKCONFIGA;
  810. #define NETWORK_CLIENT 0x00000001
  811. #ifdef UNICODE
  812. #define NETWORKCONFIG NETWORKCONFIGW
  813. #define PNETWORKCONFIG PNETWORKCONFIGW
  814. #else
  815. #define NETWORKCONFIG NETWORKCONFIGA
  816. #define PNETWORKCONFIG PNETWORKCONFIGA
  817. #endif /* UNICODE */
  818. /*------------------------------------------------*/
  819. #ifdef UNICODE
  820. #define NASICONFIG NASICONFIGW
  821. #define PNASICONFIG PNASICONFIGW
  822. #else
  823. #define NASICONFIG NASICONFIGA
  824. #define PNASICONFIG PNASICONFIGA
  825. #endif /* UNICODE */
  826. typedef struct _NASICONFIGW {
  827. NASISPECIFICNAMEW SpecificName;
  828. NASIUSERNAMEW UserName;
  829. NASIPASSWORDW PassWord;
  830. NASISESIONNAMEW SessionName;
  831. NASIFILESERVERW FileServer;
  832. BOOLEAN GlobalSession;
  833. } NASICONFIGW, * PNASICONFIGW;
  834. typedef struct _NASICONFIGA {
  835. NASISPECIFICNAMEA SpecificName;
  836. NASIUSERNAMEA UserName;
  837. NASIPASSWORDA PassWord;
  838. NASISESIONNAMEA SessionName;
  839. NASIFILESERVERA FileServer;
  840. BOOLEAN GlobalSession;
  841. } NASICONFIGA, * PNASICONFIGA;
  842. /*------------------------------------------------*/
  843. typedef struct _OEMTDCONFIGW {
  844. LONG Adapter;
  845. DEVICENAMEW DeviceName;
  846. ULONG Flags;
  847. } OEMTDCONFIGW, * POEMTDCONFIGW;
  848. typedef struct _OEMTDCONFIGA {
  849. LONG Adapter;
  850. DEVICENAMEA DeviceName;
  851. ULONG Flags;
  852. } OEMTDCONFIGA, * POEMTDCONFIGA;
  853. #ifdef UNICODE
  854. #define OEMTDCONFIG OEMTDCONFIGW
  855. #define POEMTDCONFIG POEMTDCONFIGW
  856. #else
  857. #define OEMTDCONFIG OEMTDCONFIGA
  858. #define POEMTDCONFIG POEMTDCONFIGA
  859. #endif /* UNICODE */
  860. /*------------------------------------------------*/
  861. typedef struct _PDPARAMSW {
  862. SDCLASS SdClass;
  863. union {
  864. NETWORKCONFIGW Network;
  865. ASYNCCONFIGW Async;
  866. NASICONFIGW Nasi;
  867. OEMTDCONFIGW OemTd;
  868. };
  869. } PDPARAMSW, * PPDPARAMSW;
  870. typedef struct _PDPARAMSA {
  871. SDCLASS SdClass;
  872. union {
  873. NETWORKCONFIGA Network;
  874. ASYNCCONFIGA Async;
  875. NASICONFIGA Nasi;
  876. OEMTDCONFIGA OemTd;
  877. };
  878. } PDPARAMSA, * PPDPARAMSA;
  879. #ifdef UNICODE
  880. #define PDPARAMS PDPARAMSW
  881. #define PPDPARAMS PPDPARAMSW
  882. #else
  883. #define PDPARAMS PDPARAMSA
  884. #define PPDPARAMS PPDPARAMSA
  885. #endif /* UNICODE */
  886. /*------------------------------------------------*/
  887. typedef struct _PDCONFIGW {
  888. PDCONFIG2W Create;
  889. PDPARAMSW Params;
  890. } PDCONFIGW, * PPDCONFIGW;
  891. typedef struct _PDCONFIGA {
  892. PDCONFIG2A Create;
  893. PDPARAMSA Params;
  894. } PDCONFIGA, * PPDCONFIGA;
  895. #ifdef UNICODE
  896. #define PDCONFIG PDCONFIGW
  897. #define PPDCONFIG PPDCONFIGW
  898. #else
  899. #define PDCONFIG PDCONFIGA
  900. #define PPDCONFIG PPDCONFIGA
  901. #endif /* UNICODE */
  902. /*------------------------------------------------*/
  903. /***********************
  904. * Wd structures
  905. ***********************/
  906. typedef struct _WDCONFIGW {
  907. WDNAMEW WdName;
  908. DLLNAMEW WdDLL;
  909. DLLNAMEW WsxDLL;
  910. ULONG WdFlag;
  911. ULONG WdInputBufferLength;
  912. DLLNAMEW CfgDLL;
  913. WDPREFIXW WdPrefix;
  914. } WDCONFIGW, * PWDCONFIGW;
  915. typedef struct _WDCONFIGA {
  916. WDNAMEA WdName;
  917. DLLNAMEA WdDLL;
  918. DLLNAMEA WsxDLL;
  919. ULONG WdFlag;
  920. ULONG WdInputBufferLength;
  921. DLLNAMEA CfgDLL;
  922. WDPREFIXA WdPrefix;
  923. } WDCONFIGA, * PWDCONFIGA;
  924. /*
  925. * WdFlag defines
  926. */
  927. #define WDF_UNUSED 0x00000001 // <unused>
  928. #define WDF_SHADOW_SOURCE 0x00000002 // valid shadow source
  929. #define WDF_SHADOW_TARGET 0x00000004 // valid shadow target
  930. #define WDF_ICA 0x00000008 // WD is Citrix ICA class
  931. #define WDF_TSHARE 0x00000010 // WD is Microsoft TSHARE class
  932. #define WDF_DYNAMIC_RECONNECT 0x00000020 // Session can resize Display at reconnect
  933. #ifdef UNICODE
  934. #define WDCONFIG WDCONFIGW
  935. #define PWDCONFIG PWDCONFIGW
  936. #else
  937. #define WDCONFIG WDCONFIGA
  938. #define PWDCONFIG PWDCONFIGA
  939. #endif /* UNICODE */
  940. /*------------------------------------------------*/
  941. typedef struct _WDCONFIG2W {
  942. WDCONFIGW Wd;
  943. ASYNCCONFIGW Async;
  944. USERCONFIGW User;
  945. } WDCONFIG2W, * PWDCONFIG2W;
  946. typedef struct _WDCONFIG2A {
  947. WDCONFIGA Wd;
  948. ASYNCCONFIGA Async;
  949. USERCONFIGA User;
  950. } WDCONFIG2A, * PWDCONFIG2A;
  951. #ifdef UNICODE
  952. #define WDCONFIG2 WDCONFIG2W
  953. #define PWDCONFIG2 PWDCONFIG2W
  954. #else
  955. #define WDCONFIG2 WDCONFIG2A
  956. #define PWDCONFIG2 PWDCONFIG2A
  957. #endif /* UNICODE */
  958. /*------------------------------------------------*/
  959. /**************************************
  960. * Connection Driver structures (CD)
  961. **************************************/
  962. /*
  963. * connection driver classes
  964. */
  965. typedef enum _CDCLASS {
  966. CdNone, // 0
  967. CdModem, // 1 cdmodem.dll
  968. CdClass_Maximum, // 2 -- must be last
  969. } CDCLASS;
  970. /*------------------------------------------------*/
  971. typedef struct _CDCONFIGW {
  972. CDCLASS CdClass;
  973. CDNAMEW CdName;
  974. DLLNAMEW CdDLL;
  975. ULONG CdFlag;
  976. } CDCONFIGW, * PCDCONFIGW;
  977. typedef struct _CDCONFIGA {
  978. CDCLASS CdClass;
  979. CDNAMEA CdName;
  980. DLLNAMEA CdDLL;
  981. ULONG CdFlag;
  982. } CDCONFIGA, * PCDCONFIGA;
  983. #ifdef UNICODE
  984. #define CDCONFIG CDCONFIGW
  985. #define PCDCONFIG PCDCONFIGW
  986. #else
  987. #define CDCONFIG CDCONFIGA
  988. #define PCDCONFIG PCDCONFIGA
  989. #endif /* UNICODE */
  990. /*------------------------------------------------*/
  991. /*****************************
  992. * Window Station structures
  993. *****************************/
  994. typedef struct _WINSTATIONCREATEW {
  995. ULONG fEnableWinStation : 1;
  996. ULONG MaxInstanceCount;
  997. } WINSTATIONCREATEW, * PWINSTATIONCREATEW;
  998. typedef struct _WINSTATIONCREATEA {
  999. ULONG fEnableWinStation : 1;
  1000. ULONG MaxInstanceCount;
  1001. } WINSTATIONCREATEA, * PWINSTATIONCREATEA;
  1002. #ifdef UNICODE
  1003. #define WINSTATIONCREATE WINSTATIONCREATEW
  1004. #define PWINSTATIONCREATE PWINSTATIONCREATEW
  1005. #else
  1006. #define WINSTATIONCREATE WINSTATIONCREATEA
  1007. #define PWINSTATIONCREATE PWINSTATIONCREATEA
  1008. #endif /* UNICODE */
  1009. /*------------------------------------------------*/
  1010. typedef struct _WINSTATIONCONFIGW {
  1011. WCHAR Comment[ WINSTATIONCOMMENT_LENGTH + 1 ];
  1012. USERCONFIGW User;
  1013. char OEMId[4]; // WinFrame Server OEM Id
  1014. } WINSTATIONCONFIGW, * PWINSTATIONCONFIGW;
  1015. typedef struct _WINSTATIONCONFIGA {
  1016. CHAR Comment[ WINSTATIONCOMMENT_LENGTH + 1 ];
  1017. USERCONFIGA User;
  1018. char OEMId[4]; // WinFrame Server OEM Id
  1019. } WINSTATIONCONFIGA, * PWINSTATIONCONFIGA;
  1020. #ifdef UNICODE
  1021. #define WINSTATIONCONFIG WINSTATIONCONFIGW
  1022. #define PWINSTATIONCONFIG PWINSTATIONCONFIGW
  1023. #else
  1024. #define WINSTATIONCONFIG WINSTATIONCONFIGA
  1025. #define PWINSTATIONCONFIG PWINSTATIONCONFIGA
  1026. #endif /* UNICODE */
  1027. /*------------------------------------------------*/
  1028. typedef enum _WINSTATIONINFOCLASS {
  1029. WinStationCreateData, // query WinStation create data
  1030. WinStationConfiguration, // query/set WinStation parameters
  1031. WinStationPdParams, // query/set PD parameters
  1032. WinStationWd, // query WD config (only one can be loaded)
  1033. WinStationPd, // query PD config (many can be loaded)
  1034. WinStationPrinter, // query/set LPT mapping to printer queues
  1035. WinStationClient, // query information about client
  1036. WinStationModules, // query information about all client modules
  1037. WinStationInformation, // query information about WinStation
  1038. WinStationTrace, // enable/disable winstation tracing
  1039. WinStationBeep, // beep the WinStation
  1040. WinStationEncryptionOff, // turn off encryption
  1041. WinStationEncryptionPerm, // encryption is permanent on
  1042. WinStationNtSecurity, // select winlogon security desktop
  1043. WinStationUserToken, // User token
  1044. WinStationUnused1, // *** AVAILABLE *** (old IniMapping)
  1045. WinStationVideoData, // query hres, vres, color depth
  1046. WinStationInitialProgram, // Identify Initial Program
  1047. WinStationCd, // query CD config (only one can be loaded)
  1048. WinStationSystemTrace, // enable/disable system tracing
  1049. WinStationVirtualData, // query client virtual data
  1050. WinStationClientData, // send data to client
  1051. WinStationSecureDesktopEnter, // turn encryption on, if enabled
  1052. WinStationSecureDesktopExit, // turn encryption off, if enabled
  1053. WinStationLoadBalanceSessionTarget, // Load balance info from redirected client.
  1054. WinStationLoadIndicator, // query load capacity information
  1055. WinStationShadowInfo, // query/set Shadow state & parameters
  1056. WinStationDigProductId, // get the outermost digital product id, the client's product id, and the current product id
  1057. WinStationLockedState, // winlogon sets this for notifing apps/services.
  1058. WinStationRemoteAddress, // Query client IP address
  1059. WinStationLastReconnectType, // If last reconnect for this winstation was manual or auto reconnect.
  1060. WinStationDisallowAutoReconnect, // Allow/Disallow AutoReconnect for this WinStation
  1061. WinStationMprNotifyInfo // Mprnotify info from Winlogon for notifying 3rd party network providers
  1062. } WINSTATIONINFOCLASS;
  1063. /*------------------------------------------------*/
  1064. typedef struct _WINSTATIONCLIENTDATA {
  1065. CLIENTDATANAME DataName;
  1066. BOOLEAN fUnicodeData;
  1067. /* BYTE Data[1]; Variable length data follows */
  1068. } WINSTATIONCLIENTDATA, * PWINSTATIONCLIENTDATA;
  1069. /*------------------------------------------------*/
  1070. typedef struct _WINSTATIONUSERTOKEN {
  1071. HANDLE ProcessId;
  1072. HANDLE ThreadId;
  1073. HANDLE UserToken;
  1074. } WINSTATIONUSERTOKEN, * PWINSTATIONUSERTOKEN;
  1075. /*------------------------------------------------*/
  1076. typedef struct _WINSTATIONVIDEODATA {
  1077. USHORT HResolution;
  1078. USHORT VResolution;
  1079. USHORT fColorDepth;
  1080. } WINSTATIONVIDEODATA, *PWINSTATIONVIDEODATA;
  1081. /*----------------------------------------------*/
  1082. typedef struct _WINSTATIONCONFIG2W {
  1083. WINSTATIONCREATEW Create;
  1084. PDCONFIGW Pd[ MAX_PDCONFIG ];
  1085. WDCONFIGW Wd;
  1086. CDCONFIGW Cd;
  1087. WINSTATIONCONFIGW Config;
  1088. } WINSTATIONCONFIG2W, * PWINSTATIONCONFIG2W;
  1089. typedef struct _WINSTATIONCONFIG2A {
  1090. WINSTATIONCREATEA Create;
  1091. PDCONFIGA Pd[ MAX_PDCONFIG ];
  1092. WDCONFIGA Wd;
  1093. CDCONFIGA Cd;
  1094. WINSTATIONCONFIGA Config;
  1095. } WINSTATIONCONFIG2A, * PWINSTATIONCONFIG2A;
  1096. #ifdef UNICODE
  1097. #define WINSTATIONCONFIG2 WINSTATIONCONFIG2W
  1098. #define PWINSTATIONCONFIG2 PWINSTATIONCONFIG2W
  1099. #else
  1100. #define WINSTATIONCONFIG2 WINSTATIONCONFIG2A
  1101. #define PWINSTATIONCONFIG2 PWINSTATIONCONFIG2A
  1102. #endif /* UNICODE */
  1103. /*------------------------------------------------*/
  1104. typedef struct _WINSTATIONPRINTERW {
  1105. PRINTERNAMEW Lpt1;
  1106. PRINTERNAMEW Lpt2;
  1107. PRINTERNAMEW Lpt3;
  1108. PRINTERNAMEW Lpt4;
  1109. } WINSTATIONPRINTERW, * PWINSTATIONPRINTERW;
  1110. typedef struct _WINSTATIONPRINTERA {
  1111. PRINTERNAMEA Lpt1;
  1112. PRINTERNAMEA Lpt2;
  1113. PRINTERNAMEA Lpt3;
  1114. PRINTERNAMEA Lpt4;
  1115. } WINSTATIONPRINTERA, * PWINSTATIONPRINTERA;
  1116. #ifdef UNICODE
  1117. #define WINSTATIONPRINTER WINSTATIONPRINTERW
  1118. #define PWINSTATIONPRINTER PWINSTATIONPRINTERW
  1119. #else
  1120. #define WINSTATIONPRINTER WINSTATIONPRINTERA
  1121. #define PWINSTATIONPRINTER PWINSTATIONPRINTERA
  1122. #endif /* UNICODE */
  1123. #ifndef _TS_TIME_ZONE_INFORMATION_
  1124. #define _TS_TIME_ZONE_INFORMATION_
  1125. typedef struct _TS_SYSTEMTIME {
  1126. USHORT wYear;
  1127. USHORT wMonth;
  1128. USHORT wDayOfWeek;
  1129. USHORT wDay;
  1130. USHORT wHour;
  1131. USHORT wMinute;
  1132. USHORT wSecond;
  1133. USHORT wMilliseconds;
  1134. } TS_SYSTEMTIME;
  1135. typedef struct _TS_TIME_ZONE_INFORMATION {
  1136. LONG Bias;
  1137. WCHAR StandardName[ 32 ];
  1138. TS_SYSTEMTIME StandardDate;
  1139. LONG StandardBias;
  1140. WCHAR DaylightName[ 32 ];
  1141. TS_SYSTEMTIME DaylightDate;
  1142. LONG DaylightBias;
  1143. } TS_TIME_ZONE_INFORMATION;
  1144. #endif //_TS_TIME_ZONE_INFORMATION_
  1145. /*------------------------------------------------*/
  1146. /*
  1147. * WinStation client data structure
  1148. */
  1149. typedef struct _WINSTATIONCLIENTW {
  1150. ULONG fTextOnly: 1;
  1151. ULONG fDisableCtrlAltDel: 1;
  1152. ULONG fMouse: 1;
  1153. ULONG fDoubleClickDetect: 1;
  1154. ULONG fINetClient: 1;
  1155. ULONG fPromptForPassword : 1;
  1156. ULONG fMaximizeShell: 1;
  1157. ULONG fEnableWindowsKey: 1;
  1158. ULONG fRemoteConsoleAudio: 1;
  1159. WCHAR ClientName[ CLIENTNAME_LENGTH + 1 ];
  1160. WCHAR Domain[ DOMAIN_LENGTH + 1 ];
  1161. WCHAR UserName[ USERNAME_LENGTH + 1 ];
  1162. WCHAR Password[ PASSWORD_LENGTH + 1 ];
  1163. WCHAR WorkDirectory[ DIRECTORY_LENGTH + 1 ];
  1164. WCHAR InitialProgram[ INITIALPROGRAM_LENGTH + 1 ];
  1165. ULONG SerialNumber; // client computer unique serial number
  1166. BYTE EncryptionLevel; // security level of encryption pd
  1167. ULONG ClientAddressFamily;
  1168. WCHAR ClientAddress[ CLIENTADDRESS_LENGTH + 1 ];
  1169. USHORT HRes;
  1170. USHORT VRes;
  1171. USHORT ColorDepth;
  1172. USHORT ProtocolType; // PROTOCOL_ICA or PROTOCOL_RDP
  1173. ULONG KeyboardLayout;
  1174. ULONG KeyboardType;
  1175. ULONG KeyboardSubType;
  1176. ULONG KeyboardFunctionKey;
  1177. WCHAR imeFileName[ IMEFILENAME_LENGTH + 1 ];
  1178. WCHAR ClientDirectory[ DIRECTORY_LENGTH + 1 ];
  1179. WCHAR ClientLicense[ CLIENTLICENSE_LENGTH + 1 ];
  1180. WCHAR ClientModem[ CLIENTMODEM_LENGTH + 1 ];
  1181. ULONG ClientBuildNumber;
  1182. ULONG ClientHardwareId; // client software serial number
  1183. USHORT ClientProductId; // client software product id
  1184. USHORT OutBufCountHost; // number of outbufs on host
  1185. USHORT OutBufCountClient; // number of outbufs on client
  1186. USHORT OutBufLength; // length of outbufs in bytes
  1187. WCHAR AudioDriverName[9];
  1188. //client time zone information
  1189. TS_TIME_ZONE_INFORMATION ClientTimeZone;
  1190. ULONG ClientSessionId;
  1191. WCHAR clientDigProductId[CLIENT_PRODUCT_ID_LENGTH];
  1192. ULONG PerformanceFlags; // List of features to disable for perf
  1193. } WINSTATIONCLIENTW, * PWINSTATIONCLIENTW;
  1194. /*
  1195. * WinStation client data structure
  1196. */
  1197. typedef struct _WINSTATIONCLIENTA {
  1198. ULONG fTextOnly: 1;
  1199. ULONG fDisableCtrlAltDel: 1;
  1200. ULONG fMouse: 1;
  1201. ULONG fDoubleClickDetect: 1;
  1202. ULONG fINetClient: 1;
  1203. ULONG fPromptForPassword : 1;
  1204. ULONG fMaximizeShell: 1;
  1205. ULONG fEnableWindowsKey: 1;
  1206. char ClientName[ CLIENTNAME_LENGTH + 1 ];
  1207. char Domain[ DOMAIN_LENGTH + 1 ];
  1208. char UserName[ USERNAME_LENGTH + 1 ];
  1209. char Password[ PASSWORD_LENGTH + 1 ];
  1210. char WorkDirectory[ DIRECTORY_LENGTH + 1 ];
  1211. char InitialProgram[ INITIALPROGRAM_LENGTH + 1 ];
  1212. ULONG SerialNumber; // client computer unique serial number
  1213. BYTE EncryptionLevel; // security level of encryption pd
  1214. ULONG ClientAddressFamily;
  1215. char ClientAddress[ CLIENTADDRESS_LENGTH + 1 ];
  1216. USHORT HRes;
  1217. USHORT VRes;
  1218. USHORT ColorDepth;
  1219. USHORT ProtocolType; // PROTOCOL_ICA or PROTOCOL_RDP
  1220. ULONG KeyboardLayout;
  1221. ULONG KeyboardType;
  1222. ULONG KeyboardSubType;
  1223. ULONG KeyboardFunctionKey;
  1224. char imeFileName[ IMEFILENAME_LENGTH + 1 ];
  1225. char ClientDirectory[ DIRECTORY_LENGTH + 1 ];
  1226. char ClientLicense[ CLIENTLICENSE_LENGTH + 1 ];
  1227. char ClientModem[ CLIENTMODEM_LENGTH + 1 ];
  1228. ULONG ClientBuildNumber;
  1229. ULONG ClientHardwareId; // client software serial number
  1230. USHORT ClientProductId; // client software product id
  1231. USHORT OutBufCountHost; // number of outbufs on host
  1232. USHORT OutBufCountClient; // number of outbufs on client
  1233. USHORT OutBufLength; // length of outbufs in bytes
  1234. char AudioDriverName[9];
  1235. //client time zone information
  1236. TS_TIME_ZONE_INFORMATION ClientTimeZone;
  1237. ULONG ClientSessionId;
  1238. char clientDigProductId[CLIENT_PRODUCT_ID_LENGTH];
  1239. ULONG PerformanceFlags; // List of features to disable for perf
  1240. } WINSTATIONCLIENTA, * PWINSTATIONCLIENTA;
  1241. #ifdef UNICODE
  1242. #define WINSTATIONCLIENT WINSTATIONCLIENTW
  1243. #define PWINSTATIONCLIENT PWINSTATIONCLIENTW
  1244. #else
  1245. #define WINSTATIONCLIENT WINSTATIONCLIENTA
  1246. #define PWINSTATIONCLIENT PWINSTATIONCLIENTA
  1247. #endif /* UNICODE */
  1248. /*
  1249. * Autoreconnect information passed up from the stack
  1250. */
  1251. #define MAX_TS_AUTORECONNECTINFO_LEN 128
  1252. typedef struct _TS_AUTORECONNECTINFO {
  1253. USHORT cbAutoReconnectInfo;
  1254. BYTE AutoReconnectInfo[MAX_TS_AUTORECONNECTINFO_LEN];
  1255. } TS_AUTORECONNECTINFO, *PTS_AUTORECONNECTINFO;
  1256. /*------------------------------------------------*/
  1257. /*
  1258. * ICA specific protocol performance counters
  1259. */
  1260. typedef struct _ICA_COUNTERS {
  1261. ULONG Reserved;
  1262. } ICA_COUNTERS, * PICA_COUNTERS;
  1263. /*
  1264. * T.Share specific protocol performance counters
  1265. */
  1266. typedef struct _TSHARE_COUNTERS {
  1267. ULONG Reserved;
  1268. } TSHARE_COUNTERS, * PTSHARE_COUNTERS;
  1269. /*
  1270. * WinStation protocol performance counters
  1271. */
  1272. typedef struct _PROTOCOLCOUNTERS {
  1273. ULONG WdBytes; // wd common
  1274. ULONG WdFrames; // wd common
  1275. ULONG WaitForOutBuf; // wd common
  1276. ULONG Frames; // td common
  1277. ULONG Bytes; // td common
  1278. ULONG CompressedBytes; // pdcomp
  1279. ULONG CompressFlushes; // pdcomp
  1280. ULONG Errors; // pdreli
  1281. ULONG Timeouts; // pdreli
  1282. ULONG AsyncFramingError; // pdasync
  1283. ULONG AsyncOverrunError; // pdasync
  1284. ULONG AsyncOverflowError; // pdasync
  1285. ULONG AsyncParityError; // pdasync
  1286. ULONG TdErrors; // td common
  1287. USHORT ProtocolType; // PROTOCOL_ICA or PROTOCOL_RDP
  1288. USHORT Length; // length of data in protocol-specific space
  1289. union {
  1290. ICA_COUNTERS IcaCounters;
  1291. TSHARE_COUNTERS TShareCounters;
  1292. ULONG Reserved[100];
  1293. } Specific;
  1294. } PROTOCOLCOUNTERS, * PPROTOCOLCOUNTERS;
  1295. /*
  1296. * ThinWire cache statistics
  1297. */
  1298. typedef struct _THINWIRECACHE {
  1299. ULONG CacheReads;
  1300. ULONG CacheHits;
  1301. } THINWIRECACHE, * PTHINWIRECACHE;
  1302. #define MAX_THINWIRECACHE 4
  1303. /*
  1304. * ICA specific cache statistics
  1305. */
  1306. typedef struct _ICA_CACHE {
  1307. THINWIRECACHE ThinWireCache[ MAX_THINWIRECACHE ];
  1308. } ICA_CACHE, * PICA_CACHE;
  1309. /*
  1310. * T.Share specific cache statistics
  1311. */
  1312. typedef struct _TSHARE_CACHE {
  1313. ULONG Reserved;
  1314. } TSHARE_CACHE, * PTSHARE_CACHE;
  1315. /*
  1316. * WinStation cache statistics
  1317. */
  1318. typedef struct CACHE_STATISTICS {
  1319. USHORT ProtocolType; // PROTOCOL_ICA or PROTOCOL_RDP
  1320. USHORT Length; // length of data in protocol-specific space
  1321. union {
  1322. ICA_CACHE IcaCacheStats;
  1323. TSHARE_CACHE TShareCacheStats;
  1324. ULONG Reserved[20];
  1325. } Specific;
  1326. } CACHE_STATISTICS, * PCACHE_STATISTICS;
  1327. /*
  1328. * WinStation protocol status
  1329. */
  1330. typedef struct _PROTOCOLSTATUS {
  1331. PROTOCOLCOUNTERS Output;
  1332. PROTOCOLCOUNTERS Input;
  1333. CACHE_STATISTICS Cache;
  1334. ULONG AsyncSignal; // MS_CTS_ON, MS_DSR_ON, etc...
  1335. ULONG AsyncSignalMask; // EV_CTS, EV_DSR, etc...
  1336. } PROTOCOLSTATUS, * PPROTOCOLSTATUS;
  1337. /*
  1338. * Protocol extension info struct
  1339. */
  1340. typedef struct _WSX_INFO {
  1341. ULONG Version;
  1342. HANDLE hIca;
  1343. HANDLE hStack;
  1344. ULONG SessionId;
  1345. PWCHAR pUserName;
  1346. PWCHAR pDomain;
  1347. #define WSX_INFO_VERSION_1 0x1
  1348. } WSX_INFO, * PWSX_INFO;
  1349. /*
  1350. * AsyncSignal defines
  1351. */
  1352. // #define MS_CTS_ON 0x0010
  1353. // #define MS_DSR_ON 0x0020
  1354. // #define MS_RING_ON 0x0040
  1355. // #define MS_RLSD_ON 0x0080
  1356. #define MS_DTR_ON 0x00010000
  1357. #define MS_RTS_ON 0x00020000
  1358. /*
  1359. * AsyncSignalMask defines
  1360. */
  1361. // #define EV_CTS 0x0008 // CTS changed state
  1362. // #define EV_DSR 0x0010 // DSR changed state
  1363. // #define EV_RLSD 0x0020 // RLSD changed state
  1364. // #define EV_RING 0x0100 // Ring signal detected
  1365. #define EV_DTR 0x00010000 // DTR changed state
  1366. #define EV_RTS 0x00020000 // DTR changed state
  1367. /*------------------------------------------------*/
  1368. /*
  1369. * WinStation query information
  1370. */
  1371. typedef struct _WINSTATIONINFORMATIONW {
  1372. WINSTATIONSTATECLASS ConnectState;
  1373. WINSTATIONNAMEW WinStationName;
  1374. ULONG LogonId;
  1375. LARGE_INTEGER ConnectTime;
  1376. LARGE_INTEGER DisconnectTime;
  1377. LARGE_INTEGER LastInputTime;
  1378. LARGE_INTEGER LogonTime;
  1379. PROTOCOLSTATUS Status;
  1380. WCHAR Domain[ DOMAIN_LENGTH + 1 ];
  1381. WCHAR UserName[USERNAME_LENGTH + 1];
  1382. LARGE_INTEGER CurrentTime;
  1383. } WINSTATIONINFORMATIONW, * PWINSTATIONINFORMATIONW;
  1384. typedef struct _WINSTATIONINFORMATIONA {
  1385. WINSTATIONSTATECLASS ConnectState;
  1386. WINSTATIONNAMEA WinStationName;
  1387. ULONG LogonId;
  1388. LARGE_INTEGER ConnectTime;
  1389. LARGE_INTEGER DisconnectTime;
  1390. LARGE_INTEGER LastInputTime;
  1391. LARGE_INTEGER LogonTime;
  1392. PROTOCOLSTATUS Status;
  1393. CHAR Domain[ DOMAIN_LENGTH + 1 ];
  1394. CHAR UserName[USERNAME_LENGTH + 1];
  1395. LARGE_INTEGER CurrentTime;
  1396. } WINSTATIONINFORMATIONA, * PWINSTATIONINFORMATIONA;
  1397. #ifdef UNICODE
  1398. #define WINSTATIONINFORMATION WINSTATIONINFORMATIONW
  1399. #define PWINSTATIONINFORMATION PWINSTATIONINFORMATIONW
  1400. #else
  1401. #define WINSTATIONINFORMATION WINSTATIONINFORMATIONA
  1402. #define PWINSTATIONINFORMATION PWINSTATIONINFORMATIONA
  1403. #endif /* UNICODE */
  1404. /*
  1405. * Load balancing data types
  1406. */
  1407. typedef enum _LOADFACTORTYPE {
  1408. ErrorConstraint,
  1409. PagedPoolConstraint,
  1410. NonPagedPoolConstraint,
  1411. AvailablePagesConstraint,
  1412. SystemPtesConstraint,
  1413. CPUConstraint
  1414. } LOADFACTORTYPE;
  1415. typedef struct _WINSTATIONLOADINDICATORDATA {
  1416. ULONG RemainingSessionCapacity;
  1417. LOADFACTORTYPE LoadFactor;
  1418. ULONG TotalSessions;
  1419. ULONG DisconnectedSessions;
  1420. LARGE_INTEGER IdleCPU;
  1421. LARGE_INTEGER TotalCPU;
  1422. ULONG RawSessionCapacity;
  1423. ULONG reserved[9];
  1424. } WINSTATIONLOADINDICATORDATA, * PWINSTATIONLOADINDICATORDATA;
  1425. /*------------------------------------------------*/
  1426. /*
  1427. * WinStation shadow states
  1428. */
  1429. typedef enum _SHADOWSTATECLASS {
  1430. State_NoShadow, // No shadow operations on this session
  1431. State_Shadowing, // The session is a Shadow client (viewer)
  1432. State_Shadowed, // The session is a Shadow target
  1433. } SHADOWSTATECLASS;
  1434. /*
  1435. * Shadow query/set information
  1436. */
  1437. typedef struct _WINSTATIONSHADOW {
  1438. SHADOWSTATECLASS ShadowState;
  1439. SHADOWCLASS ShadowClass;
  1440. ULONG SessionId;
  1441. ULONG ProtocolType; // ignored in a set operation
  1442. } WINSTATIONSHADOW, * PWINSTATIONSHADOW;
  1443. //get the outermost product id, client product id, and current product id
  1444. //and corresponding session ids for use in checking shadow loop
  1445. typedef struct _WINSTATIONPRODIDW {
  1446. WCHAR DigProductId[CLIENT_PRODUCT_ID_LENGTH];
  1447. WCHAR ClientDigProductId[CLIENT_PRODUCT_ID_LENGTH ];
  1448. WCHAR OuterMostDigProductId[CLIENT_PRODUCT_ID_LENGTH ];
  1449. ULONG curentSessionId;
  1450. ULONG ClientSessionId;
  1451. ULONG OuterMostSessionId;
  1452. }WINSTATIONPRODIDW, *PWINSTATIONPRODIDW;
  1453. typedef struct _WINSTATIONPRODIDA {
  1454. CHAR DigProductId[CLIENT_PRODUCT_ID_LENGTH];
  1455. CHAR ClientDigProductId[CLIENT_PRODUCT_ID_LENGTH ];
  1456. CHAR OuterMostDigProductId[CLIENT_PRODUCT_ID_LENGTH ];
  1457. ULONG curentSessionId;
  1458. ULONG ClientSessionId;
  1459. ULONG OuterMostSessionId;
  1460. }WINSTATIONPRODIDA, *PWINSTATIONPRODIDA;
  1461. #ifdef UNICODE
  1462. #define WINSTATIONPRODID WINSTATIONPRODIDW
  1463. #define PWINSTATIONPRODID PWINSTATIONPRODIDW
  1464. #else
  1465. #define WINSTATIONPRODID WINSTATIONPRODIDA
  1466. #define PWINSTATIONPRODID PWINSTATIONPRODIDA
  1467. #endif /* UNICODE */
  1468. typedef struct {
  1469. unsigned short sin_family; // Socket address family.
  1470. // AF_INET or AF_INET6
  1471. union {
  1472. // structure identical to TDI_ADDRESS_IP
  1473. struct {
  1474. USHORT sin_port;
  1475. ULONG in_addr;
  1476. UCHAR sin_zero[8];
  1477. } ipv4;
  1478. // structure identical to TDI_ADDRESS_IP6
  1479. struct {
  1480. USHORT sin6_port;
  1481. ULONG sin6_flowinfo;
  1482. USHORT sin6_addr[8];
  1483. ULONG sin6_scope_id;
  1484. } ipv6;
  1485. };
  1486. } WINSTATIONREMOTEADDRESS, *PWINSTATIONREMOTEADDRESS;
  1487. /*------------------------------------------------*/
  1488. /*
  1489. * Licensing Policy information struct
  1490. */
  1491. #define LCPOLICYINFOTYPE_V1 (1)
  1492. #define LCPOLICYINFOTYPE_CURRENT LCPOLICYINFOTYPE_V1
  1493. typedef struct {
  1494. ULONG ulVersion;
  1495. LPWSTR lpPolicyName;
  1496. LPWSTR lpPolicyDescription;
  1497. } LCPOLICYINFO_V1W, *LPLCPOLICYINFO_V1W;
  1498. typedef struct {
  1499. ULONG ulVersion;
  1500. LPSTR lpPolicyName;
  1501. LPSTR lpPolicyDescription;
  1502. } LCPOLICYINFO_V1A, *LPLCPOLICYINFO_V1A;
  1503. #ifdef UNICODE
  1504. #define LCPOLICYINFO_V1 LCPOLICYINFO_V1W
  1505. #define LPLCPOLICYINFO_V1 LPLCPOLICYINFO_V1W
  1506. #else
  1507. #define LCPOLICYINFO_V1 LCPOLICYINFO_V1A
  1508. #define LPLCPOLICYINFO_V1 LPLCPOLICYINFO_V1A
  1509. #endif
  1510. //
  1511. // The generic type is for the API. This will help callers realize that while
  1512. // this API can correctly handle several types of input, they are all based
  1513. // on the LCPOLICYINFO series.
  1514. //
  1515. typedef struct {
  1516. ULONG ulVersion;
  1517. } LCPOLICYINFOGENERIC, *LPLCPOLICYINFOGENERIC;
  1518. /*------------------------------------------------*/
  1519. /*
  1520. * Types of settings that termsrv can update. Callers to
  1521. * _WinStationUpdateSettings choose one, therefore we need not update
  1522. * everything because one type of setting has changed.
  1523. *
  1524. * What used to be contained in ReadRegistry is now covered by
  1525. * WINSTACFG_LEGACY.
  1526. */
  1527. typedef enum _WINSTATIONUPDATECFGCLASS {
  1528. WINSTACFG_LEGACY,
  1529. WINSTACFG_SESSDIR
  1530. } WINSTATIONUPDATECFGCLASS;
  1531. /*------------------------------------------------*/
  1532. typedef struct _BEEPINPUT {
  1533. ULONG uType;
  1534. } BEEPINPUT, * PBEEPINPUT;
  1535. /*------------------------------------------------*/
  1536. /**********************
  1537. * NWLogon Structure
  1538. **********************/
  1539. typedef struct _NWLOGONADMIN {
  1540. WCHAR Username[ USERNAME_LENGTH + 1 ];
  1541. WCHAR Password[ PASSWORD_LENGTH + 1 ];
  1542. WCHAR Domain[ DOMAIN_LENGTH + 1 ];
  1543. } NWLOGONADMIN, * PNWLOGONADMIN;
  1544. /*------------------------------------------------*/
  1545. /**********************************************
  1546. * Registry APIs for Connection Drivers (Cds)
  1547. **********************************************/
  1548. LONG WINAPI
  1549. RegCdEnumerateW(
  1550. HANDLE hServer,
  1551. PWDNAMEW pWdName,
  1552. PULONG pIndex,
  1553. PULONG pEntries,
  1554. PCDNAMEW pCdName,
  1555. PULONG pByteCount
  1556. );
  1557. LONG WINAPI
  1558. RegCdEnumerateA(
  1559. HANDLE hServer,
  1560. PWDNAMEA pWdName,
  1561. PULONG pIndex,
  1562. PULONG pEntries,
  1563. PCDNAMEA pCdName,
  1564. PULONG pByteCount
  1565. );
  1566. #ifdef UNICODE
  1567. #define RegCdEnumerate RegCdEnumerateW
  1568. #else
  1569. #define RegCdEnumerate RegCdEnumerateA
  1570. #endif /* UNICODE */
  1571. /*------------------------------------------------*/
  1572. LONG WINAPI
  1573. RegCdCreateW(
  1574. HANDLE hServer,
  1575. PWDNAMEW pWdName,
  1576. PCDNAMEW pCdName,
  1577. BOOLEAN bCreate,
  1578. PCDCONFIGW pCdConfig,
  1579. ULONG CdConfigLength
  1580. );
  1581. LONG WINAPI
  1582. RegCdCreateA(
  1583. HANDLE hServer,
  1584. PWDNAMEA pWdName,
  1585. PCDNAMEA pCdName,
  1586. BOOLEAN bCreate,
  1587. PCDCONFIGA pCdConfig,
  1588. ULONG CdConfigLength
  1589. );
  1590. #ifdef UNICODE
  1591. #define RegCdCreate RegCdCreateW
  1592. #else
  1593. #define RegCdCreate RegCdCreateA
  1594. #endif /* UNICODE */
  1595. /*------------------------------------------------*/
  1596. LONG WINAPI
  1597. RegCdQueryW(
  1598. HANDLE hServer,
  1599. PWDNAMEW pWdName,
  1600. PCDNAMEW pCdName,
  1601. PCDCONFIGW pCdConfig,
  1602. ULONG CdConfigLength,
  1603. PULONG pReturnLength
  1604. );
  1605. LONG WINAPI
  1606. RegCdQueryA(
  1607. HANDLE hServer,
  1608. PWDNAMEA pWdName,
  1609. PCDNAMEA pCdName,
  1610. PCDCONFIGA pCdConfig,
  1611. ULONG CdConfigLength,
  1612. PULONG pReturnLength
  1613. );
  1614. #ifdef UNICODE
  1615. #define RegCdQuery RegCdQueryW
  1616. #else
  1617. #define RegCdQuery RegCdQueryA
  1618. #endif /* UNICODE */
  1619. /*------------------------------------------------*/
  1620. LONG WINAPI
  1621. RegCdDeleteW(
  1622. HANDLE hServer,
  1623. PWDNAMEW pWdName,
  1624. PCDNAMEW pCdName
  1625. );
  1626. LONG WINAPI
  1627. RegCdDeleteA(
  1628. HANDLE hServer,
  1629. PWDNAMEA pWdName,
  1630. PCDNAMEA pCdName
  1631. );
  1632. #ifdef UNICODE
  1633. #define RegCdDelete RegCdDeleteW
  1634. #else
  1635. #define RegCdDelete RegCdDeleteA
  1636. #endif /* UNICODE */
  1637. /*------------------------------------------------*/
  1638. /**********************************************
  1639. * Registry APIs for WinStation Drivers (Wds)
  1640. **********************************************/
  1641. LONG WINAPI
  1642. RegWdEnumerateW(
  1643. HANDLE hServer,
  1644. PULONG pIndex,
  1645. PULONG pEntries,
  1646. PWDNAMEW pWdName,
  1647. PULONG pByteCount
  1648. );
  1649. LONG WINAPI
  1650. RegWdEnumerateA(
  1651. HANDLE hServer,
  1652. PULONG pIndex,
  1653. PULONG pEntries,
  1654. PWDNAMEA pWdName,
  1655. PULONG pByteCount
  1656. );
  1657. #ifdef UNICODE
  1658. #define RegWdEnumerate RegWdEnumerateW
  1659. #else
  1660. #define RegWdEnumerate RegWdEnumerateA
  1661. #endif /* UNICODE */
  1662. /*------------------------------------------------*/
  1663. LONG WINAPI
  1664. RegWdCreateW(
  1665. HANDLE hServer,
  1666. PWDNAMEW pWdName,
  1667. BOOLEAN bCreate,
  1668. PWDCONFIG2W pWdConfig,
  1669. ULONG WdConfigLength
  1670. );
  1671. LONG WINAPI
  1672. RegWdCreateA(
  1673. HANDLE hServer,
  1674. PWDNAMEA pWdName,
  1675. BOOLEAN bCreate,
  1676. PWDCONFIG2A pWdConfig,
  1677. ULONG WdConfigLength
  1678. );
  1679. #ifdef UNICODE
  1680. #define RegWdCreate RegWdCreateW
  1681. #else
  1682. #define RegWdCreate RegWdCreateA
  1683. #endif /* UNICODE */
  1684. /*------------------------------------------------*/
  1685. LONG WINAPI
  1686. RegWdQueryW(
  1687. HANDLE hServer,
  1688. PWDNAMEW pWdName,
  1689. PWDCONFIG2W pWdConfig,
  1690. ULONG WdConfigLength,
  1691. PULONG pReturnLength
  1692. );
  1693. LONG WINAPI
  1694. RegWdQueryA(
  1695. HANDLE hServer,
  1696. PWDNAMEA pWdName,
  1697. PWDCONFIG2A pWdConfig,
  1698. ULONG WdConfigLength,
  1699. PULONG pReturnLength
  1700. );
  1701. #ifdef UNICODE
  1702. #define RegWdQuery RegWdQueryW
  1703. #else
  1704. #define RegWdQuery RegWdQueryA
  1705. #endif /* UNICODE */
  1706. /*------------------------------------------------*/
  1707. LONG WINAPI
  1708. RegWdDeleteW(
  1709. HANDLE hServer,
  1710. PWDNAMEW pWdName
  1711. );
  1712. LONG WINAPI
  1713. RegWdDeleteA(
  1714. HANDLE hServer,
  1715. PWDNAMEA pWdName
  1716. );
  1717. #ifdef UNICODE
  1718. #define RegWdDelete RegWdDeleteW
  1719. #else
  1720. #define RegWdDelete RegWdDeleteA
  1721. #endif /* UNICODE */
  1722. /*------------------------------------------------*/
  1723. /******************************************************************
  1724. * Registry APIs for Transport and Protocol Drivers (Tds and Pds)
  1725. ******************************************************************/
  1726. HANDLE WINAPI
  1727. RegOpenServerW(
  1728. LPWSTR hServerName
  1729. );
  1730. HANDLE WINAPI
  1731. RegOpenServerA(
  1732. LPSTR hServerName
  1733. );
  1734. #ifdef UNICODE
  1735. #define RegOpenServer RegOpenServerW
  1736. #else
  1737. #define RegOpenServer RegOpenServerA
  1738. #endif /* UNICODE */
  1739. /*------------------------------------------------*/
  1740. LONG WINAPI
  1741. RegCloseServer(
  1742. HANDLE hServer
  1743. );
  1744. /*------------------------------------------------*/
  1745. LONG WINAPI
  1746. RegPdEnumerateW(
  1747. HANDLE hServer,
  1748. PWDNAMEW pWdName,
  1749. BOOLEAN bTd,
  1750. PULONG pIndex,
  1751. PULONG pEntries,
  1752. PPDNAMEW pPdName,
  1753. PULONG pByteCount
  1754. );
  1755. LONG WINAPI
  1756. RegPdEnumerateA(
  1757. HANDLE hServer,
  1758. PWDNAMEA pWdName,
  1759. BOOLEAN bTd,
  1760. PULONG pIndex,
  1761. PULONG pEntries,
  1762. PPDNAMEA pPdName,
  1763. PULONG pByteCount
  1764. );
  1765. #ifdef UNICODE
  1766. #define RegPdEnumerate RegPdEnumerateW
  1767. #else
  1768. #define RegPdEnumerate RegPdEnumerateA
  1769. #endif /* UNICODE */
  1770. /*------------------------------------------------*/
  1771. LONG WINAPI
  1772. RegPdCreateW(
  1773. HANDLE hServer,
  1774. PWDNAMEW pWdName,
  1775. BOOLEAN bTd,
  1776. PPDNAMEW pPdName,
  1777. BOOLEAN bCreate,
  1778. PPDCONFIG3W pPdConfig,
  1779. ULONG PdConfigLength
  1780. );
  1781. LONG WINAPI
  1782. RegPdCreateA(
  1783. HANDLE hServer,
  1784. PWDNAMEA pWdName,
  1785. BOOLEAN bTd,
  1786. PPDNAMEA pPdName,
  1787. BOOLEAN bCreate,
  1788. PPDCONFIG3A pPdConfig,
  1789. ULONG PdConfigLength
  1790. );
  1791. #ifdef UNICODE
  1792. #define RegPdCreate RegPdCreateW
  1793. #else
  1794. #define RegPdCreate RegPdCreateA
  1795. #endif /* UNICODE */
  1796. /*------------------------------------------------*/
  1797. LONG WINAPI
  1798. RegPdQueryW(
  1799. HANDLE hServer,
  1800. PWDNAMEW pWdName,
  1801. BOOLEAN bTd,
  1802. PPDNAMEW pPdName,
  1803. PPDCONFIG3W pPdConfig,
  1804. ULONG PdConfigLength,
  1805. PULONG pReturnLength
  1806. );
  1807. LONG WINAPI
  1808. RegPdQueryA(
  1809. HANDLE hServer,
  1810. PWDNAMEA pWdName,
  1811. BOOLEAN bTd,
  1812. PPDNAMEA pPdName,
  1813. PPDCONFIG3A pPdConfig,
  1814. ULONG PdConfigLength,
  1815. PULONG pReturnLength
  1816. );
  1817. #ifdef UNICODE
  1818. #define RegPdQuery RegPdQueryW
  1819. #else
  1820. #define RegPdQuery RegPdQueryA
  1821. #endif /* UNICODE */
  1822. /*------------------------------------------------*/
  1823. LONG WINAPI
  1824. RegPdDeleteW(
  1825. HANDLE hServer,
  1826. PWDNAMEW pWdName,
  1827. BOOLEAN bTd,
  1828. PPDNAMEW pPdName
  1829. );
  1830. LONG WINAPI
  1831. RegPdDeleteA(
  1832. HANDLE hServer,
  1833. PWDNAMEA pWdName,
  1834. BOOLEAN bTd,
  1835. PPDNAMEA pPdName
  1836. );
  1837. #ifdef UNICODE
  1838. #define RegPdDelete RegPdDeleteW
  1839. #else
  1840. #define RegPdDelete RegPdDeleteA
  1841. #endif /* UNICODE */
  1842. /*------------------------------------------------*/
  1843. /*************************************
  1844. * Registry APIs for Window Stations
  1845. *************************************/
  1846. LONG WINAPI
  1847. RegWinStationAccessCheck(
  1848. HANDLE hServer,
  1849. ACCESS_MASK samDesired
  1850. );
  1851. /*------------------------------------------------*/
  1852. LONG WINAPI
  1853. RegWinStationEnumerateW(
  1854. HANDLE hServer,
  1855. PULONG pIndex,
  1856. PULONG pEntries,
  1857. PWINSTATIONNAMEW pWinStationName,
  1858. PULONG pByteCount
  1859. );
  1860. /*------------------------------------------------*/
  1861. LONG WINAPI
  1862. RegWinStationEnumerateA(
  1863. HANDLE hServer,
  1864. PULONG pIndex,
  1865. PULONG pEntries,
  1866. PWINSTATIONNAMEA pWinStationName,
  1867. PULONG pByteCount
  1868. );
  1869. #ifdef UNICODE
  1870. #define RegWinStationEnumerate RegWinStationEnumerateW
  1871. #else
  1872. #define RegWinStationEnumerate RegWinStationEnumerateA
  1873. #endif /* UNICODE */
  1874. /*------------------------------------------------*/
  1875. LONG WINAPI
  1876. RegWinStationCreateW(
  1877. HANDLE hServer,
  1878. PWINSTATIONNAMEW pWinStationName,
  1879. BOOLEAN bCreate,
  1880. PWINSTATIONCONFIG2W pWinStationConfig,
  1881. ULONG WinStationConfigLength
  1882. );
  1883. LONG WINAPI
  1884. RegWinStationCreateA(
  1885. HANDLE hServer,
  1886. PWINSTATIONNAMEA pWinStationName,
  1887. BOOLEAN bCreate,
  1888. PWINSTATIONCONFIG2A pWinStationConfig,
  1889. ULONG WinStationConfigLength
  1890. );
  1891. #ifdef UNICODE
  1892. #define RegWinStationCreate RegWinStationCreateW
  1893. #else
  1894. #define RegWinStationCreate RegWinStationCreateA
  1895. #endif /* UNICODE */
  1896. /*------------------------------------------------*/
  1897. LONG WINAPI
  1898. RegWinStationQueryW(
  1899. HANDLE hServer,
  1900. PWINSTATIONNAMEW pWinStationName,
  1901. PWINSTATIONCONFIG2W pWinStationConfig,
  1902. ULONG WinStationConfigLength,
  1903. PULONG pReturnLength
  1904. );
  1905. LONG WINAPI
  1906. RegWinStationQueryEx(
  1907. HANDLE hServer,
  1908. PPOLICY_TS_MACHINE pMachinePolicy,
  1909. PWINSTATIONNAMEW pWinStationName,
  1910. PWINSTATIONCONFIG2W pWinStationConfig,
  1911. ULONG WinStationConfigLength,
  1912. PULONG pReturnLength,
  1913. BOOLEAN bPerformMerger
  1914. );
  1915. LONG WINAPI
  1916. RegWinStationQueryA(
  1917. HANDLE hServer,
  1918. PWINSTATIONNAMEA pWinStationName,
  1919. PWINSTATIONCONFIG2A pWinStationConfig,
  1920. ULONG WinStationConfigLength,
  1921. PULONG pReturnLength
  1922. );
  1923. #ifdef UNICODE
  1924. #define RegWinStationQuery RegWinStationQueryW
  1925. #else
  1926. #define RegWinStationQuery RegWinStationQueryA
  1927. #endif /* UNICODE */
  1928. /*------------------------------------------------*/
  1929. LONG WINAPI
  1930. RegConsoleShadowQueryA( HANDLE hServer,
  1931. PWINSTATIONNAMEA pWinStationName,
  1932. PWDPREFIXA pWdPrefixName,
  1933. PWINSTATIONCONFIG2A pWinStationConfig,
  1934. ULONG WinStationConfigLength,
  1935. PULONG pReturnLength );
  1936. LONG WINAPI
  1937. RegConsoleShadowQueryW( HANDLE hServer,
  1938. PWINSTATIONNAMEW pWinStationName,
  1939. PWDPREFIXW pWdPrefixName,
  1940. PWINSTATIONCONFIG2W pWinStationConfig,
  1941. ULONG WinStationConfigLength,
  1942. PULONG pReturnLength );
  1943. #ifdef UNICODE
  1944. #define RegConsoleShadowQuery RegConsoleShadowQueryW
  1945. #else
  1946. #define RegConsoleShadowQuery RegConsoleShadowQueryA
  1947. #endif /* UNICODE */
  1948. /*------------------------------------------------*/
  1949. LONG WINAPI
  1950. RegWinStationDeleteW(
  1951. HANDLE hServer,
  1952. PWINSTATIONNAMEW pWinStationName
  1953. );
  1954. LONG WINAPI
  1955. RegWinStationDeleteA(
  1956. HANDLE hServer,
  1957. PWINSTATIONNAMEA pWinStationName
  1958. );
  1959. #ifdef UNICODE
  1960. #define RegWinStationDelete RegWinStationDeleteW
  1961. #else
  1962. #define RegWinStationDelete RegWinStationDeleteA
  1963. #endif /* UNICODE */
  1964. /*------------------------------------------------*/
  1965. LONG WINAPI
  1966. RegWinStationSetSecurityW(
  1967. HANDLE hServer,
  1968. PWINSTATIONNAMEW pWinStationName,
  1969. PSECURITY_DESCRIPTOR pSecurityDescriptor,
  1970. ULONG SecurityDescriptorLength
  1971. );
  1972. LONG WINAPI
  1973. RegWinStationSetSecurityA(
  1974. HANDLE hServer,
  1975. PWINSTATIONNAMEA pWinStationName,
  1976. PSECURITY_DESCRIPTOR pSecurityDescriptor,
  1977. ULONG SecurityDescriptorLength
  1978. );
  1979. #ifdef UNICODE
  1980. #define RegWinStationSetSecurity RegWinStationSetSecurityW
  1981. #else
  1982. #define RegWinStationSetSecurity RegWinStationSetSecurityA
  1983. #endif /* UNICODE */
  1984. /*------------------------------------------------*/
  1985. LONG WINAPI
  1986. RegWinStationQuerySecurityW(
  1987. HANDLE hServer,
  1988. PWINSTATIONNAMEW pWinStationName,
  1989. PSECURITY_DESCRIPTOR pSecurityDescriptor,
  1990. ULONG SecurityDescriptorLength,
  1991. PULONG SecurityDescriptorLengthRequired
  1992. );
  1993. LONG WINAPI
  1994. RegWinStationQuerySecurityA(
  1995. HANDLE hServer,
  1996. PWINSTATIONNAMEA pWinStationName,
  1997. PSECURITY_DESCRIPTOR pSecurityDescriptor,
  1998. ULONG SecurityDescriptorLength,
  1999. PULONG SecurityDescriptorLengthRequired
  2000. );
  2001. #ifdef UNICODE
  2002. #define RegWinStationQuerySecurity RegWinStationQuerySecurityW
  2003. #else
  2004. #define RegWinStationQuerySecurity RegWinStationQuerySecurityA
  2005. #endif /* UNICODE */
  2006. /*------------------------------------------------*/
  2007. LONG WINAPI
  2008. RegWinStationQueryDefaultSecurity(
  2009. HANDLE hServer,
  2010. PSECURITY_DESCRIPTOR pSecurityDescriptor,
  2011. ULONG SecurityDescriptorLength,
  2012. PULONG SecurityDescriptorLengthRequired
  2013. );
  2014. /*------------------------------------------------*/
  2015. LONG WINAPI
  2016. RegWinStationSetNumValueW(
  2017. HANDLE hServer,
  2018. PWINSTATIONNAMEW pWinStationName,
  2019. LPWSTR pValueName,
  2020. ULONG ValueData
  2021. );
  2022. #ifdef UNICODE
  2023. #define RegWinStationSetNumValue RegWinStationSetNumValueW
  2024. #else
  2025. #define RegWinStationSetNumValue
  2026. #endif /* UNICODE */
  2027. /*------------------------------------------------*/
  2028. LONG WINAPI
  2029. RegWinStationQueryNumValueW(
  2030. HANDLE hServer,
  2031. PWINSTATIONNAMEW pWinStationName,
  2032. LPWSTR pValueName,
  2033. PULONG pValueData );
  2034. #ifdef UNICODE
  2035. #define RegWinStationQueryNumValue RegWinStationQueryNumValueW
  2036. #else
  2037. #define RegWinStationQueryNumValue
  2038. #endif /* UNICODE */
  2039. /*------------------------------------------------*/
  2040. LONG WINAPI
  2041. RegWinStationQueryValueW(
  2042. HANDLE hServer,
  2043. PWINSTATIONNAMEW pWinStationName,
  2044. LPWSTR pValueName,
  2045. PVOID pValueData,
  2046. ULONG ValueSize,
  2047. PULONG pValueSize );
  2048. #ifdef UNICODE
  2049. #define RegWinStationQueryValue RegWinStationQueryValueW
  2050. #else
  2051. #define RegWinStationQueryValue
  2052. #endif /* UNICODE */
  2053. /*------------------------------------------------*/
  2054. /*********************************************
  2055. * Registry APIs for User Configuration Data
  2056. *********************************************/
  2057. /*------------------------------------------------*/
  2058. BOOLEAN RegGetUserPolicy( LPWSTR userSID, PPOLICY_TS_USER pPolicy , PUSERCONFIGW pData );
  2059. void RegGetMachinePolicy( PPOLICY_TS_MACHINE pPolicy );
  2060. void RegMergeMachinePolicy( PPOLICY_TS_MACHINE pPolicy, USERCONFIGW *pMachineConfigData ,
  2061. PWINSTATIONCREATE pCreate );
  2062. /*------------------------------------------------*/
  2063. LONG WINAPI
  2064. RegUserConfigSet(
  2065. WCHAR * pServerName,
  2066. WCHAR * pUserName,
  2067. PUSERCONFIGW pUserConfig,
  2068. ULONG UserConfigLength
  2069. );
  2070. /*------------------------------------------------*/
  2071. LONG WINAPI
  2072. RegUserConfigQuery(
  2073. WCHAR * pServerName,
  2074. WCHAR * pUserName,
  2075. PUSERCONFIGW pUserConfig,
  2076. ULONG UserConfigLength,
  2077. PULONG pReturnLength
  2078. );
  2079. /*------------------------------------------------*/
  2080. LONG WINAPI
  2081. RegUserConfigDelete(
  2082. WCHAR * pServerName,
  2083. WCHAR * pUserName
  2084. );
  2085. /*------------------------------------------------*/
  2086. LONG WINAPI
  2087. RegUserConfigRename(
  2088. WCHAR * pServerName,
  2089. WCHAR * pUserOldName,
  2090. WCHAR * pUserNewName
  2091. );
  2092. /*------------------------------------------------*/
  2093. LONG WINAPI
  2094. RegDefaultUserConfigQueryW(
  2095. WCHAR * pServerName,
  2096. PUSERCONFIGW pUserConfig,
  2097. ULONG UserConfigLength,
  2098. PULONG pReturnLength
  2099. );
  2100. LONG WINAPI
  2101. RegDefaultUserConfigQueryA(
  2102. CHAR * pServerName,
  2103. PUSERCONFIGA pUserConfig,
  2104. ULONG UserConfigLength,
  2105. PULONG pReturnLength
  2106. );
  2107. #ifdef UNICODE
  2108. #define RegDefaultUserConfigQuery RegDefaultUserConfigQueryW
  2109. #else
  2110. #define RegDefaultUserConfigQuery RegDefaultUserConfigQueryA
  2111. #endif /* UNICODE */
  2112. /*------------------------------------------------*/
  2113. /*********************************************
  2114. * Additional Support Registry APIs
  2115. *********************************************/
  2116. BOOLEAN WINAPI
  2117. RegIsTServer(
  2118. WCHAR * pServerName
  2119. );
  2120. BOOLEAN WINAPI
  2121. RegBuildNumberQuery(
  2122. PULONG pBuildNum
  2123. );
  2124. BOOLEAN WINAPI
  2125. RegGetTServerVersion(
  2126. WCHAR * pServerName,
  2127. PULONG pVersionNumber
  2128. );
  2129. BOOLEAN WINAPI
  2130. RegQueryOEMId(
  2131. BYTE *,
  2132. ULONG
  2133. );
  2134. typedef struct _PROGRAMCALL {
  2135. struct _PROGRAMCALL *pFirst; /* Points to first item in sorted list */
  2136. struct _PROGRAMCALL *pNext; /* Points to next item in sorted list */
  2137. BOOLEAN fAlias; /* TRUE if commmand is an alias (hidden) */
  2138. LPWSTR pRegistryMultiString; /* Command info from registry */
  2139. USHORT CommandLen; /* min chars needed for command */
  2140. PWCHAR Command; /* command string */
  2141. PWCHAR Program; /* name of program to execute */
  2142. PWCHAR Args; /* extra args to put on command line */
  2143. } PROGRAMCALL, /*FAR*/ *PPROGRAMCALL;
  2144. LONG WINAPI
  2145. RegQueryUtilityCommandList(
  2146. LPWSTR pUtilityKey,
  2147. PPROGRAMCALL * ppProgramCall
  2148. );
  2149. LONG WINAPI
  2150. RegFreeUtilityCommandList(
  2151. PPROGRAMCALL pProgramCall
  2152. );
  2153. BOOLEAN WINAPI
  2154. RegIsMachinePolicyAllowHelp();
  2155. /*------------------------------------------------*/
  2156. /***********************************
  2157. * APIs for Window Station Objects
  2158. ***********************************/
  2159. /*------------------------------------------------*/
  2160. HANDLE WINAPI
  2161. WinStationOpenServerW(
  2162. LPWSTR pServerName
  2163. );
  2164. HANDLE WINAPI
  2165. WinStationOpenServerA(
  2166. LPSTR pServerName
  2167. );
  2168. #ifdef UNICODE
  2169. #define WinStationOpenServer WinStationOpenServerW
  2170. #else
  2171. #define WinStationOpenServer WinStationOpenServerA
  2172. #endif /* UNICODE */
  2173. /*------------------------------------------------*/
  2174. BOOLEAN WINAPI
  2175. WinStationCloseServer(
  2176. HANDLE hServer
  2177. );
  2178. /*------------------------------------------------*/
  2179. BOOLEAN WINAPI
  2180. WinStationServerPing(
  2181. HANDLE hServer
  2182. );
  2183. /*------------------------------------------------*/
  2184. typedef BOOLEAN (WINAPI * PWINSTATIONENUMERATEW)(HANDLE,PLOGONIDW *,PULONG);
  2185. typedef BOOLEAN (WINAPI * PWINSTATIONENUMERATEA)(HANDLE,PLOGONIDA *,PULONG);
  2186. BOOLEAN WINAPI
  2187. WinStationEnumerateW(
  2188. HANDLE hServer,
  2189. PLOGONIDW *ppLogonId,
  2190. PULONG pEntries
  2191. );
  2192. BOOLEAN WINAPI
  2193. WinStationEnumerateA(
  2194. HANDLE hServer,
  2195. PLOGONIDA *ppLogonId,
  2196. PULONG pEntries
  2197. );
  2198. #ifdef UNICODE
  2199. #define WinStationEnumerate WinStationEnumerateW
  2200. #else
  2201. #define WinStationEnumerate WinStationEnumerateA
  2202. #endif /* UNICODE */
  2203. /*------------------------------------------------*/
  2204. typedef BOOLEAN (WINAPI * PWINSTATIONENUMERATE_INDEXEDW)(HANDLE,PULONG,PLOGONIDW,PULONG,PULONG);
  2205. typedef BOOLEAN (WINAPI * PWINSTATIONENUMERATE_INDEXEDA)(HANDLE,PULONG,PLOGONIDA,PULONG,PULONG);
  2206. BOOLEAN WINAPI
  2207. WinStationEnumerate_IndexedW(
  2208. HANDLE hServer,
  2209. PULONG pEntries,
  2210. PLOGONIDW pLogonId,
  2211. PULONG pByteCount,
  2212. PULONG pIndex
  2213. );
  2214. BOOLEAN WINAPI
  2215. WinStationEnumerate_IndexedA(
  2216. HANDLE hServer,
  2217. PULONG pEntries,
  2218. PLOGONIDA pLogonId,
  2219. PULONG pByteCount,
  2220. PULONG pIndex
  2221. );
  2222. #ifdef UNICODE
  2223. #define WinStationEnumerate_Indexed WinStationEnumerate_IndexedW
  2224. #else
  2225. #define WinStationEnumerate_Indexed WinStationEnumerate_IndexedA
  2226. #endif /* UNICODE */
  2227. /*------------------------------------------------*/
  2228. BOOLEAN WINAPI
  2229. WinStationEnumerateProcesses(
  2230. HANDLE hServer,
  2231. PVOID *ppProcessBuffer
  2232. );
  2233. /*------------------------------------------------*/
  2234. BOOLEAN WINAPI
  2235. WinStationGetAllProcesses(
  2236. HANDLE hServer,
  2237. ULONG Level,
  2238. ULONG *pNumberOfProcesses,
  2239. PVOID *ppProcessArray
  2240. );
  2241. /*------------------------------------------------*/
  2242. #ifdef _WINBASE_
  2243. BOOLEAN WINAPI
  2244. WinStationGetProcessSid(
  2245. HANDLE hServer,
  2246. DWORD ProcessId,
  2247. FILETIME ProcessStartTime,
  2248. PBYTE pProcessUserSid,
  2249. DWORD *pdwSidSize
  2250. );
  2251. #else
  2252. BOOLEAN WINAPI
  2253. WinStationGetProcessSid(
  2254. HANDLE hServer,
  2255. ULONG ProcessId,
  2256. LARGE_INTEGER ProcessStartTime,
  2257. PUCHAR pProcessUserSid,
  2258. ULONG *pdwSidSize
  2259. );
  2260. #endif
  2261. BOOLEAN WINAPI
  2262. WinStationRenameW(
  2263. HANDLE hServer,
  2264. PWINSTATIONNAMEW pWinStationNameOld,
  2265. PWINSTATIONNAMEW pWinStationNameNew
  2266. );
  2267. BOOLEAN WINAPI
  2268. WinStationRenameA(
  2269. HANDLE hServer,
  2270. PWINSTATIONNAMEA pWinStationNameOld,
  2271. PWINSTATIONNAMEA pWinStationNameNew
  2272. );
  2273. #ifdef UNICODE
  2274. #define WinStationRename WinStationRenameW
  2275. #else
  2276. #define WinStationRename WinStationRenameA
  2277. #endif /* UNICODE */
  2278. /*------------------------------------------------*/
  2279. typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONW)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
  2280. typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONA)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
  2281. BOOLEAN WINAPI
  2282. WinStationQueryInformationW(
  2283. HANDLE hServer,
  2284. ULONG LogonId,
  2285. WINSTATIONINFOCLASS WinStationInformationClass,
  2286. PVOID pWinStationInformation,
  2287. ULONG WinStationInformationLength,
  2288. PULONG pReturnLength
  2289. );
  2290. BOOLEAN WINAPI
  2291. WinStationQueryInformationA(
  2292. HANDLE hServer,
  2293. ULONG LogonId,
  2294. WINSTATIONINFOCLASS WinStationInformationClass,
  2295. PVOID pWinStationInformation,
  2296. ULONG WinStationInformationLength,
  2297. PULONG pReturnLength
  2298. );
  2299. #ifdef UNICODE
  2300. #define WinStationQueryInformation WinStationQueryInformationW
  2301. #else
  2302. #define WinStationQueryInformation WinStationQueryInformationA
  2303. #endif /* UNICODE */
  2304. /*------------------------------------------------*/
  2305. BOOLEAN WINAPI
  2306. WinStationSetInformationW(
  2307. HANDLE hServer,
  2308. ULONG LogonId,
  2309. WINSTATIONINFOCLASS WinStationInformationClass,
  2310. PVOID pWinStationInformation,
  2311. ULONG WinStationInformationLength
  2312. );
  2313. BOOLEAN WINAPI
  2314. WinStationSetInformationA(
  2315. HANDLE hServer,
  2316. ULONG LogonId,
  2317. WINSTATIONINFOCLASS WinStationInformationClass,
  2318. PVOID pWinStationInformation,
  2319. ULONG WinStationInformationLength
  2320. );
  2321. #ifdef UNICODE
  2322. #define WinStationSetInformation WinStationSetInformationW
  2323. #else
  2324. #define WinStationSetInformation WinStationSetInformationA
  2325. #endif /* UNICODE */
  2326. /*------------------------------------------------*/
  2327. BOOLEAN WINAPI
  2328. WinStationGetLanAdapterNameW(
  2329. HANDLE hServer,
  2330. ULONG LanAdapter,
  2331. ULONG pdNameLength,
  2332. PWCHAR pPdName,
  2333. ULONG *pLength,
  2334. PWCHAR *ppLanAdapter
  2335. );
  2336. BOOLEAN WINAPI
  2337. WinStationGetLanAdapterNameA(
  2338. HANDLE hServer,
  2339. ULONG LanAdapter,
  2340. ULONG pdNameLength,
  2341. PCHAR pPdName,
  2342. ULONG *pLength,
  2343. PCHAR *ppLanAdapter
  2344. );
  2345. #ifdef UNICODE
  2346. #define WinStationGetLanAdapterName WinStationGetLanAdapterNameW
  2347. #else
  2348. #define WinStationGetLanAdapterName WinStationGetLanAdapterNameA
  2349. #endif /* UNICODE */
  2350. /*------------------------------------------------*/
  2351. BOOLEAN WINAPI
  2352. WinStationSendMessageW(
  2353. HANDLE hServer,
  2354. ULONG LogonId,
  2355. LPWSTR pTitle,
  2356. ULONG TitleLength,
  2357. LPWSTR pMessage,
  2358. ULONG MessageLength,
  2359. ULONG Style,
  2360. ULONG Timeout,
  2361. PULONG pResponse,
  2362. BOOLEAN DoNotWait
  2363. );
  2364. BOOLEAN WINAPI
  2365. WinStationSendMessageA(
  2366. HANDLE hServer,
  2367. ULONG LogonId,
  2368. LPSTR pTitle,
  2369. ULONG TitleLength,
  2370. LPSTR pMessage,
  2371. ULONG MessageLength,
  2372. ULONG Style,
  2373. ULONG Timeout,
  2374. PULONG pResponse,
  2375. BOOLEAN DoNotWait
  2376. );
  2377. #ifdef UNICODE
  2378. #define WinStationSendMessage WinStationSendMessageW
  2379. #else
  2380. #define WinStationSendMessage WinStationSendMessageA
  2381. #endif /* UNICODE */
  2382. /*
  2383. * These are new pResponse values
  2384. */
  2385. #define IDTIMEOUT 32000 // The MsgBox timed out before a user response
  2386. #define IDASYNC 32001 // The request was for an Async message box, no return
  2387. #define IDERROR 32002 // an error occured that resulted in not displaying
  2388. #define IDCOUNTEXCEEDED 32003 // to many in queue for winstation already
  2389. #define IDDESKTOPERROR 32004 // current desktop is not default
  2390. /*------------------------------------------------*/
  2391. BOOLEAN WINAPI
  2392. LogonIdFromWinStationNameW(
  2393. HANDLE hServer,
  2394. PWINSTATIONNAMEW pWinStationName,
  2395. PULONG pLogonId
  2396. );
  2397. BOOLEAN WINAPI
  2398. LogonIdFromWinStationNameA(
  2399. HANDLE hServer,
  2400. PWINSTATIONNAMEA pWinStationName,
  2401. PULONG pLogonId
  2402. );
  2403. #ifdef UNICODE
  2404. #define LogonIdFromWinStationName LogonIdFromWinStationNameW
  2405. #else
  2406. #define LogonIdFromWinStationName LogonIdFromWinStationNameA
  2407. #endif /* UNICODE */
  2408. /*------------------------------------------------*/
  2409. BOOLEAN WINAPI
  2410. WinStationNameFromLogonIdW(
  2411. HANDLE hServer,
  2412. ULONG LogonId,
  2413. PWINSTATIONNAMEW pWinStationName
  2414. );
  2415. BOOLEAN WINAPI
  2416. WinStationNameFromLogonIdA(
  2417. HANDLE hServer,
  2418. ULONG LogonId,
  2419. PWINSTATIONNAMEA pWinStationName
  2420. );
  2421. #ifdef UNICODE
  2422. #define WinStationNameFromLogonId WinStationNameFromLogonIdW
  2423. #else
  2424. #define WinStationNameFromLogonId WinStationNameFromLogonIdA
  2425. #endif /* UNICODE */
  2426. /*------------------------------------------------*/
  2427. BOOLEAN WINAPI
  2428. WinStationConnectW(
  2429. HANDLE hServer,
  2430. ULONG LogonId,
  2431. ULONG TargetLogonId,
  2432. PWCHAR pPassword,
  2433. BOOLEAN bWait
  2434. );
  2435. BOOLEAN WINAPI
  2436. WinStationConnectA(
  2437. HANDLE hServer,
  2438. ULONG LogonId,
  2439. ULONG TargetLogonId,
  2440. PCHAR pPassword,
  2441. BOOLEAN bWait
  2442. );
  2443. #ifdef UNICODE
  2444. #define WinStationConnect WinStationConnectW
  2445. #else
  2446. #define WinStationConnect WinStationConnectA
  2447. #endif /* UNICODE */
  2448. /*------------------------------------------------*/
  2449. HANDLE WINAPI
  2450. WinStationVirtualOpen(
  2451. HANDLE hServer,
  2452. ULONG LogonId,
  2453. PVIRTUALCHANNELNAME pVirtualChannelName /* ascii name */
  2454. );
  2455. typedef HANDLE (WINAPI * PWINSTATIONBEEPOPEN)(ULONG);
  2456. HANDLE WINAPI
  2457. _WinStationBeepOpen(
  2458. ULONG LogonId
  2459. );
  2460. BOOLEAN WINAPI
  2461. WinStationDisconnect(
  2462. HANDLE hServer,
  2463. ULONG LogonId,
  2464. BOOLEAN bWait
  2465. );
  2466. BOOLEAN WINAPI
  2467. WinStationReset(
  2468. HANDLE hServer,
  2469. ULONG LogonId,
  2470. BOOLEAN bWait
  2471. );
  2472. BOOLEAN WINAPI
  2473. WinStationShadowStop(
  2474. HANDLE hServer,
  2475. ULONG LogonId,
  2476. BOOLEAN bWait
  2477. );
  2478. BOOLEAN WINAPI
  2479. WinStationShutdownSystem(
  2480. HANDLE hServer,
  2481. ULONG ShutdownFlags
  2482. );
  2483. #define WSD_LOGOFF 0x00000001 // force WinStations to logoff
  2484. #define WSD_SHUTDOWN 0x00000002 // shutdown system
  2485. #define WSD_REBOOT 0x00000004 // reboot after shutdown
  2486. #define WSD_POWEROFF 0x00000008 // reboot after shutdown
  2487. #define WSD_FASTREBOOT 0x00000010 // CTRL-SHIFT-ALT-DEL fast reboot
  2488. typedef BOOLEAN (WINAPI * PWINSTATIONWAITSYSTEMEVENT)(HANDLE,ULONG,PULONG);
  2489. BOOLEAN WINAPI
  2490. WinStationWaitSystemEvent(
  2491. HANDLE hServer,
  2492. ULONG EventMask,
  2493. PULONG pEventFlags
  2494. );
  2495. BOOLEAN WINAPI
  2496. WinStationShadow(
  2497. HANDLE hServer,
  2498. PWSTR pTargetServerName,
  2499. ULONG TargetLogonId,
  2500. BYTE HotkeyVk,
  2501. USHORT HotkeyModifiers
  2502. );
  2503. typedef BOOLEAN (WINAPI * PWINSTATIONFREEMEMORY)( PVOID );
  2504. BOOLEAN WINAPI
  2505. WinStationFreeMemory(
  2506. PVOID pBuffer
  2507. );
  2508. BOOLEAN WINAPI
  2509. WinStationFreeGAPMemory(
  2510. ULONG Level,
  2511. PVOID ProcessArray,
  2512. ULONG NbProcesses
  2513. );
  2514. BOOLEAN WINAPI
  2515. WinStationTerminateProcess(
  2516. HANDLE hServer,
  2517. ULONG ProcessId,
  2518. ULONG ExitCode
  2519. );
  2520. BOOLEAN WINAPI
  2521. WinStationNtsdDebug(
  2522. ULONG LogonId,
  2523. LONG ProcessId,
  2524. ULONG DbgProcessId,
  2525. ULONG DbgThreadId,
  2526. PVOID AttachCompletionRoutine
  2527. );
  2528. BOOLEAN WINAPI
  2529. _WinStationCallback(
  2530. HANDLE hServer,
  2531. ULONG LogonId,
  2532. LPWSTR pPhoneNumber
  2533. );
  2534. BOOLEAN WINAPI
  2535. _WinStationBreakPoint(
  2536. HANDLE hServer,
  2537. ULONG LogonId,
  2538. BOOLEAN KernelFlag
  2539. );
  2540. BOOLEAN WINAPI
  2541. _WinStationReadRegistry(
  2542. HANDLE hServer
  2543. );
  2544. BOOLEAN WINAPI
  2545. _WinStationUpdateSettings(
  2546. HANDLE hServer,
  2547. WINSTATIONUPDATECFGCLASS SettingsClass,
  2548. ULONG SettingsParameters
  2549. );
  2550. BOOLEAN WINAPI
  2551. _WinStationWaitForConnect(
  2552. VOID
  2553. );
  2554. BOOLEAN WINAPI
  2555. _WinStationNotifyLogon(
  2556. BOOLEAN fUserIsAdmin,
  2557. HANDLE UserToken,
  2558. PWCHAR pDomain,
  2559. PWCHAR pUserName,
  2560. PWCHAR pPassword,
  2561. UCHAR Seed,
  2562. PUSERCONFIGW pUserConfig
  2563. );
  2564. BOOLEAN WINAPI
  2565. _WinStationNotifyLogoff(
  2566. VOID
  2567. );
  2568. BOOLEAN WINAPI
  2569. _WinStationNotifyNewSession(
  2570. HANDLE hServer,
  2571. ULONG LogonId
  2572. );
  2573. BOOLEAN WINAPI
  2574. _WinStationGetApplicationInfo(
  2575. HANDLE hServer,
  2576. ULONG LogonId,
  2577. PBOOLEAN pfPublished,
  2578. PBOOLEAN pfAnonymous
  2579. );
  2580. BOOLEAN WINAPI
  2581. _WinStationCheckForApplicationName(
  2582. HANDLE hServer,
  2583. ULONG LogonId,
  2584. PWCHAR pUserName,
  2585. ULONG UserNameSize,
  2586. PWCHAR pDomain,
  2587. ULONG DomainSize,
  2588. PWCHAR pPassword,
  2589. ULONG *pPasswordSize,
  2590. ULONG MaxPasswordSize,
  2591. PCHAR pSeed,
  2592. PBOOLEAN pfPublished,
  2593. PBOOLEAN pfAnonymous
  2594. );
  2595. BOOLEAN WINAPI
  2596. _WinStationReInitializeSecurity(
  2597. HANDLE hServer
  2598. );
  2599. BOOLEAN WINAPI
  2600. _WinStationUpdateClientCachedCredentials(
  2601. PWCHAR pDomain,
  2602. PWCHAR pUserName
  2603. );
  2604. BOOLEAN WINAPI
  2605. _WinStationFUSCanRemoteUserDisconnect(
  2606. ULONG LogonId,
  2607. PWCHAR pDomain,
  2608. PWCHAR pUserName
  2609. );
  2610. BOOLEAN WINAPI
  2611. WinStationCheckLoopBack(
  2612. HANDLE hServer,
  2613. ULONG ClientSessionId,
  2614. ULONG TargetLogonId,
  2615. LPWSTR pTargetServerName
  2616. );
  2617. BOOLEAN WINAPI
  2618. _WinStationNotifyDisconnectPipe(
  2619. VOID
  2620. );
  2621. /*******************************************************************
  2622. * WinStation APIs for Generic Licensing
  2623. * (The WinStation extension DLL determines actual implementation)
  2624. *******************************************************************/
  2625. BOOLEAN WINAPI
  2626. WinStationGenerateLicense(
  2627. HANDLE hServer,
  2628. PWCHAR pSerialNumberString,
  2629. PVOID pLicense,
  2630. ULONG LicenseSize
  2631. );
  2632. BOOLEAN WINAPI
  2633. WinStationInstallLicense(
  2634. HANDLE hServer,
  2635. PVOID pLicense,
  2636. ULONG LicenseSize
  2637. );
  2638. typedef BOOLEAN (WINAPI * PWINSTATIONENUMERATELICENSES)( HANDLE, PCHAR *, ULONG * );
  2639. BOOLEAN WINAPI
  2640. WinStationEnumerateLicenses(
  2641. HANDLE hServer,
  2642. PVOID *ppLicense,
  2643. ULONG *pEntries
  2644. );
  2645. BOOLEAN WINAPI
  2646. WinStationActivateLicense(
  2647. HANDLE hServer,
  2648. PVOID pLicense,
  2649. ULONG LicenseSize,
  2650. PWCHAR pActivationCode
  2651. );
  2652. BOOLEAN WINAPI
  2653. WinStationRemoveLicense(
  2654. HANDLE hServer,
  2655. PVOID pLicense,
  2656. ULONG LicenseSize
  2657. );
  2658. BOOLEAN WINAPI
  2659. WinStationSetPoolCount(
  2660. HANDLE hServer,
  2661. PVOID pLicense,
  2662. ULONG LicenseSize
  2663. );
  2664. BOOLEAN WINAPI
  2665. WinStationQueryLicense(
  2666. HANDLE hServer,
  2667. PVOID pLicenseCounts,
  2668. ULONG ByteCount
  2669. );
  2670. BOOLEAN WINAPI
  2671. WinStationQueryUpdateRequired(
  2672. HANDLE hServer,
  2673. PULONG pUpdateFlag
  2674. );
  2675. BOOLEAN WINAPI
  2676. _WinStationAnnoyancePopup(
  2677. HANDLE hServer,
  2678. ULONG LogonId
  2679. );
  2680. BOOLEAN WINAPI
  2681. WinStationGetTermSrvCountersValue(
  2682. HANDLE hServer,
  2683. ULONG dwEntries,
  2684. PVOID pCounter
  2685. );
  2686. #ifdef _WINBASE_
  2687. LONG WINAPI
  2688. WinStationBroadcastSystemMessage(
  2689. HANDLE hServer,
  2690. BOOL sendToAllWinstations,
  2691. ULONG sessionID,
  2692. ULONG timeOut,
  2693. DWORD dwFlags,
  2694. DWORD *lpdwRecipients,
  2695. ULONG uiMessage,
  2696. WPARAM wParam,
  2697. LPARAM lParam,
  2698. LONG *pResponse
  2699. );
  2700. LONG WINAPI
  2701. WinStationSendWindowMessage(
  2702. HANDLE hServer,
  2703. ULONG sessionID,
  2704. ULONG timeOut,
  2705. ULONG hWnd,
  2706. ULONG Msg,
  2707. WPARAM wParam,
  2708. LPARAM lParam,
  2709. LONG *pResponse
  2710. );
  2711. BOOLEAN WinStationGetMachinePolicy (
  2712. HANDLE hServer,
  2713. POLICY_TS_MACHINE *pPolicy
  2714. );
  2715. #endif
  2716. //
  2717. // This API consolidates the previous two APIs used by Winlogon to retrieve
  2718. // auto-logon credentials. It is hardcoded to use the local server only, for
  2719. // the caller's session only. Is is UNICODE only, as well. The parameter is
  2720. // actually a PWLX_CLIENT_CREDENTIALS_INFO of at least version 2.
  2721. //
  2722. #ifdef _WINBASE_
  2723. #include <winwlx.h>
  2724. BOOLEAN WINAPI
  2725. WinStationQueryLogonCredentialsW(
  2726. PWLX_CLIENT_CREDENTIALS_INFO_V2_0 pCredentials
  2727. );
  2728. /* __CONSOLE_NOTIFY__ */
  2729. BOOL WINAPI
  2730. WinStationRegisterConsoleNotification (
  2731. HANDLE hServer,
  2732. HWND hWnd,
  2733. DWORD dwFlags
  2734. );
  2735. BOOL WINAPI
  2736. WinStationUnRegisterConsoleNotification (
  2737. HANDLE hServer,
  2738. HWND hWnd
  2739. );
  2740. /* __CONSOLE_NOTIFY__ */
  2741. #endif // _WINBASE_ // handle rdpwd including this
  2742. //-----------------------------------------------------------------------------
  2743. //
  2744. // The following APIs are only for supporting a 5.1 client to 5.0 server
  2745. // connection. On a 5.1 server, ERROR_INVALID_FUNCTION will be returned.
  2746. //
  2747. //-----------------------------------------------------------------------------
  2748. BOOLEAN WINAPI
  2749. ServerGetInternetConnectorStatus(
  2750. HANDLE hServer,
  2751. ULONG *pResult,
  2752. PBOOLEAN pfEnabled
  2753. );
  2754. BOOLEAN WINAPI
  2755. ServerSetInternetConnectorStatus(
  2756. HANDLE hServer,
  2757. ULONG *pResult,
  2758. BOOLEAN fEnabled
  2759. );
  2760. /*-ServerQueryInetConnectorInformation-------------*/
  2761. BOOLEAN WINAPI
  2762. ServerQueryInetConnectorInformationW(
  2763. HANDLE hServer,
  2764. PVOID pWinStationInformation,
  2765. ULONG WinStationInformationLength,
  2766. PULONG pReturnLength
  2767. );
  2768. BOOLEAN WINAPI
  2769. ServerQueryInetConnectorInformationA(
  2770. HANDLE hServer,
  2771. PVOID pWinStationInformation,
  2772. ULONG WinStationInformationLength,
  2773. PULONG pReturnLength
  2774. );
  2775. #ifdef UNICODE
  2776. #define ServerQueryInetConnectorInformation ServerQueryInetConnectorInformationW
  2777. #else
  2778. #define ServerQueryInetConnectorInformation ServerQueryInetConnectorInformationA
  2779. #endif /* UNICODE */
  2780. /*-------------------------------------------------*/
  2781. //
  2782. // Surround these APIs with a check for winbase.h. Termdd is including this
  2783. // file, but doesn't understand winbase types (DWORD).
  2784. //
  2785. #ifdef _WINBASE_
  2786. HANDLE WINAPI
  2787. ServerLicensingOpenW(
  2788. LPWSTR pszServerName
  2789. );
  2790. HANDLE WINAPI
  2791. ServerLicensingOpenA(
  2792. LPSTR pszServerName
  2793. );
  2794. #ifdef UNICODE
  2795. #define ServerLicensingOpen ServerLicensingOpenW
  2796. #else
  2797. #define ServerLicensingOpen ServerLicensingOpenA
  2798. #endif
  2799. VOID WINAPI
  2800. ServerLicensingClose(
  2801. HANDLE hServer
  2802. );
  2803. BOOLEAN WINAPI
  2804. ServerLicensingLoadPolicy(
  2805. HANDLE hServer,
  2806. ULONG ulPolicyId
  2807. );
  2808. BOOLEAN WINAPI
  2809. ServerLicensingUnloadPolicy(
  2810. HANDLE hServer,
  2811. ULONG ulPolicyId
  2812. );
  2813. DWORD WINAPI
  2814. ServerLicensingSetPolicy(
  2815. HANDLE hServer,
  2816. ULONG ulPolicyId,
  2817. LPDWORD lpNewPolicyStatus
  2818. );
  2819. BOOLEAN WINAPI
  2820. ServerLicensingGetAvailablePolicyIds(
  2821. HANDLE hServer,
  2822. PULONG *ppulPolicyIds,
  2823. PULONG pcPolicies
  2824. );
  2825. BOOLEAN WINAPI
  2826. ServerLicensingGetPolicy(
  2827. HANDLE hServer,
  2828. PULONG pulPolicyId
  2829. );
  2830. BOOLEAN WINAPI
  2831. ServerLicensingGetPolicyInformationW(
  2832. HANDLE hServer,
  2833. ULONG ulPolicyId,
  2834. PULONG pulVersion,
  2835. LPLCPOLICYINFOGENERIC *ppPolicyInfo
  2836. );
  2837. BOOLEAN WINAPI
  2838. ServerLicensingGetPolicyInformationA(
  2839. HANDLE hServer,
  2840. ULONG ulPolicyId,
  2841. PULONG pulVersion,
  2842. LPLCPOLICYINFOGENERIC *ppPolicyInfo
  2843. );
  2844. VOID
  2845. ServerLicensingFreePolicyInformation(
  2846. LPLCPOLICYINFOGENERIC *ppPolicyInfo
  2847. );
  2848. BOOLEAN
  2849. WinStationConnectCallback(
  2850. HANDLE hServer,
  2851. DWORD Timeout,
  2852. ULONG AddressType,
  2853. PBYTE pAddress,
  2854. ULONG AddressSize
  2855. );
  2856. #ifdef UNICODE
  2857. #define ServerLicensingGetPolicyInformation ServerLicensingGetPolicyInformationW
  2858. #else
  2859. #define ServerLicensingGetPolicyInformation ServerLicensingGetPolicyInformationA
  2860. #endif
  2861. BOOLEAN WINAPI
  2862. ServerLicensingDeactivateCurrentPolicy(
  2863. HANDLE hServer
  2864. );
  2865. #endif // _WINBASE_
  2866. BOOLEAN WINAPI
  2867. WinStationIsHelpAssistantSession(
  2868. HANDLE hServer,
  2869. ULONG SessionId
  2870. );
  2871. BOOLEAN WINAPI
  2872. RemoteAssistancePrepareSystemRestore(
  2873. HANDLE hServer
  2874. );
  2875. ULONG WINAPI
  2876. WinStationAutoReconnect(
  2877. ULONG flags
  2878. );
  2879. #ifdef __cplusplus
  2880. }
  2881. #endif
  2882. #endif /* !_INC_WINSTAH */