ReactOS 0.4.17-dev-243-g1369312
atom.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/rtl/atom.c
5 * PURPOSE: Atom management
6 * PROGRAMMER: Thomas Weidenmueller
7 */
8
9/* INCLUDES *****************************************************************/
10
11#include <rtl.h>
12
13#define NDEBUG
14#include <debug.h>
15
16/* PROTOTYPES ****************************************************************/
17
22
25
27extern VOID RtlpFreeAtomTable(PRTL_ATOM_TABLE AtomTable);
30
34
35/* FUNCTIONS *****************************************************************/
36
37static
40 IN PRTL_ATOM_TABLE AtomTable,
41 IN PWSTR AtomName,
42 OUT PRTL_ATOM_TABLE_ENTRY **HashLink)
43{
45 ULONG Hash;
46
47 RtlInitUnicodeString(&Name, AtomName);
48
49 if (Name.Length != 0 &&
51 TRUE,
53 &Hash)))
54 {
57
58 Link = &AtomTable->Buckets[Hash % AtomTable->NumberOfBuckets];
59
60 /* search for an existing entry */
61 Current = *Link;
62 while (Current != NULL)
63 {
64 if (Current->NameLength == Name.Length / sizeof(WCHAR) &&
65 !_wcsicmp(Current->Name, Name.Buffer))
66 {
67 *HashLink = Link;
68 return Current;
69 }
70
71 Link = &Current->HashLink;
72 Current = Current->HashLink;
73 }
74
75 /* no matching atom found, return the hash link */
76 *HashLink = Link;
77 }
78 else
79 *HashLink = NULL;
80
81 return NULL;
82}
83
84static
87 PWSTR AtomName,
88 PUSHORT AtomValue)
89{
90 UNICODE_STRING AtomString;
91 ULONG LongValue;
92 USHORT LoValue;
93 PWCHAR p;
94
95 DPRINT("RtlpCheckIntegerAtom(AtomName '%S' AtomValue %p)\n",
96 AtomName, AtomValue);
97
98 if (!((ULONG_PTR)AtomName & 0xFFFF0000))
99 {
100 LoValue = (USHORT)((ULONG_PTR)AtomName & 0xFFFF);
101
102 if (LoValue == 0)
103 LoValue = 0xC000;
104
105 if (AtomValue != NULL)
106 *AtomValue = LoValue;
107
108 return TRUE;
109 }
110
111 /*
112 * AtomName cannot be NULL because this
113 * case was caught by the previous test.
114 */
115 ASSERT(AtomName != NULL);
116
117 if (*AtomName != L'#')
118 return FALSE;
119
120 p = AtomName;
121 p++;
122 while (*p)
123 {
124 if ((*p < L'0') || (*p > L'9'))
125 return FALSE;
126 p++;
127 }
128
129 p = AtomName;
130 p++;
131 RtlInitUnicodeString(&AtomString, p);
132
133 DPRINT("AtomString: %wZ\n", &AtomString);
134
135 RtlUnicodeStringToInteger(&AtomString, 10, &LongValue);
136
137 DPRINT("LongValue: %lu\n", LongValue);
138
139 *AtomValue = (USHORT)(LongValue & 0x0000FFFF);
140
141 return TRUE;
142}
143
144
145/*
146 * @implemented
147 */
149NTAPI
152 IN OUT PRTL_ATOM_TABLE *AtomTable)
153{
156
157 DPRINT("RtlCreateAtomTable(TableSize %lu AtomTable %p)\n",
158 TableSize, AtomTable);
159
160 if (*AtomTable != NULL)
161 {
162 return STATUS_SUCCESS;
163 }
164
165 /* Use default if size was incorrect */
166 if (TableSize <= 1) TableSize = 37;
167
168 /* allocate atom table */
170 sizeof(RTL_ATOM_TABLE));
171 if (Table == NULL)
172 {
173 return STATUS_NO_MEMORY;
174 }
175
176 /* initialize atom table */
177 Table->Signature = 'motA';
178 Table->NumberOfBuckets = TableSize;
179
181 if (!NT_SUCCESS(Status))
182 {
184 return Status;
185 }
186
188 {
191 return STATUS_NO_MEMORY;
192 }
193
194 *AtomTable = Table;
195 return STATUS_SUCCESS;
196}
197
198
199/*
200 * @implemented
201 */
203NTAPI
205 IN PRTL_ATOM_TABLE AtomTable)
206{
207 PRTL_ATOM_TABLE_ENTRY *CurrentBucket, *LastBucket;
208 PRTL_ATOM_TABLE_ENTRY CurrentEntry, NextEntry;
209
210 DPRINT("RtlDestroyAtomTable (AtomTable %p)\n", AtomTable);
211
212 if (!RtlpLockAtomTable(AtomTable))
213 {
215 }
216
217 /* delete all atoms */
218 LastBucket = AtomTable->Buckets + AtomTable->NumberOfBuckets;
219 for (CurrentBucket = AtomTable->Buckets;
220 CurrentBucket != LastBucket;
221 CurrentBucket++)
222 {
223 NextEntry = *CurrentBucket;
224 *CurrentBucket = NULL;
225
226 while (NextEntry != NULL)
227 {
228 CurrentEntry = NextEntry;
229 NextEntry = NextEntry->HashLink;
230
231 /* no need to delete the atom handle, the handles will all be freed
232 up when destroying the atom handle table! */
233
234 RtlpFreeAtomTableEntry(CurrentEntry);
235 }
236 }
237
239
240 RtlpUnlockAtomTable(AtomTable);
241
242 RtlpDestroyAtomTableLock(AtomTable);
243
244 RtlpFreeAtomTable(AtomTable);
245
246 return STATUS_SUCCESS;
247}
248
249
250/*
251 * @implemented
252 */
254NTAPI
256 PRTL_ATOM_TABLE AtomTable,
257 BOOLEAN DeletePinned)
258{
259 PRTL_ATOM_TABLE_ENTRY *CurrentBucket, *LastBucket;
260 PRTL_ATOM_TABLE_ENTRY CurrentEntry, NextEntry, *PtrEntry;
261
262 DPRINT("RtlEmptyAtomTable (AtomTable %p DeletePinned %x)\n",
263 AtomTable, DeletePinned);
264
265 if (RtlpLockAtomTable(AtomTable) == FALSE)
266 {
268 }
269
270 /* delete all atoms */
271 LastBucket = AtomTable->Buckets + AtomTable->NumberOfBuckets;
272 for (CurrentBucket = AtomTable->Buckets;
273 CurrentBucket != LastBucket;
274 CurrentBucket++)
275 {
276 NextEntry = *CurrentBucket;
277 PtrEntry = CurrentBucket;
278
279 while (NextEntry != NULL)
280 {
281 CurrentEntry = NextEntry;
282 NextEntry = NextEntry->HashLink;
283
284 if (DeletePinned || !(CurrentEntry->Flags & RTL_ATOM_IS_PINNED))
285 {
286 *PtrEntry = NextEntry;
287
288 RtlpFreeAtomHandle(AtomTable, CurrentEntry);
289
290 RtlpFreeAtomTableEntry(CurrentEntry);
291 }
292 else
293 {
294 PtrEntry = &CurrentEntry->HashLink;
295 }
296 }
297 }
298
299 RtlpUnlockAtomTable(AtomTable);
300
301 return STATUS_SUCCESS;
302}
303
304
305/*
306 * @implemented
307 */
310 IN PWSTR AtomName,
312{
313 USHORT AtomValue;
314 PRTL_ATOM_TABLE_ENTRY *HashLink;
317
318 DPRINT("RtlAddAtomToAtomTable (AtomTable %p AtomName %S Atom %p)\n",
319 AtomTable, AtomName, Atom);
320
321 if (RtlpCheckIntegerAtom (AtomName, &AtomValue))
322 {
323 /* integer atom */
324 if (AtomValue >= 0xC000)
325 {
327 }
328 else if (Atom != NULL)
329 {
330 *Atom = (RTL_ATOM)AtomValue;
331 }
332
333 return Status;
334 }
335
336 RtlpLockAtomTable(AtomTable);
337
338 /* string atom, hash it and try to find an existing atom with the same name */
339 Entry = RtlpHashAtomName(AtomTable, AtomName, &HashLink);
340
341 if (Entry != NULL)
342 {
343 /* found another atom, increment the reference counter unless it's pinned */
344
345 if (!(Entry->Flags & RTL_ATOM_IS_PINNED))
346 {
347 if (++Entry->ReferenceCount == 0)
348 {
349 /* FIXME - references overflowed, pin the atom? */
350 Entry->Flags |= RTL_ATOM_IS_PINNED;
351 }
352 }
353
354 if (Atom != NULL)
355 {
356 *Atom = (RTL_ATOM)Entry->Atom;
357 }
358 }
359 else
360 {
361 /* couldn't find an existing atom, HashLink now points to either the
362 HashLink pointer of the previous atom or to the bucket so we can
363 simply add it to the list */
364 if (HashLink != NULL)
365 {
366 ULONG AtomNameLen = (ULONG)wcslen(AtomName);
367
368 if (AtomNameLen > RTL_MAXIMUM_ATOM_LENGTH)
369 {
371 goto end;
372 }
373
375 sizeof(Entry->Name) +
376 (AtomNameLen + 1) * sizeof(WCHAR));
377 if (Entry != NULL)
378 {
379 Entry->HashLink = NULL;
380 Entry->ReferenceCount = 1;
381 Entry->Flags = 0x0;
382
383 Entry->NameLength = (UCHAR)AtomNameLen;
384 RtlCopyMemory(Entry->Name,
385 AtomName,
386 (AtomNameLen + 1) * sizeof(WCHAR));
387
388 if (RtlpCreateAtomHandle(AtomTable, Entry))
389 {
390 /* append the atom to the list */
391 *HashLink = Entry;
392
393 if (Atom != NULL)
394 {
395 *Atom = (RTL_ATOM)Entry->Atom;
396 }
397 }
398 else
399 {
402 }
403 }
404 else
405 {
407 }
408 }
409 else
410 {
411 /* The caller supplied an empty atom name! */
413 }
414 }
415end:
416 RtlpUnlockAtomTable(AtomTable);
417
418 return Status;
419}
420
421
422/*
423 * @implemented
424 */
426NTAPI
428 IN PRTL_ATOM_TABLE AtomTable,
430{
433
434 DPRINT("RtlDeleteAtomFromAtomTable (AtomTable %p Atom %x)\n",
435 AtomTable, Atom);
436
437 if (Atom >= 0xC000)
438 {
439 RtlpLockAtomTable(AtomTable);
440
441 Entry = RtlpGetAtomEntry(AtomTable, (ULONG)((USHORT)Atom - 0xC000));
442
443 if (Entry != NULL && Entry->Atom == (USHORT)Atom)
444 {
445 if (!(Entry->Flags & RTL_ATOM_IS_PINNED))
446 {
447 if (--Entry->ReferenceCount == 0)
448 {
449 PRTL_ATOM_TABLE_ENTRY *HashLink;
450
451 /* it's time to delete the atom. we need to unlink it from
452 the list. The easiest way is to take the atom name and
453 hash it again, this way we get the pointer to either
454 the hash bucket or the previous atom that links to the
455 one we want to delete. This way we can easily bypass
456 this item. */
457 if (RtlpHashAtomName(AtomTable, Entry->Name, &HashLink) != NULL)
458 {
459 /* bypass this atom */
460 *HashLink = Entry->HashLink;
461
462 RtlpFreeAtomHandle(AtomTable, Entry);
463
465 }
466 else
467 {
468 /* WTF?! This should never happen!!! */
469 ASSERT(FALSE);
470 }
471 }
472 }
473 else
474 {
475 /* tried to delete a pinned atom, do nothing and return
476 STATUS_WAS_LOCKED, which is NOT a failure code! */
478 }
479 }
480 else
481 {
483 }
484
485 RtlpUnlockAtomTable(AtomTable);
486 }
487
488 return Status;
489}
490
491
492/*
493 * @implemented
494 */
497 IN PWSTR AtomName,
499{
500 PRTL_ATOM_TABLE_ENTRY Entry, *HashLink;
501 USHORT AtomValue;
502 RTL_ATOM FoundAtom = 0;
504
505 DPRINT("RtlLookupAtomInAtomTable (AtomTable %p AtomName %S Atom %p)\n",
506 AtomTable, AtomName, Atom);
507
508 if (RtlpCheckIntegerAtom (AtomName, &AtomValue))
509 {
510 /* integer atom */
511 if (AtomValue >= 0xC000)
512 {
514 }
515 else if (Atom != NULL)
516 {
517 *Atom = (RTL_ATOM)AtomValue;
518 }
519
520 return Status;
521 }
522
523 RtlpLockAtomTable(AtomTable);
525
526 /* string atom */
527 Entry = RtlpHashAtomName(AtomTable, AtomName, &HashLink);
528 if (Entry != NULL)
529 {
531 FoundAtom = (RTL_ATOM)Entry->Atom;
532 }
533
534 RtlpUnlockAtomTable(AtomTable);
535 if (NT_SUCCESS(Status) && Atom != NULL)
536 {
537 *Atom = FoundAtom;
538 }
539 return Status;
540}
541
542
543/*
544 * @implemented
545 */
549{
551
552 DPRINT("RtlPinAtomInAtomTable (AtomTable %p Atom %x)\n",
553 AtomTable, Atom);
554
555 if (Atom >= 0xC000)
556 {
558
559 RtlpLockAtomTable(AtomTable);
560
561 Entry = RtlpGetAtomEntry(AtomTable, (ULONG)((USHORT)Atom - 0xC000));
562
563 if (Entry != NULL && Entry->Atom == (USHORT)Atom)
564 {
565 Entry->Flags |= RTL_ATOM_IS_PINNED;
566 }
567 else
568 {
570 }
571
572 RtlpUnlockAtomTable(AtomTable);
573 }
574
575 return Status;
576}
577
578
579/*
580 * @implemented
581 *
582 * This API is really messed up with regards to NameLength. If you pass in a
583 * valid buffer for AtomName, NameLength should be the size of the buffer
584 * (in bytes, not characters). So if you expect the string to be 6 char long,
585 * you need to allocate a buffer of 7 WCHARs and pass 14 for NameLength.
586 * The AtomName returned is always null terminated. If the NameLength you pass
587 * is smaller than 4 (4 would leave room for 1 character) the function will
588 * return with status STATUS_BUFFER_TOO_SMALL. If you pass more than 4, the
589 * return status will be STATUS_SUCCESS, even if the buffer is not large enough
590 * to hold the complete string. In that case, the string is silently truncated
591 * and made to fit in the provided buffer. On return NameLength is set to the
592 * number of bytes (but EXCLUDING the bytes for the null terminator) copied.
593 * So, if the string is 6 char long, you pass a buffer of 10 bytes, on return
594 * NameLength will be set to 8.
595 * If you pass in a NULL value for AtomName, the length of the string in bytes
596 * (again EXCLUDING the null terminator) is returned in NameLength, at least
597 * on Win2k, XP and ReactOS. NT4 will return 0 in that case.
598 */
600NTAPI
602 PRTL_ATOM_TABLE AtomTable,
604 PULONG RefCount,
606 PWSTR AtomName,
607 PULONG NameLength)
608{
610 BOOL Unlock = FALSE;
611
612 union
613 {
614 /* A RTL_ATOM_TABLE_ENTRY has a "WCHAR Name[1]" entry at the end.
615 * Make sure we reserve enough room to facilitate a 12 character name */
616 RTL_ATOM_TABLE_ENTRY AtomTableEntry;
617 WCHAR StringBuffer[sizeof(RTL_ATOM_TABLE_ENTRY) / sizeof(WCHAR) + 12];
618 } NumberEntry;
621
622 if (Atom < 0xC000)
623 {
624 /* Synthesize an entry */
625 NumberEntry.AtomTableEntry.Atom = Atom;
626 NumberEntry.AtomTableEntry.NameLength = _swprintf(NumberEntry.AtomTableEntry.Name,
627 L"#%lu",
628 (ULONG)Atom);
629 NumberEntry.AtomTableEntry.ReferenceCount = 1;
630 NumberEntry.AtomTableEntry.Flags = RTL_ATOM_IS_PINNED;
631 Entry = &NumberEntry.AtomTableEntry;
632 }
633 else
634 {
635 RtlpLockAtomTable(AtomTable);
636 Unlock = TRUE;
637
638 Entry = RtlpGetAtomEntry(AtomTable, (ULONG)((USHORT)Atom - 0xC000));
639 }
640
641 if (Entry != NULL && Entry->Atom == (USHORT)Atom)
642 {
643 DPRINT("Atom name: %wZ\n", &Entry->Name);
644
645 if (RefCount != NULL)
646 {
647 *RefCount = Entry->ReferenceCount;
648 }
649
650 if (PinCount != NULL)
651 {
652 *PinCount = ((Entry->Flags & RTL_ATOM_IS_PINNED) != 0);
653 }
654
655 if (NULL != NameLength)
656 {
657 Length = Entry->NameLength * sizeof(WCHAR);
658 if (NULL != AtomName)
659 {
660 if (*NameLength < Length + sizeof(WCHAR))
661 {
662 if (*NameLength < 4)
663 {
664 *NameLength = Length;
666 }
667 else
668 {
669 Length = *NameLength - sizeof(WCHAR);
670 }
671 }
672 if (NT_SUCCESS(Status))
673 {
674 RtlCopyMemory(AtomName, Entry->Name, Length);
675 AtomName[Length / sizeof(WCHAR)] = L'\0';
676 *NameLength = Length;
677 }
678 }
679 else
680 {
681 *NameLength = Length;
682 }
683 }
684 else if (NULL != AtomName)
685 {
687 }
688 }
689 else
690 {
692 }
693
694 if (Unlock) RtlpUnlockAtomTable(AtomTable);
695
696 return Status;
697}
698
699
700/*
701 * @private - only used by NtQueryInformationAtom
702 */
704NTAPI
706 IN PRTL_ATOM_TABLE AtomTable,
707 IN ULONG MaxAtomCount,
708 OUT ULONG *AtomCount,
709 OUT RTL_ATOM *AtomList)
710{
711 PRTL_ATOM_TABLE_ENTRY *CurrentBucket, *LastBucket;
712 PRTL_ATOM_TABLE_ENTRY CurrentEntry;
713 ULONG Atoms = 0;
715
716 RtlpLockAtomTable(AtomTable);
717
718 LastBucket = AtomTable->Buckets + AtomTable->NumberOfBuckets;
719 for (CurrentBucket = AtomTable->Buckets;
720 CurrentBucket != LastBucket;
721 CurrentBucket++)
722 {
723 CurrentEntry = *CurrentBucket;
724
725 while (CurrentEntry != NULL)
726 {
727 if (MaxAtomCount > 0)
728 {
729 *(AtomList++) = (RTL_ATOM)CurrentEntry->Atom;
730 MaxAtomCount--;
731 }
732 else
733 {
734 /* buffer too small, but don't bail. we need to determine the
735 total number of atoms in the table! */
737 }
738
739 Atoms++;
740 CurrentEntry = CurrentEntry->HashLink;
741 }
742 }
743
744 *AtomCount = Atoms;
745
746 RtlpUnlockAtomTable(AtomTable);
747
748 return Status;
749}
750
unsigned char BOOLEAN
Definition: actypes.h:127
LONG NTSTATUS
Definition: precomp.h:26
_Out_ RTL_ATOM * Atom
Definition: class.h:54
#define STATUS_INVALID_HANDLE
Definition: d3dkmdt.h:40
#define STATUS_NO_MEMORY
Definition: d3dkmdt.h:51
LPWSTR Name
Definition: desk.c:124
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:159
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2983
static int Hash(const char *)
Definition: reader.c:2237
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
Status
Definition: gdiplustypes.h:24
ASMGENDATA Table[]
Definition: genincdata.c:61
GLuint GLuint end
Definition: gl.h:1545
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR StringBuffer[156]
Definition: ldrinit.c:41
#define ASSERT(a)
Definition: mode.c:44
#define _swprintf(buf, format,...)
Definition: sprintf.c:56
struct atom_table * RTL_ATOM_TABLE
Definition: atom.c:43
unsigned short RTL_ATOM
Definition: atom.c:42
unsigned short * PRTL_ATOM
Definition: atom.c:42
struct atom_table ** PRTL_ATOM_TABLE
Definition: atom.c:43
NTSYSAPI NTSTATUS NTAPI RtlHashUnicodeString(_In_ CONST UNICODE_STRING *String, _In_ BOOLEAN CaseInSensitive, _In_ ULONG HashAlgorithm, _Out_ PULONG HashValue)
NTSYSAPI NTSTATUS NTAPI RtlAddAtomToAtomTable(_In_ PRTL_ATOM_TABLE AtomTable, _In_ PWSTR AtomName, _Out_ PRTL_ATOM Atom)
NTSYSAPI NTSTATUS NTAPI RtlLookupAtomInAtomTable(_In_ PRTL_ATOM_TABLE AtomTable, _In_ PWSTR AtomName, _Out_ PRTL_ATOM Atom)
NTSYSAPI NTSTATUS NTAPI RtlCreateAtomTable(_In_ ULONG TableSize, _Inout_ PRTL_ATOM_TABLE *AtomTable)
NTSYSAPI NTSTATUS NTAPI RtlDeleteAtomFromAtomTable(_In_ PRTL_ATOM_TABLE AtomTable, _In_ RTL_ATOM Atom)
NTSYSAPI NTSTATUS NTAPI RtlQueryAtomInAtomTable(_In_ PRTL_ATOM_TABLE AtomTable, _In_ RTL_ATOM Atom, _Out_opt_ PULONG RefCount, _Out_opt_ PULONG PinCount, _Out_opt_z_bytecap_(*NameLength) PWSTR AtomName, _Inout_opt_ PULONG NameLength)
struct _RTL_ATOM_TABLE_ENTRY RTL_ATOM_TABLE_ENTRY
#define RTL_MAXIMUM_ATOM_LENGTH
Definition: rtltypes.h:36
#define RTL_ATOM_IS_PINNED
Definition: rtltypes.h:375
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToInteger(PUNICODE_STRING String, ULONG Base, PULONG Value)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
NTSTATUS NTAPI RtlQueryAtomListInAtomTable(IN PRTL_ATOM_TABLE AtomTable, IN ULONG MaxAtomCount, OUT ULONG *AtomCount, OUT RTL_ATOM *AtomList)
Definition: atom.c:705
#define STATUS_WAS_LOCKED
Definition: ntstatus.h:214
short WCHAR
Definition: pedump.c:58
unsigned short USHORT
Definition: pedump.c:61
@ Unlock
Definition: ntsecapi.h:294
PRTL_ATOM_TABLE_ENTRY RtlpAllocAtomTableEntry(ULONG Size)
Definition: libsupp.c:425
NTSTATUS NTAPI RtlEmptyAtomTable(PRTL_ATOM_TABLE AtomTable, BOOLEAN DeletePinned)
Definition: atom.c:255
BOOLEAN RtlpLockAtomTable(PRTL_ATOM_TABLE AtomTable)
Definition: libsupp.c:376
static PRTL_ATOM_TABLE_ENTRY RtlpHashAtomName(IN PRTL_ATOM_TABLE AtomTable, IN PWSTR AtomName, OUT PRTL_ATOM_TABLE_ENTRY **HashLink)
Definition: atom.c:39
static BOOLEAN RtlpCheckIntegerAtom(PWSTR AtomName, PUSHORT AtomValue)
Definition: atom.c:86
VOID RtlpFreeAtomTable(PRTL_ATOM_TABLE AtomTable)
Definition: libsupp.c:417
VOID RtlpDestroyAtomHandleTable(PRTL_ATOM_TABLE AtomTable)
Definition: libsupp.c:403
BOOLEAN RtlpCreateAtomHandleTable(PRTL_ATOM_TABLE AtomTable)
Definition: libsupp.c:393
VOID RtlpUnlockAtomTable(PRTL_ATOM_TABLE AtomTable)
Definition: libsupp.c:384
NTSTATUS NTAPI RtlDestroyAtomTable(IN PRTL_ATOM_TABLE AtomTable)
Definition: atom.c:204
NTSTATUS RtlpInitAtomTableLock(PRTL_ATOM_TABLE AtomTable)
Definition: libsupp.c:361
VOID RtlpDestroyAtomTableLock(PRTL_ATOM_TABLE AtomTable)
Definition: libsupp.c:369
VOID RtlpFreeAtomTableEntry(PRTL_ATOM_TABLE_ENTRY Entry)
Definition: libsupp.c:433
PRTL_ATOM_TABLE RtlpAllocAtomTable(ULONG Size)
Definition: libsupp.c:409
PRTL_ATOM_TABLE_ENTRY RtlpGetAtomEntry(PRTL_ATOM_TABLE AtomTable, ULONG Index)
Definition: libsupp.c:491
BOOLEAN RtlpCreateAtomHandle(PRTL_ATOM_TABLE AtomTable, PRTL_ATOM_TABLE_ENTRY Entry)
Definition: libsupp.c:455
NTSTATUS NTAPI RtlPinAtomInAtomTable(IN PRTL_ATOM_TABLE AtomTable, IN RTL_ATOM Atom)
Definition: atom.c:547
VOID RtlpFreeAtomHandle(PRTL_ATOM_TABLE AtomTable, PRTL_ATOM_TABLE_ENTRY Entry)
Definition: libsupp.c:441
Entry
Definition: section.c:5216
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define DPRINT
Definition: sndvol32.h:73
_In_ const GUID _In_ ULONG PinCount
Definition: strmini.h:505
Definition: rtltypes.h:1691
UCHAR NameLength
Definition: rtltypes.h:1697
USHORT Atom
Definition: rtltypes.h:1694
UCHAR Flags
Definition: rtltypes.h:1696
WCHAR Name[1]
Definition: rtltypes.h:1698
struct _RTL_ATOM_TABLE_ENTRY * HashLink
Definition: rtltypes.h:1692
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char UCHAR
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
uint16_t * PUSHORT
Definition: typedefs.h:56
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
#define STATUS_OBJECT_NAME_INVALID
Definition: udferr_usr.h:148
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149
static int Link(const char **args)
Definition: vfdcmd.c:2414
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
#define HASH_STRING_ALGORITHM_X65599
Definition: winternl.h:4523
_Must_inspect_result_ typedef _Out_ PULONG TableSize
Definition: iotypes.h:4330