00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
#if !defined(_WIN64) && !defined(BUILD_WOW6432)
00014
00015 #define StartValidateHandleMacro(h) \
00016
{ \
00017
PHE phe; \
00018
DWORD dw; \
00019
WORD uniq; \
00020
\
00021
00022
00023
00024 \
00025 dw = HMIndexFromHandle(h); \
00026 \
00027
00028
00029 \
00030 if (dw < gpsi->cHandleEntries) { \
00031
00032
00033
00034
00035
00036
00037 \
00038 phe = &gSharedInfo.aheList[dw]; \
00039 uniq = HMUniqFromHandle(h); \
00040 if ( uniq == phe->wUniq \
00041 || uniq == 0 \
00042 || uniq == HMUNIQBITS \
00043 ) { \
00044
00045
#else
00046
00047
#define StartValidateHandleMacro(h) \
00048
{ \
00049
PHE phe; \
00050
DWORD dw; \
00051
WORD uniq; \
00052
\
00053
00054
00055
00056 \
00057 dw = HMIndexFromHandle(h); \
00058 \
00059
00060
00061 \
00062 if (dw < gpsi->cHandleEntries) { \
00063
00064
00065
00066
00067
00068
00069
00070 \
00071 phe = &gSharedInfo.aheList[dw]; \
00072 uniq = HMUniqFromHandle(h); \
00073 if ( uniq == phe->wUniq \
00074 || uniq == HMUNIQBITS \
00075 ) { \
00076
00077
#endif
00078
00079
#define BeginAliveValidateHandleMacro() \
00080
00081
00082
00083 \
00084 if (!(phe->bFlags & HANDLEF_DESTROY)) { \
00085
00086
00087
#define EndAliveValidateHandleMacro() \
00088
} else { \
00089 RIPMSG2(RIP_WARNING, "ValidateAliveHandle: Object phe %#p is destroyed. Handle: %#p", \
00090
phe, h); \
00091
} \
00092
00093
00094
#define BeginTypeValidateHandleMacro(pobj, bTypeTest) \
00095
00096
00097
00098
00099 \
00100 if ((phe->bType == bTypeTest) || \
00101 (bTypeTest == TYPE_GENERIC && phe->bType != TYPE_FREE)) { \
00102 \
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112 \
00113 pobj = phe->phead; \
00114 { \
00115
00116
#define EndTypeValidateHandleMacro \
00117
} \
00118
} \
00119
00120
#define EndValidateHandleMacro \
00121
} \
00122
} \
00123
}