#ifndef __LOCALTYPES_H
#define __LOCALTYPES_H

#ifdef __cplusplus
extern "C" {
#endif


/******************************************
 * Basic Type Definitions in Windows XP/2000
 ******************************************/

#if !defined(DWORD)
    typedef unsigned long           DWORD;
#endif

#if !defined(WORD)
    typedef unsigned short          WORD;
#endif

#if !defined(BYTE)
    typedef unsigned char           BYTE;
#endif

#if !defined(UCHAR)
    typedef unsigned char           UCHAR;
#endif

#if !defined(PUCHAR)
    typedef unsigned char*          PUCHAR;
#endif

#if !defined(ULONG)
    typedef unsigned long           ULONG;
#endif

#if !defined(LONG)
    typedef signed long             LONG;
#endif

#if !defined(SHORT)
    typedef signed short            SHORT;
#endif

#if !defined(USHORT)
    typedef unsigned short          USHORT;
#endif

#if !defined(BOOL)
    typedef unsigned char           BOOL;
#endif

#if !defined(BOOLEAN)
    typedef enum { FALSE, TRUE }    BOOLEAN;
#endif



#if !defined(INVALID_HANDLE_VALUE)
#    define  INVALID_HANDLE_VALUE  -1
#endif

/******************************************
 * Basic Type Definitions
 ******************************************/
#if !defined(VOID)
    typedef void                    VOID;
#endif

#if !defined(PVOID)
    typedef void*                   PVOID;
#endif

#if !defined(S8)
    typedef signed char             S8;
#endif

#if !defined(U8)
    typedef unsigned char           U8;
#endif

#if !defined(S16)
    typedef signed short            S16;
#endif

#if !defined(U16)
    typedef unsigned short          U16;
#endif

#if !defined(S32)
    typedef signed long             S32;
#endif

#if !defined(U32)
    typedef unsigned long           U32;
#endif

#if !defined(LONGLONG)
    typedef signed long long        LONGLONG;
#endif

#if !defined(ULONGLONG)
    typedef unsigned long long      ULONGLONG;
#endif


/******************************************
 * Volatile Type Definitions
 ******************************************/
#if !defined(S8)
    typedef volatile signed char        VS8;
#endif

#if !defined(U8)
    typedef volatile unsigned char      VU8;
#endif

#if !defined(VS16)
    typedef volatile signed short       VS16;
#endif

#if !defined(VU16)
    typedef volatile unsigned short     VU16;
#endif

#if !defined(VS32)
    typedef volatile signed long        VS32;
#endif

#if !defined(VU32)
    typedef volatile unsigned long      VU32;
#endif

#if !defined(VLONGLONG)
    typedef volatile LONGLONG           VLONGLONG;
#endif

#if !defined(VULONGLONG)
    typedef volatile ULONGLONG          VULONGLONG;
#endif

#if !defined(VS64)
    typedef struct _VS64
    {
        struct
        {
            VU32  LowPart;
            VS32  HighPart;
        }u;

        VLONGLONG QuadPart;
    } VS64;
#endif

#if !defined(VU64)
    typedef struct _VU64
    {
        struct
        {
            VU32  LowPart;
            VU32  HighPart;
        }u;

        VULONGLONG QuadPart;
    } VU64;
#endif



/******************************************
 * Other definitions
 ******************************************/

#if !defined(NULL)
    #define NULL                    ((VOID *) 0x0)
#endif

#if !defined(TRUE)
    #define TRUE                    1
#endif

#if !defined(FALSE)
    #define FALSE                   0
#endif



#ifdef __cplusplus
}
#endif

#endif
