You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
4.9 KiB
1 lines
4.9 KiB
// ===========================================================================
// macwindefs.h © 2002 Microsoft Corp. All rights reserved.
// ===========================================================================
// Aid for porting windows functions/files to compile on the Mac.
//
#ifndef _MAC_MACWINDEFS_H_INCLUDE_
#define _MAC_MACWINDEFS_H_INCLUDE_
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef MAC
#define MAC
#endif
#define _MAC 1
#ifdef __POWERPC__
#define MPPC 1
#endif // __POWERPC__
// Calling convention defaults to MetroWerks Standard
#ifndef RSA32API
#define RSA32API
#endif
#define NTSYSAPI
#define NTAPI
#define __cdecl
#define __loadds
#define __stdcall
#define __far
#define __pascal
#define __int64 long long
// Common Windows types
#define HANDLE void*
#define FAR
#define IN
#define OUT
#define UNALIGNED
#define OPTIONAL
#define FARPROC void*
#define SEC_FAR
#define FAR
#ifndef CONST
#ifdef __cplusplus
#define CONST const
#else // !__cplusplus
#define CONST
#endif // __cplusplus
#endif //CONST
#define HEAP_ZERO_MEMORY 0x00000001
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif // TRUE
#ifndef NULL
#define NULL (0)
#endif //NULL
#define UNICODE_NULL ((WCHAR)0)
#define TEXT(x) x
#define UNALIGNED
#define _fstrcmp strcmp
#define _fstrcpy strcpy
#define _fstrlen strlen
#define _fstrncmp strncmp
#define _fmemcpy memcpy
#define _fmemset memset
#define _fmemcmp memcmp
#define MoveMemory memmove
#define CopyMemory memcpy
#define ZeroMemory(_pb, _cb) memset(_pb, 0, _cb)
#define FillMemory(_pb, _cb, _val) memset(_pb, _val, _cb)
#define MAXUSHORT (0xffff)
#define MAXLONGLONG (0x7fffffffffffffff)
#define POINTER_32
#define FIRMWARE_PTR POINTER_32
#ifndef lstrlenA
#define lstrlenA strlen
#endif
#ifndef lstrcat
#define lstrcat strcat
#endif
#ifndef wvsprintfA
#define wvsprintfA vsprintf
#endif
typedef long NTSTATUS;
#ifndef NT_SUCCESS
#define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0)
#endif //NT_SUCCESS
//
// C_ASSERT() can be used to perform many compile-time assertions:
// type sizes, field offsets, etc.
//
// An assertion failure results in error C2118: negative subscript.
//
#define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1]
#define ALIGN_WCHAR sizeof(WCHAR)
// BOOL
// COUNT_IS_ALIGNED(
// IN DWORD Count,
// IN DWORD Pow2 // undefined if this isn't a power of 2.
// );
//
#define COUNT_IS_ALIGNED(Count,Pow2) \
( ( ( (Count) & (((Pow2)-1)) ) == 0) ? TRUE : FALSE )
//============================================================================
// Standard Windows Type Defs
//============================================================================
typedef unsigned char BOOL;
typedef char CHAR;
typedef const char *PCSZ;
typedef unsigned char UCHAR, BYTE, *PBYTE, *LPBYTE;
typedef short SHORT;
typedef unsigned short USHORT, WORD;
typedef long LONG, *PLONG, *LPLONG;
typedef unsigned long ULONG;
typedef unsigned long DWORD, *LPDWORD;
typedef unsigned short WCHAR;
typedef void *PVOID, *LPVOID;
typedef void VOID;
typedef PVOID PSID;
typedef LONG HRESULT;
typedef UCHAR BOOLEAN;
typedef BOOLEAN *PBOOLEAN;
typedef WCHAR *PWCHAR;
typedef WCHAR *LPWCH, *PWCH;
typedef CONST WCHAR *LPCWCH, *PCWCH;
typedef WCHAR *NWPSTR;
typedef WCHAR *LPWSTR, *PWSTR;
typedef CONST WCHAR *LPCWSTR, *PCWSTR;
typedef CHAR *PCHAR;
typedef CHAR *LPCH, *PCH;
typedef CONST CHAR *LPCCH, *PCCH;
typedef CHAR *NPSTR;
typedef CHAR *LPSTR, *PSTR;
typedef CONST CHAR *LPCSTR, *PCSTR;
typedef UCHAR *PUCHAR;
typedef USHORT *PUSHORT;
typedef ULONG *PULONG;
typedef unsigned long ULONG_PTR, *PULONG_PTR;
typedef int INT;
typedef unsigned __int64 DWORDLONG, *LPDWORDLONG;
typedef unsigned __int64 ULONGLONG, ULONG64, PULONG64, *LPULONGLONG;
typedef __int64 LONGLONG, *LPLONGLONG;
typedef struct _LUID {
ULONG LowPart;
LONG HighPart;
} LUID, *PLUID;
typedef union _LARGE_INTEGER {
struct {
LONG HighPart;
DWORD LowPart;
}u;
LONGLONG QuadPart;
} LARGE_INTEGER;
typedef union _ULARGE_INTEGER {
struct {
ULONG LowPart;
ULONG HighPart;
}u;
ULONGLONG QuadPart;
} ULARGE_INTEGER, *PULARGE_INTEGER;
typedef struct _STRING32
{
USHORT Length;
USHORT MaximumLength;
ULONG Buffer;
}STRING32;
typedef STRING32 *PSTRING32;
typedef struct _STRING
{
USHORT Length;
USHORT MaximumLength;
PCHAR Buffer;
}STRING, *PSTRING;
typedef STRING ANSI_STRING, *PANSI_STRING;
typedef PSTRING PCANSI_STRING;
#ifndef _FILETIME_
#define _FILETIME_
typedef struct _FILETIME {
DWORD dwLowDateTime;
DWORD dwHighDateTime;
} FILETIME, *PFILETIME;
#endif // _FILETIME_
typedef struct _MAC_FILETIME {
DWORD dwHighDateTime;
DWORD dwLowDateTime;
}MACFILETIME, *PMACFILETIME;
#endif _MAC_MACWINDEFS_H_INCLUDE_
|