Changeset 10251 for trunk/src/kernel32/atom.cpp
- Timestamp:
- Sep 18, 2003, 4:21:07 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/atom.cpp
r7883 r10251 1 /* $Id: atom.cpp,v 1.1 2 2002-02-12 11:43:31sandervl Exp $ */1 /* $Id: atom.cpp,v 1.13 2003-09-18 14:21:07 sandervl Exp $ */ 2 2 3 3 /* … … 21 21 #include <misc.h> 22 22 23 #define DBG_LOCALLOG 23 #define DBG_LOCALLOG DBG_atom 24 24 #include "dbglocal.h" 25 25 … … 54 54 { 55 55 if(privateAtomTable == NULL) { 56 privateAtomTable = WinCreateAtomTable(0, 37); 56 privateAtomTable = WinCreateAtomTable(0, 37); 57 57 } 58 58 return privateAtomTable; … … 63 63 { 64 64 if(systemAtomTable == NULL) { 65 systemAtomTable = WinQuerySystemAtomTable(); 65 systemAtomTable = WinQuerySystemAtomTable(); 66 66 } 67 67 return systemAtomTable; … … 81 81 //****************************************************************************** 82 82 ATOM WIN32API FindAtomA( LPCSTR atomName) 83 { 83 { 84 84 HATOMTBL atomTable = getPrivateAtomTable(); 85 85 ATOM atom = 0; 86 86 87 87 if(HIWORD(atomName)) { 88 88 dprintf(("FindAtomA %s", atomName)); … … 91 91 92 92 if(atomTable != NULL) { 93 atom = LookupAtom(atomTable, HIWORD(atomName) ? 93 atom = LookupAtom(atomTable, HIWORD(atomName) ? 94 94 (PSZ) atomName : (PSZ) (LOWORD(atomName) | 0xFFFF0000), 95 95 LOOKUP_FIND | LOOKUP_NOCASE); … … 130 130 if(atomTable != NULL) 131 131 { 132 atom = LookupAtom(atomTable, HIWORD(atomName) ? 132 atom = LookupAtom(atomTable, HIWORD(atomName) ? 133 133 (PSZ) atomName : (PSZ) (LOWORD(atomName) | 0xFFFF0000), 134 134 LOOKUP_ADD | LOOKUP_NOCASE); … … 136 136 137 137 if(HIWORD(atomName)) { 138 138 dprintf(("KERNEL32: AddAtomA %s returned %x", atomName, atom)); 139 139 } 140 140 else dprintf(("KERNEL32: AddAtomA %x returned %x", atomName, atom)); … … 191 191 192 192 dprintf(("KERNEL32: GetAtomNameW %x %x %d", atom, lpszBuffer, cchBuffer)); 193 astring = (char *)alloca(cchBuffer );193 astring = (char *)alloca(cchBuffer * sizeof( WCHAR )); 194 194 if(astring == NULL) { 195 196 197 198 } 199 rc = GetAtomNameA(atom, astring, cchBuffer );195 dprintf(("GlobalGetAtomNameW: alloca failed!!")); 196 DebugInt3(); 197 return 0; 198 } 199 rc = GetAtomNameA(atom, astring, cchBuffer * sizeof( WCHAR )); 200 200 if(rc) { 201 lstrcpyAtoW(lpszBuffer, astring);201 lstrcpynAtoW(lpszBuffer, astring, cchBuffer); 202 202 } 203 203 else lpszBuffer[0] = 0; //necessary? 204 return rc;204 return lstrlenW( lpszBuffer ); 205 205 } 206 206 //****************************************************************************** … … 236 236 if(atomTable != NULL) 237 237 { 238 atom = LookupAtom(atomTable, HIWORD(atomName) ? 238 atom = LookupAtom(atomTable, HIWORD(atomName) ? 239 239 (PSZ) atomName : (PSZ) (LOWORD(atomName) | 0xFFFF0000), 240 240 LOOKUP_ADD | LOOKUP_NOCASE); … … 242 242 243 243 if(HIWORD(atomName)) { 244 244 dprintf(("KERNEL32: GlobalAddAtomA %s returned %x", atomName, atom)); 245 245 } 246 246 else dprintf(("KERNEL32: GlobalAddAtomA %x returned %x", atomName, atom)); … … 283 283 else dprintf(("KERNEL32: GlobalFindAtomA %x", atomName)); 284 284 285 atom = LookupAtom(atomTable, HIWORD(atomName) ? 285 atom = LookupAtom(atomTable, HIWORD(atomName) ? 286 286 (PSZ) atomName : (PSZ) (LOWORD(atomName) | 0xFFFF0000), 287 287 LOOKUP_FIND | LOOKUP_NOCASE); … … 340 340 341 341 dprintf(("KERNEL32: GlobalGetAtomNameW %x %x %d", atom, lpszBuffer, cchBuffer)); 342 astring = (char *)alloca(cchBuffer );342 astring = (char *)alloca(cchBuffer * sizeof( WCHAR )); 343 343 if(astring == NULL) { 344 345 346 347 } 348 rc = GlobalGetAtomNameA(atom, astring, cchBuffer );344 dprintf(("GlobalGetAtomNameW: alloca failed!!")); 345 DebugInt3(); 346 return 0; 347 } 348 rc = GlobalGetAtomNameA(atom, astring, cchBuffer * sizeof( WCHAR )); 349 349 if(rc) { 350 lstrcpyAtoW(lpszBuffer, astring);350 lstrcpynAtoW(lpszBuffer, astring, cchBuffer); 351 351 } 352 352 else lpszBuffer[0] = 0; //necessary? 353 return rc;354 } 355 //****************************************************************************** 356 //****************************************************************************** 353 return lstrlenW( lpszBuffer ); 354 } 355 //****************************************************************************** 356 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.