Add INVALID_ATOM and MAXINTATOM to winbase.h.

Replace MIN_STR_ATOM with MAXINTATOM.
This commit is contained in:
Francois Gouget 2001-10-15 17:49:23 +00:00 committed by Alexandre Julliard
parent 386cf6e342
commit 541ff5fb9f
2 changed files with 11 additions and 9 deletions

View file

@ -409,6 +409,8 @@ typedef struct
#define GHND (GMEM_MOVEABLE | GMEM_ZEROINIT) #define GHND (GMEM_MOVEABLE | GMEM_ZEROINIT)
#define GPTR (GMEM_FIXED | GMEM_ZEROINIT) #define GPTR (GMEM_FIXED | GMEM_ZEROINIT)
#define INVALID_ATOM ((ATOM)0)
#define MAXINTATOM 0xc000
#define MAKEINTATOMA(atom) ((LPCSTR)((ULONG_PTR)((WORD)(atom)))) #define MAKEINTATOMA(atom) ((LPCSTR)((ULONG_PTR)((WORD)(atom))))
#define MAKEINTATOMW(atom) ((LPCWSTR)((ULONG_PTR)((WORD)(atom)))) #define MAKEINTATOMW(atom) ((LPCWSTR)((ULONG_PTR)((WORD)(atom))))
#define MAKEINTATOM WINELIB_NAME_AW(MAKEINTATOM) #define MAKEINTATOM WINELIB_NAME_AW(MAKEINTATOM)

View file

@ -19,6 +19,7 @@
#include <ctype.h> #include <ctype.h>
#include "windef.h" #include "windef.h"
#include "winbase.h"
#include "winerror.h" #include "winerror.h"
#include "wine/server.h" #include "wine/server.h"
@ -33,7 +34,6 @@
DEFAULT_DEBUG_CHANNEL(atom); DEFAULT_DEBUG_CHANNEL(atom);
#define DEFAULT_ATOMTABLE_SIZE 37 #define DEFAULT_ATOMTABLE_SIZE 37
#define MIN_STR_ATOM 0xc000
#define MAX_ATOM_LEN 255 #define MAX_ATOM_LEN 255
#define ATOMTOHANDLE(atom) ((HANDLE16)(atom) << 2) #define ATOMTOHANDLE(atom) ((HANDLE16)(atom) << 2)
@ -129,7 +129,7 @@ static BOOL ATOM_IsIntAtomA(LPCSTR atomstr,WORD *atomid)
} }
if (*atomstr) return FALSE; if (*atomstr) return FALSE;
} }
if (!atom || (atom >= MIN_STR_ATOM)) if (!atom || (atom >= MAXINTATOM))
{ {
SetLastError( ERROR_INVALID_PARAMETER ); SetLastError( ERROR_INVALID_PARAMETER );
atom = 0; atom = 0;
@ -156,7 +156,7 @@ static BOOL ATOM_IsIntAtomW(LPCWSTR atomstr,WORD *atomid)
} }
if (*atomstr) return FALSE; if (*atomstr) return FALSE;
} }
if (!atom || (atom >= MIN_STR_ATOM)) if (!atom || (atom >= MAXINTATOM))
{ {
SetLastError( ERROR_INVALID_PARAMETER ); SetLastError( ERROR_INVALID_PARAMETER );
atom = 0; atom = 0;
@ -218,7 +218,7 @@ WORD WINAPI InitAtomTable16( WORD entries )
*/ */
HANDLE16 WINAPI GetAtomHandle16( ATOM atom ) HANDLE16 WINAPI GetAtomHandle16( ATOM atom )
{ {
if (atom < MIN_STR_ATOM) return 0; if (atom < MAXINTATOM) return 0;
return ATOMTOHANDLE( atom ); return ATOMTOHANDLE( atom );
} }
@ -299,7 +299,7 @@ ATOM WINAPI DeleteAtom16( ATOM atom )
HANDLE16 entry, *prevEntry; HANDLE16 entry, *prevEntry;
WORD hash; WORD hash;
if (atom < MIN_STR_ATOM) return 0; /* Integer atom */ if (atom < MAXINTATOM) return 0; /* Integer atom */
if (CURRENT_DS == ATOM_UserDS) return GlobalDeleteAtom( atom ); if (CURRENT_DS == ATOM_UserDS) return GlobalDeleteAtom( atom );
TRACE("0x%x\n",atom); TRACE("0x%x\n",atom);
@ -380,7 +380,7 @@ UINT16 WINAPI GetAtomName16( ATOM atom, LPSTR buffer, INT16 count )
TRACE("%x\n",atom); TRACE("%x\n",atom);
if (!count) return 0; if (!count) return 0;
if (atom < MIN_STR_ATOM) if (atom < MAXINTATOM)
{ {
sprintf( text, "#%d", atom ); sprintf( text, "#%d", atom );
len = strlen(text); len = strlen(text);
@ -516,7 +516,7 @@ ATOM WINAPI AddAtomW( LPCWSTR str )
static ATOM ATOM_DeleteAtom( ATOM atom, BOOL local) static ATOM ATOM_DeleteAtom( ATOM atom, BOOL local)
{ {
TRACE( "(%s) %x\n", local ? "local" : "global", atom ); TRACE( "(%s) %x\n", local ? "local" : "global", atom );
if (atom < MIN_STR_ATOM) atom = 0; if (atom < MAXINTATOM) atom = 0;
else else
{ {
SERVER_START_REQ( delete_atom ) SERVER_START_REQ( delete_atom )
@ -666,7 +666,7 @@ static UINT ATOM_GetAtomNameA( ATOM atom, LPSTR buffer, INT count, BOOL local )
SetLastError( ERROR_MORE_DATA ); SetLastError( ERROR_MORE_DATA );
return 0; return 0;
} }
if (atom < MIN_STR_ATOM) if (atom < MAXINTATOM)
{ {
char name[8]; char name[8];
if (!atom) if (!atom)
@ -751,7 +751,7 @@ static UINT ATOM_GetAtomNameW( ATOM atom, LPWSTR buffer, INT count, BOOL local )
SetLastError( ERROR_MORE_DATA ); SetLastError( ERROR_MORE_DATA );
return 0; return 0;
} }
if (atom < MIN_STR_ATOM) if (atom < MAXINTATOM)
{ {
char name[8]; char name[8];
if (!atom) if (!atom)