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.

836 lines
24 KiB

  1. #ifndef RC_INVOKED
  2. #include <nt.h>
  3. #include <ntrtl.h>
  4. #include <nturtl.h>
  5. #endif
  6. #include <windows.h>
  7. #include <tchar.h>
  8. #define SECURITY_WIN32
  9. #include <security.h>
  10. #include <lm.h>
  11. #include <lmdfs.h>
  12. #include <ole2.h>
  13. #include <iads.h>
  14. #include <iadsp.h>
  15. #include <olectl.h>
  16. #include <shellapi.h>
  17. #include <shlobj.h>
  18. #include <shlwapi.h>
  19. #include <commctrl.h>
  20. #include <commdlg.h>
  21. #include <prsht.h>
  22. #include <dsclient.h>
  23. #include <dsgetdc.h>
  24. #include <dsrole.h>
  25. #include <mmc.h>
  26. #include <accctrl.h>
  27. #include <aclapi.h>
  28. #include <winsock2.h>
  29. #include <richedit.h>
  30. #include <gpedit.h>
  31. #ifndef RC_INVOKED
  32. #include <wbemcli.h>
  33. #include <ntdsapi.h>
  34. #endif
  35. #define _USERENV_NO_LINK_APIS_ 1
  36. #include <userenv.h>
  37. #include <userenvp.h>
  38. #include <dssec.h>
  39. #include <winuserp.h>
  40. class CSnapIn;
  41. #include "structs.h"
  42. #include "registry.h"
  43. #include "compdata.h"
  44. #include "snapin.h"
  45. #include "events.h"
  46. #include "rsoproot.h"
  47. #include "rsopsnap.h"
  48. #include "about.h"
  49. #include "dataobj.h"
  50. #include "rsopdobj.h"
  51. #include "gpmgr.h"
  52. #include "smartptr.h"
  53. #include "guidlist.h"
  54. #include "gpobj.h"
  55. #include "debug.h"
  56. #include "util.h"
  57. #include "sid.h"
  58. #include "pcommon.h"
  59. #include <strsafe.h>
  60. #if !defined(_WIN64)
  61. #include <wow64t.h>
  62. #define DISABLE_32BIT_FILE_REDIRECTION_ON_64BIT(x) { if (IsWin64()) {Wow64DisableFilesystemRedirector(x);} }
  63. #define ENABLE_32BIT_FILE_REDIRECTION_ON_64BIT { if (IsWin64()) {Wow64EnableFilesystemRedirector();} }
  64. #else // _WIN64
  65. #define DISABLE_32BIT_FILE_REDIRECTION_ON_64BIT(x)
  66. #define ENABLE_32BIT_FILE_REDIRECTION_ON_64BIT
  67. #endif // _WIN64
  68. //
  69. // Resource ids
  70. //
  71. #define IDS_SNAPIN_NAME 1
  72. #define IDS_SNAPIN_EXT_NAME 2
  73. #define IDS_GPM_SNAPIN_NAME 3
  74. #define IDS_RSOP_SNAPIN_NAME 4
  75. #define IDS_DCOPTIONS 5
  76. #define IDS_DCOPTIONSDESC 6
  77. #define IDS_UNKNOWNREASON 7
  78. #define IDS_DISPLAYNAME2 8
  79. #define IDS_DISPLAYNAME 9
  80. #define IDS_NOTAPPLICABLE 10
  81. #define IDS_DATETIMEFORMAT 11
  82. #define IDS_REVISIONFORMAT 12
  83. #define IDS_NAMEFORMAT 13
  84. #define IDS_NONE 14
  85. #define IDS_NOTSPECIFIED 15
  86. #define IDS_ARCHIVEDATA 16
  87. #define IDS_ARCHIVEDATADESC 17
  88. #define IDS_ARCHIVEDATATAG 18
  89. #define IDS_ARCHIVEDATA_CAPTION 19
  90. #define IDS_ARCHIVEDATA_MESSAGE 20
  91. #define IDS_DIAGNOSTIC 21
  92. #define IDS_PLANNING 22
  93. #define IDS_VERSION 23
  94. #define IDS_VERSIONFORMAT 24
  95. #define IDS_WMIFILTERFAILED 25
  96. #define IDS_DISABLEDGPO 26
  97. #define IDS_GPM_FORESTDESC 27
  98. #define IDS_NAME 28
  99. #define IDS_MACHINE 29
  100. #define IDS_USER 30
  101. #define IDS_SERVERAPPS 31
  102. #define IDS_DEVICES 32
  103. #define IDS_WINSETTINGS 33
  104. #define IDS_SWSETTINGS 34
  105. #define IDS_COMPUTERTITLE 35
  106. #define IDS_UNTITLED 36
  107. #define IDS_LOCAL_NAME 37
  108. #define IDS_LOCAL_DISPLAY_NAME 38
  109. #define IDS_REMOTE_DISPLAY_NAME 39
  110. #define IDS_GPM_NAME 40
  111. #define IDS_GPM_NOOVERRIDE 41
  112. #define IDS_GPM_DISABLED 42
  113. #define IDS_GPM_DESCRIPTION 43
  114. #define IDS_GPM_NOGPONAME 44
  115. #define IDS_GPM_ADDTITLE 45
  116. #define IDS_GPM_DCNAME 46
  117. #define IDS_GPM_DOMAINNAME 47
  118. #define IDS_APPLIED 48
  119. #define IDS_SECURITYDENIED 49
  120. #define IDS_SNAPIN_DESCRIPT 50
  121. #define IDS_PROVIDER_NAME 51
  122. #define IDS_SNAPIN_VERSION 52
  123. #define IDS_ABOUT_NAME 53
  124. #define IDS_RSOP_SNAPIN_DESCRIPT 54
  125. #define IDS_RSOP_ABOUT_NAME 55
  126. #define IDS_RSOP_DETAILS 56
  127. #define IDS_RSOP_SETTINGS 57
  128. #define IDS_INVALIDMSC 58
  129. #define IDS_ACCESSDENIED 59
  130. #define IDS_FILTERING 60
  131. #define IDS_SOM 61
  132. #define IDS_DISABLEDLINK 62
  133. #define IDS_RSOP_DISPLAYNAME1 63
  134. #define IDS_RSOP_DISPLAYNAME2 64
  135. #define IDS_RSOP_FINISH_P0 65
  136. #define IDS_RSOP_FINISH_P1 66
  137. #define IDS_RSOP_FINISH_P2 67
  138. #define IDS_RSOP_FINISH_P3 68
  139. #define IDS_RSOP_FINISH_P4 69
  140. #define IDS_RSOP_FINISH_P5 70
  141. #define IDS_RSOP_FINISH_P6 71
  142. #define IDS_RSOP_FINISH_P7 72
  143. #define IDS_RSOP_FINISH_P8 73
  144. #define IDS_RSOP_FINISH_P9 74
  145. #define IDS_RSOP_FINISH_P10 75
  146. #define IDS_BROWSE_USER_OU_TITLE 76
  147. #define IDS_BROWSE_USER_OU_CAPTION 77
  148. #define IDS_BROWSE_COMPUTER_OU_TITLE 78
  149. #define IDS_BROWSE_COMPUTER_OU_CAPTION 79
  150. #define IDS_RSOP_GPOLIST_MACHINE 80
  151. #define IDS_RSOP_GPOLIST_USER 81
  152. #define IDS_TITLE_WELCOME 82
  153. #define IDS_TITLE_CHOOSEMODE 83
  154. #define IDS_SUBTITLE_CHOOSEMODE 84
  155. #define IDS_TITLE_GETCOMP 85
  156. #define IDS_SUBTITLE_GETCOMP 86
  157. //#define IDS_TITLE_GETUSER 305
  158. #define IDS_SUBTITLE_GETUSER 87
  159. #define IDS_TITLE_FINISHED 88
  160. #define IDS_SUBTITLE_FINISHED 89
  161. #define IDS_TITLE_GETTARGET 90
  162. #define IDS_SUBTITLE_GETTARGET 91
  163. #define IDS_TITLE_GETDC 92
  164. #define IDS_SUBTITLE_GETDC 93
  165. #define IDS_TITLE_ALTDIRS 94
  166. #define IDS_SUBTITLE_ALTDIRS 95
  167. #define IDS_TITLE_USERSECGRPS 96
  168. #define IDS_SUBTITLE_USERSECGRPS 97
  169. #define IDS_TITLE_COMPSECGRPS 98
  170. #define IDS_SUBTITLE_COMPSECGRPS 99
  171. #define IDS_GPO_NAME 100
  172. #define IDS_ACCESSDENIED2 101
  173. #define IDS_FAILEDLOCAL 102
  174. #define IDS_FAILEDREMOTE 103
  175. #define IDS_FAILEDDS 104
  176. #define IDS_FAILEDNEW 105
  177. #define IDS_FAILEDDELETE 106
  178. #define IDS_FAILEDLINK 107
  179. #define IDS_FAILEDUNLINK 108
  180. #define IDS_FAILEDSETNAME 109
  181. #define IDS_FAILEDGPLINK 110
  182. #define IDS_FAILEDGPINFO 115
  183. #define IDS_FAILEDGPQUERY 116
  184. #define IDS_FAILEDGPODELETE 117
  185. #define IDS_SPAWNGPEFAILED 118
  186. #define IDS_NODC 119
  187. #define IDS_NODSDC 120
  188. #define IDS_DELETECONFIRM 121
  189. #define IDS_CONFIRMTITLE 122
  190. #define IDS_CONFIRMDISABLE 123
  191. #define IDS_CONFIRMTITLE2 124
  192. #define IDS_NODC_ERROR_TEXT 130
  193. #define IDS_NODC_ERROR_TITLE 131
  194. #define IDS_NODC_OPTIONS_TEXT 132
  195. #define IDS_NODC_OPTIONS_TITLE 133
  196. #define IDS_EXECFAILED_USER 136
  197. #define IDS_EXECFAILED_COMPUTER 137
  198. #define IDS_NOUSER2 138
  199. #define IDS_NOCOMPUTER2 139
  200. #define IDS_NODSOBJECT_MSG 140
  201. #define IDS_BADUSERSOM 141
  202. #define IDS_BADCOMPUTERSOM 142
  203. #define IDS_NOUSER 143
  204. #define IDS_NOCOMPUTER 144
  205. #define IDS_NOUSERCONTAINER 145
  206. #define IDS_NOCOMPUTERCONTAINER 146
  207. #define IDS_EXECFAILED 147
  208. #define IDS_CONNECTSERVERFAILED 148
  209. #define IDS_RSOPLOGGINGDISABLED 149
  210. #define IDS_RSOPLOGGINGTITLE 150
  211. #define IDS_CAPTION 151
  212. #define IDS_OPENBUTTON 152
  213. #define IDS_DOMAINS 153
  214. #define IDS_SITES 154
  215. #define IDS_COMPUTERS 155
  216. #define IDS_ALL 156
  217. #define IDS_NEWGPO 157
  218. #define IDS_NAMECOLUMN 160
  219. #define IDS_DOMAINCOLUMN 161
  220. #define IDS_ALLDESCRIPTION 162
  221. #define IDS_DOMAINDESCRIPTION 163
  222. #define IDS_SITEDESCRIPTION 164
  223. #define IDS_TOOLTIP_BACK 165
  224. #define IDS_TOOLTIP_NEW 166
  225. #define IDS_TOOLTIP_ROTATE 167
  226. #define IDS_STOP 169
  227. #define IDS_FINDNOW 170
  228. #define IDS_FOREST 171
  229. #define IDS_FORESTHEADING 172
  230. #define IDS_TITLE_WQLUSER 180
  231. #define IDS_SUBTITLE_WQL 181
  232. #define IDS_TITLE_WQLCOMP 182
  233. #define IDS_RSOP_FINISH_P11 190
  234. #define IDS_RSOP_FINISH_P12 191
  235. #define IDS_RSOP_FINISH_P13 192
  236. #define IDS_YES 193
  237. #define IDS_NO 194
  238. #define IDS_NORSOPDC 195
  239. #define IDS_DSBINDFAILED 196
  240. #define IDS_DOMAINLIST 197
  241. #define IDS_FAILEDPROPERTIES 198
  242. #define IDS_NODATA 199
  243. #define IDS_DCMISSINGRSOP 200
  244. #define IDS_COMPONENT_NAME 225
  245. #define IDS_STATUS 226
  246. #define IDS_SUCCESS 227
  247. #define IDS_FAILED 228
  248. #define IDS_PENDING 229
  249. #define IDS_SUCCESSMSG 230
  250. #define IDS_FAILEDMSG1 231
  251. #define IDS_PENDINGMSG 232
  252. #define IDS_LOGGINGFAILED 233
  253. #define IDS_OVERRIDE 234
  254. #define IDS_WARNING 235
  255. #define IDS_CSE_NA 236
  256. #define IDS_SUCCESS2 237
  257. #define IDS_FAILED2 238
  258. #define IDS_SYNC_REQUIRED_USER 239
  259. #define IDS_ERRORFILTER 240
  260. #define IDS_FAILEDMSG2 241
  261. #define IDS_DISPLAYPROPERTIES 250
  262. #define IDS_MACHINE_DESC 251
  263. #define IDS_USER_DESC 252
  264. #define IDS_U_SWSETTINGS_DESC 253
  265. #define IDS_U_WINSETTINGS_DESC 254
  266. #define IDS_C_SWSETTINGS_DESC 255
  267. #define IDS_C_WINSETTINGS_DESC 256
  268. #define IDS_CSEFAILURE_DESC 257
  269. #define IDS_CSEFAILURE2_DESC 258
  270. #define IDS_GPE_WELCOME 270
  271. #define IDS_MISSINGFILTER 271
  272. #define IDS_WMIFILTERMISSING 272
  273. #define IDS_ADDITIONALINFO 275
  274. #define IDS_GPCOREFAIL 276
  275. #define IDS_LEGACYCSE 277
  276. #define IDS_LEGACYCSE1 278
  277. #define IDS_ENUMUSERSFAILED 279
  278. #define IDS_DOWNLEVELCOMPUTER 280
  279. #define IDS_PLEASEWAIT 281
  280. #define IDS_RSOP_FINISH_P14 282
  281. #define IDS_RSOP_FINISH_P15 283
  282. #define IDS_RSOP_PLANNING 284
  283. #define IDS_RSOP_CMENU_NAME 285
  284. #define IDS_RSOP_LOGGING 286
  285. #define IDS_BLOCKEDSOM 287
  286. #define IDS_SKIPWQLFILTER 289
  287. #define IDS_NONESELECTED 290
  288. #define IDS_GPCORE_LOGGINGFAIL 291
  289. #define IDS_RSOP_FINISH_P16 292
  290. #define IDS_LOOPBACK_REPLACE 293
  291. #define IDS_LOOPBACK_MERGE 294
  292. #define IDS_EXECFAILED_BOTH 295
  293. #define IDS_EXECFAILED_TIMEDOUT 296
  294. #define IDS_PLEASEWAIT1 297
  295. #define IDS_DEFDC_DOWNLEVEL 298
  296. #define IDS_DEFDC_CONNECTFAILED 299
  297. #define IDS_WMIFILTERFORCEDNONE 300
  298. #define IDS_RSOPWMIQRYFMT 301
  299. #define IDS_RSOPDELNAMESPACE 302
  300. #define IDS_RSOPDELNS_TITLE 303
  301. #define IDS_INVALID_NAMESPACE 304
  302. #define IDS_TITLE_GETUSER 305
  303. #define IDS_LARGEFONTNAME 306
  304. #define IDS_LARGEFONTSIZE 307
  305. #define IDS_SMALLFONTNAME 308
  306. #define IDS_SMALLFONTSIZE 309
  307. #define IDS_POLICY_DELAYED 310
  308. #define IDS_POLICY_DELAYED2 311
  309. #define IDS_RSOP_RUNQUERY 312
  310. #define IDS_RSOP_RUNQUERYDESC 313
  311. #define IDS_RSOP_CHANGEQUERY 314
  312. #define IDS_RSOP_CHANGEQUERYDESC 315
  313. #define IDS_DEFDC_FAILED 316
  314. #define IDS_RSOP_REFRESHQUERY 317
  315. #define IDS_RSOP_REFRESHQUERYDESC 318
  316. #define IDS_RSOP_UNINITIALIZED 319
  317. #define IDS_RSOP_UNINITIALIZEDDESC 320
  318. #define IDS_NOCROSSFORESTALLOWED 321
  319. #define IDS_CROSSFORESTFAILED 322
  320. #define IDS_RSOPDELNAMESPACE2 323
  321. #define IDS_SYNC_REQUIRED_MACH 324
  322. //
  323. // Icons
  324. //
  325. #define IDI_POLICY 1
  326. #define IDI_POLICY2 2
  327. #define IDI_POLICY3 3
  328. #define IDA_FIND 4
  329. //
  330. // Bitmaps
  331. //
  332. #define IDB_16x16 101
  333. #define IDB_32x32 102
  334. #define IDB_WIZARD 103
  335. #define IDB_POLICY16 104
  336. #define IDB_POLICY32 105
  337. #define IDB_HEADER 106
  338. //
  339. // Menu items
  340. //
  341. #define IDM_DCOPTIONS 1
  342. #define IDM_ARCHIVEDATA 2
  343. #define IDM_GENERATE_RSOP 3
  344. #define IDM_REFRESH_RSOP 4
  345. #define IDM_GPM_CONTEXTMENU 10
  346. #define IDM_GPM_NOOVERRIDE 11
  347. #define IDM_GPM_DISABLED 12
  348. #define IDM_GPM_NEW 13
  349. #define IDM_GPM_ADD 14
  350. #define IDM_GPM_EDIT 15
  351. #define IDM_GPM_DELETE 16
  352. #define IDM_GPM_RENAME 17
  353. #define IDM_GPM_REFRESH 18
  354. #define IDM_GPM_PROPERTIES 19
  355. #define IDM_GPOLIST_CONTEXTMENU 30
  356. #define IDM_GPOLIST_EDIT 31
  357. #define IDM_GPOLIST_SECURITY 32
  358. //
  359. // Error dialog defines
  360. //
  361. #define IDD_ERROR 200
  362. #define IDC_ERRORTEXT 201
  363. #define IDC_DETAILSBORDER 202
  364. #define IDC_DETAILSTEXT 203
  365. #define IDC_ERROR_ICON 204
  366. //
  367. // Properties dialog defines
  368. //
  369. #define IDD_PROPERTIES 500
  370. #define IDC_TITLE 501
  371. #define IDC_DISABLE_TEXT 502
  372. #define IDC_DISABLE_COMPUTER 503
  373. #define IDC_DISABLE_USER 504
  374. #define IDC_CREATE_DATE 505
  375. #define IDC_MODIFIED_DATE 506
  376. #define IDC_REVISION 507
  377. #define IDC_DOMAIN 508
  378. #define IDC_UNIQUE_NAME 509
  379. #define IDC_DOMAIN_HEADING 510
  380. #define IDD_GPE_LINKS 550
  381. #define IDC_RESULTLIST 551
  382. #define IDI_FIND 552
  383. #define IDC_CBDOMAIN 553
  384. #define IDC_ACTION 554
  385. #define IDAC_FIND 555
  386. #define IDD_WQLFILTER 560
  387. #define IDC_NONE 561
  388. #define IDC_THIS_FILTER 562
  389. #define IDC_FILTER_NAME 563
  390. #define IDC_FILTER_BROWSE 564
  391. //
  392. // Choose dialog defines
  393. //
  394. #define IDD_CHOOSE_INTRO 900
  395. #define IDC_BITMAP 901
  396. #define IDC_DS_GPO 902
  397. #define IDC_MACHINE_GPO 903
  398. #define IDC_CAPTION 904
  399. #define IDD_CHOOSE_DS 925
  400. #define IDC_OPEN 926
  401. #define IDC_OPEN_TITLE 927
  402. #define IDC_OPEN_NAME 928
  403. #define IDC_OPEN_BROWSE 929
  404. #define IDC_NEW 930
  405. #define IDC_NEW_TITLE 931
  406. #define IDC_NEW_NAME 932
  407. #define IDC_NEW_TITLE2 933
  408. #define IDC_NEW_DOMAIN 934
  409. #define IDC_COPY_FROM 935
  410. #define IDC_COPY_NAME 936
  411. #define IDC_COPY_BROWSE 937
  412. #define IDC_OVERRIDE 938
  413. #define IDC_SPAWN 939
  414. #define IDD_CHOOSE_MACHINE 950
  415. #define IDC_LOCAL 951
  416. #define IDC_REMOTE 952
  417. #define IDC_NAME 953
  418. #define IDC_BROWSE 954
  419. #define IDD_ADD_GPO 975
  420. //
  421. // Browse dialog defines
  422. //
  423. #define IDC_STATIC -1
  424. #define IDD_BROWSEGPO 1000
  425. #define IDC_BROWSE_LIST 1001
  426. #define IDC_DOMAIN_LIST 1002
  427. #define IDC_BROWSE_DELETE 1003
  428. #define IDD_BROWSE2_DIALOG 1202
  429. #define IDD_PROPPAGE_GPOBROWSER 1203
  430. #define IDR_MAINFRAME 1228
  431. #define IDR_TOOLBAR1 1229
  432. #define IDR_LISTMENU 1234
  433. #define IDD_PROPPAGE_COMPUTERS 1237
  434. #define IDC_BUTTON1 1300
  435. #define IDC_LIST1 1301
  436. #define IDC_COMBO1 1302
  437. #define IDC_RADIO1 1304
  438. #define IDC_RADIO2 1305
  439. #define IDC_EDIT1 1306
  440. #define IDC_STATIC1 1307
  441. #define IDC_DESCRIPTION 1308
  442. #define ID_BACKBUTTON 32771
  443. #define ID_NEWFOLDER 32772
  444. #define ID_ROTATEVIEW 32773
  445. #define ID_DETAILSVIEW 32774
  446. #define ID_SMALLICONS 32776
  447. #define ID_LIST 32780
  448. #define ID_DETAILS 32781
  449. #define ID_LARGEICONS 32782
  450. #define ID_TOP_placeholder 32783
  451. #define ID_NEW 32783
  452. #define ID_EDIT 32784
  453. #define ID_DELETE 32788
  454. #define ID_RENAME 32789
  455. #define ID_REFRESH 32790
  456. #define ID_PROPERTIES 32792
  457. #define ID_TOP_LINEUPICONS 32794
  458. #define ID_ARRANGE_BYNAME 32795
  459. #define ID_ARRANGE_BYTYPE 32796
  460. #define ID_ARRANGE_AUTO 32797
  461. //
  462. // Group Policy Manager dialog defines
  463. //
  464. #define IDD_GPMANAGER 1025
  465. #define IDC_GPM_TITLE 1026
  466. #define IDC_GPM_DCNAME 1027
  467. #define IDC_GPM_LIST 1028
  468. #define IDC_GPM_UP 1029
  469. #define IDC_GPM_DOWN 1030
  470. #define IDC_GPM_ADD 1031
  471. #define IDC_GPM_EDIT 1032
  472. #define IDC_GPM_DELETE 1033
  473. #define IDC_GPM_PROPERTIES 1034
  474. #define IDC_GPM_BLOCK 1035
  475. #define IDC_GPM_NEW 1036
  476. #define IDC_GPM_OPTIONS 1037
  477. #define IDC_GPM_ICON 1038
  478. #define IDC_GPM_LINE1 1039
  479. #define IDD_GPM_LINK_OPTIONS 1040
  480. #define IDC_GPM_NOOVERRIDE 1041
  481. #define IDC_GPM_DISABLED 1042
  482. #define IDC_GPM_PRIORITY 1043
  483. #define IDC_GPM_LINE2 1044
  484. //
  485. // Remove GPO dialog defines
  486. //
  487. #define IDD_REMOVE_GPO 1050
  488. #define IDC_REMOVE_TITLE 1051
  489. #define IDC_REMOVE_LIST 1052
  490. #define IDC_REMOVE_DS 1053
  491. #define IDC_QUESTION 1054
  492. //
  493. // No DC dialog
  494. //
  495. #define IDD_NODC 1060
  496. #define IDC_NODC_TEXT 1061
  497. #define IDC_NODC_ERROR 1062
  498. #define IDC_NODC_PDC 1063
  499. #define IDC_NODC_INHERIT 1064
  500. #define IDC_NODC_ANYDC 1065
  501. //
  502. // Missing DS object dialog
  503. //
  504. #define IDD_NODSOBJECT 1070
  505. #define IDC_NODSOBJECT_ICON 1071
  506. #define IDC_NODSOBJECT_TEXT 1072
  507. //
  508. // RSOP welcome dialog
  509. //
  510. #define IDD_RSOP_WELCOME 1090
  511. //
  512. // RSOP choose mode dialog (diag vs planning)
  513. //
  514. #define IDD_RSOP_CHOOSEMODE 1091
  515. #define IDD_RSOP_WQLUSER 1088
  516. #define IDD_RSOP_WQLCOMP 1089
  517. #define IDD_RSOP_GETCOMP 1092
  518. #define IDD_RSOP_GETUSER 1093
  519. #define IDD_RSOP_GETTARGET 1094
  520. #define IDD_RSOP_GETDC 1095
  521. #define IDD_RSOP_ALTDIRS 1096
  522. #define IDD_RSOP_ALTUSERSEC 1097
  523. #define IDD_RSOP_ALTCOMPSEC 1098
  524. #define IDD_RSOP_FINISHED 1099
  525. //#define IDD_RSOP_FINISHED2 1105
  526. //#define IDD_RSOP_FINISHED3 1106
  527. #define IDD_RSOP_GPOLIST 1100
  528. #define IDD_CHOOSEDC 1101
  529. #define IDD_RSOP_QUERY 1102
  530. #define IDD_RSOP_ERRORS 1103
  531. #define IDD_RSOP_BROWSEDC 1104
  532. #define IDD_RSOP_FINISHED2 1105
  533. #define IDD_RSOP_FINISHED3 1106
  534. #define IDC_RSOP_BIG_BOLD1 1107
  535. #define IDD_RSOP_FINISHED3_INT 1108
  536. #define IDD_RSOP_FINISHED_INT 1109
  537. #define IDD_BROWSE2_DIALOG 1202
  538. #define IDD_PROPPAGE_GPOBROWSER 1203
  539. #define IDR_MAINFRAME 1228
  540. #define IDR_TOOLBAR1 1229
  541. #define IDR_LISTMENU 1234
  542. #define IDD_PROPPAGE_COMPUTERS 1237
  543. #define IDC_BUTTON1 1300
  544. #define IDC_BUTTON2 1310
  545. #define IDC_COMBO1 1302
  546. #define IDC_BUTTON3 1302
  547. #define IDC_COMBO2 1303
  548. #define IDC_RADIO1 1304
  549. #define IDC_RADIO2 1305
  550. #define IDC_EDIT1 1306
  551. #define IDC_STATIC1 1307
  552. #define IDC_EDIT2 1307
  553. #define IDC_DESCRIPTION 1308
  554. #define IDC_EDIT3 1308
  555. #define IDC_PROGRESS1 1401
  556. #define IDC_DC 1402
  557. #define IDC_LIST2 1403
  558. #define IDC_CHECK1 1404
  559. #define IDC_RADIO3 1405
  560. #define IDC_RADIO4 1406
  561. #define IDC_BROWSE1 1407
  562. #define IDC_BROWSE2 1408
  563. #define IDC_BROWSE3 1409
  564. #define IDC_BROWSE4 1410
  565. #define IDC_EDIT4 1411
  566. #define IDC_EDIT5 1412
  567. #define IDC_EDIT6 1413
  568. #define IDC_CHECK2 1414
  569. #define IDC_CHECK3 1415
  570. #define IDD_RSOP_STATUSMSC 1416
  571. //
  572. // Help file
  573. //
  574. #define HELP_FILE TEXT("gpedit.hlp")
  575. //
  576. // Help IDs
  577. //
  578. #define IDH_NOCONTEXTHELP -1L
  579. #define IDH_GPMGR_DCNAME 2
  580. #define IDH_GPMGR_LIST 3
  581. #define IDH_GPMGR_UP 4
  582. #define IDH_GPMGR_DOWN 5
  583. #define IDH_GPMGR_ADD 6
  584. #define IDH_GPMGR_EDIT 7
  585. #define IDH_GPMGR_DELETE 8
  586. #define IDH_GPMGR_PROPERTIES 9
  587. #define IDH_GPMGR_BLOCK 10
  588. #define IDH_GPMGR_NEW 11
  589. #define IDH_GPMGR_OPTIONS 12
  590. #define IDH_GPMGR_NOOVERRIDE 13
  591. #define IDH_GPMGR_DISABLED 14
  592. #define IDH_PROP_TITLE 15
  593. #define IDH_PROP_DISABLE_COMPUTER 17
  594. #define IDH_PROP_DISABLE_USER 23
  595. #define IDH_BROWSE_LIST 25
  596. #define IDH_BROWSE_DOMAINS 26
  597. #define IDH_REMOVE_LIST 36
  598. #define IDH_REMOVE_DS 37
  599. #define IDH_LINK_DOMAIN 40
  600. #define IDH_LINK_BUTTON 41
  601. #define IDH_LINK_RESULT 42
  602. #define IDH_DC_PDC 43
  603. #define IDH_DC_INHERIT 44
  604. #define IDH_DC_ANYDC 45
  605. #define IDH_NODSOBJECT 47
  606. #define IDH_BROWSER_LOOKIN 75
  607. #define IDH_BROWSER_DOMAINGPO 76
  608. #define IDH_BROWSER_SITELIST 77
  609. #define IDH_BROWSER_GPOLIST 78
  610. #define IDH_BROWSER_DOMAINLIST 79
  611. #define IDH_BROWSER_FULLGPOLIST 80
  612. #define IDH_BROWSER_LOCALCOMPUTER 81
  613. #define IDH_BROWSER_REMOTECOMPUTER 82
  614. #define IDH_BROWSER_BROWSE 83
  615. #define IDH_RSOPLOGGINGDISABLED 90
  616. #define IDH_WQL_FILTER_NONE 100
  617. #define IDH_WQL_FILTER_THIS_FILTER 101
  618. #define IDH_WQL_FILTER_NAME 102
  619. #define IDH_WQL_FILTER_BROWSE 103
  620. #define IDH_RSOP_BANNER 200
  621. #define IDH_RSOP_CONTAINERLIST 201
  622. #define IDH_RSOP_GPOLIST 205
  623. #define IDH_RSOP_APPLIEDGPOS 206
  624. #define IDH_RSOP_GPOSOM 207
  625. #define IDH_RSOP_REVISION 208
  626. #define IDH_RSOP_SECURITY 209
  627. #define IDH_RSOP_EDIT 210
  628. #define IDH_RSOP_QUERYLIST 215
  629. #define IDH_RSOP_COMPONENTLIST 220
  630. #define IDH_RSOP_COMPONENTDETAILS 221
  631. #define IDH_RSOP_SAVEAS 222
  632. #define IDH_RSOP_BROWSEDC 225
  633. //
  634. // Private window message used to refresh the button states
  635. //
  636. #define WM_REFRESHDISPLAY (WM_USER + 532)
  637. #define WM_BUILDWQLLIST (WM_USER + 533)
  638. #define WM_INITRSOP (WM_USER + 534)
  639. //
  640. // Strings
  641. //
  642. #define USER_SECTION TEXT("User")
  643. #define MACHINE_SECTION TEXT("Machine")
  644. #define COMPUTER_SECTION TEXT("Computer")
  645. #define GPE_KEY TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Group Policy Editor")
  646. #define GPE_POLICIES_KEY TEXT("Software\\Policies\\Microsoft\\Windows\\Group Policy Editor")
  647. #define DCOPTION_VALUE TEXT("DCOption")
  648. #define NEW_LINKS_DISABLED_VALUE TEXT("NewGPOLinksDisabled")
  649. #define GPO_DISPLAY_NAME_VALUE TEXT("GPODisplayName")
  650. //
  651. // Global variables
  652. //
  653. extern LONG g_cRefThisDll;
  654. extern HINSTANCE g_hInstance;
  655. extern DWORD g_dwNameSpaceItems;
  656. extern NAMESPACEITEM g_NameSpace[];
  657. extern NAMESPACEITEM g_RsopNameSpace[];
  658. extern CRITICAL_SECTION g_DCCS;
  659. extern TCHAR g_szDisplayProperties[];
  660. //
  661. // DC selection dialog
  662. //
  663. typedef struct _DCSELINFO
  664. {
  665. BOOL bError;
  666. BOOL bAllowInherit;
  667. INT iDefault;
  668. LPTSTR lpDomainName;
  669. } DCSELINFO, *LPDCSELINFO;
  670. INT_PTR CALLBACK DCDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  671. //
  672. // Macros
  673. //
  674. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  675. #define MAX_FRIENDLYNAME 256
  676. #ifndef NORM_STOP_ON_NULL
  677. #define NORM_STOP_ON_NULL 0x10000000
  678. #endif
  679. //
  680. // Define to manage if FOREST GPO support is enabled or disabled.
  681. //
  682. // If this feature is re-enabled, 2 changes need to be made to gpedit.h
  683. //
  684. // 1) Add the GPO_OPEN_FOREST flag for the IGPO interface
  685. // #define GPO_OPEN_FOREST 0x00000004 // Open the GPO on the forest
  686. //
  687. // 2) Add GPHintForest entry to the GROUP_POLICY_HINT_TYPE enumerated type
  688. //
  689. #define FGPO_SUPPORT 0
  690. #define MAX_ALIGNMENT_SIZE 8
  691. #define ALIGN_SIZE_TO_NEXTPTR( offset ) \
  692. ( ((DWORD)offset + (MAX_ALIGNMENT_SIZE-1) ) & (~(MAX_ALIGNMENT_SIZE - 1) ) )