Filter:   InfoImg
download jwagpedit.pas
Language: Delphi
License: LGPL
Copyright: (C) 1995-2001 Microsoft } Copyright 1997-1999, Microsoft Corporation (C) 1999-2001 }
LOC: 219
Project Info
FreePascal
Server: FreePascal
Type: zip
...rc\packages\extra\winunits\
   activex.pp
   buildjwa.pp
   commctrl.pp
   comobj.pp
   jedi.inc
   jediapilib.inc
   jwaaccctrl.pas
   jwaaclapi.pas
   jwaaclui.pas
   jwaactiveds.pas
   jwaadsdb.pas
   jwaadserr.pas
   jwaadshlp.pas
   jwaadsnms.pas
   jwaadsprop.pas
   jwaadssts.pas
   jwaadstlb.pas
   jwaadtgen.pas
   jwaaf_irda.pas
   jwaatalkwsh.pas
   jwaauthif.pas
   jwaauthz.pas
   jwabatclass.pas
   jwabits.pas
   jwabits1_5.pas
   jwabitscfg.pas
   jwabitsmsg.pas
   jwablberr.pas
   jwabluetoothapis.pas
   jwabthdef.pas
   jwabthsdpdef.pas
   jwabugcodes.pas
   jwacderr.pas
   jwacmnquery.pas
   jwacolordlg.pas
   jwacpl.pas
   jwacplext.pas
   jwacryptuiapi.pas
   jwadbt.pas
   jwadde.pas
   jwadhcpcsdk.pas
   jwadhcpsapi.pas
   jwadhcpssdk.pas
   jwadlgs.pas
   jwadsadmin.pas
   jwadsclient.pas
   jwadsgetdc.pas
   jwadskquota.pas
   jwadsquery.pas
   jwadsrole.pas
   jwadssec.pas
   jwaerrorrep.pas
   jwaexcpt.pas
   jwafaxdev.pas
   jwafaxext.pas
   jwafaxmmc.pas
   jwafaxroute.pas
   jwagpedit.pas
   jwahherror.pas
   jwahtmlGuid.pas
   jwahtmlhelp.pas
   jwaiaccess.pas
   jwaiadmext.pas
   jwaicmpapi.pas
   jwaiiscnfg.pas
   jwaimagehlp.pas
   jwaimapi.pas
   jwaimapierror.pas
   jwaime.pas
   jwaioevent.pas
   jwaipexport.pas
   jwaiphlpapi.pas
   jwaipifcons.pas
   jwaipinfoid.pas
   jwaiprtrmib.pas
   jwaiptypes.pas
   jwaisguids.pas
   jwaissper16.pas
   jwalmaccess.pas
   jwalmalert.pas
   jwalmapibuf.pas
   jwalmat.pas
   jwalmaudit.pas
   jwalmconfig.pas
   jwalmcons.pas
   jwalmdfs.pas
   jwalmerr.pas
   jwalmerrlog.pas
   jwalmjoin.pas
   jwalmmsg.pas
   jwalmremutl.pas
   jwalmrepl.pas
   jwalmserver.pas
   jwalmshare.pas
   jwalmsname.pas
   jwalmstats.pas
   jwalmsvc.pas
   jwalmuse.pas
   jwalmuseflg.pas
   jwalmwksta.pas
   jwaloadperf.pas
   jwalpmapi.pas
   jwamciavi.pas
   jwamprerror.pas
   jwamsi.pas
   jwamsidefs.pas
   jwamsiquery.pas
   jwamstask.pas
   jwamstcpip.pas
   jwamswsock.pas
   jwanative.pas
   jwanb30.pas
   jwanetsh.pas
   jwanspapi.pas
   jwantddpar.pas
   jwantdsapi.pas
   jwantdsbcli.pas
   jwantdsbmsg.pas
   jwantldap.pas
   jwantquery.pas
   jwantsecapi.pas
   jwantstatus.pas
   jwaObjsel.pas
   jwapatchapi.pas
   jwapatchwiz.pas
   jwapbt.pas
   jwapdh.pas
   jwapdhmsg.pas
   jwapowrprof.pas
   jwaprofinfo.pas
   jwaprotocol.pas
   jwaprsht.pas
   jwapsapi.pas
   jwaqos.pas
   jwaqosname.pas
   jwaqospol.pas
   jwaqossp.pas
   jwareason.pas
   jwaregstr.pas
   jwarpc.pas
   jwarpcasync.pas
   jwarpcdce.pas
   jwarpcnsi.pas
   jwarpcnterr.pas
   jwarpcssl.pas
   jwascesvc.pas
   jwaschedule.pas
   jwaschemadef.pas
   jwasddl.pas
   jwasecext.pas
   jwasecurity.pas
   jwasens.pas
   jwasensapi.pas
   jwasensevts.pas
   jwasfc.pas
   jwashlguid.pas
   jwasisbkup.pas
   jwasnmp.pas
   jwasporder.pas
   jwasrrestoreptapi.pas
   jwasspi.pas
   jwasubauth.pas
   jwasvcguid.pas
   jwatlhelp32.pas
   jwatmschema.pas
   jwatraffic.pas
   jwauserenv.pas
   jwauxtheme.pas
   jwawbemcli.pas
   jwawinable.pas
   jwawinber.pas
   jwawincon.pas
   jwawincpl.pas
   jwawincred.pas
   jwawindns.pas
   jwawinefs.pas
   jwawinfax.pas
   jwawingdi.pas
   jwawinioctl.pas
   jwawinldap.pas
   jwawinnetwk.pas
   jwawinnls.pas
   jwawinnt.pas
   jwawinperf.pas
   jwawinreg.pas
   jwawinresrc.pas
   jwawinsafer.pas
   jwawinsock.pas
   jwawinsock2.pas
   jwawinsvc.pas
   jwawintype.pas
   jwawinver.pas
   jwawinwlx.pas
   jwawmistr.pas
   jwawownt16.pas
   jwawownt32.pas
   jwawpapi.pas
   jwawpapimsg.pas
   jwawpcrsmsg.pas
   jwawpftpmsg.pas
   jwawppstmsg.pas
   jwawpspihlp.pas
   jwawptypes.pas
   jwawpwizmsg.pas
   jwaws2atm.pas
   jwaws2bth.pas
   jwaws2dnet.pas
   jwaws2spi.pas
   jwaws2tcpip.pas
   jwawshisotp.pas
   jwawsipx.pas
   jwawsnetbs.pas
   jwawsnwlink.pas
   jwawsrm.pas
   jwawsvns.pas
   jwawtsapi32.pas
   jwazmouse.pas
   Makefile.fpc
   mmsystem.pp
   ole2.pp
   shellapi.pp
   shfolder.pp
   shlobj.pp
   winver.pp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
{******************************************************************************}
{                                                                              }
{ Group Policy API interface Unit for Object Pascal                            }
{                                                                              }
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
{ Corporation. All Rights Reserved.                                            }
{                                                                              }
{ The original file is: gpedit.h, released June 2000. The original Pascal      }
{ code is: GPEdit.pas, released December 2000. The initial developer of the    }
{ Pascal code is Marcel van Brakel (brakelm att chello dott nl).               }
{                                                                              }
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
{ Marcel van Brakel. All Rights Reserved.                                      }
{                                                                              }
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
{                                                                              }
{ You may retrieve the latest version of this file at the Project JEDI         }
{ APILIB home page, located at http://jedi-apilib.sourceforge.net              }
{                                                                              }
{ The contents of this file are used with permission, subject to the Mozilla   }
{ Public License Version 1.1 (the "License"); you may not use this file except }
{ in compliance with the License. You may obtain a copy of the License at      }
{ http://www.mozilla.org/MPL/MPL-1.1.html                                      }
{                                                                              }
{ Software distributed under the License is distributed on an "AS IS" basis,   }
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
{ the specific language governing rights and limitations under the License.    }
{                                                                              }
{ Alternatively, the contents of this file may be used under the terms of the  }
{ GNU Lesser General Public License (the  "LGPL License"), in which case the   }
{ provisions of the LGPL License are applicable instead of those above.        }
{ If you wish to allow use of your version of this file only under the terms   }
{ of the LGPL License and not to allow others to use your version of this file }
{ under the MPL, indicate your decision by deleting  the provisions above and  }
{ replace  them with the notice and other provisions required by the LGPL      }
{ License.  If you do not delete the provisions above, a recipient may use     }
{ your version of this file under either the MPL or the LGPL License.          }
{                                                                              }
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
{                                                                              }
{******************************************************************************}


unit JwaGPEdit;

{$WEAKPACKAGEUNIT}

{$HPPEMIT ''}
{$HPPEMIT '#include "GPEdit.h"'}
{$HPPEMIT ''}

{$I jediapilib.inc}

interface

uses
  ActiveX {TODO}, JwaPrSht, JwaWinType;

type
  LPOLESTR = POleStr;
  {$NODEFINE LPOLESTR}

//-----------------------------------------------------------------------------
//
// GPEDIT.H - Definitions and prototypes for Group Policy
//
// Copyright 1997-1999, Microsoft Corporation
//
//-----------------------------------------------------------------------------

//
// Terminology
//
// Group Policy Editor  -  The tool to view a Group Policy Object.
//
// Group Policy Object  -  A collection of administrator defined policies.
//                         Each Group Policy Object (GPO) has both file system
//                         and Active Directory storage available to it.
//
// IGPEInformation      -  The interface MMC Snapin Extensions use to
//                         talk to the Group Policy Editor.
//
// IGroupPolicyObject   -  The interface used to create/edit a GPO directly
//                         without going through the Group Policy Editor
//

//
// Group Policy Editor MMC SnapIn GUID
//
// {8FC0B734-A0E1-11d1-A7D3-0000F87571E3}

const
  CLSID_GPESnapIn: TGUID = (
    D1:$8fc0b734; D2:$a0e1; D3:$11d1; D4:($a7, $d3, $0, $0, $f8, $75, $71, $e3));
  {$EXTERNALSYM CLSID_GPESnapIn}

//
// Group Policy Editor node ids
//

//
// Computer Configuration\Windows Settings
// {8FC0B737-A0E1-11d1-A7D3-0000F87571E3}
//

  NODEID_Machine: TGUID = (
    D1:$8fc0b737; D2:$a0e1; D3:$11d1; D4:($a7, $d3, $0, $0, $f8, $75, $71, $e3));
  {$EXTERNALSYM NODEID_Machine}

//
// Computer Configuration\Software Settings
// {8FC0B73A-A0E1-11d1-A7D3-0000F87571E3}
//

  NODEID_MachineSWSettings: TGUID = (
    D1:$8fc0b73a; D2:$a0e1; D3:$11d1; D4:($a7, $d3, $0, $0, $f8, $75, $71, $e3));
  {$EXTERNALSYM NODEID_MachineSWSettings}

//
// User Configuration\Windows Settings
// {8FC0B738-A0E1-11d1-A7D3-0000F87571E3}
//

  NODEID_User: TGUID = (
    D1:$8fc0b738; D2:$a0e1; D3:$11d1; D4:($a7, $d3, $0, $0, $f8, $75, $71, $e3));
  {$EXTERNALSYM NODEID_User}

//
// User Configuration\Software Settings
// {8FC0B73C-A0E1-11d1-A7D3-0000F87571E3}
//

  NODEID_UserSWSettings: TGUID = (
    D1:$8fc0b73c; D2:$a0e1; D3:$11d1; D4:($a7, $d3, $0, $0, $f8, $75, $71, $e3));
  {$EXTERNALSYM NODEID_UserSWSettings}

//
// IGPEInformation interface id
//
// {8FC0B735-A0E1-11d1-A7D3-0000F87571E3}

  IID_IGPEInformation: TGUID = (
    D1:$8fc0b735; D2:$a0e1; D3:$11d1; D4:($a7, $d3, $0, $0, $f8, $75, $71, $e3));
  {$EXTERNALSYM IID_IGPEInformation}

//
// Group Policy Object class id
//
// {EA502722-A23D-11d1-A7D3-0000F87571E3}

  CLSID_GroupPolicyObject: TGUID = (
    D1:$ea502722; D2:$a23d; D3:$11d1; D4:($a7, $d3, $0, $0, $f8, $75, $71, $e3));
  {$EXTERNALSYM CLSID_GroupPolicyObject}

//
// Group Policy Object interface id
//
// {EA502723-A23D-11d1-A7D3-0000F87571E3}

  IID_IGroupPolicyObject: TGUID = (
    D1:$ea502723; D2:$a23d; D3:$11d1; D4:($a7, $d3, $0, $0, $f8, $75, $71, $e3));
  {$EXTERNALSYM IID_IGroupPolicyObject}

//
// GUID that identifies the registry extension
//

  REGISTRY_EXTENSION_GUID: TGUID = (
    D1:$35378EAC; D2:$683F; D3:$11D2; D4:($A8, $9A, $00, $C0, $4F, $BB, $CF, $A2));
  {$EXTERNALSYM IID_IGroupPolicyObject}

//========================================================================================
//
// Resultant Set of Policy node ids
//
//========================================================================================

//
// Resultant Set of Policy MMC SnapIn GUID
//
// {6DC3804B-7212-458D-ADB0-9A07E2AE1FA2}

  CLSID_RSOPSnapIn: TGUID = (
    D1:$6dc3804b; D2:$7212; D3:$458d; D4:($ad, $b0, $9a, $07, $e2, $ae, $1f, $a2));
  {$EXTERNALSYM CLSID_RSOPSnapIn}

//
// Computer Configuration\Windows Settings
// {BD4C1A2E-0B7A-4A62-A6B0-C0577539C97E}
//

  NODEID_RSOPMachine: TGUID = (
    D1:$bd4c1a2e; D2:$0b7a; D3:$4a62; D4:($a6, $b0, $c0, $57, $75, $39, $c9, $7e));
  {$EXTERNALSYM NODEID_RSOPMachine}

//
// Computer Configuration\Software Settings
// {6A76273E-EB8E-45DB-94C5-25663A5f2C1A}
//

  NODEID_RSOPMachineSWSettings: TGUID = (
    D1:$6a76273e; D2:$eb8e; D3:$45db; D4:($94, $c5, $25, $66, $3a, $5f, $2c, $1a));
  {$EXTERNALSYM NODEID_RSOPMachineSWSettings}

//
// User Configuration\Windows Settings
// {AB87364F-0CEC-4CD8-9BF8-898F34628FB8}
//

  NODEID_RSOPUser: TGUID = (
    D1:$ab87364f; D2:$0cec; D3:$4cd8; D4:($9b, $f8, $89, $8f, $34, $62, $8f, $b8));
  {$EXTERNALSYM NODEID_RSOPUser}

//
// User Configuration\Software Settings
// {E52C5CE3-FD27-4402-84DE-D9A5F2858910}
//

  NODEID_RSOPUserSWSettings: TGUID = (
    D1:$e52c5ce3; D2:$fd27; D3:$4402; D4:($84, $de, $d9, $a5, $f2, $85, $89, $10));
  {$EXTERNALSYM NODEID_RSOPUserSWSettings}

//
// IRSOPInformation interface id
//
// {9A5A81B5-D9C7-49EF-9D11-DDF50968C48D}

  IID_IRSOPInformation: TGUID = (
    D1:$9a5a81b5; D2:$d9c7; D3:$49ef; D4:($9d, $11, $dd, $f5, $09, $68, $c4, $8d));
  {$EXTERNALSYM IID_IRSOPInformation}

// #include <objbase.h>

//
// Group Policy Object Section flags
//

const
  GPO_SECTION_ROOT                = 0;  // Root
  {$EXTERNALSYM GPO_SECTION_ROOT}
  GPO_SECTION_USER                = 1;  // User
  {$EXTERNALSYM GPO_SECTION_USER}
  GPO_SECTION_MACHINE             = 2;  // Machine
  {$EXTERNALSYM GPO_SECTION_MACHINE}

//
// Group Policy Object types
//

type
  _GROUP_POLICY_OBJECT_TYPE = (
    GPOTypeLocal,                         // GPO on the local machine
    GPOTypeRemote,                        // GPO on a remote machine
    GPOTypeDS);                           // GPO in the Active Directory
  {$EXTERNALSYM _GROUP_POLICY_OBJECT_TYPE}
  GROUP_POLICY_OBJECT_TYPE = _GROUP_POLICY_OBJECT_TYPE;
  {$EXTERNALSYM GROUP_POLICY_OBJECT_TYPE}
  PGROUP_POLICY_OBJECT_TYPE = ^GROUP_POLICY_OBJECT_TYPE;
  {$EXTERNALSYM PGROUP_POLICY_OBJECT_TYPE}
  TGroupPolicyObjectType = GROUP_POLICY_OBJECT_TYPE;
  PGroupPolicyObjectType = PGROUP_POLICY_OBJECT_TYPE;

//
// Group Policy Hint types
//

  _GROUP_POLICY_HINT_TYPE = (
    GPHintUnknown,                          // No link information available
    GPHintMachine,                          // GPO linked to a machine (local or remote)
    GPHintSite,                             // GPO linked to a site
    GPHintDomain,                           // GPO linked to a domain
    GPHintOrganizationalUnit);              // GPO linked to a organizational unit
  {$EXTERNALSYM _GROUP_POLICY_HINT_TYPE}
  GROUP_POLICY_HINT_TYPE = _GROUP_POLICY_HINT_TYPE;
  {$EXTERNALSYM GROUP_POLICY_HINT_TYPE}
  PGROUP_POLICY_HINT_TYPE = ^GROUP_POLICY_HINT_TYPE;
  {$EXTERNALSYM PGROUP_POLICY_HINT_TYPE}
  TGroupPolicyHintType = GROUP_POLICY_HINT_TYPE;
  PGroupPolicyHintType = PGROUP_POLICY_HINT_TYPE;

  IGPEInformation = interface (IUnknown)
  ['{8FC0B735-A0E1-11d1-A7D3-0000F87571E3}']

    // *** IGPEInformation methods ***

    //
    // Returns the unique Group Policy Object name (a GUID)
    //
    // pszName contains the name on return
    // cchMaxLength is the max number of characters that can be stored in pszName
    //

    function GetName(pszName: LPOLESTR; cchMaxLength: Integer): HRESULT; stdcall;

    //
    // Returns the friendly display name for this Group Policy Object
    //
    // pszName contains the name on return
    // cchMaxLength is the max number of characters that can be stored in pszName
    //

    function GetDisplayName(pszName: LPOLESTR; cchMaxLength: Integer): HRESULT; stdcall;

    //
    // Returns a registry key handle for the requested section.  The returned
    // key is the root of the registry, not the Policies subkey.  To set / read
    // a value in the Policies subkey, you will need to call RegOpenKeyEx to
    // open Software\Policies subkey first.
    //
    // The handle has been opened with ALL ACCESS rights.  Call RegCloseKey
    // on the handle when finished.
    //
    // dwSection is either GPO_SECTION_USER or GPO_SECTION_MACHINE
    // hKey contains the registry key on return
    //

    function GetRegistryKey(dwSection: DWORD; var hKey: HKEY): HRESULT; stdcall;

    //
    // Returns the Active Directory path to the root of the request section.
    // The path is in ADSI name format.
    //
    // dwSection is one of the GPO_SECTION_* flags
    // pszPath contains the path on return
    // cchMaxPath is the max number of characters that can be stored in pszPath
    //

    function GetDSPath(dwSection: DWORD; pszPath: LPOLESTR; cchMaxPath: Integer): HRESULT; stdcall;

    //
    // Returns the UNC path to the root of the requested section.
    //
    // dwSection is one of the GPO_SECTION_* flags
    // pszPath contains the path on return
    // cchMaxPath is the number of characters that can be stored in pszPath.
    //

    function GetFileSysPath(dwSection: DWORD; pszPath: LPOLESTR; cchMaxPath: Integer): HRESULT; stdcall;

    //
    // Returns the user preferences (options)
    //
    // Currently, there are no options defined.  This is reserved for future use.
    //
    // dwOptions receives a bitmask value
    //

    function GetOptions(var dwOptions: DWORD): HRESULT; stdcall;

    //
    // Returns the type of GPO being edited.
    //
    // The three types are:  a GPO in the Active Directory, the GPO on the local machine,
    // and the GPO on a remote machine.
    //
    // Machine GPOs only have file system storage (no Active Directory storage available).
    // If GetDSPath is called for a machine GPO, the function will succeed
    // and the returned buffer will be the empty string ""
    //
    // Active Directory GPOs have both file system and Active Directory storage available to them.
    //
    // gpoType receives one of the type flags listed above.
    //

    function GetType(var gpoType: GROUP_POLICY_OBJECT_TYPE): HRESULT; stdcall;

    //
    // Returns the type of Active Directory object (or machine) that could be linked to
    // this GPO
    //
    // This is a hint api only.  The GPE does not know which Active Directory objects are
    // linked to a particular GPO, but it can offer a hint based upon how the
    // user started the GPE.
    //
    // Use this method with great caution.  Some extensions might want to
    // customize their user interface based upon the scoping for this GPO,
    // but it is easy to offer the wrong namespace.  Best advice is to
    // always offer your full user interface, but if you choose to use this
    // method, always offer your full user interface if you recieve the
    // unknown hint back.
    //
    // gpHint receives one of the hint flags listed above.
    //

    function GetHint(var gpHint: GROUP_POLICY_HINT_TYPE): HRESULT; stdcall;

    //
    // Informs the Group Policy Editor that policy settings have changed.
    // Extensions MUST call this methold every time a change is made
    // to a Group Policy Object.
    //
    // bMachine specifies if machine or user policy has changed.
    // bAdd specifies whether this is an add or delete.
    // pGuidExtension is the guid or unique name of extension that
    //    will process this GPO.
    // pGuidSnapin is the guid or unique name of snapin that is making
    //    this call
    //

    function PolicyChanged(bMachine, bAdd: BOOL; const pGuidExtension, pGuidSnapin: GUID): HRESULT; stdcall;

  end;
  {$EXTERNALSYM IGPEInformation}

  LPGPEINFORMATION = ^IGPEInformation;
  {$EXTERNALSYM LPGPEINFORMATION}

//
// Group Policy Object open / creation flags
//

const
  GPO_OPEN_LOAD_REGISTRY     = $00000001;  // Load the registry files
  {$EXTERNALSYM GPO_OPEN_LOAD_REGISTRY}
  GPO_OPEN_READ_ONLY         = $00000002;  // Open the GPO as read only
  {$EXTERNALSYM GPO_OPEN_READ_ONLY}

//
// Group Policy Object option flags
//

const
  GPO_OPTION_DISABLE_USER    = $00000001;  // The user portion of this GPO is disabled
  {$EXTERNALSYM GPO_OPTION_DISABLE_USER}
  GPO_OPTION_DISABLE_MACHINE = $00000002;  // The machine portion of this GPO is disabled
  {$EXTERNALSYM GPO_OPTION_DISABLE_MACHINE}

type
  IGroupPolicyObject = interface (IUnknown)
  ['{EA502723-A23D-11d1-A7D3-0000F87571E3}']

    // *** IGroupPolicyObject methods ***

    //
    // Creates a new GPO in the Active Directory with the given friendly name
    // and opens it via OpenDSGPO().  If pszDomainName contains a domain
    // controller name, the GPO will be created on that DC.  If it does not
    // specify a domain controller name, the method will select a DC on
    // the callers behalf.
    //
    // pszDomainName contains the ADSI path of the domain root
    // pszDisplayName contains the friendly display name
    // dwFlags is a bitmask of GPO open / creation flags listed above
    //

    function New(pszDomainName, pszDisplayName: LPOLESTR; dwFlags: DWORD): HRESULT; stdcall;

    //
    // Opens the specified Group Policy Object in the Active Directory
    // based upon the passed in flags.  If pszPath contains a domain
    // controller name, the GPO will be opened on that DC.  If it does
    // not contain a domain controller name, the method will select a
    // DC on the callers behalf.  If the registry is not loaded,
    // GetRegistryKey() will return E_FAIL.
    //
    // pszPath contains the ADSI path to the GPO to open
    // dwFlags is a bitmask of GPO open / creation flags listed above
    //

    function OpenDSGPO(pszPath: LPOLESTR; dwFlags: DWORD): HRESULT; stdcall;

    //
    // Opens the default Group Policy Object on this machine with the
    // dwFlags options listed above.  If the registry is not loaded,
    // GetRegistryKey() will return E_FAIL.
    //
    // dwFlags is a bitmask of GPO open / creation flags listed above
    //

    function OpenLocalMachineGPO(dwFlags: DWORD): HRESULT; stdcall;

    //
    // Opens the default Group Policy Object on a remote machine with the
    // dwFlags options listed above.  If the registry is not loaded,
    // GetRegistryKey() will return E_FAIL.
    //
    // pszComputerName contains the machine name in \\machine format
    // dwFlags is a bitmask of GPO open / creation flags listed above
    //

    function OpenRemoteMachineGPO(pszComputerName: LPOLESTR; dwFlags: DWORD): HRESULT; stdcall;

    //
    // Flushes the registry settings to disk and updates the revision
    // number of the GPO.
    //
    // bMachine specifies if machine or user should be saved.
    // bAdd specifies whether this is an add or delete.
    // pGuidExtension is the guid or unique name of extension that
    //    will process this GPO.
    // pGuid is a guid
    //

    function Save(bMachine, bAdd: BOOL; const pGuidExtension, pGuid: GUID): HRESULT; stdcall;

    //
    // Deletes this Group Policy Object.
    //
    // After calling this method, no other methods are valid to call
    // since the data will have been deleted.
    //

    function Delete: HRESULT; stdcall;

    //
    // Returns the unique Group Policy Object name
    //
    // For Active Directory policy objects, this is a GUID
    // For the local policy object, it is the string "Local"
    // For remote policy objects, it is the computername
    //
    // pszName contains the name on return
    // cchMaxLength is the max number of characters that can be stored in pszName
    //

    function GetName(pszName: LPOLESTR; cchMaxLength: Integer): HRESULT; stdcall;

    //
    // Returns the friendly display name for this Group Policy Object
    //
    // pszName contains the name on return
    // cchMaxLength is the max number of characters that can be stored in pszName
    //

    function GetDisplayName(pszName: LPOLESTR; cchMaxLength: Integer): HRESULT; stdcall;

    //
    // Sets the friendly display name for this Group Policy Object
    //
    // pszName is the new display name
    //

    function SetDisplayName(pszName: LPOLESTR): HRESULT; stdcall;

    //
    // Returns the path to the Group Policy Object
    //
    //
    // If the GPO is an Active Directory object, the path is in ADSI name format.
    // If the GPO is a machine object, it is a file system path
    //
    // pszPath contains the path on return
    // cchMaxPath is the max number of characters that can be stored in pszPath
    //

    function GetPath(pszPath: LPOLESTR; cchMaxPath: Integer): HRESULT; stdcall;

    //
    // Returns the Active Directory path to the root of the request section.
    // The path is in DN name format.
    //
    // dwSection is one of the GPO_SECTION_* flags
    // pszPath contains the path on return
    // cchMaxPath is the max number of characters that can be stored in pszPath
    //

    function GetDSPath(dwSection: DWORD; pszPath: LPOLESTR; cchMaxPath: Integer): HRESULT; stdcall;

    //
    // Returns the UNC path to the root of the requested section.
    //
    // dwSection is one of the GPO_SECTION_* flags
    // pszPath contains the path on return
    // cchMaxPath is the number of characters that can be stored in pszPath.
    //

    function GetFileSysPath(dwSection: DWORD; pszPath: LPOLESTR; cchMaxPath: Integer): HRESULT; stdcall;

    //
    // Returns a registry key handle for the requested section.  The returned
    // key is the root of the registry, not the Policies subkey.  To set / read
    // a value in the Policies subkey, you will need to call RegOpenKeyEx to
    // open Software\Policies subkey first.
    //
    // The handle has been opened with ALL ACCESS rights.  Call RegCloseKey
    // on the handle when finished.
    //
    // If the GPO was loaded / created without the registry being loaded
    // this method will return E_FAIL.
    //
    // dwSection is either GPO_SECTION_USER or GPO_SECTION_MACHINE
    // hKey contains the registry key on return
    //

    function GetRegistryKey(dwSection: DWORD; var hKey: HKEY): HRESULT; stdcall;

    //
    // Returns any options for this Group Policy Object
    //
    // dwOptions receives the GPO_OPTION_* flags
    //

    function GetOptions(var dwOptions: DWORD): HRESULT; stdcall;

    //
    // Sets any options for this Group Policy Object
    //
    // This method sets any options for this GPO.  To change
    // an option, that flag must be set in the mask field.
    // If the flag is in the mask field, then the dwOptions
    // field is read for the current state.
    //
    // For example:  to disable the GPO, make this call
    //
    //    SetOptions (GPO_OPTION_DISABLED, GPO_OPTION_DISABLED);
    //
    // dwOptions specifies one or more GPO_OPTION_* flags
    // dwMask specificies which of the dwOptions to change
    //

    function SetOptions(dwOptions, dwMask: DWORD): HRESULT; stdcall;

    //
    // Returns the type of GPO being edited.
    //
    // The three types are:  a GPO in the Active Directory, the GPO on the local machine,
    // and the GPO on a remote machine.
    //
    // Machine GPOs only have file system storage (no Active Directory storage available).
    // If GetDSPath is called for a machine GPO, the function will succeed
    // and the returned buffer will be the empty string ""
    //
    // Active Directory GPOs have both file system and Active Directory storage available to them.
    //
    // gpoType receives one of the type flags
    //

    function GetType(var gpoType: GROUP_POLICY_OBJECT_TYPE): HRESULT; stdcall;

    //
    // Returns the machine name of the remote GPO
    //
    // This method returns the name passed to OpenRemoteMachineGPO.
    //
    // pszName contains the name on return
    // cchMaxLength is the max number of characters that can be stored in pszName
    //

    function GetMachineName(pszName: LPOLESTR; cchMaxLength: Integer): HRESULT; stdcall;

    //
    // Returns an array of property sheet pages and the number of pages
    // in the array
    //
    // Note, this method will allocate memory for the array with
    // LocalAlloc.  When finished, the caller should free the array
    // with LocalFree
    //
    // hPages address of the pointer for the array of property sheet pages
    // uPageCount receives the number of pages in the array
    //

    function GetPropertySheetPages(var hPages: PHPROPSHEETPAGE; var uPageCount: UINT): HRESULT; stdcall;
    
  end;
  {$EXTERNALSYM IGroupPolicyObject}

  LPGROUPPOLICYOBJECT = ^IGroupPolicyObject;
  {$EXTERNALSYM LPGROUPPOLICYOBJECT}

//
// RSOP flags
//

const
  RSOP_INFO_FLAG_DIAGNOSTIC_MODE = $00000001; // Running in diagnostic mode vs planning mode
  {$EXTERNALSYM RSOP_INFO_FLAG_DIAGNOSTIC_MODE}

type
  IRSOPInformation = interface (IUnknown)
  ['{9A5A81B5-D9C7-49EF-9D11-DDF50968C48D}']

    // *** IRSOPInformation methods ***

    //
    // Returns the namespace for the RSOP data
    //
    // dwSection is either GPO_SECTION_US