7 #define BUFFER_SIZE 256
9 int main(int argc
, char* argv
[])
11 PRTL_ATOM_TABLE AtomTable
= NULL
;
12 RTL_ATOM AtomA
= -1, AtomB
= -1, AtomC
= -1;
14 WCHAR Buffer
[BUFFER_SIZE
];
15 ULONG NameLength
, Data1
, Data2
;
17 printf("Atom table test app\n\n");
19 printf("RtlCreateAtomTable()\n");
20 Status
= RtlCreateAtomTable(37,
22 printf(" Status 0x%08lx\n", Status
);
24 if (NT_SUCCESS(Status
))
26 printf(" AtomTable %p\n", AtomTable
);
28 printf("RtlAddAtomToAtomTable()\n");
29 Status
= RtlAddAtomToAtomTable(AtomTable
,
32 printf(" Status 0x%08lx\n", Status
);
33 if (NT_SUCCESS(Status
))
35 printf(" AtomA 0x%x\n", AtomA
);
38 printf("RtlAddAtomToAtomTable()\n");
39 Status
= RtlAddAtomToAtomTable(AtomTable
,
42 printf(" Status 0x%08lx\n", Status
);
43 if (NT_SUCCESS(Status
))
45 printf(" AtomB 0x%x\n", AtomB
);
49 printf("RtlLookupAtomInAtomTable()\n");
50 Status
= RtlLookupAtomInAtomTable(AtomTable
,
53 printf(" Status 0x%08lx\n", Status
);
54 if (NT_SUCCESS(Status
))
56 printf(" AtomC 0x%x\n", AtomC
);
60 printf("RtlPinAtomInAtomTable()\n");
61 Status
= RtlPinAtomInAtomTable(AtomTable
,
63 printf(" Status 0x%08lx\n", Status
);
65 printf("RtlPinAtomInAtomTable()\n");
66 Status
= RtlPinAtomInAtomTable(AtomTable
,
68 printf(" Status 0x%08lx\n", Status
);
71 // printf("RtlDeleteAtomFromAtomTable()\n");
72 // Status = RtlDeleteAtomFromAtomTable(AtomTable,
74 // printf(" Status 0x%08lx\n", Status);
77 // printf("RtlEmptyAtomTable()\n");
78 // Status = RtlEmptyAtomTable(AtomTable,
80 // printf(" Status 0x%08lx\n", Status);
83 // printf("RtlLookupAtomInAtomTable()\n");
84 // Status = RtlLookupAtomInAtomTable(AtomTable,
87 // printf(" Status 0x%08lx\n", Status);
90 printf("RtlQueryAtomInAtomTable()\n");
91 NameLength
= sizeof(WCHAR
) * BUFFER_SIZE
;
92 Status
= RtlQueryAtomInAtomTable(AtomTable
,
98 printf(" Status 0x%08lx\n", Status
);
99 if (NT_SUCCESS(Status
))
101 printf(" RefCount %ld\n", Data1
);
102 printf(" PinCount %ld\n", Data2
);
103 printf(" NameLength %lu\n", NameLength
);
104 printf(" AtomName: %S\n", Buffer
);
107 printf("RtlDestroyAtomTable()\n");
108 RtlDestroyAtomTable(AtomTable
);
111 printf("Atom table test app finished\n");