Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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