Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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