00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
#include "tsecomm.c"
00036
00037
00038
00040
00041
00042
00044
00045 NTSTATUS Status;
00046 STRING
Event1Name,
Process1Name;
00047 UNICODE_STRING
UnicodeEvent1Name,
UnicodeProcess1Name;
00048
00049 OBJECT_ATTRIBUTES
NullObjectAttributes;
00050
00051 HANDLE
Event1;
00052 OBJECT_ATTRIBUTES
Event1ObjectAttributes;
00053 PSECURITY_DESCRIPTOR
Event1SecurityDescriptor;
00054 PSID
Event1Owner;
00055 PSID
Event1Group;
00056 PACL
Event1Dacl;
00057 PACL
Event1Sacl;
00058
00059 PACL
TDacl;
00060 BOOLEAN
TDaclPresent;
00061 BOOLEAN
TDaclDefaulted;
00062
00063 PACL
TSacl;
00064 BOOLEAN
TSaclPresent;
00065 BOOLEAN
TSaclDefaulted;
00066
00067 PSID
TOwner;
00068 BOOLEAN
TOwnerDefaulted;
00069 PSID
TGroup;
00070 BOOLEAN
TGroupDefaulted;
00071
00072
00073 HANDLE
Process1;
00074 OBJECT_ATTRIBUTES
Process1ObjectAttributes;
00075
00076
00077
00078
00080
00081
00082
00084
00085 BOOLEAN
00086 TestSeInitialize()
00087 {
00088
00089
Event1SecurityDescriptor = (PSECURITY_DESCRIPTOR)TstAllocatePool(
PagedPool, 1024 );
00090
00091
RtlInitString(&
Event1Name,
"\\SecurityTestEvent1");
00092
Status =
RtlAnsiStringToUnicodeString(
00093 &
UnicodeEvent1Name,
00094 &
Event1Name,
00095
TRUE );
SEASSERT_SUCCESS(
NT_SUCCESS(
Status) );
00096
RtlInitString(&
Process1Name,
"\\SecurityTestProcess1");
00097
Status =
RtlAnsiStringToUnicodeString(
00098 &
UnicodeProcess1Name,
00099 &
Process1Name,
00100
TRUE );
SEASSERT_SUCCESS(
NT_SUCCESS(
Status) );
00101
00102 InitializeObjectAttributes(&
NullObjectAttributes,
NULL, 0,
NULL,
NULL);
00103
00104
00105
00106
00107
TDacl = (PACL)TstAllocatePool(
PagedPool, 256 );
00108
TSacl = (PACL)TstAllocatePool(
PagedPool, 256 );
00109
00110
TDacl->AclRevision=
TSacl->AclRevision=ACL_REVISION;
00111
TDacl->Sbz1=
TSacl->Sbz1=0;
00112
TDacl->Sbz2=
TSacl->Sbz2=0;
00113
TDacl->AclSize=256;
00114
TSacl->AclSize=8;
00115
TDacl->AceCount=
TSacl->AceCount=0;
00116
00117
return TRUE;
00118 }
00119
00120
00121
00123
00124
00125
00127
00128 BOOLEAN
00129 TestSeUnnamedCreate()
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173 {
00174
00175
00176 BOOLEAN CompletionStatus =
TRUE;
00177
00178 InitializeObjectAttributes(&
Event1ObjectAttributes,
NULL, 0,
NULL,
NULL);
00179
DbgPrint(
"Se: No Security Descriptor... Test\n");
00180
DbgPrint(
"Se: No Inheritence... ");
00181
00182
Status =
NtCreateEvent(
00183 &
Event1,
00184 DELETE,
00185 &
Event1ObjectAttributes,
00186 NotificationEvent,
00187
FALSE
00188 );
00189
if (
NT_SUCCESS(
Status)) {
00190
DbgPrint(
"Succeeded.\n");
00191 }
else {
00192
DbgPrint(
" **** Failed ****\n");
00193 CompletionStatus =
FALSE;
00194 }
00195
ASSERT(
NT_SUCCESS(
Status));
00196
Status =
NtClose(
Event1);
00197
ASSERT(
NT_SUCCESS(
Status));
00198
00199
DbgPrint(
"Se: Dacl Inheritence... ");
00200
DbgPrint(
" Not Implemented.\n");
00201
DbgPrint(
"Se: Sacl Inheritence... ");
00202
DbgPrint(
" Not Implemented.\n");
00203
DbgPrint(
"Se: Dacl Inheritence W/ Creator ID... ");
00204
DbgPrint(
" Not Implemented.\n");
00205
DbgPrint(
"Se: Dacl And Sacl Inheritence... ");
00206
DbgPrint(
" Not Implemented.\n");
00207
00208
return CompletionStatus;
00209
00210 }
00211
00212 BOOLEAN
00213 TestSeNamedCreate()
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257 {
00258
00259 BOOLEAN CompletionStatus =
TRUE;
00260
00261
00262 InitializeObjectAttributes(
00263 &
Event1ObjectAttributes,
00264 &
UnicodeEvent1Name,
00265 0,
00266
NULL,
00267
NULL);
00268
00269
DbgPrint(
"Se: No Security Specified... Test\n");
00270
DbgPrint(
"Se: No Inheritence... ");
00271
Status =
NtCreateEvent(
00272 &
Event1,
00273 DELETE,
00274 &
Event1ObjectAttributes,
00275 NotificationEvent,
00276
FALSE
00277 );
00278
if (
NT_SUCCESS(
Status)) {
00279
DbgPrint(
"Succeeded.\n");
00280 }
else {
00281
DbgPrint(
" **** Failed ****\n");
00282 CompletionStatus =
FALSE;
00283 }
00284
ASSERT(
NT_SUCCESS(
Status));
00285
Status =
NtClose(
Event1);
00286
ASSERT(
NT_SUCCESS(
Status));
00287
00288
DbgPrint(
"Se: Dacl Inheritence... ");
00289
DbgPrint(
" Not Implemented.\n");
00290
DbgPrint(
"Se: Sacl Inheritence... ");
00291
DbgPrint(
" Not Implemented.\n");
00292
DbgPrint(
"Se: Dacl Inheritence With Creator ID... ");
00293
DbgPrint(
" Not Implemented.\n");
00294
DbgPrint(
"Se: Dacl & Sacl Inheritence... ");
00295
DbgPrint(
" Not Implemented.\n");
00296
00297
DbgPrint(
"Se: Empty Security Descriptor Explicitly Specified... Test\n");
00298
DbgPrint(
"Se: No Inheritence... ");
00299
00300
RtlCreateSecurityDescriptor(
Event1SecurityDescriptor, 1 );
00301 InitializeObjectAttributes(&
Event1ObjectAttributes,
00302 &
UnicodeEvent1Name,
00303 0,
00304
NULL,
00305
Event1SecurityDescriptor);
00306
Status =
NtCreateEvent(
00307 &
Event1,
00308 DELETE,
00309 &
Event1ObjectAttributes,
00310 NotificationEvent,
00311
FALSE
00312 );
00313
if (
NT_SUCCESS(
Status)) {
00314
DbgPrint(
"Succeeded.\n");
00315 }
else {
00316
DbgPrint(
" **** Failed ****\n");
00317 CompletionStatus =
FALSE;
00318 }
00319
ASSERT(
NT_SUCCESS(
Status));
00320
Status =
NtClose(
Event1);
00321
ASSERT(
NT_SUCCESS(
Status));
00322
00323
00324
00325
00326
DbgPrint(
"Se: Dacl Inheritence... ");
00327
DbgPrint(
" Not Implemented.\n");
00328
DbgPrint(
"Se: Sacl Inheritence... ");
00329
DbgPrint(
" Not Implemented.\n");
00330
DbgPrint(
"Se: Dacl & Sacl Inheritence... ");
00331
DbgPrint(
" Not Implemented.\n");
00332
00333
DbgPrint(
"Se: Explicit Dacl Specified... Test\n");
00334
DbgPrint(
"Se: No Inheritence... ");
00335
00336
RtlCreateSecurityDescriptor(
Event1SecurityDescriptor, 1 );
00337
RtlSetDaclSecurityDescriptor(
Event1SecurityDescriptor,
TRUE,
TDacl,
FALSE );
00338
00339 InitializeObjectAttributes(&
Event1ObjectAttributes,
00340 &
UnicodeEvent1Name,
00341 0,
00342
NULL,
00343
Event1SecurityDescriptor);
00344
Status =
NtCreateEvent(
00345 &
Event1,
00346 DELETE,
00347 &
Event1ObjectAttributes,
00348 NotificationEvent,
00349
FALSE
00350 );
00351
if (
NT_SUCCESS(
Status)) {
00352
DbgPrint(
"Succeeded.\n");
00353 }
else {
00354
DbgPrint(
" **** Failed ****\n");
00355 CompletionStatus =
FALSE;
00356 }
00357
ASSERT(
NT_SUCCESS(
Status));
00358
Status =
NtClose(
Event1);
00359
ASSERT(
NT_SUCCESS(
Status));
00360
00361
DbgPrint(
"Se: Dacl Inheritence... ");
00362
DbgPrint(
" Not Implemented.\n");
00363
DbgPrint(
"Se: Sacl Inheritence... ");
00364
DbgPrint(
" Not Implemented.\n");
00365
DbgPrint(
"Se: Dacl & Sacl Inheritence... ");
00366
DbgPrint(
" Not Implemented.\n");
00367
00368
DbgPrint(
"Se: Explicit Sacl Specified (W/Privilege)... Test\n");
00369
DbgPrint(
"Se: No Inheritence... ");
00370
DbgPrint(
" Not Implemented.\n");
00371
DbgPrint(
"Se: Dacl & Sacl Inheritence... ");
00372
DbgPrint(
" Not Implemented.\n");
00373
00374
DbgPrint(
"Se: Default Dacl Specified... Test\n");
00375
DbgPrint(
"Se: No Inheritence... ");
00376
DbgPrint(
" Not Implemented.\n");
00377
DbgPrint(
"Se: Dacl Inheritence... ");
00378
DbgPrint(
" Not Implemented.\n");
00379
DbgPrint(
"Se: Sacl Inheritence... ");
00380
DbgPrint(
" Not Implemented.\n");
00381
DbgPrint(
"Se: Dacl & Sacl Inheritence... ");
00382
DbgPrint(
" Not Implemented.\n");
00383
00384
DbgPrint(
"Se: Default Sacl (W/Privilege)... Test\n");
00385
DbgPrint(
"Se: No Inheritence... ");
00386
DbgPrint(
" Not Implemented.\n");
00387
DbgPrint(
"Se: Dacl & Sacl Inheritence... ");
00388
DbgPrint(
" Not Implemented.\n");
00389
00390
DbgPrint(
"Se: Explicit Sacl (W/O Privilege)... Test\n");
00391
DbgPrint(
" ");
00392
DbgPrint(
" Not Implemented.\n");
00393
DbgPrint(
"Se: Default Sacl (W/O Privilege)... Test\n");
00394
DbgPrint(
" ");
00395
DbgPrint(
" Not Implemented.\n");
00396
00397
DbgPrint(
"Se: Valid Owner Explicitly Specified... Test\n");
00398
DbgPrint(
" ");
00399
DbgPrint(
" Not Implemented.\n");
00400
DbgPrint(
"Se: Invalid Owner Explicitly Specified... Test\n");
00401
DbgPrint(
" ");
00402
DbgPrint(
" Not Implemented.\n");
00403
00404
DbgPrint(
"Se: Explicit Group Specified... Test\n");
00405
DbgPrint(
" ");
00406
DbgPrint(
" Not Implemented.\n");
00407
00408
00409
00410
return CompletionStatus;
00411
00412 }
00413
00414 BOOLEAN
00415 TestSeQuerySecurity()
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446 {
00447
00448 BOOLEAN CompletionStatus =
TRUE;
00449
00450
DbgPrint(
" ");
00451
DbgPrint(
" Not Implemented.\n");
00452
00453
#if 0
00454
DbgPrint(
"Se: No Security Descriptor... \n");
00455
DbgPrint(
"Se: Query Owner... ");
00456
DbgPrint(
" Not Implemented.\n");
00457
DbgPrint(
"Se: Query Group... ");
00458
DbgPrint(
" Not Implemented.\n");
00459
DbgPrint(
"Se: Query Dacl... ");
00460
DbgPrint(
" Not Implemented.\n");
00461
DbgPrint(
"Se: Query Sacl (Privileged)... ");
00462
DbgPrint(
" Not Implemented.\n");
00463
DbgPrint(
"Se: Query Sacl (Unprivileged)... ");
00464
DbgPrint(
" Not Implemented.\n");
00465
00466
DbgPrint(
"Se: Empty Security Descriptor... \n");
00467
DbgPrint(
"Se: Query Owner... ");
00468
DbgPrint(
" Not Implemented.\n");
00469
DbgPrint(
"Se: Query Group... ");
00470
DbgPrint(
" Not Implemented.\n");
00471
DbgPrint(
"Se: Query Dacl... ");
00472
DbgPrint(
" Not Implemented.\n");
00473
DbgPrint(
"Se: Query Sacl (Privileged)... ");
00474
DbgPrint(
" Not Implemented.\n");
00475
DbgPrint(
"Se: Query Sacl (Unprivileged)... ");
00476
DbgPrint(
" Not Implemented.\n");
00477
00478
DbgPrint(
"Se: Security Descriptor W/ Owner & Group... \n");
00479
DbgPrint(
"Se: Query Owner... ");
00480
DbgPrint(
" Not Implemented. \n");
00481
DbgPrint(
"Se: Query Group... ");
00482
DbgPrint(
" Not Implemented.\n");
00483
DbgPrint(
"Se: Query Dacl... ");
00484
DbgPrint(
" Not Implemented.\n");
00485
DbgPrint(
"Se: Query Sacl (Privileged)... ");
00486
DbgPrint(
" Not Implemented.\n");
00487
DbgPrint(
"Se: Query Sacl (Unprivileged)... ");
00488
DbgPrint(
" Not Implemented.\n");
00489
00490
DbgPrint(
"Se: Full Security Descriptor...\n");
00491
DbgPrint(
"Se: Query Owner... ");
00492
DbgPrint(
" Not Implemented.\n");
00493
DbgPrint(
"Se: Query Group... ");
00494
DbgPrint(
" Not Implemented.\n");
00495
DbgPrint(
"Se: Query Dacl... ");
00496
DbgPrint(
" Not Implemented.\n");
00497
DbgPrint(
"Se: Query Sacl (Privileged)... ");
00498
DbgPrint(
" Not Implemented.\n");
00499
DbgPrint(
"Se: Query Sacl (Unprivileged)... ");
00500
DbgPrint(
" Not Implemented.\n");
00501
#endif //0
00502
00503
return CompletionStatus;
00504 }
00505
00506 BOOLEAN
00507 TestSeSetSecurity()
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550 {
00551
00552 BOOLEAN CompletionStatus =
TRUE;
00553
00554
DbgPrint(
" ");
00555
DbgPrint(
" Not Implemented.\n");
00556
#if 0
00557
DbgPrint(
"Se: No Security Descriptor...\n");
00558
DbgPrint(
"Se: Set Valid Owner SID... ");
00559
DbgPrint(
" Not Implemented.\n");
00560
DbgPrint(
"Se: Set Invalid Owner SID... ");
00561
DbgPrint(
" Not Implemented.\n");
00562
DbgPrint(
"Se: Set Group... ");
00563
DbgPrint(
" Not Implemented.\n");
00564
DbgPrint(
"Se: Set Dacl (explicitly granted by dacl)... ");
00565
DbgPrint(
" Not Implemented.\n");
00566
DbgPrint(
"Se: Set Dacl (by virtue of ownership)... ");
00567
DbgPrint(
" Not Implemented.\n");
00568
DbgPrint(
"Se: Set Dacl (invalid attempt)... ");
00569
DbgPrint(
" Not Implemented.\n");
00570
DbgPrint(
"Se: Set Sacl (privileged)... ");
00571
DbgPrint(
" Not Implemented.\n");
00572
DbgPrint(
"Se: Set Sacl (unprivileged - should be rejected)... ");
00573
DbgPrint(
" Not Implemented.\n");
00574
00575
DbgPrint(
"Se: Empty Security Descriptor...\n");
00576
DbgPrint(
"Se: Set Valid Owner SID... ");
00577
DbgPrint(
" Not Implemented.\n");
00578
DbgPrint(
"Se: Set Invalid Owner SID... ");
00579
DbgPrint(
" Not Implemented.\n");
00580
DbgPrint(
"Se: Set Group... ");
00581
DbgPrint(
" Not Implemented.\n");
00582
DbgPrint(
"Se: Set Dacl (explicitly granted by dacl)... ");
00583
DbgPrint(
" Not Implemented.\n");
00584
DbgPrint(
"Se: Set Dacl (by virtue of ownership)... ");
00585
DbgPrint(
" Not Implemented.\n");
00586
DbgPrint(
"Se: Set Dacl (invalid attempt)... ");
00587
DbgPrint(
" Not Implemented.\n");
00588
DbgPrint(
"Se: Set Sacl (privileged)... ");
00589
DbgPrint(
" Not Implemented.\n");
00590
DbgPrint(
"Se: Set Sacl (unprivileged - should be rejected)... ");
00591
DbgPrint(
" Not Implemented.\n");
00592
00593
DbgPrint(
"Se: Security Descriptor W/ Owner & Group Only...\n");
00594
DbgPrint(
"Se: Set Valid Owner SID... ");
00595
DbgPrint(
" Not Implemented.\n");
00596
DbgPrint(
"Se: Set Invalid Owner SID... ");
00597
DbgPrint(
" Not Implemented.\n");
00598
DbgPrint(
"Se: Set Group... ");
00599
DbgPrint(
" Not Implemented.\n");
00600
DbgPrint(
"Se: Set Dacl (explicitly granted by dacl)... ");
00601
DbgPrint(
" Not Implemented.\n");
00602
DbgPrint(
"Se: Set Dacl (by virtue of ownership)... ");
00603
DbgPrint(
" Not Implemented.\n");
00604
DbgPrint(
"Se: Set Dacl (invalid attempt)... ");
00605
DbgPrint(
" Not Implemented.\n");
00606
DbgPrint(
"Se: Set Sacl (privileged)... ");
00607
DbgPrint(
" Not Implemented.\n");
00608
DbgPrint(
"Se: Set Sacl (unprivileged - should be rejected)... ");
00609
DbgPrint(
" Not Implemented.\n");
00610
00611
DbgPrint(
"Se: Full Security Descriptor...\n");
00612
DbgPrint(
"Se: Set Valid Owner SID... ");
00613
DbgPrint(
" Not Implemented.\n");
00614
DbgPrint(
"Se: Set Invalid Owner SID... ");
00615
DbgPrint(
" Not Implemented.\n");
00616
DbgPrint(
"Se: Set Group... ");
00617
DbgPrint(
" Not Implemented.\n");
00618
DbgPrint(
"Se: Set Dacl (explicitly granted by dacl)... ");
00619
DbgPrint(
" Not Implemented.\n");
00620
DbgPrint(
"Se: Set Dacl (by virtue of ownership)... ");
00621
DbgPrint(
" Not Implemented.\n");
00622
DbgPrint(
"Se: Set Dacl (invalid attempt)... ");
00623
DbgPrint(
" Not Implemented.\n");
00624
DbgPrint(
"Se: Set Sacl (privileged)... ");
00625
DbgPrint(
" Not Implemented.\n");
00626
DbgPrint(
"Se: Set Sacl (unprivileged - should be rejected)... ");
00627
DbgPrint(
" Not Implemented.\n");
00628
00629
#endif //0
00630
00631
return CompletionStatus;
00632
00633 }
00634
00635 BOOLEAN
00636 TestSeAccess()
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655 {
00656 BOOLEAN CompletionStatus =
TRUE;
00657
00658
DbgPrint(
" ");
00659
DbgPrint(
" Not Implemented.\n");
00660
#if 0
00661
00662
DbgPrint(
"Se: Creation...\n");
00663
DbgPrint(
"Se: No Access Requested (should be rejected)... ");
00664
DbgPrint(
" Not Implemented.\n");
00665
DbgPrint(
"Se: Specific Access Requested... ");
00666
DbgPrint(
" Not Implemented.\n");
00667
DbgPrint(
"Se: - Attempted Granted... ");
00668
DbgPrint(
" Not Implemented.\n");
00669
DbgPrint(
"Se: - Attempt Ungranted... ");
00670
DbgPrint(
" Not Implemented.\n");
00671
DbgPrint(
"Se: Access System Security... ");
00672
DbgPrint(
" Not Implemented.\n");
00673
00674
DbgPrint(
"Se: Open Existing...\n");
00675
DbgPrint(
"Se: No Access Requested (should be rejected)... ");
00676
DbgPrint(
" Not Implemented.\n");
00677
DbgPrint(
"Se: Specific Access Requested... ");
00678
DbgPrint(
" Not Implemented.\n");
00679
DbgPrint(
"Se: - Attempted Granted... ");
00680
DbgPrint(
" Not Implemented.\n");
00681
DbgPrint(
"Se: - Attempt Ungranted... ");
00682
DbgPrint(
" Not Implemented.\n");
00683
DbgPrint(
"Se: Access System Security... ");
00684
DbgPrint(
" Not Implemented.\n");
00685
#endif //0
00686
00687
#if 0 //old code
00688
00689
00690
00691
00692
DbgPrint(
"Se: Test1b... \n");
00693
Status =
NtSetEvent(
00694
Event1,
00695
NULL
00696 );
00697
ASSERT(!
NT_SUCCESS(
Status));
00698
00699
DbgPrint(
"Se: Test1c... \n");
00700
Status =
NtClose(
Event1);
00701
ASSERT(
NT_SUCCESS(
Status));
00702
00703
00704
00705
00706
00707
00708
00709
DbgPrint(
"Se: Test2a... \n");
00710
Status =
NtCreateEvent(
00711 &
Event1,
00712 (EVENT_MODIFY_STATE | STANDARD_DELETE),
00713 &
Event1ObjectAttributes,
00714 NotificationEvent,
00715
FALSE
00716 );
00717
ASSERT(
NT_SUCCESS(
Status));
00718
00719
DbgPrint(
"Se: Test2b... \n");
00720
Status =
NtSetEvent(
00721
Event1,
00722
NULL
00723 );
00724
ASSERT(
NT_SUCCESS(
Status));
00725
00726
DbgPrint(
"Se: Test2c... \n");
00727
00728
00729
00730
00731
00732
00733
00734
DbgPrint(
"Se: Test3a... \n");
00735
Status =
NtCreateEvent(
00736 &
Event1,
00737 GENERIC_EXECUTE,
00738 &
Event1ObjectAttributes,
00739 NotificationEvent,
00740
FALSE
00741 );
00742
ASSERT(
NT_SUCCESS(
Status));
00743
00744
DbgPrint(
"Se: Test3b... \n");
00745
Status =
NtSetEvent(
00746
Event1,
00747
NULL
00748 );
00749
ASSERT(
NT_SUCCESS(
Status));
00750
00751
DbgPrint(
"Se: Test3c... \n");
00752
Status =
NtClose(
Event1);
00753
ASSERT(
NT_SUCCESS(
Status));
00754
00755
00756
00757
00758
00759
00760
00761
DbgPrint(
"Se: Test4a... \n");
00762
Status =
NtCreateEvent(
00763 &
Event1,
00764 0,
00765 &
Event1ObjectAttributes,
00766 NotificationEvent,
00767
FALSE
00768 );
00769
ASSERT(!
NT_SUCCESS(
Status));
00770
00771
00772
RtlCreateSecurityDescriptor(
Event1SecurityDescriptor,
00773 SECURITY_DESCRIPTOR_REVISION);
00774 InitializeObjectAttributes(&
Event1ObjectAttributes,
00775
NULL, 0,
NULL,
00776
Event1SecurityDescriptor);
00777
DbgPrint(
"Se: Empty Security Descriptor... \n");
00778
00779
00780
00781
00782
00783
00784
DbgPrint(
"Se: Test1a... \n");
00785
Status =
NtCreateEvent(
00786 &
Event1,
00787 STANDARD_DELETE,
00788 &
Event1ObjectAttributes,
00789 NotificationEvent,
00790
FALSE
00791 );
00792
ASSERT(
NT_SUCCESS(
Status));
00793
00794
DbgPrint(
"Se: Test1b... \n");
00795
Status =
NtSetEvent(
00796
Event1,
00797
NULL
00798 );
00799
ASSERT(!
NT_SUCCESS(
Status));
00800
00801
DbgPrint(
"Se: Test1c... \n");
00802
Status =
NtClose(
Event1);
00803
ASSERT(
NT_SUCCESS(
Status));
00804
00805
00806
00807
00808
00809
00810
00811
DbgPrint(
"Se: Test2a... \n");
00812
Status =
NtCreateEvent(
00813 &
Event1,
00814 (EVENT_MODIFY_STATE | STANDARD_DELETE),
00815 &
Event1ObjectAttributes,
00816 NotificationEvent,
00817
FALSE
00818 );
00819
ASSERT(
NT_SUCCESS(
Status));
00820
00821
DbgPrint(
"Se: Test2b... \n");
00822
Status =
NtSetEvent(
00823
Event1,
00824
NULL
00825 );
00826
ASSERT(
NT_SUCCESS(
Status));
00827
00828
DbgPrint(
"Se: Test2c... \n");
00829
Status =
NtClose(
Event1);
00830
ASSERT(
NT_SUCCESS(
Status));
00831
00832
00833
00834
00835
00836
00837
00838
DbgPrint(
"Se: Test3a... \n");
00839
Status =
NtCreateEvent(
00840 &
Event1,
00841 GENERIC_EXECUTE,
00842 &
Event1ObjectAttributes,
00843 NotificationEvent,
00844
FALSE
00845 );
00846
ASSERT(
NT_SUCCESS(
Status));
00847
00848
DbgPrint(
"Se: Test3b... \n");
00849
Status =
NtSetEvent(
00850
Event1,
00851
NULL
00852 );
00853
ASSERT(
NT_SUCCESS(
Status));
00854
00855
DbgPrint(
"Se: Test3c... \n");
00856
Status =
NtClose(
Event1);
00857
ASSERT(
NT_SUCCESS(
Status));
00858
00859
00860
00861
00862
00863
00864
00865
DbgPrint(
"Se: Test4a... \n");
00866
Status =
NtCreateEvent(
00867 &
Event1,
00868 0,
00869 &
Event1ObjectAttributes,
00870 NotificationEvent,
00871
FALSE
00872 );
00873
ASSERT(!
NT_SUCCESS(
Status));
00874
#endif // old code
00875
00876
return CompletionStatus;
00877 }
00878
00879 BOOLEAN
00880 TSeAcc()
00881 {
00882 BOOLEAN Result =
TRUE;
00883
00884
DbgPrint(
"Se: Initialization... ");
00885
TestSeInitialize();
00886
DbgPrint(
"Succeeded.\n");
00887
00888
DbgPrint(
"Se: Unnamed Object Creation Test... Suite\n");
00889
if (!
TestSeUnnamedCreate()) {
00890 Result =
FALSE;
00891 }
00892
DbgPrint(
"Se: Named Object Creation Test... Suite\n");
00893
if (!
TestSeNamedCreate()) {
00894 Result =
FALSE;
00895 }
00896
DbgPrint(
"Se: Query Object Security Descriptor Test... Suite\n");
00897
if (!
TestSeQuerySecurity()) {
00898 Result =
FALSE;
00899 }
00900
DbgPrint(
"Se: Set Object Security Descriptor Test... Suite\n");
00901
if (!
TestSeSetSecurity()) {
00902 Result =
FALSE;
00903 }
00904
DbgPrint(
"Se: Access Test... Suite\n");
00905
if (!
TestSeAccess()) {
00906 Result =
FALSE;
00907 }
00908
00909
DbgPrint(
"\n");
00910
DbgPrint(
"\n");
00911
DbgPrint(
" ********************\n");
00912
DbgPrint(
" ** **\n");
00913
00914
if (Result =
TRUE) {
00915
DbgPrint(
" ** Test Succeeded **\n");
00916 }
else {
00917
DbgPrint(
" ** Test Failed **\n");
00918 }
00919
00920
DbgPrint(
" ** **\n");
00921
DbgPrint(
" ********************\n");
00922
DbgPrint(
"\n");
00923
DbgPrint(
"\n");
00924
00925
return Result;
00926 }
00927