Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

wow.h

Go to the documentation of this file.
00001 /****************************** Module Header ******************************\ 00002 * Module Name: wow.h 00003 * 00004 * Copyright (c) 1985 - 1999, Microsoft Corporation 00005 * 00006 * This header file contains macros to be used in rtl\wow.c client\ and kernel\ 00007 * 00008 * History: 00009 * 22-AUG-97 CLupu created 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 * This is a macro that does an AND with HMINDEXBITS, \ 00023 * so it is fast. \ 00024 */ \ 00025 dw = HMIndexFromHandle(h); \ 00026 \ 00027 /* \ 00028 * Make sure it is part of our handle table. \ 00029 */ \ 00030 if (dw < gpsi->cHandleEntries) { \ 00031 /* \ 00032 * Make sure it is the handle \ 00033 * the app thought it was, by \ 00034 * checking the uniq bits in \ 00035 * the handle against the uniq \ 00036 * bits in the handle entry. \ 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 /* _WIN64 */ 00046 00047 #define StartValidateHandleMacro(h) \ 00048 { \ 00049 PHE phe; \ 00050 DWORD dw; \ 00051 WORD uniq; \ 00052 \ 00053 /* \ 00054 * This is a macro that does an AND with HMINDEXBITS, \ 00055 * so it is fast. \ 00056 */ \ 00057 dw = HMIndexFromHandle(h); \ 00058 \ 00059 /* \ 00060 * Make sure it is part of our handle table. \ 00061 */ \ 00062 if (dw < gpsi->cHandleEntries) { \ 00063 /* \ 00064 * Make sure it is the handle \ 00065 * the app thought it was, by \ 00066 * checking the uniq bits in \ 00067 * the handle against the uniq \ 00068 * bits in the handle entry. \ 00069 * For Win64 uniq can't be zero! \ 00070 */ \ 00071 phe = &gSharedInfo.aheList[dw]; \ 00072 uniq = HMUniqFromHandle(h); \ 00073 if ( uniq == phe->wUniq \ 00074 || uniq == HMUNIQBITS \ 00075 ) { \ 00076 00077 #endif /* _WIN64 */ 00078 00079 #define BeginAliveValidateHandleMacro() \ 00080 /* \ 00081 * Now make sure that the handle is not destroyed. On free \ 00082 * builds the RIP disappears and the main line is straightthrough. \ 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 * Now make sure the app is passing the right handle \ 00097 * type for this api. If the handle is TYPE_FREE, this'll \ 00098 * catch it. Also let Generic requests through. \ 00099 */ \ 00100 if ((phe->bType == bTypeTest) || \ 00101 (bTypeTest == TYPE_GENERIC && phe->bType != TYPE_FREE)) { \ 00102 \ 00103 /* \ 00104 * Instead of try/except we use the heap range check \ 00105 * mechanism to verify that the given 'pwnd' belongs to \ 00106 * the default desktop. We also have to do a Win 3.1 like \ 00107 * check to make sure the window is not deleted \ 00108 * See NT bug 12242 Kitchen app. Also 6479 \ 00109 * \ 00110 * TESTDESKOP returns the handle if the handle is valid \ 00111 * in the current desktop \ 00112 */ \ 00113 pobj = phe->phead; \ 00114 { \ 00115 00116 #define EndTypeValidateHandleMacro \ 00117 } \ 00118 } \ 00119 00120 #define EndValidateHandleMacro \ 00121 } \ 00122 } \ 00123 }

Generated on Sat May 15 19:42:27 2004 for test by doxygen 1.3.7