ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

user_x.h
Go to the documentation of this file.
00001 
00002 static __inline PVOID
00003 SharedPtrToUser(PVOID Ptr)
00004 {
00005     ASSERT(Ptr != NULL);
00006     ASSERT(g_ulSharedDelta != 0);
00007     return (PVOID)((ULONG_PTR)Ptr - g_ulSharedDelta);
00008 }
00009 
00010 static __inline PVOID
00011 DesktopPtrToUser(PVOID Ptr)
00012 {
00013     PCLIENTINFO pci;
00014     PDESKTOPINFO pdi;
00015     GetW32ThreadInfo();
00016     pci = GetWin32ClientInfo();
00017     pdi = pci->pDeskInfo;
00018 
00019     ASSERT(Ptr != NULL);
00020     ASSERT(pdi != NULL);
00021     if ((ULONG_PTR)Ptr >= (ULONG_PTR)pdi->pvDesktopBase &&
00022         (ULONG_PTR)Ptr < (ULONG_PTR)pdi->pvDesktopLimit)
00023     {
00024         return (PVOID)((ULONG_PTR)Ptr - pci->ulClientDelta);
00025     }
00026     else
00027     {
00028         /* NOTE: This is slow as it requires a call to win32k. This should only be
00029                  neccessary if a thread wants to access an object on a different
00030                  desktop */
00031         return (PVOID)NtUserxGetDesktopMapping(Ptr);
00032     }
00033 }
00034 
00035 static __inline BOOL
00036 IsThreadHooked(PCLIENTINFO pci)
00037 {
00038     return (pci->fsHooks|pci->pDeskInfo->fsHooks) != 0;
00039 }
00040 
00041 static __inline PDESKTOPINFO
00042 GetThreadDesktopInfo(VOID)
00043 {
00044     PTHREADINFO ti;
00045     PDESKTOPINFO di = NULL;
00046 
00047     ti = GetW32ThreadInfo();
00048     if (ti != NULL)
00049         di = GetWin32ClientInfo()->pDeskInfo;
00050 
00051     return di;
00052 }
00053 
00054 static __inline BOOL
00055 IsCallProcHandle(IN WNDPROC lpWndProc)
00056 {
00057     /* FIXME - check for 64 bit architectures... */
00058     return ((ULONG_PTR)lpWndProc & 0xFFFF0000) == 0xFFFF0000;
00059 }
00060 
00061 #define STATIC_UISTATE_GWL_OFFSET (sizeof(HFONT)+sizeof(HICON))// see UISTATE_GWL_OFFSET in static.c
00062 
00063 /* Retrieve the UI state for the control */
00064 static __inline BOOL STATIC_update_uistate(HWND hwnd, BOOL unicode)
00065 {
00066     LONG flags, prevflags;
00067 
00068     if (unicode)
00069         flags = DefWindowProcW(hwnd, WM_QUERYUISTATE, 0, 0);
00070     else
00071         flags = DefWindowProcA(hwnd, WM_QUERYUISTATE, 0, 0);
00072 
00073     prevflags = GetWindowLongW(hwnd, STATIC_UISTATE_GWL_OFFSET);
00074 
00075     if (prevflags != flags)
00076     {
00077         SetWindowLongW(hwnd, STATIC_UISTATE_GWL_OFFSET, flags);
00078         return TRUE;
00079     }
00080 
00081     return FALSE;
00082 }
00083 
00084 static __inline void LoadUserApiHook()
00085 {
00086    if (!gfServerProcess &&                                
00087        !IsInsideUserApiHook() &&                          
00088        (gpsi->dwSRVIFlags & SRVINFO_APIHOOK) &&           
00089        !RtlIsThreadWithinLoaderCallout())                 
00090    {                                                      
00091       NtUserCallNoParam(NOPARAM_ROUTINE_LOADUSERAPIHOOK); 
00092    }                                                      
00093 }
00094 
00095 #define UserHasDlgFrameStyle(Style, ExStyle)                                   \
00096  (((ExStyle) & WS_EX_DLGMODALFRAME) ||                                         \
00097   (((Style) & WS_DLGFRAME) && (!((Style) & WS_THICKFRAME))))
00098 
00099 #define UserHasThickFrameStyle(Style, ExStyle)                                 \
00100   (((Style) & WS_THICKFRAME) &&                                                \
00101    (!(((Style) & (WS_DLGFRAME | WS_BORDER)) == WS_DLGFRAME)))
00102 
00103 #define UserHasThinFrameStyle(Style, ExStyle)                                  \
00104   (((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP))))
00105 
00106 /* macro for source compatibility with wine */
00107 #define WIN_GetFullHandle(h) ((HWND)(h))
00108 
00109 #define HOOKID_TO_FLAG(HookId) (1 << ((HookId) + 1))
00110 #define ISITHOOKED(HookId) (GetWin32ClientInfo()->fsHooks & HOOKID_TO_FLAG(HookId) ||\
00111                            (GetWin32ClientInfo()->pDeskInfo && GetWin32ClientInfo()->pDeskInfo->fsHooks & HOOKID_TO_FLAG(HookId)))
00112                            

Generated on Sun May 27 2012 04:38:41 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.