mirror of https://github.com/tongzx/nt5src
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.
48 lines
1.3 KiB
48 lines
1.3 KiB
|
|
// ************************************************************************
|
|
//
|
|
// JCOHEN.H
|
|
//
|
|
// Microsoft Confidential
|
|
// Copyright (c) Microsoft Corporation 1998
|
|
// All rights reserved
|
|
//
|
|
// Contains common include files, macros, and other stuff I use
|
|
// all the time.
|
|
//
|
|
// ************************************************************************
|
|
|
|
|
|
#ifndef _JCOHEN_H_
|
|
#define _JCOHEN_H_
|
|
|
|
|
|
//
|
|
// Include files
|
|
//
|
|
|
|
#include <windows.h>
|
|
|
|
#define NULLSTR _T("")
|
|
#define NULLCHR _T('\0')
|
|
|
|
//
|
|
// Macros.
|
|
//
|
|
|
|
// Memory managing macros.
|
|
//
|
|
#define MALLOC(cb) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cb)
|
|
#define REALLOC(lp, cb) HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, lp, cb)
|
|
#define FREE(lp) ( (lp != NULL) ? ( (HeapFree(GetProcessHeap(), HEAP_NO_SERIALIZE, (LPVOID) lp)) ? ((lp = NULL) == NULL) : (FALSE) ) : (FALSE) )
|
|
#define NETFREE(lp) ( (lp != NULL) ? ( (NetApiBufferFree((LPVOID) lp)) ? ((lp = NULL) == NULL) : (FALSE) ) : (FALSE) )
|
|
|
|
// Misc. macros.
|
|
//
|
|
#define EXIST(lpFileName) ( (GetFileAttributes(lpFileName) == 0xFFFFFFFF) ? (FALSE) : (TRUE) )
|
|
#define ISNUM(cChar) ((cChar >= '0') && (cChar <= '9')) ? (TRUE) : (FALSE)
|
|
#define UPPER(x) ( ( (x >= 'a') && (x <= 'z') ) ? (x + 'A' - 'a') : (x) )
|
|
#define RANDOM(low, high) (high - low + 1) ? rand() % (high - low + 1) + low : 0
|
|
|
|
|
|
#endif // _JCOHEN_H_
|