Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

atom.c File Reference

#include "precomp.h"

Go to the source code of this file.

Functions

NTSTATUS UserRtlCreateAtomTable (IN ULONG NumberOfBuckets)
ATOM UserAddAtom (LPCWSTR ccxlpAtom, BOOL bPin)
ATOM UserFindAtom (LPCWSTR ccxlpAtom)
ATOM UserDeleteAtom (ATOM atom)
UINT UserGetAtomName (ATOM atom, LPWSTR ccxlpch, int cchMax)

Variables

PVOID UserAtomTableHandle


Function Documentation

ATOM UserAddAtom LPCWSTR  ccxlpAtom,
BOOL  bPin
 

Definition at line 35 of file w32/ntuser/kernel/atom.c.

References IS_PTR, NT_SUCCESS, NTSTATUS(), RtlAddAtomToAtomTable(), RtlPinAtomInAtomTable(), Status, and UserAtomTableHandle.

Referenced by _SetCursorIconData(), GetHmodTableIndex(), InitOLEFormats(), InternalRegisterClassEx(), InternalSetClipboardData(), NtUserRegisterWindowMessage(), SetupClassAtoms(), and Win32UserInitialize().

00037 { 00038 NTSTATUS Status; 00039 ATOM atom; 00040 00041 UserAssert(IS_PTR(ccxlpAtom)); 00042 00043 /* 00044 * Rtl routines protect accesses to strings with their 00045 * own try/except blocks. 00046 */ 00047 atom = 0; 00048 Status = RtlAddAtomToAtomTable( UserAtomTableHandle, 00049 (PWSTR)ccxlpAtom, 00050 &atom 00051 ); 00052 if (!NT_SUCCESS(Status)) { 00053 RIPNTERR0(Status, RIP_VERBOSE, "UserAddAtom: add failed"); 00054 } 00055 00056 if (atom && bPin) 00057 RtlPinAtomInAtomTable(UserAtomTableHandle,atom); 00058 00059 return atom; 00060 }

ATOM UserDeleteAtom ATOM  atom  ) 
 

Definition at line 84 of file w32/ntuser/kernel/atom.c.

References gatomFirstPinned, gatomLastPinned, NT_SUCCESS, NTSTATUS(), RtlDeleteAtomFromAtomTable(), Status, and UserAtomTableHandle.

Referenced by _DestroyCursor(), CleanEventMessage(), DestroyClass(), GetHmodTableIndex(), InternalRegisterClassEx(), xxxDoSysExpunge(), and xxxEmptyClipboard().

00086 { 00087 NTSTATUS Status; 00088 00089 if ((atom >= gatomFirstPinned) && (atom <= gatomLastPinned)) 00090 return 0; // if pinned, just return 00091 00092 Status = RtlDeleteAtomFromAtomTable( UserAtomTableHandle, atom ); 00093 if (NT_SUCCESS(Status)) { 00094 return 0; 00095 } else { 00096 RIPNTERR0(Status, RIP_VERBOSE, "UserDeleteAtom: delete failed"); 00097 return atom; 00098 } 00099 }

ATOM UserFindAtom LPCWSTR  ccxlpAtom  ) 
 

Definition at line 62 of file w32/ntuser/kernel/atom.c.

References NT_SUCCESS, NTSTATUS(), RtlLookupAtomInAtomTable(), Status, and UserAtomTableHandle.

Referenced by _GetWOWClass(), NtUserFindExistingCursorIcon(), and xxxCreateWindowEx().

00064 { 00065 NTSTATUS Status; 00066 ATOM atom; 00067 00068 /* 00069 * Rtl routines protect accesses to strings with their 00070 * own try/except blocks. 00071 */ 00072 atom = 0; 00073 Status = RtlLookupAtomInAtomTable( UserAtomTableHandle, 00074 (PWSTR)ccxlpAtom, 00075 &atom 00076 ); 00077 if (!NT_SUCCESS(Status)) { 00078 RIPNTERR0(Status, RIP_VERBOSE, "UserFindAtom: lookup failed"); 00079 } 00080 00081 return atom; 00082 }

UINT UserGetAtomName ATOM  atom,
LPWSTR  ccxlpch,
int  cchMax
 

Definition at line 101 of file w32/ntuser/kernel/atom.c.

References NT_SUCCESS, NTSTATUS(), NULL, RtlQueryAtomInAtomTable(), Status, UINT, and UserAtomTableHandle.

Referenced by _InternalGetIconInfo(), InternalSetClipboardData(), NtUserGetClassName(), NtUserGetClipboardFormatName(), and xxxLoadHmodIndex().

00105 { 00106 NTSTATUS Status; 00107 ULONG AtomNameLength; 00108 00109 AtomNameLength = cchMax * sizeof(WCHAR); 00110 Status = RtlQueryAtomInAtomTable( UserAtomTableHandle, 00111 atom, 00112 NULL, 00113 NULL, 00114 ccxlpch, 00115 &AtomNameLength 00116 ); 00117 if (!NT_SUCCESS(Status)) { 00118 RIPNTERR0(Status, RIP_VERBOSE, "UserGetAtomName: query failed"); 00119 return 0; 00120 } else { 00121 return AtomNameLength / sizeof(WCHAR); 00122 } 00123 }

NTSTATUS UserRtlCreateAtomTable IN ULONG  NumberOfBuckets  ) 
 

Definition at line 18 of file w32/ntuser/kernel/atom.c.

References NTSTATUS(), NULL, RtlCreateAtomTable(), Status, and UserAtomTableHandle.

00021 { 00022 NTSTATUS Status; 00023 00024 if (UserAtomTableHandle == NULL) { 00025 Status = RtlCreateAtomTable( NumberOfBuckets, &UserAtomTableHandle ); 00026 } else { 00027 RIPMSG0(RIP_VERBOSE, "UserRtlCreateAtomTable: table alread exists"); 00028 Status = STATUS_SUCCESS; 00029 } 00030 00031 return Status; 00032 }


Variable Documentation

PVOID UserAtomTableHandle
 

Definition at line 15 of file w32/ntuser/kernel/atom.c.

Referenced by UserAddAtom(), UserDeleteAtom(), UserFindAtom(), UserGetAtomName(), UserRtlCreateAtomTable(), and Win32kNtUserCleanup().


Generated on Sat May 15 19:42:56 2004 for test by doxygen 1.3.7