3 #define WIN32_NO_STATUS
8 #define BUFFER_SIZE 256
10 int main(int argc
, char* argv
[])
12 PRTL_ATOM_TABLE AtomTable
= NULL
;
13 RTL_ATOM AtomA
= -1, AtomB
= -1, AtomC
= -1;
15 WCHAR Buffer
[BUFFER_SIZE
];
16 ULONG NameLength
, Data1
, Data2
;
18 printf("Atom table test app\n\n");
20 printf("RtlCreateAtomTable()\n");
21 Status
= RtlCreateAtomTable(37,
23 printf(" Status 0x%08lx\n", Status
);
25 if (NT_SUCCESS(Status
))
27 printf(" AtomTable %p\n", AtomTable
);
29 printf("RtlAddAtomToAtomTable()\n");
30 Status
= RtlAddAtomToAtomTable(AtomTable
,
33 printf(" Status 0x%08lx\n", Status
);
34 if (NT_SUCCESS(Status
))
36 printf(" AtomA 0x%x\n", AtomA
);
39 printf("RtlAddAtomToAtomTable()\n");
40 Status
= RtlAddAtomToAtomTable(AtomTable
,
43 printf(" Status 0x%08lx\n", Status
);
44 if (NT_SUCCESS(Status
))
46 printf(" AtomB 0x%x\n", AtomB
);
50 printf("RtlLookupAtomInAtomTable()\n");
51 Status
= RtlLookupAtomInAtomTable(AtomTable
,
54 printf(" Status 0x%08lx\n", Status
);
55 if (NT_SUCCESS(Status
))
57 printf(" AtomC 0x%x\n", AtomC
);
61 printf("RtlPinAtomInAtomTable()\n");
62 Status
= RtlPinAtomInAtomTable(AtomTable
,
64 printf(" Status 0x%08lx\n", Status
);
66 printf("RtlPinAtomInAtomTable()\n");
67 Status
= RtlPinAtomInAtomTable(AtomTable
,
69 printf(" Status 0x%08lx\n", Status
);
72 // printf("RtlDeleteAtomFromAtomTable()\n");
73 // Status = RtlDeleteAtomFromAtomTable(AtomTable,
75 // printf(" Status 0x%08lx\n", Status);
78 // printf("RtlEmptyAtomTable()\n");
79 // Status = RtlEmptyAtomTable(AtomTable,
81 // printf(" Status 0x%08lx\n", Status);
84 // printf("RtlLookupAtomInAtomTable()\n");
85 // Status = RtlLookupAtomInAtomTable(AtomTable,
88 // printf(" Status 0x%08lx\n", Status);
91 printf("RtlQueryAtomInAtomTable()\n");
92 NameLength
= sizeof(WCHAR
) * BUFFER_SIZE
;
93 Status
= RtlQueryAtomInAtomTable(AtomTable
,
99 printf(" Status 0x%08lx\n", Status
);
100 if (NT_SUCCESS(Status
))
102 printf(" RefCount %ld\n", Data1
);
103 printf(" PinCount %ld\n", Data2
);
104 printf(" NameLength %lu\n", NameLength
);
105 printf(" AtomName: %S\n", Buffer
);
108 printf("RtlDestroyAtomTable()\n");
109 RtlDestroyAtomTable(AtomTable
);
112 printf("Atom table test app finished\n");