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

cltxt.h File Reference

#include "ntsend.h"
#include "powrprof.h"

Go to the source code of this file.

Defines

#define IS_ANSI   TRUE

Typedefs

typedef BOOLEAN(* PFNGETACTIVEPWRSCHEME )(PUINT)
typedef BOOLEAN(* PFNSETACTIVEPWRSCHEME )(UINT, PGLOBAL_POWER_POLICY, PPOWER_POLICY)
typedef BOOLEAN(* PFNREADPWRSCHEME )(UINT, PPOWER_POLICY)

Functions

HWND WINAPI CreateWindowEx (DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hModule, LPVOID lpParam)
LONG_PTR APIENTRY GetWindowLongPtr (HWND hwnd, int nIndex)
LONG_PTR APIENTRY SetWindowLongPtr (HWND hWnd, int nIndex, LONG_PTR dwNewLong)
ULONG_PTR APIENTRY GetClassLongPtr (HWND hWnd, int nIndex)
BOOL APIENTRY PeekMessage (LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
LRESULT APIENTRY DefWindowProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY SendMessage (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY SendMessageTimeout (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, UINT fuFlags, UINT uTimeout, PULONG_PTR lpdwResult)
LRESULT WINAPI SendDlgItemMessage (HWND hwnd, int id, UINT message, WPARAM wParam, LPARAM lParam)
UINT GetDlgItemText (HWND hwnd, int id, LPTSTR lpch, int cchMax)
BOOL SetDlgItemText (HWND hwnd, int id, LPCTSTR lpch)
int WINAPI GetWindowText (HWND hwnd, LPTSTR lpName, int nMaxCount)
int WINAPI GetWindowTextLength (HWND hwnd)
BOOL WINAPI SetWindowText (HWND hwnd, LPCTSTR pString)
LRESULT APIENTRY DispatchMessage (CONST MSG *lpMsg)
BOOL SetVideoTimeout (DWORD dwVideoTimeout)
BOOL APIENTRY SystemParametersInfo (UINT wFlag, UINT wParam, PVOID lParam, UINT flags)
HANDLE APIENTRY GetProp (HWND hwnd, LPCTSTR pString)
int GetMenuString (HMENU hMenu, UINT wID, LPTSTR lpsz, int cchMax, UINT flags)
BOOL GetMenuItemInfo (HMENU hMenu, UINT wID, BOOL fByPos, LPMENUITEMINFO lpmii)
BOOL SetMenuItemInfo (HMENU hMenu, UINT uID, BOOL fByPosition, LPCMENUITEMINFO lpmii)
BOOL InsertMenuItem (HMENU hMenu, UINT uID, BOOL fByPosition, LPCMENUITEMINFO lpmii)
BOOL InsertMenu (HMENU hMenu, UINT uPosition, UINT uFlags, UINT_PTR uIDNewItem, LPCTSTR lpNewItem)
BOOL AppendMenu (HMENU hMenu, UINT uFlags, UINT_PTR uIDNewItem, LPCTSTR lpNewItem)
BOOL ModifyMenu (HMENU hMenu, UINT uPosition, UINT uFlags, UINT_PTR uIDNewItem, LPCTSTR lpNewItem)
WINUSERAPI LONG BroadcastSystemMessage (DWORD dwFlags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam)
WINUSERAPI UINT WINAPI GetWindowModuleFileName (HWND hwnd, LPTSTR pszFileName, UINT cchFileNameMax)
WINUSERAPI HDEVNOTIFY WINAPI RegisterDeviceNotification (IN HANDLE hRecipient, IN LPVOID NotificationFilter, IN DWORD Flags)
BOOL WINUSERAPI GetMonitorInfo (HMONITOR hMonitor, LPMONITORINFO lpmi)

Variables

LRESULT TEXT_FN( fnHkINLPCWPSTRUCT )(PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, ULONG_PTR xParam)
LRESULT TEXT_FN( fnHkINLPCWPRETSTRUCT )(PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, ULONG_PTR xParam)
LRESULT TEXT_FN( DispatchHook )(int dw, WPARAM wParam, LPARAM lParam, HOOKPROC pfn)
ATOM WINAPI TEXT_FN( RegisterClass )(CONST WNDCLASS *lpWndClass)
ATOM WINAPI TEXT_FN( RegisterClassEx )(CONST WNDCLASSEX *lpWndClass)
BOOL TEXT_FN( GetMenuItemInfoInternal )(HMENU hMenu, UINT uID, BOOL fByPosition, LPMENUITEMINFOW lpInfo)


Define Documentation

#define IS_ANSI   TRUE
 

Definition at line 18 of file cltxt.h.

Referenced by AppendMenu(), BroadcastSystemMessage(), CreateWindowEx(), DefWindowProc(), DispatchMessage(), GetAltTabInfo(), GetClassInfo(), GetClassInfoEx(), GetClassLongPtr(), GetWindowLongPtr(), GetWindowText(), GetWindowTextLength(), InsertMenu(), InsertMenuItem(), ModifyMenu(), PeekMessage(), RegisterDeviceNotification(), SendMessage(), SendMessageTimeout(), SetClassLongPtr(), SetMenuItemInfo(), SetWindowLongPtr(), and SetWindowText().


Typedef Documentation

typedef BOOLEAN(* PFNGETACTIVEPWRSCHEME)(PUINT)
 

Definition at line 914 of file cltxt.h.

Referenced by SetVideoTimeout().

typedef BOOLEAN(* PFNREADPWRSCHEME)(UINT, PPOWER_POLICY)
 

Definition at line 916 of file cltxt.h.

Referenced by SetVideoTimeout().

typedef BOOLEAN(* PFNSETACTIVEPWRSCHEME)(UINT, PGLOBAL_POWER_POLICY, PPOWER_POLICY)
 

Definition at line 915 of file cltxt.h.

Referenced by SetVideoTimeout().


Function Documentation

BOOL AppendMenu HMENU  hMenu,
UINT  uFlags,
UINT_PTR  uIDNewItem,
LPCTSTR  lpNewItem
 

Definition at line 1734 of file cltxt.h.

References BOOL, IS_ANSI, MFMWFP_NOITEM, SetMenuItemInfoStruct(), ThunkedMenuItemInfo(), and TRUE.

Referenced by InitSystemMenu(), and WndProc().

01735 { 01736 MENUITEMINFOW miiLocal; 01737 01738 SetMenuItemInfoStruct(hMenu, uFlags, uIDNewItem, (LPWSTR)lpNewItem, &miiLocal); 01739 return ThunkedMenuItemInfo(hMenu, MFMWFP_NOITEM, MF_BYPOSITION, TRUE, (LPMENUITEMINFOW)&miiLocal, IS_ANSI); 01740 }

WINUSERAPI LONG BroadcastSystemMessage DWORD  dwFlags,
LPDWORD  lpdwRecipients,
UINT  uiMessage,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 1760 of file cltxt.h.

References BOOL, BroadcastSystemMessageWorker(), dwFlags, DWORD, IS_ANSI, and UINT.

Referenced by HandleMediaChangeEvent(), HandleRemoteNetDeviceChangeEvent(), and RemoteDoBroadcastSystemMessage().

01762 { 01763 extern LONG BroadcastSystemMessageWorker(DWORD dwFlags, LPDWORD lpdwRecipients, 01764 UINT uiMessage, WPARAM wParam, LPARAM lParam, BOOL fAnsi); 01765 01766 return BroadcastSystemMessageWorker(dwFlags, lpdwRecipients, 01767 uiMessage, wParam, lParam, IS_ANSI); 01768 }

HWND WINAPI CreateWindowEx DWORD  dwExStyle,
LPCTSTR  lpClassName,
LPCTSTR  lpWindowName,
DWORD  dwStyle,
int  X,
int  Y,
int  nWidth,
int  nHeight,
HWND  hWndParent,
HMENU  hMenu,
HINSTANCE  hModule,
LPVOID  lpParam
 

Definition at line 38 of file cltxt.h.

References _CreateWindowEx(), IS_ANSI, WS_EX_ANSICREATOR, and WS_EX_MDICHILD.

Referenced by CreateWindowsWindow(), and ImmCreateSoftKeyboard().

00051 { 00052 00053 #if 0 00054 /* 00055 * We use some of the undocumented bits in dwExStyle to mark a window 00056 * with certain attributes. Make sure this bits aren't turned on by 00057 * the app 00058 */ 00059 dwExStyle &= ~(WS_EX_MDICHILD | WS_EX_ANSICREATOR); 00060 #endif 00061 00062 return _CreateWindowEx(dwExStyle, lpClassName, lpWindowName, 00063 dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, 00064 hModule, lpParam, IS_ANSI); 00065 }

LRESULT APIENTRY DefWindowProc HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 629 of file cltxt.h.

References APIENTRY, DefWindowProcWorker(), IS_ANSI, NULL, and ValidateHwnd.

Referenced by ConsoleWindowProc(), CreateDestroyWndProc(), DDEMLClientWndProc(), DDEMLMotherWndProc(), DDEMLServerWndProc(), CResizeDlg::DlgProc(), MainWndProc(), ReaderWndProc(), SKWndProcC1(), SKWndProcT1(), WinHelpA(), and WndProc().

00630 { 00631 PWND pwnd; 00632 00633 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 00634 switch (message) { 00635 case WM_CTLCOLORBTN: 00636 case WM_CTLCOLORSTATIC: 00637 case WM_CTLCOLORDLG: 00638 case WM_CTLCOLORMSGBOX: 00639 00640 /* 00641 * Draw default colors 00642 */ 00643 break; 00644 default: 00645 return 0; 00646 } 00647 } 00648 00649 return DefWindowProcWorker(pwnd, message, wParam, lParam, IS_ANSI); 00650 }

LRESULT APIENTRY DispatchMessage CONST MSG *  lpMsg  ) 
 

Definition at line 874 of file cltxt.h.

References APIENTRY, BOOL, DispatchMessageWorker(), and IS_ANSI.

Referenced by ConsoleInputThread(), DdeClientTransaction(), DialogBox2(), DispatchMessageWorker(), ExitWindowsWorker(), IsDialogMessageW(), msProfDispatchMessage(), msProfMenu(), SendMessageDiffThreadFunc(), SmoothScrollWindowEx(), ThreadShutdownNotify(), WaitForZombieTerminate(), and WinMain().

00875 { 00876 extern LRESULT DispatchMessageWorker(CONST MSG *lpMsg, BOOL fAnsi); 00877 00878 return DispatchMessageWorker(lpMsg, IS_ANSI); 00879 }

ULONG_PTR APIENTRY GetClassLongPtr HWND  hWnd,
int  nIndex
 

Definition at line 440 of file cltxt.h.

References _GetClassLongPtr, APIENTRY, FALSE, hWnd, IS_ANSI, NULL, and ValidateHwnd.

Referenced by EndTaskDlgProc(), and msProfClassGroup().

00441 { 00442 PWND pwnd; 00443 00444 pwnd = ValidateHwnd(hWnd); 00445 00446 if (pwnd == NULL) 00447 return 0; 00448 00449 try { 00450 return _GetClassLongPtr(pwnd, nIndex, IS_ANSI); 00451 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00452 RIPERR1(ERROR_INVALID_WINDOW_HANDLE, 00453 RIP_WARNING, 00454 "Window %x no longer valid", 00455 hWnd); 00456 return 0; 00457 } 00458 }

UINT GetDlgItemText HWND  hwnd,
int  id,
LPTSTR  lpch,
int  cchMax
 

Definition at line 740 of file cltxt.h.

References GetDlgItem(), GetWindowText(), NULL, and UINT.

Referenced by EnterNew(), FileOpenHookProc(), FileSaveHookProc(), and FindDialogProc().

00745 { 00746 if ((hwnd = GetDlgItem(hwnd, id)) != NULL) { 00747 return GetWindowText(hwnd, lpch, cchMax); 00748 } 00749 00750 /* 00751 * If we couldn't find the window, just null terminate lpch so that the 00752 * app doesn't gp fault if it tries to run through the text. 00753 */ 00754 if (cchMax) 00755 *lpch = (TCHAR)0; 00756 00757 return 0; 00758 }

BOOL GetMenuItemInfo HMENU  hMenu,
UINT  wID,
BOOL  fByPos,
LPMENUITEMINFO  lpmii
 

Definition at line 1643 of file cltxt.h.

References BOOL, FALSE, GetMenuItemInfoInternal, MENUAPI_GET, NULL, TEXT_FN, TRUE, UINT, and ValidateMENUITEMINFO().

01644 { 01645 UINT cbCallercbSize = lpmii->cbSize; 01646 MENUITEMINFOW miiLocal; 01647 01648 01649 if (!ValidateMENUITEMINFO((LPMENUITEMINFOW)lpmii, &miiLocal, MENUAPI_GET)) { 01650 return FALSE; 01651 } 01652 01653 if (!TEXT_FN(GetMenuItemInfoInternal)(hMenu, wID, fByPos, &miiLocal)) { 01654 return FALSE; 01655 } 01656 01657 /* 01658 * Copy the structure and map old flags back. Only requested fields were 01659 * modified, so it's OK to copy all fields back. 01660 */ 01661 RtlCopyMemory(lpmii, &miiLocal, SIZEOFMENUITEMINFO95); 01662 lpmii->cbSize = cbCallercbSize; 01663 if (cbCallercbSize > SIZEOFMENUITEMINFO95) { 01664 lpmii->hbmpItem = miiLocal.hbmpItem; 01665 } 01666 01667 if (lpmii->fMask & MIIM_TYPE) { 01668 if ((miiLocal.hbmpItem != NULL) && (miiLocal.dwTypeData == NULL)) { 01669 lpmii->fType |= MFT_BITMAP; 01670 lpmii->dwTypeData = (LPTSTR)miiLocal.hbmpItem; 01671 } else if (miiLocal.cch == 0) { 01672 lpmii->dwTypeData = NULL; 01673 } 01674 lpmii->fMask &= ~(MIIM_FTYPE | MIIM_BITMAP | MIIM_STRING); 01675 } 01676 01677 return TRUE; 01678 }

int GetMenuString HMENU  hMenu,
UINT  wID,
LPTSTR  lpsz,
int  cchMax,
UINT  flags
 

Definition at line 1611 of file cltxt.h.

References BOOL, GetMenuItemInfoInternal, and TEXT_FN.

01612 { 01613 MENUITEMINFOW miiLocal; 01614 01615 miiLocal.fMask = MIIM_STRING; 01616 miiLocal.dwTypeData = (LPWSTR)lpsz; 01617 miiLocal.cch = cchMax; 01618 01619 if (cchMax != 0) { 01620 *lpsz = (TCHAR)0; 01621 } 01622 01623 if (TEXT_FN(GetMenuItemInfoInternal)(hMenu, wID, (BOOL)(flags & MF_BYPOSITION), &miiLocal)) { 01624 return miiLocal.cch; 01625 } else { 01626 return 0; 01627 } 01628 }

BOOL WINUSERAPI GetMonitorInfo HMONITOR  hMonitor,
LPMONITORINFO  lpmi
 

Definition at line 1824 of file cltxt.h.

References BOOL, FALSE, GetPrimaryMonitor(), NtUserCallTwoParam(), NULL, tagMONITOR::rcMonitor, tagMONITOR::rcWork, TRUE, and VALIDATEHMONITOR.

Referenced by GetWindowLimits(), and PositionConsoleWindow().

01825 { 01826 PMONITOR pMonitor; 01827 BOOL bRetVal; 01828 int cbSize; 01829 01830 pMonitor = VALIDATEHMONITOR(hMonitor); 01831 if (!pMonitor) { 01832 return FALSE; 01833 } 01834 01835 cbSize = lpmi->cbSize; 01836 if (cbSize == sizeof(MONITORINFO)) { 01837 /* 01838 * Check for this first, since it is the most 01839 * common size. All the work for filling in 01840 * MONITORINFO fields is done after the else-if 01841 * statements. 01842 */ 01843 01844 } else if (cbSize == sizeof(MONITORINFOEX)) { 01845 /* 01846 * The ANSI version has to translate the szDevice field 01847 */ 01848 ULONG_PTR pName; 01849 #if IS_ANSI 01850 WCHAR szDevice[CCHDEVICENAME]; 01851 pName = (ULONG_PTR)szDevice; 01852 #else 01853 pName = (ULONG_PTR)(((LPMONITORINFOEX)lpmi)->szDevice); 01854 #endif 01855 bRetVal = (BOOL)NtUserCallTwoParam((ULONG_PTR)(hMonitor), 01856 pName, 01857 SFI_GETHDEVNAME); 01858 if (!bRetVal) { 01859 return FALSE; 01860 } 01861 #if IS_ANSI 01862 WideCharToMultiByte( 01863 CP_ACP, 0, // ANSI -> Unicode 01864 (LPWSTR)pName, -1, // source & length 01865 (LPSTR)((LPMONITORINFOEX)lpmi)->szDevice, // destination & length 01866 sizeof(WCHAR)*CCHDEVICENAME, 01867 NULL, NULL); 01868 01869 #endif 01870 } else { 01871 RIPERR1(ERROR_INVALID_PARAMETER, 01872 RIP_WARNING, 01873 "Invalid lpmi->cbSize, %d", lpmi->cbSize); 01874 01875 return FALSE; 01876 } 01877 01878 lpmi->dwFlags = (pMonitor == GetPrimaryMonitor()) ? MONITORINFOF_PRIMARY : 0; 01879 lpmi->rcMonitor = pMonitor->rcMonitor; 01880 lpmi->rcWork = pMonitor->rcWork; 01881 01882 return TRUE; 01883 }

HANDLE APIENTRY GetProp HWND  hwnd,
LPCTSTR  pString
 

Definition at line 1387 of file cltxt.h.

References _GetProp(), APIENTRY, FALSE, IS_PTR, NULL, PTR_TO_ID, and ValidateHwnd.

Referenced by EndTaskDlgProc(), EndTaskModalDialog(), MB_DlgProcWorker(), MDIActivateDlgInit(), MDIActivateDlgProcWorker(), and MDIActivateDlgSize().

01387 { 01388 PWND pwnd; 01389 int iString; 01390 01391 if (IS_PTR(pString)) { 01392 iString = (int)GlobalFindAtom(pString); 01393 if (iString == 0) 01394 return NULL; 01395 } else 01396 iString = PTR_TO_ID(pString); 01397 01398 pwnd = ValidateHwnd(hwnd); 01399 01400 if (pwnd == NULL) 01401 return NULL; 01402 01403 return _GetProp(pwnd, (LPWSTR)UIntToPtr( iString ), FALSE); 01404 }

LONG_PTR APIENTRY GetWindowLongPtr HWND  hwnd,
int  nIndex
 

Definition at line 388 of file cltxt.h.

References _GetWindowLongPtr, APIENTRY, FALSE, IS_ANSI, NULL, and ValidateHwnd.

Referenced by _EndTask(), AbandonEnumerateProc(), ConnectConv(), DdeConnectList(), DdeDisconnectList(), DDEMLClientWndProc(), DDEMLMotherWndProc(), DDEMLServerWndProc(), DdePostAdvise(), DdeQueryNextServer(), DestroyC1Window(), DestroyT1Window(), DialogHookProc(), CPropertyPage::DialogProc(), CDialog::DialogProc(), EnableEnumProc(), EndTaskDlgProc(), FindDialogProc(), InitiateEnumerationProc(), MB_CopyToClipboard(), MDIChildWndProc(), ProcessDDEMLInitiate(), ProcessRegistrationMessage(), SetSKT1Data(), ShowSKC1Window(), SKC1ButtonUp(), SKC1MouseMove(), SKC1SetCursor(), SKT1ButtonUp(), SKT1MouseMove(), SKT1SetCursor(), SKWndProcC1(), SKWndProcT1(), ThreadShutdownNotify(), UnlinkConvFromOthers(), UpdateSKC1Window(), and UpdateSKT1Window().

00389 { 00390 PWND pwnd; 00391 00392 pwnd = ValidateHwnd(hwnd); 00393 00394 if (pwnd == NULL) 00395 return 0; 00396 00397 try { 00398 return _GetWindowLongPtr(pwnd, nIndex, IS_ANSI); 00399 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00400 RIPERR1(ERROR_INVALID_WINDOW_HANDLE, 00401 RIP_WARNING, 00402 "Window %x no longer valid", 00403 hwnd); 00404 return 0; 00405 } 00406 }

WINUSERAPI UINT WINAPI GetWindowModuleFileName HWND  hwnd,
LPTSTR  pszFileName,
UINT  cchFileNameMax
 

Definition at line 1771 of file cltxt.h.

References NULL, and ValidateHwnd.

01772 { 01773 PWND pwnd; 01774 01775 pwnd = ValidateHwnd(hwnd); 01776 01777 if (pwnd == NULL) { 01778 return 0; 01779 } 01780 01781 return GetModuleFileName(pwnd->hModule, pszFileName, cchFileNameMax); 01782 }

int WINAPI GetWindowText HWND  hwnd,
LPTSTR  lpName,
int  nMaxCount
 

Definition at line 781 of file cltxt.h.

References DefWindowProcWorker(), FALSE, IS_ANSI, NULL, SendMessageWorker(), TestWindowProcess(), and ValidateHwnd.

Referenced by EndTaskDlgProc(), GetApplicationText(), GetDlgItemText(), GetHardErrorText(), CString::Load(), SetWinText(), xxxGNM_FindNextMnem(), and xxxInitActivateDlg().

00785 { 00786 PWND pwnd; 00787 00788 /* 00789 * Don't try to fill a non-existent buffer 00790 */ 00791 if (lpName == NULL || nMaxCount == 0) { 00792 return 0; 00793 } 00794 00795 try { 00796 /* 00797 * Initialize string empty, in case SendMessage aborts validation 00798 */ 00799 *lpName = TEXT('\0'); 00800 00801 /* 00802 * Make sure we have a valid window. 00803 */ 00804 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 00805 return 0; 00806 } 00807 00808 /* 00809 * This process comparison is bogus, but it is what win3.1 does. 00810 */ 00811 if (TestWindowProcess(pwnd)) { 00812 return (int)SendMessageWorker(pwnd, WM_GETTEXT, nMaxCount, (LPARAM)lpName, IS_ANSI); 00813 } else { 00814 return (int)DefWindowProcWorker(pwnd, WM_GETTEXT, nMaxCount, (LPARAM)lpName, IS_ANSI); 00815 } 00816 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00817 RIPERR1(ERROR_INVALID_WINDOW_HANDLE, 00818 RIP_WARNING, 00819 "Window %x no longer valid", 00820 hwnd); 00821 return 0; 00822 } 00823 }

int WINAPI GetWindowTextLength HWND  hwnd  ) 
 

Definition at line 825 of file cltxt.h.

References DefWindowProcWorker(), IS_ANSI, NULL, SendMessageWorker(), TestWindowProcess(), and ValidateHwnd.

Referenced by GetHardErrorText(), and CString::Load().

00827 { 00828 PWND pwnd; 00829 00830 /* 00831 * Make sure we have a valid window. 00832 */ 00833 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 00834 return 0; 00835 } 00836 00837 /* 00838 * This process comparison is bogus, but it is what win3.1 does. 00839 */ 00840 if (TestWindowProcess(pwnd)) { 00841 return (int)SendMessageWorker(pwnd, WM_GETTEXTLENGTH, 0, 0, IS_ANSI); 00842 } else { 00843 return (int)DefWindowProcWorker(pwnd, WM_GETTEXTLENGTH, 0, 0, IS_ANSI); 00844 } 00845 }

BOOL InsertMenu HMENU  hMenu,
UINT  uPosition,
UINT  uFlags,
UINT_PTR  uIDNewItem,
LPCTSTR  lpNewItem
 

Definition at line 1720 of file cltxt.h.

References BOOL, IS_ANSI, SetMenuItemInfoStruct(), ThunkedMenuItemInfo(), and TRUE.

01721 { 01722 MENUITEMINFOW miiLocal; 01723 01724 SetMenuItemInfoStruct(hMenu, uFlags, uIDNewItem, (LPWSTR)lpNewItem, &miiLocal); 01725 return ThunkedMenuItemInfo(hMenu, uPosition, (BOOL) (uFlags & MF_BYPOSITION), TRUE, (LPMENUITEMINFOW)&miiLocal, IS_ANSI); 01726 }

BOOL InsertMenuItem HMENU  hMenu,
UINT  uID,
BOOL  fByPosition,
LPCMENUITEMINFO  lpmii
 

Definition at line 1702 of file cltxt.h.

References BOOL, FALSE, IS_ANSI, MENUAPI_SET, ThunkedMenuItemInfo(), TRUE, and ValidateMENUITEMINFO().

Referenced by ECSetIMEMenu().

01703 { 01704 01705 MENUITEMINFOW miiLocal; 01706 01707 if (!ValidateMENUITEMINFO((LPMENUITEMINFOW)lpmii, &miiLocal, MENUAPI_SET)) { 01708 return FALSE; 01709 } 01710 01711 return (ThunkedMenuItemInfo(hMenu, uID, fByPosition, TRUE, &miiLocal, IS_ANSI)); 01712 }

BOOL ModifyMenu HMENU  hMenu,
UINT  uPosition,
UINT  uFlags,
UINT_PTR  uIDNewItem,
LPCTSTR  lpNewItem
 

Definition at line 1747 of file cltxt.h.

References BOOL, FALSE, IS_ANSI, SetMenuItemInfoStruct(), and ThunkedMenuItemInfo().

01747 { 01748 MENUITEMINFOW miiLocal; 01749 01750 SetMenuItemInfoStruct(hMenu, uFlags, uIDNewItem, (LPWSTR)lpNewItem, &miiLocal); 01751 return ThunkedMenuItemInfo(hMenu, uPosition, (BOOL) (uFlags & MF_BYPOSITION), FALSE, (LPMENUITEMINFOW)&miiLocal, IS_ANSI); 01752 }

BOOL APIENTRY PeekMessage LPMSG  lpMsg,
HWND  hWnd,
UINT  wMsgFilterMin,
UINT  wMsgFilterMax,
UINT  wRemoveMsg
 

Definition at line 483 of file cltxt.h.

References _PeekMessage(), APIENTRY, BOOL, CalcWakeMask(), CSPINBACKGROUND, _CLIENTINFO::cSpins, tagCLIENTTHREADINFO::CTIF_flags, CTIF_SYSQUEUELOCKED, _CLIENTINFO::dwTIFlags, FALSE, tagCLIENTTHREADINFO::fsChangeBits, tagCLIENTTHREADINFO::fsWakeBits, GetCallBackDbcsInfo, GetClientInfo, gpsi, hWnd, IS_ANSI, IS_DBCS_ENABLED, NtGetTickCount(), NtUserGetThreadState(), NtYieldExecution(), NULL, _CLIENTINFO::pClientThreadInfo, TIF_16BIT, TIF_DELAYEDEVENT, TIF_FIRSTIDLE, TIF_SPINNING, TIF_WAITFORINPUTIDLE, tagCLIENTTHREADINFO::timeLastRead, and UINT.

Referenced by _PeekMessage(), ConsoleWindowProc(), DialogBox2(), ExitWindowsWorker(), HardErrorHandler(), msProfMenu(), SmoothScrollWindowEx(), ThreadShutdownNotify(), WaitForZombieTerminate(), and WinMain().

00489 { 00490 PCLIENTTHREADINFO pcti; 00491 PCLIENTINFO pci; 00492 UINT fsWakeMaskFilter; 00493 UINT fsWakeMask; 00494 UINT cSpinLimit; 00495 00496 pci = GetClientInfo(); 00497 00498 if (hWnd != NULL) { 00499 goto lbCallServer; 00500 } 00501 00502 #if IS_ANSI 00503 /* 00504 * If we have a DBCS TrailingByte that should be returned to App, 00505 * we should pass it, never can fail.... 00506 */ 00507 UserAssert(IS_DBCS_ENABLED() || GetCallBackDbcsInfo()->wParam == 0); 00508 if (GetCallBackDbcsInfo()->wParam) { // accesses fs:xxx, but no speed penalty 00509 /* 00510 * Check message filter... WM_CHAR should be in the Range... 00511 */ 00512 if ((!wMsgFilterMin && !wMsgFilterMax) || 00513 (wMsgFilterMin <= WM_CHAR && wMsgFilterMax >=WM_CHAR)) 00514 { 00515 goto lbCallServer; 00516 } 00517 } 00518 #endif 00519 00520 if ( (pci->dwTIFlags & TIF_16BIT) 00521 && !(wRemoveMsg & PM_NOYIELD) 00522 && ((gpsi->nEvents != 0) || (pci->dwTIFlags & (TIF_FIRSTIDLE | TIF_DELAYEDEVENT)))) { 00523 00524 goto lbCallServer; 00525 } 00526 00527 /* 00528 * If we can't see the client thread info, we need to go to the kernel. 00529 */ 00530 if ((pcti = pci->pClientThreadInfo) == NULL) { 00531 goto lbCallServer; 00532 } 00533 00534 fsWakeMaskFilter = HIWORD(wRemoveMsg); 00535 #if DBG 00536 /* 00537 * New for NT5: HIWORD(wRemoveMsg) contains a QS_ mask. This is 00538 * validated for real in the kernel side. 00539 */ 00540 if (fsWakeMaskFilter & ~QS_VALID) { 00541 RIPMSG1(RIP_WARNING, "PeekMessage: Invalid QS_ bits:%#lx", fsWakeMaskFilter); 00542 } 00543 #endif 00544 /* 00545 * If any appropriate input is available, we need to go to the kernel. 00546 */ 00547 if (wMsgFilterMax == 0 && fsWakeMaskFilter == 0) { 00548 fsWakeMask = (QS_ALLINPUT | QS_EVENT | QS_ALLPOSTMESSAGE); 00549 } else { 00550 fsWakeMask = CalcWakeMask(wMsgFilterMin, wMsgFilterMax, fsWakeMaskFilter); 00551 } 00552 if ((pcti->fsChangeBits | pcti->fsWakeBits) & fsWakeMask) { 00553 goto lbCallServer; 00554 } 00555 00556 /* 00557 * If this thread has the queue locked, we have to go to the kernel 00558 * or other threads on the same queue may be prevented from getting 00559 * input messages. 00560 */ 00561 if (pcti->CTIF_flags & CTIF_SYSQUEUELOCKED) { 00562 goto lbCallServer; 00563 } 00564 00565 /* 00566 * This is the peek message count (not going idle count). If it gets 00567 * to be 100 or greater, call the server. This'll cause this app to be 00568 * put at background priority until it sleeps. This is really important 00569 * for compatibility because win3.1 peek/getmessage usually takes a trip 00570 * through the win3.1 scheduler and runs the next task. 00571 */ 00572 pci->cSpins++; 00573 00574 if ((pci->cSpins >= CSPINBACKGROUND) && !(pci->dwTIFlags & TIF_SPINNING)) { 00575 goto lbCallServer; 00576 } 00577 00578 /* 00579 * We have to go to the server if someone is waiting on this event. 00580 * We used to just wait until the spin cound got large but for some 00581 * apps like terminal. They always just call PeekMessage and after 00582 * just a few calls they would blink their caret which bonks the spincount 00583 */ 00584 if (pci->dwTIFlags & TIF_WAITFORINPUTIDLE){ 00585 goto lbCallServer; 00586 } 00587 00588 /* 00589 * Make sure we go to the kernel at least once a second so that 00590 * hung app painting won't occur. 00591 */ 00592 if ((NtGetTickCount() - pcti->timeLastRead) > 1000) { 00593 NtUserGetThreadState(UserThreadStatePeekMessage); 00594 } 00595 00596 /* 00597 * Determine the maximum number of spins before we yield. Yields 00598 * are performed more frequently for 16 bit apps. 00599 */ 00600 if ((pci->dwTIFlags & TIF_16BIT) && !(wRemoveMsg & PM_NOYIELD)) { 00601 cSpinLimit = CSPINBACKGROUND / 10; 00602 } else { 00603 cSpinLimit = CSPINBACKGROUND; 00604 } 00605 00606 /* 00607 * If the PeekMessage() is just spinning, then we should sleep 00608 * just enough so that we allow other processes to gain CPU time. 00609 * A problem was found when an OLE app tries to communicate to a 00610 * background app (via SendMessage) running at the same priority as a 00611 * background/spinning process. This will starve the CPU from those 00612 * processes. Sleep on every re-cycle of the spin-count. This will 00613 * assure that apps doing peeks are degraded. 00614 * 00615 */ 00616 if ((pci->dwTIFlags & TIF_SPINNING) && (pci->cSpins >= cSpinLimit)) { 00617 pci->cSpins = 0; 00618 NtYieldExecution(); 00619 } 00620 00621 return FALSE; 00622 00623 lbCallServer: 00624 00625 return _PeekMessage(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, 00626 wRemoveMsg, IS_ANSI); 00627 }

WINUSERAPI HDEVNOTIFY WINAPI RegisterDeviceNotification IN HANDLE  hRecipient,
IN LPVOID  NotificationFilter,
IN DWORD  Flags
 

Definition at line 1792 of file cltxt.h.

References BOOL, DWORD, IS_ANSI, LPVOID, and RegisterDeviceNotificationWorker().

Referenced by DECLARE_INTERFACE_().

01797 { 01798 extern HDEVNOTIFY RegisterDeviceNotificationWorker(IN HANDLE hRecipient, 01799 IN LPVOID NotificationFilter, 01800 IN DWORD Flags, 01801 IN BOOL IsAnsi 01802 ); 01803 01804 // translate strings in NotificationFilter (if any) 01805 01806 return RegisterDeviceNotificationWorker(hRecipient, 01807 NotificationFilter, 01808 Flags, 01809 IS_ANSI 01810 ); 01811 }

LRESULT WINAPI SendDlgItemMessage HWND  hwnd,
int  id,
UINT  message,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 717 of file cltxt.h.

References GetDlgItem(), L, and SendMessage().

Referenced by FindDialogProc(), HelpDlgProc(), MB_DlgProcWorker(), MDIActivateDlgProcWorker(), CAdvancedPage::OnCommand(), CInstallPage::OnCommand(), CProfileAssociationPage::OnCommand(), CProfilePropertySheet::OnInit(), CProfileInformationPage::OnInit(), CProfileAssociationPage::OnInit(), CProfileAssociationPage::OnNotify(), OpenFiles(), CAdvancedPage::Update(), CProfileAssociationPage::UpdateDeviceListBox(), and xxxInitActivateDlg().

00723 { 00724 if (hwnd == (HWND)-1 || hwnd == (HWND)0x0000FFFF) 00725 return 0; 00726 00727 if (hwnd = GetDlgItem(hwnd, id)) 00728 return SendMessage(hwnd, message, wParam, lParam); 00729 00730 return 0L; 00731 }

LRESULT APIENTRY SendMessage HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 652 of file cltxt.h.

References APIENTRY, CsSendMessage, FNID_SENDMESSAGEFF, GetDesktopWindow(), IS_ANSI, L, NULL, RESERVED_MSG_BITS, SendMessageWorker(), and ValidateHwnd.

Referenced by AnimateWindow(), CheckDlgButton(), CheckRadioButton(), ComboBoxWndProcWorker(), ConnectConv(), ConsoleWindowProc(), CreateMDIChild(), CreateWindowsWindow(), DefDlgProcWorker(), DefFrameProcWorker(), DefMDIChildProcWorker(), DestroyC1Window(), DestroyT1Window(), DestroyWindowsWindow(), CScaleDlg::DeterminWeights(), DialogBox2(), CPropertyPage::DisableApplyButton(), DlgDirSelectHelper(), DlgSetFocus(), ECCutText(), ECMenu(), ECNotifyParent(), CPropertyPage::EnableApplyButton(), FileOpenHookProc(), FileSaveHookProc(), CMonitorProfileManagement::FillList(), CPrinterProfileManagement::FillList(), CDeviceProfileManagement::FillList(), ImeNotifyHandler(), ImmActivateLayout(), ImmConfigureIMEA(), ImmConfigureIMEW(), ImmGetImeMenuItemsInterProcess(), ImmSendMessageToActiveDefImeWndW(), ImmSetActiveContext(), InitializeInstance(), InitiateEnumerationProc(), InternalCreateDialog(), IsDialogMessageW(), IsDlgButtonChecked(), JCloseOpen(), ListBoxWndProcWorker(), MakeIMENotify(), MDIClientWndProcWorker(), MDICompleteChildCreation(), MLChar(), MLEditWndProc(), MLKeyDown(), MLUndo(), mndtDragOver(), msProfCallback(), msProfListboxInsert1(), msProfListboxInsert2(), msProfListboxInsert3(), msProfMenu(), msProfSendMessage(), msProfSendMessageDiffThread(), CAdvancedPage::OnCommand(), CAddDeviceDialog::OnCommand(), CMonitorProfileManagement::OnCommand(), CPrinterProfileManagement::OnCommand(), CDeviceProfileManagement::OnCommand(), CColorMatchDialog::OnCommand(), CProfilePropertySheet::OnInit(), CAddDeviceDialog::OnInit(), CPrinterProfileManagement::OnInit(), CColorMatchDialog::OnInit(), CProfilePropertySheet::OnNotify(), PostMessage(), ProcessDDEMLInitiate(), ReaderProcInternal(), RemoteDoSendWindowMessage(), CScaleDlg::ResizeControls(), SendDlgItemMessage(), SendHelpMessage(), SendIMEMessageAll(), SendOpenStatusNotify(), SendRegisterMessageToClass(), SendWinHelpMessage(), SetEndTaskDlgStatus(), SLChar(), SLEditWndProc(), SLKeyDown(), SLKillFocus(), SmoothScrollWindowEx(), StaticNotifyParent(), TransHanjaMode(), TranslateMDISysAccel(), CProfileAssociationPage::UpdateDeviceListBox(), WinMain(), WINNLSTranslateMessageJ(), WndProc(), xxxBNOwnerDraw(), xxxBNReleaseCapture(), xxxButtonNotifyParent(), xxxCBCalcControlRects(), xxxCBInternalUpdateEditWindow(), xxxCBMessageItemHandler(), xxxCheckDefPushButton(), xxxChildResize(), xxxDlgDirListHelper(), xxxFindString(), xxxGNM_FindNextMnem(), xxxGotoNextMnem(), xxxLBBinarySearchString(), xxxLBCreate(), xxxLbDir(), xxxLBInsertItem(), xxxLBoxCtlKeyInput(), xxxLBoxDeleteItem(), xxxLBoxDrawItem(), xxxMDIActivate(), xxxMDIDestroy(), xxxNotifyOwner(), xxxRemoveDefaultButton(), xxxStaticPaint(), and xxxTrackMouse().

00653 { 00654 PWND pwnd; 00655 00656 /* 00657 * Prevent apps from setting hi 16 bits so we can use them internally. 00658 */ 00659 if (message & RESERVED_MSG_BITS) { 00660 RIPERR1(ERROR_INVALID_PARAMETER, 00661 RIP_WARNING, 00662 "Invalid parameter \"message\" (%ld) to SendMessage", 00663 message); 00664 00665 return 0; 00666 } 00667 00668 /* 00669 * Thunk through a special sendmessage for -1 hwnd's so that the general 00670 * purpose thunks don't allow -1 hwnd's. 00671 */ 00672 if (hwnd == (HWND)-1 || hwnd == (HWND)0x0000FFFF) { 00673 /* 00674 * Get a real hwnd so the thunks will validation ok. Note that since 00675 * -1 hwnd is really rare, calling GetDesktopWindow() here is not a 00676 * big deal. 00677 */ 00678 hwnd = GetDesktopWindow(); 00679 00680 /* 00681 * Always send broadcast requests straight to the server. 00682 * Note: if the xParam needs to be used, must update 00683 * SendMsgTimeout, FNID_SENDMESSAGEFF uses it to id who 00684 * it is from... 00685 */ 00686 return CsSendMessage(hwnd, message, wParam, lParam, 0L, 00687 FNID_SENDMESSAGEFF, IS_ANSI); 00688 } 00689 00690 if ((pwnd = ValidateHwnd(hwnd)) == NULL) 00691 return 0; 00692 00693 return SendMessageWorker(pwnd, message, wParam, lParam, IS_ANSI); 00694 }

LRESULT APIENTRY SendMessageTimeout HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
UINT  fuFlags,
UINT  uTimeout,
PULONG_PTR  lpdwResult
 

Definition at line 697 of file cltxt.h.

References APIENTRY, IS_ANSI, and SendMessageTimeoutWorker().

Referenced by ConsoleImeSendMessage(), FreeCon(), and SrvDeviceEvent().

00700 { 00701 return SendMessageTimeoutWorker(hwnd, message, wParam, lParam, 00702 fuFlags, uTimeout, lpdwResult, IS_ANSI); 00703 }

BOOL SetDlgItemText HWND  hwnd,
int  id,
LPCTSTR  lpch
 

Definition at line 768 of file cltxt.h.

References BOOL, FALSE, GetDlgItem(), NULL, and SetWindowText().

Referenced by CMonitorProfileManagement::FillList(), CPrinterProfileManagement::FillList(), CAdvancedPage::OnInit(), CInstallPage::OnInit(), CProfileInformationPage::OnInit(), CProfileAssociationPage::OnInit(), CMonitorProfileManagement::OnInit(), CColorMatchDialog::OnInit(), CAddProfileDialog::OpenFileHookProc(), SetEndTaskDlgStatus(), and xxxDlgDirListHelper().

00772 { 00773 if ((hwnd = GetDlgItem(hwnd, id)) != NULL) { 00774 return SetWindowText(hwnd, lpch); 00775 } 00776 00777 return FALSE; 00778 }

BOOL SetMenuItemInfo HMENU  hMenu,
UINT  uID,
BOOL  fByPosition,
LPCMENUITEMINFO  lpmii
 

Definition at line 1685 of file cltxt.h.

References BOOL, FALSE, IS_ANSI, MENUAPI_SET, ThunkedMenuItemInfo(), and ValidateMENUITEMINFO().

Referenced by MyModifyMenuItem(), and SetMenuItemBitmaps().

01686 { 01687 01688 MENUITEMINFOW miiLocal; 01689 01690 if (!ValidateMENUITEMINFO((LPMENUITEMINFOW)lpmii, &miiLocal, MENUAPI_SET)) { 01691 return FALSE; 01692 } 01693 01694 return (ThunkedMenuItemInfo(hMenu, uID, fByPosition, FALSE, &miiLocal, IS_ANSI)); 01695 }

BOOL SetVideoTimeout DWORD  dwVideoTimeout  ) 
 

Definition at line 918 of file cltxt.h.

References BOOL, FALSE, NULL, PFNGETACTIVEPWRSCHEME, PFNREADPWRSCHEME, PFNSETACTIVEPWRSCHEME, and UINT.

Referenced by SystemParametersInfo().

00920 { 00921 POWER_POLICY pp; 00922 UINT uiID; 00923 HINSTANCE hInstDLL; 00924 PFNGETACTIVEPWRSCHEME pfnGetActivePwrScheme; 00925 PFNSETACTIVEPWRSCHEME pfnSetActivePwrScheme; 00926 PFNREADPWRSCHEME pfnReadPwrScheme; 00927 BOOL fRet = FALSE; 00928 00929 if ((hInstDLL = LoadLibrary(TEXT("powrprof.dll"))) == NULL) { 00930 return FALSE; 00931 } 00932 00933 pfnGetActivePwrScheme = (PFNGETACTIVEPWRSCHEME)GetProcAddress(hInstDLL, "GetActivePwrScheme"); 00934 pfnSetActivePwrScheme = (PFNSETACTIVEPWRSCHEME)GetProcAddress(hInstDLL, "SetActivePwrScheme"); 00935 pfnReadPwrScheme = (PFNREADPWRSCHEME)GetProcAddress(hInstDLL, "ReadPwrScheme"); 00936 00937 if (pfnGetActivePwrScheme(&uiID)) { 00938 00939 if (pfnReadPwrScheme(uiID, &pp)) { 00940 00941 pp.user.VideoTimeoutDc = dwVideoTimeout; 00942 pp.user.VideoTimeoutAc = dwVideoTimeout; 00943 00944 fRet = pfnSetActivePwrScheme(uiID, NULL, &pp); 00945 } 00946 } 00947 FreeLibrary (hInstDLL); 00948 00949 return fRet; 00950 }

LONG_PTR APIENTRY SetWindowLongPtr HWND  hWnd,
int  nIndex,
LONG_PTR  dwNewLong
 

Definition at line 408 of file cltxt.h.

References _SetWindowLongPtr, APIENTRY, hWnd, and IS_ANSI.

Referenced by ConnectConv(), CreateC1Window(), CreateT1Window(), DDEMLClientWndProc(), CPropertyPage::DialogProc(), CDialog::DialogProc(), EndTaskDlgProc(), FindDialogProc(), ImeSelectHandler(), ImeSetContextHandler(), InternalDdeInitialize(), MB_DlgProcWorker(), MDIChildWndProc(), CMonitorProfileManagement::OnNotify(), CPrinterProfileManagement::OnNotify(), CDeviceProfileManagement::OnNotify(), ProcessDDEMLInitiate(), ReaderWndProc(), ShiftMenuIDs(), UnlinkConvFromOthers(), and xxxMDIActivate().

00409 { 00410 return _SetWindowLongPtr(hWnd, nIndex, dwNewLong, IS_ANSI); 00411 }

BOOL WINAPI SetWindowText HWND  hwnd,
LPCTSTR  pString
 

Definition at line 848 of file cltxt.h.

References BOOL, DefWindowProcWorker(), FALSE, IS_ANSI, NULL, SendMessageWorker(), TestWindowProcess(), and ValidateHwnd.

Referenced by ConsoleWindowProc(), EndTaskDlgProc(), InitConsoleIME(), SetDlgItemText(), SetWinText(), and xxxCBInternalUpdateEditWindow().

00851 { 00852 LRESULT lReturn; 00853 PWND pwnd; 00854 00855 /* 00856 * Make sure we have a valid window. 00857 */ 00858 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 00859 return FALSE; 00860 } 00861 00862 /* 00863 * This process comparison is bogus, but it is what win3.1 does. 00864 */ 00865 if (TestWindowProcess(pwnd)) { 00866 lReturn = SendMessageWorker(pwnd, WM_SETTEXT, 0, (LPARAM)pString, IS_ANSI); 00867 } else { 00868 lReturn = DefWindowProcWorker(pwnd, WM_SETTEXT, 0, (LPARAM)pString, IS_ANSI); 00869 } 00870 return (lReturn >= 0); 00871 }

BOOL APIENTRY SystemParametersInfo UINT  wFlag,
UINT  wParam,
PVOID  lParam,
UINT  flags
 

Definition at line 959 of file cltxt.h.

References APIENTRY, ARRAY_SIZE, BEGINCALL, BOOL, tagINTERNALSETHIGHCONTRAST::cbSize, CLEANUPLPTSTR, CopyLogFontAtoW(), CopyLogFontWtoA(), COPYLPTSTR, tagINTERNALSETHIGHCONTRAST::dwFlags, DWORD, ENDCALL, ERRORTRAP, _IN_STRING::fAllocated, FALSE, IN_STRING, INT, INTERNALSETHIGHCONTRAST, MAX_PATH, min, MSGERROR, NtUserSystemParametersInfo(), NULL, pcHighContrastScheme, _IN_STRING::pstr, pwcHighContrastScheme, SetVideoTimeout(), and UINT.

Referenced by ConsoleWindowProc(), GetAllMonitorSize(), ImeSystemHandler(), InitializeSystemMetrics(), SrvGetConsoleKeyboardLayoutName(), and UpdatePerUserSystemParameters().

00964 { 00965 #if IS_ANSI 00966 NONCLIENTMETRICSW ClientMetricsW; 00967 ICONMETRICSW IconMetricsW; 00968 LOGFONTW LogFontW; 00969 /* 00970 * Bug 257718 - joejo 00971 * Add SPI_GETDESKWALLPAPER to SystemParametersInfo 00972 */ 00973 WCHAR szTemp[MAX_PATH]; 00974 UINT oldwParam = wParam; 00975 #endif 00976 INTERNALSETHIGHCONTRAST ihc; 00977 IN_STRING strlParam; 00978 PVOID oldlParam = lParam; 00979 00980 /* 00981 * Make sure cleanup will work successfully 00982 */ 00983 strlParam.fAllocated = FALSE; 00984 00985 BEGINCALL(); 00986 00987 switch (wFlag) { 00988 case SPI_SETSCREENSAVERRUNNING: // same as SPI_SCREENSAVERRUNNING 00989 MSGERROR(); 00990 00991 case SPI_SETDESKPATTERN: 00992 00993 if (wParam == 0x0000FFFF) 00994 wParam = (UINT)-1; 00995 00996 /* 00997 * lParam not a string (and already copied) 00998 */ 00999 if (wParam == (UINT)-1) 01000 break; 01001 01002 /* 01003 * lParam is possibly 0 or -1 (filled in already) or a string 01004 */ 01005 if ((lParam != (PVOID)0) && (lParam != (PVOID)-1)) { 01006 COPYLPTSTR(&strlParam, (LPTSTR)lParam); 01007 lParam = strlParam.pstr; 01008 } 01009 break; 01010 01011 case SPI_SETDESKWALLPAPER: { 01012 01013 /* 01014 * lParam is possibly 0, -1 or -2 (filled in already) or a string. 01015 * Get a pointer to the string so we can use it later. We're 01016 * going to a bit of normalizing here for consistency. 01017 * 01018 * If the caller passes in 0, -1 or -2, we're going to set 01019 * the wParam to -1, and use the lParam to pass the string 01020 * representation of the wallpaper. 01021 */ 01022 if ((lParam != (PVOID) 0) && 01023 (lParam != (PVOID)-1) && 01024 (lParam != (PVOID)-2)) { 01025 01026 COPYLPTSTR(&strlParam, (LPTSTR)lParam); 01027 lParam = strlParam.pstr; 01028 wParam = 0; 01029 01030 } else { 01031 wParam = (UINT)-1; 01032 } 01033 } 01034 break; 01035 01036 /* 01037 * Bug 257718 - joejo 01038 * Add SPI_GETDESKWALLPAPER to SystemParametersInfo 01039 */ 01040 case SPI_GETDESKWALLPAPER: 01041 if ((lParam == NULL) || (wParam == 0)) 01042 MSGERROR(); 01043 #if IS_ANSI 01044 lParam = szTemp; 01045 wParam = ARRAY_SIZE(szTemp); 01046 #else 01047 /* 01048 * Bug 283318 - joejo 01049 * Leave space for a null termination 01050 */ 01051 wParam--; 01052 #endif 01053 01054 break; 01055 01056 01057 case SPI_GETANIMATION: 01058 if ((lParam == NULL) || (*((DWORD *)(lParam)) != sizeof(ANIMATIONINFO))) 01059 MSGERROR(); 01060 break; 01061 01062 case SPI_GETNONCLIENTMETRICS: 01063 #if IS_ANSI 01064 if ((lParam == NULL) || (*((DWORD *)(lParam)) != sizeof(NONCLIENTMETRICSA))) 01065 MSGERROR(); 01066 lParam = &ClientMetricsW; 01067 #else 01068 if ((lParam == NULL) || (*((DWORD *)(lParam)) != sizeof(NONCLIENTMETRICSW))) 01069 MSGERROR(); 01070 #endif 01071 break; 01072 01073 case SPI_GETMINIMIZEDMETRICS: 01074 if ((lParam == NULL) || (*((DWORD *)(lParam)) != sizeof(MINIMIZEDMETRICS))) 01075 MSGERROR(); 01076 break; 01077 01078 case SPI_GETICONMETRICS: 01079 #if IS_ANSI 01080 if ((lParam == NULL) || (*((DWORD *)(lParam)) != sizeof(ICONMETRICSA))) 01081 MSGERROR(); 01082 lParam = &IconMetricsW; 01083 #else 01084 if ((lParam == NULL) || (*((DWORD *)(lParam)) != sizeof(ICONMETRICSW))) 01085 MSGERROR(); 01086 #endif 01087 break; 01088 01089 case SPI_GETHIGHCONTRAST: 01090 #if IS_ANSI 01091 { 01092 LPHIGHCONTRASTA pHC = (HIGHCONTRASTA *)lParam; 01093 if (!pHC || (pHC->cbSize != sizeof(HIGHCONTRASTA))) { 01094 MSGERROR(); 01095 } 01096 if (!pcHighContrastScheme) { 01097 pcHighContrastScheme = LocalAlloc(LPTR, MAX_SCHEME_NAME_SIZE * sizeof(WCHAR)); 01098 if (!pcHighContrastScheme) 01099 MSGERROR(); 01100 } 01101 if (!pwcHighContrastScheme) { 01102 pwcHighContrastScheme = LocalAlloc(LPTR, MAX_SCHEME_NAME_SIZE * sizeof(WCHAR)); 01103 if (!pwcHighContrastScheme) 01104 MSGERROR(); 01105 } 01106 ((LPHIGHCONTRASTW)(lParam))->lpszDefaultScheme = pwcHighContrastScheme; 01107 } 01108 #else 01109 { 01110 LPHIGHCONTRASTW pHC = (HIGHCONTRASTW *)lParam; 01111 if (!pHC || (pHC->cbSize != sizeof(HIGHCONTRASTW))) 01112 MSGERROR(); 01113 if (!pwcHighContrastScheme) { 01114 pwcHighContrastScheme = LocalAlloc(LPTR, MAX_SCHEME_NAME_SIZE * sizeof(WCHAR)); 01115 if (!pwcHighContrastScheme) 01116 MSGERROR(); 01117 } 01118 pHC->lpszDefaultScheme = pwcHighContrastScheme; 01119 } 01120 #endif 01121 01122 break; 01123 01124 #if IS_ANSI 01125 case SPI_GETICONTITLELOGFONT: 01126 lParam = &LogFontW; 01127 break; 01128 #endif 01129 01130 case SPI_SETANIMATION: 01131 { 01132 if ((lParam == NULL) || (*((DWORD *)(lParam)) != sizeof(ANIMATIONINFO))) 01133 MSGERROR(); 01134 } 01135 break; 01136 01137 case SPI_SETHIGHCONTRAST: 01138 ihc.cbSize = sizeof (HIGHCONTRASTW); 01139 { 01140 LPHIGHCONTRAST pHC = (HIGHCONTRAST *)lParam; 01141 if ((lParam == NULL) || (pHC->cbSize != sizeof(HIGHCONTRAST))) 01142 MSGERROR(); 01143 01144 lParam = &ihc; 01145 ihc.dwFlags = pHC->dwFlags; 01146 COPYLPTSTR(&strlParam, pHC->lpszDefaultScheme); 01147 ihc.usDefaultScheme = *strlParam.pstr; 01148 } 01149 break; 01150 01151 case SPI_SETNONCLIENTMETRICS: 01152 #if IS_ANSI 01153 { 01154 PNONCLIENTMETRICSA psrc = (PNONCLIENTMETRICSA)lParam; 01155 01156 if ((lParam == NULL) || (*((DWORD *)(lParam)) != sizeof(NONCLIENTMETRICSA))) 01157 MSGERROR(); 01158 01159 if( psrc->iCaptionWidth > 256 ) 01160 psrc->iCaptionWidth = 256; 01161 01162 if( psrc->iCaptionHeight > 256 ) 01163 psrc->iCaptionHeight = 256; 01164 01165 ClientMetricsW.cbSize = psrc->cbSize; 01166 ClientMetricsW.iBorderWidth = psrc->iBorderWidth; 01167 ClientMetricsW.iScrollWidth = psrc->iScrollWidth; 01168 ClientMetricsW.iScrollHeight = psrc->iScrollHeight; 01169 ClientMetricsW.iCaptionWidth = psrc->iCaptionWidth; 01170 ClientMetricsW.iCaptionHeight = psrc->iCaptionHeight; 01171 ClientMetricsW.iSmCaptionWidth = psrc->iSmCaptionWidth; 01172 ClientMetricsW.iSmCaptionHeight = psrc->iSmCaptionHeight; 01173 ClientMetricsW.iMenuWidth = psrc->iMenuWidth; 01174 ClientMetricsW.iMenuHeight = psrc->iMenuHeight; 01175 01176 CopyLogFontAtoW(&(ClientMetricsW.lfCaptionFont), &(psrc->lfCaptionFont)); 01177 CopyLogFontAtoW(&(ClientMetricsW.lfSmCaptionFont), &(psrc->lfSmCaptionFont)); 01178 CopyLogFontAtoW(&(ClientMetricsW.lfMenuFont), &(psrc->lfMenuFont)); 01179 CopyLogFontAtoW(&(ClientMetricsW.lfStatusFont), &(psrc->lfStatusFont)); 01180 CopyLogFontAtoW(&(ClientMetricsW.lfMessageFont), &(psrc->lfMessageFont)); 01181 01182 lParam = &ClientMetricsW; 01183 } 01184 #else 01185 { 01186 PNONCLIENTMETRICSA psrc; 01187 01188 if ((lParam == NULL) || (*((DWORD *)(lParam)) != sizeof(NONCLIENTMETRICSW))) 01189 MSGERROR(); 01190 01191 psrc = (PNONCLIENTMETRICSA)lParam; 01192 01193 if( psrc->iCaptionWidth > 256 ) 01194 psrc->iCaptionWidth = 256; 01195 01196 if( psrc->iCaptionHeight > 256 ) 01197 psrc->iCaptionHeight = 256; 01198 } 01199 #endif 01200 wParam = sizeof(NONCLIENTMETRICSW); 01201 break; 01202 01203 case SPI_SETMINIMIZEDMETRICS: 01204 if ((lParam == NULL) || (*((DWORD *)(lParam)) != sizeof(MINIMIZEDMETRICS))) 01205 MSGERROR(); 01206 wParam = sizeof(MINIMIZEDMETRICS); 01207 break; 01208 01209 case SPI_SETICONMETRICS: 01210 #if IS_ANSI 01211 { 01212 PICONMETRICSA psrc = (PICONMETRICSA)lParam; 01213 01214 if ((lParam == NULL) || (*((DWORD *)(lParam)) != sizeof(ICONMETRICSA))) 01215 MSGERROR(); 01216 01217 memcpy(&IconMetricsW, psrc, sizeof(ICONMETRICSA) - sizeof(LOGFONTA)); 01218 01219 CopyLogFontAtoW(&(IconMetricsW.lfFont), &(psrc->lfFont)); 01220 lParam = &IconMetricsW; 01221 } 01222 #else 01223 if ((lParam == NULL) || (*((DWORD *)(lParam)) != sizeof(ICONMETRICSW))) 01224 MSGERROR(); 01225 #endif 01226 wParam = sizeof(ICONMETRICSW); 01227 break; 01228 01229 case SPI_SETICONTITLELOGFONT: 01230 #if IS_ANSI 01231 CopyLogFontAtoW(&LogFontW, lParam); 01232 lParam = &LogFontW; 01233 #endif 01234 wParam = sizeof(LOGFONTW); 01235 break; 01236 01237 case SPI_GETFILTERKEYS: 01238 { 01239 if ((((LPFILTERKEYS)lParam)->cbSize == 0) || 01240 (((LPFILTERKEYS)lParam)->cbSize) > sizeof(FILTERKEYS)) { 01241 MSGERROR(); 01242 } 01243 } 01244 break; 01245 01246 case SPI_GETSTICKYKEYS: 01247 { 01248 if ((((LPSTICKYKEYS)lParam)->cbSize == 0) || 01249 (((LPSTICKYKEYS)lParam)->cbSize) > sizeof(STICKYKEYS)) { 01250 MSGERROR(); 01251 } 01252 } 01253 break; 01254 01255 case SPI_GETTOGGLEKEYS: 01256 { 01257 if ((((LPTOGGLEKEYS)lParam)->cbSize == 0) || 01258 (((LPTOGGLEKEYS)lParam)->cbSize) > sizeof(TOGGLEKEYS)) { 01259 MSGERROR(); 01260 } 01261 } 01262 break; 01263 01264 case SPI_GETMOUSEKEYS: 01265 { 01266 if ((((LPMOUSEKEYS)lParam)->cbSize == 0) || 01267 (((LPMOUSEKEYS)lParam)->cbSize) > sizeof(MOUSEKEYS)) { 01268 MSGERROR(); 01269 } 01270 } 01271 break; 01272 01273 case SPI_GETACCESSTIMEOUT: 01274 { 01275 if ((((LPACCESSTIMEOUT)lParam)->cbSize == 0) || 01276 (((LPACCESSTIMEOUT)lParam)->cbSize) > sizeof(ACCESSTIMEOUT)) { 01277 MSGERROR(); 01278 } 01279 } 01280 break; 01281 01282 case SPI_GETSOUNDSENTRY: 01283 /* 01284 * Note: Currently we don't support the windows effect dll 01285 * option for sound sentry. Therefore, we don't have to 01286 * deal with the lpszWindowsEffectDLL field (which can be 01287 * ANSI or Unicode). 01288 */ 01289 { 01290 if ((((LPSOUNDSENTRY)lParam)->cbSize == 0) || 01291 (((LPSOUNDSENTRY)lParam)->cbSize) > sizeof(SOUNDSENTRY)) { 01292 MSGERROR(); 01293 } 01294 } 01295 break; 01296 } 01297 01298 retval = NtUserSystemParametersInfo(wFlag, wParam, lParam, flags); 01299 01300 switch (wFlag) { 01301 #if IS_ANSI 01302 case SPI_GETNONCLIENTMETRICS: 01303 { 01304 PNONCLIENTMETRICSA pdst = (PNONCLIENTMETRICSA)oldlParam; 01305 01306 pdst->cbSize = sizeof(NONCLIENTMETRICSA); 01307 pdst->iBorderWidth = ClientMetricsW.iBorderWidth; 01308 pdst->iScrollWidth = ClientMetricsW.iScrollWidth; 01309 pdst->iScrollHeight = ClientMetricsW.iScrollHeight; 01310 pdst->iCaptionWidth = ClientMetricsW.iCaptionWidth; 01311 pdst->iCaptionHeight = ClientMetricsW.iCaptionHeight; 01312 pdst->iSmCaptionWidth = ClientMetricsW.iSmCaptionWidth; 01313 pdst->iSmCaptionHeight = ClientMetricsW.iSmCaptionHeight; 01314 pdst->iMenuWidth = ClientMetricsW.iMenuWidth; 01315 pdst->iMenuHeight = ClientMetricsW.iMenuHeight; 01316 01317 CopyLogFontWtoA(&(pdst->lfCaptionFont), &(ClientMetricsW.lfCaptionFont)); 01318 CopyLogFontWtoA(&(pdst->lfSmCaptionFont), &(ClientMetricsW.lfSmCaptionFont)); 01319 CopyLogFontWtoA(&(pdst->lfMenuFont), &(ClientMetricsW.lfMenuFont)); 01320 CopyLogFontWtoA(&(pdst->lfStatusFont), &(ClientMetricsW.lfStatusFont)); 01321 CopyLogFontWtoA(&(pdst->lfMessageFont), &(ClientMetricsW.lfMessageFont)); 01322 } 01323 break; 01324 01325 case SPI_GETICONMETRICS: 01326 { 01327 PICONMETRICSA pdst = (PICONMETRICSA)oldlParam; 01328 01329 memcpy(pdst, &IconMetricsW, sizeof(ICONMETRICSA) - sizeof(LOGFONTA)); 01330 pdst->cbSize = sizeof(ICONMETRICSA); 01331 01332 CopyLogFontWtoA(&(pdst->lfFont), &(IconMetricsW.lfFont)); 01333 } 01334 break; 01335 01336 case SPI_GETICONTITLELOGFONT: 01337 { 01338 CopyLogFontWtoA((PLOGFONTA)oldlParam, &LogFontW); 01339 } 01340 break; 01341 01342 case SPI_GETHIGHCONTRAST: 01343 WCSToMB(pwcHighContrastScheme, -1, &pcHighContrastScheme, MAX_SCHEME_NAME_SIZE, FALSE); 01344 ((LPHIGHCONTRASTA)(lParam))->lpszDefaultScheme = pcHighContrastScheme; 01345 break; 01346 01347 #endif // IS_ANSI 01348 01349 /* 01350 * Bug 257718 - joejo 01351 * Add SPI_GETDESKWALLPAPER to SystemParametersInfo 01352 */ 01353 case SPI_GETDESKWALLPAPER: 01354 { 01355 /* 01356 * Bug 283318 - joejo 01357 * Make sure strings are null terminated. 01358 */ 01359 #if IS_ANSI 01360 INT cchAnsiCopy = WCSToMB(lParam, 01361 -1, 01362 (LPSTR*)&oldlParam, 01363 oldwParam - 1, 01364 FALSE); 01365 01366 cchAnsiCopy = min(cchAnsiCopy, (INT)(oldwParam - 1)); 01367 ((LPSTR)oldlParam)[cchAnsiCopy] = 0; 01368 #else //UNICODE 01369 ((LPWSTR)oldlParam)[wParam] = (WCHAR)0; 01370 #endif //IS_ANSI 01371 break; 01372 } 01373 case SPI_SETLOWPOWERTIMEOUT: 01374 case SPI_SETPOWEROFFTIMEOUT: 01375 if (retval && (flags & SPIF_UPDATEINIFILE)) { 01376 retval = SetVideoTimeout(wParam); 01377 } 01378 break; 01379 } 01380 01381 ERRORTRAP(FALSE); 01382 CLEANUPLPTSTR(strlParam); 01383 ENDCALL(BOOL); 01384 }


Variable Documentation

LRESULT TEXT_FN( DispatchHook)(int dw, WPARAM wParam, LPARAM lParam, HOOKPROC pfn)
 

Definition at line 128 of file cltxt.h.

00133 { 00134 int dwHookSave; 00135 LRESULT nRet; 00136 PCLIENTINFO pci; 00137 #ifdef WX86 00138 HOOKPROC pfnHook; 00139 #endif 00140 #if IS_ANSI 00141 WPARAM wParamSave; 00142 #endif 00143 /* -FE- 00144 * * THIS VARIABLE SHOULD BE THREAD AWARE * 00145 */ 00146 static EVENTMSG CachedEvent = {0,0,0,(DWORD)0,(HWND)0}; 00147 00148 /* 00149 * First save the current hook stored in the CTI structure in case we're 00150 * being recursed into. dw contains MAKELONG(nCode, nFilterType). 00151 */ 00152 pci = GetClientInfo(); 00153 dwHookSave = pci->dwHookCurrent; 00154 pci->dwHookCurrent = (dw & 0xFFFF0000) | IS_ANSI; 00155 00156 #ifdef WX86 00157 00158 // 00159 // If this is an x86 hook proc, fetch a risc thunk to call 00160 // 00161 00162 pfnHook = (PVOID)((ULONG_PTR)pfn & ~0x80000000); 00163 if (pfn != pfnHook) { 00164 if (pfnWx86HookCallBack) { 00165 pfn = pfnWx86HookCallBack(HIWORD(dw), // filter type 00166 pfnHook // hook proc 00167 ); 00168 } 00169 } 00170 00171 #endif 00172 00173 #if IS_ANSI // TEXT_FN(DispatchHook)() 00174 if (IS_DBCS_ENABLED()) { 00175 PMSG pMsg; 00176 PEVENTMSG pEMsg; 00177 switch (HIWORD(dw)) { 00178 case WH_JOURNALPLAYBACK: 00179 switch (LOWORD(dw)) { 00180 case HC_SKIP: 00181 CachedEvent.message = 0; 00182 break; 00183 case HC_GETNEXT: 00184 case HC_NOREMOVE: 00185 pEMsg = (PEVENTMSG)lParam; 00186 if (CachedEvent.message != 0 && pEMsg != NULL) { 00187 RtlCopyMemory((PEVENTMSG)lParam,&CachedEvent,sizeof(EVENTMSG)); 00188 return 0; 00189 } 00190 break; 00191 } 00192 break; 00193 case WH_MSGFILTER: 00194 case WH_SYSMSGFILTER: 00195 case WH_GETMESSAGE: 00196 pMsg = (PMSG)lParam; 00197 if (pMsg) { 00198 /* 00199 * Save original message. 00200 */ 00201 wParamSave = pMsg->wParam; 00202 switch (pMsg->message) { 00203 case WM_CHAR: 00204 case EM_SETPASSWORDCHAR: 00205 /* 00206 * Here... pMsg->wParam contains.. 00207 * 00208 * HIWORD(wParam) = Information for DBCS messgaing. 00209 * HIBYTE(LOWORD(wParam)) = Dbcs LeadingByte Byte. 00210 * LOBYTE(LOWORD(wParam)) = Dbcs TrailingByte or Sbcs character. 00211 * 00212 */ 00213 if (pMsg->wParam & WMCR_IR_DBCSCHAR) { 00214 /* 00215 * Mask off DBCS messaging infomation area. 00216 * (Look up only DBCS character code data). 00217 */ 00218 pMsg->wParam &= 0x0000FFFF; 00219 } else { 00220 if (IS_DBCS_MESSAGE(LOWORD(pMsg->wParam))) { 00221 PKERNEL_MSG pDbcsMsg = GetCallBackDbcsInfo(); 00222 /* 00223 * Copy this message to CLIENTINFO for next GetMessage 00224 * or PeekMesssage() call. 00225 */ 00226 COPY_MSG_TO_KERNELMSG(pDbcsMsg,pMsg); 00227 /* 00228 * Only Dbcs Trailingbyte is nessesary for pushed message. we'll 00229 * pass this message when GetMessage/PeekMessage is called at next. 00230 */ 00231 pDbcsMsg->wParam = (WPARAM)((pMsg->wParam & 0x0000FF00) >> 8); 00232 /* 00233 * Return DbcsLeading byte to Apps. 00234 */ 00235 pMsg->wParam = (WPARAM)(pMsg->wParam & 0x000000FF); 00236 } else { 00237 /* 00238 * This is SBCS char, make sure it. 00239 */ 00240 pMsg->wParam &= 0x000000FF; 00241 } 00242 } 00243 } 00244 } /* if (pMsg) */ 00245 } /* switch (HIWORD(dw)) */ 00246 GetNextHookData: 00247 ; 00248 } 00249 #endif // IS_ANSI 00250 00251 /* 00252 * Call the hook. dw contains MAKELONG(nCode, nFilterType). 00253 */ 00254 nRet = pfn(LOWORD(dw), wParam, lParam); 00255 00256 #if IS_ANSI // TEXT_FN(DispatchHook)() 00257 if (IS_DBCS_ENABLED()) { 00258 PMSG pMsg; 00259 PEVENTMSG pEMsg; 00260 switch (HIWORD(dw)) { 00261 case WH_JOURNALPLAYBACK: 00262 switch (LOWORD(dw)) { 00263 case HC_GETNEXT: 00264 case HC_NOREMOVE: 00265 pEMsg = (PEVENTMSG)lParam; 00266 if ((nRet == 0) && pEMsg) { 00267 WPARAM dwAnsi = LOWORD(pEMsg->paramL); 00268 switch(pEMsg->message) { 00269 case WM_CHAR: 00270 case EM_SETPASSWORDCHAR: 00271 /* 00272 * Chech wParam is DBCS character or not. 00273 */ 00274 if (IS_DBCS_MESSAGE((dwAnsi))) { 00275 /* 00276 * DO NOT NEED TO MARK FOR IR_DBCSCHAR 00277 */ 00278 } else { 00279 PBYTE pchDbcsCF = GetDispatchDbcsInfo(); 00280 /* 00281 * If we have cached Dbcs LeadingByte character, build A Dbcs character 00282 * with the TrailingByte in wParam... 00283 */ 00284 if (*pchDbcsCF) { 00285 WORD DbcsLeadChar = (WORD)(*pchDbcsCF); 00286 /* 00287 * HIBYTE(LOWORD(dwAnsi)) = Dbcs LeadingByte. 00288 * LOBYTE(LOWORD(dwAnsi)) = Dbcs TrailingByte. 00289 */ 00290 dwAnsi |= (DbcsLeadChar << 8); 00291 /* 00292 * Invalidate cached data.. 00293 */ 00294 *pchDbcsCF = 0; 00295 } else if (IsDBCSLeadByteEx(THREAD_CODEPAGE(),LOBYTE(dwAnsi))) { 00296 /* 00297 * if this is Dbcs LeadByte character, we should wait Dbcs TrailingByte 00298 * to convert this to Unicode. then we cached it here... 00299 */ 00300 *pchDbcsCF = LOBYTE(dwAnsi); 00301 /* 00302 * Get DBCS TrailByte... 00303 */ 00304 pfn(HC_SKIP,0,0); 00305 goto GetNextHookData; 00306 } 00307 } 00308 /* 00309 * Convert to Unicode... 00310 */ 00311 RtlMBMessageWParamCharToWCS(pEMsg->message, &dwAnsi); 00312 /* 00313 * Restore converted Unicode to EVENTMSG.. 00314 */ 00315 pEMsg->paramL = (UINT)dwAnsi; 00316 /* 00317 * Keep this EVENTMSG to local buffer... 00318 */ 00319 RtlCopyMemory(&CachedEvent,pEMsg,sizeof(EVENTMSG)); 00320 } /* switch(pEMsg->message) */ 00321 } /* if (pEMsg) */ 00322 } 00323 break; 00324 case WH_MSGFILTER: 00325 case WH_SYSMSGFILTER: 00326 case WH_GETMESSAGE: 00327 pMsg = (PMSG)lParam; 00328 if (pMsg) { 00329 switch (pMsg->message) { 00330 case WM_CHAR: 00331 case EM_SETPASSWORDCHAR: 00332 if (GetCallBackDbcsInfo()->wParam) { 00333 PKERNEL_MSG pmsgDbcs = GetCallBackDbcsInfo(); 00334 /* 00335 * Get pushed message. 00336 * 00337 * Backup current message. this backupped message will be used 00338 * when Apps peek (or get) message from thier WndProc. 00339 * (see GetMessageA(), PeekMessageA()...) 00340 * 00341 * pmsg->hwnd = pmsgDbcs->hwnd; 00342 * pmsg->message = pmsgDbcs->message; 00343 * pmsg->wParam = pmsgDbcs->wParam; 00344 * pmsg->lParam = pmsgDbcs->lParam; 00345 * pmsg->time = pmsgDbcs->time; 00346 * pmsg->pt = pmsgDbcs->pt; 00347 */ 00348 COPY_KERNELMSG_TO_MSG(pMsg,pmsgDbcs); 00349 /* 00350 * Invalidate pushed message in CLIENTINFO. 00351 */ 00352 pmsgDbcs->wParam = 0; 00353 /* 00354 * Call the hook with DBCS TrailByte.. 00355 */ 00356 nRet = pfn(LOWORD(dw), wParam, lParam); 00357 } 00358 /* 00359 * Restore original message.. 00360 * #96571 [hiroyama] 00361 * Other messages than WM_CHAR and EM_SETPASSWORDCHAR can be 00362 * modifed by a hooker. 00363 * Wparam for WM_CHAR and EM_SETPASSWORDCHAR must be restored. 00364 * *by design* 00365 */ 00366 pMsg->wParam = wParamSave; 00367 } 00368 } /* if (pMsg) */ 00369 } /* switch (HIWORD(dw)) */ 00370 } 00371 #endif // IS_ANSI 00372 00373 /* 00374 * Restore the hook number and return the return code. 00375 */ 00376 pci->dwHookCurrent = dwHookSave; 00377 return nRet; 00378 }

LRESULT TEXT_FN( fnHkINLPCWPRETSTRUCT)(PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, ULONG_PTR xParam)
 

Definition at line 96 of file cltxt.h.

00102 { 00103 CWPRETSTRUCT cwp; 00104 PCLIENTINFO pci = GetClientInfo(); 00105 00106 cwp.hwnd = HW(pwnd); 00107 cwp.message = message; 00108 cwp.wParam = wParam; 00109 cwp.lParam = lParam; 00110 cwp.lResult = KERNEL_LRESULT_TO_LRESULT(pci->dwHookData); 00111 00112 return TEXT_FN(DispatchHook)(MAKELONG(HC_ACTION, WH_CALLWNDPROCRET), 00113 (GetClientInfo()->CI_flags & CI_INTERTHREAD_HOOK) != 0, 00114 (LPARAM)&cwp, (HOOKPROC)xParam); 00115 }

LRESULT TEXT_FN( fnHkINLPCWPSTRUCT)(PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, ULONG_PTR xParam)
 

Definition at line 77 of file cltxt.h.

00083 { 00084 CWPSTRUCT cwp; 00085 00086 cwp.hwnd = HW(pwnd); 00087 cwp.message = message; 00088 cwp.wParam = wParam; 00089 cwp.lParam = lParam; 00090 00091 return TEXT_FN(DispatchHook)(MAKELONG(HC_ACTION, WH_CALLWNDPROC), 00092 (GetClientInfo()->CI_flags & CI_INTERTHREAD_HOOK) != 0, 00093 (LPARAM)&cwp, (HOOKPROC)xParam); 00094 }

BOOL TEXT_FN( GetMenuItemInfoInternal)(HMENU hMenu, UINT uID, BOOL fByPosition, LPMENUITEMINFOW lpInfo)
 

Definition at line 1463 of file cltxt.h.

Referenced by GetMenuItemInfo(), and GetMenuString().

01465 { 01466 VALIDATIONFNNAME(GetMenuItemInfoInternal) 01467 01468 PITEM pItem; 01469 PMENU pMenu; 01470 PMENU pMenuT; 01471 01472 pMenu = VALIDATEHMENU(hMenu); 01473 if (pMenu == NULL) { 01474 VALIDATIONFAIL(hMenu); 01475 } 01476 01477 pMenuT = pMenu; // need to check the ORIGINAL menu if popup 01478 01479 pItem = MNLookUpItem(pMenu, uID, fByPosition, &pMenu); 01480 if (pItem == NULL) { 01481 /* 01482 * Don't display a warning. The explorer makes a lot of calls 01483 * that fail here. 01484 * VALIDATIONFAIL(uID); 01485 */ 01486 SetLastError(ERROR_MENU_ITEM_NOT_FOUND); 01487 return FALSE; 01488 01489 } 01490 01491 if (lpInfo->fMask & MIIM_STATE) { 01492 lpInfo->fState = pItem->fState & MFS_MASK; 01493 } 01494 01495 if (lpInfo->fMask & MIIM_ID) { 01496 lpInfo->wID = pItem->wID; 01497 } 01498 01499 if ((lpInfo->fMask & MIIM_SUBMENU) && (pItem->spSubMenu != NULL)) { 01500 lpInfo->hSubMenu = PtoH(REBASEPTR(pMenu, pItem->spSubMenu)); 01501 } else { 01502 lpInfo->hSubMenu = NULL; 01503 } 01504 01505 if (lpInfo->fMask & MIIM_CHECKMARKS) { 01506 lpInfo->hbmpChecked = pItem->hbmpChecked; 01507 lpInfo->hbmpUnchecked= pItem->hbmpUnchecked; 01508 } 01509 01510 if (lpInfo->fMask & MIIM_DATA) { 01511 lpInfo->dwItemData = KERNEL_ULONG_PTR_TO_ULONG_PTR(pItem->dwItemData); 01512 } 01513 01514 if (lpInfo->fMask & MIIM_FTYPE) { 01515 lpInfo->fType = pItem->fType & MFT_MASK; 01516 if (TestMF(pMenuT,MFRTL)) 01517 lpInfo->fType |= MFT_RIGHTORDER; 01518 } 01519 01520 if ( lpInfo->fMask & MIIM_BITMAP) { 01521 lpInfo->hbmpItem = pItem->hbmp; 01522 } 01523 01524 if (lpInfo->fMask & MIIM_STRING) { 01525 if ((lpInfo->cch == 0) 01526 || (lpInfo->dwTypeData == NULL) 01527 01528 /* 01529 * If this is an old caller (MIIM_TYPE set), and this item 01530 * has a bitmap or it's ownerdraw, then don't attempt to 01531 * copy a string since they probably didn't pass a pointer 01532 */ 01533 01534 || ((lpInfo->fMask & MIIM_TYPE) 01535 && ((lpInfo->fType & MFT_OWNERDRAW) 01536 /* 01537 * Bug 278750 - jojoe 01538 * 01539 * Soemone forgot to check for separator in the list 01540 * of menuitems that do NOT return string data! 01541 */ 01542 || (lpInfo->fType & MFT_SEPARATOR) 01543 || ((pItem->hbmp != NULL) && ((pItem->hbmp < HBMMENU_POPUPFIRST) || (pItem->hbmp > HBMMENU_POPUPLAST)))))) { 01544 01545 01546 01547 /* 01548 * When DBCS is enabled, one UNICODE character may occupy two bytes. 01549 * GetMenuItemInfoA should return the byte count, rather than the character count. 01550 * On NT5, pItem->lpstr is guaranteed to be a valid string, if it is not NULL. 01551 */ 01552 if (IS_ANSI && IS_DBCS_ENABLED() && pItem->lpstr != NULL) { 01553 NTSTATUS Status; 01554 ULONG cch; 01555 01556 Status = RtlUnicodeToMultiByteSize(&cch, REBASEPTR(pMenu, pItem->lpstr), pItem->cch * sizeof(WCHAR)); 01557 UserAssert(NT_SUCCESS(Status)); // RtlUnicodeToMultiByteSize is not expected to fail 01558 lpInfo->cch = cch; 01559 } else { 01560 lpInfo->cch = pItem->cch; 01561 } 01562 lpInfo->dwTypeData = NULL; 01563 01564 01565 } else { 01566 int cch = 0; 01567 01568 if (pItem->lpstr != NULL) { 01569 01570 // originally: 01571 // cch = min(lpInfo->cch - 1, (pItem->cch * sizeof(WORD))); 01572 cch = pItem->cch; 01573 UserAssert(cch >= 0); 01574 if (IS_DBCS_ENABLED()) { 01575 /* pItem->cch contains Unicode character counts, 01576 * we guess max DBCS string size for the Unicode string. 01577 */ 01578 cch *= DBCS_CHARSIZE; 01579 } 01580 cch = min(lpInfo->cch - 1, (DWORD)cch); 01581 01582 #if IS_ANSI 01583 cch = WCSToMB(REBASEPTR(pMenu, pItem->lpstr), pItem->cch, 01584 (LPSTR *)&(lpInfo->dwTypeData), cch, FALSE); 01585 #else 01586 wcsncpy(lpInfo->dwTypeData, (LPWSTR)REBASEPTR(pMenu, pItem->lpstr), 01587 cch); 01588 #endif 01589 } 01590 01591 #if IS_ANSI 01592 *((LPSTR)lpInfo->dwTypeData + cch) = (CHAR)0; 01593 #else 01594 *(lpInfo->dwTypeData + cch) = (WCHAR)0; 01595 #endif 01596 lpInfo->cch = cch; 01597 } 01598 } 01599 01600 return TRUE; 01601 01602 VALIDATIONERROR(FALSE); 01603 01604 }

ATOM WINAPI TEXT_FN( RegisterClass)(CONST WNDCLASS *lpWndClass)
 

Definition at line 1415 of file cltxt.h.

Referenced by InitApplication(), InitConsoleIME(), InitializeInstance(), msProfClassGroup(), msProfCreateDestroyButton(), msProfCreateDestroyChildWindow(), msProfCreateDestroyCombobox(), msProfCreateDestroyEdit(), msProfCreateDestroyListbox(), msProfCreateDestroyScrollbar(), msProfCreateDestroyStatic(), msProfCreateDestroyWindow(), msProfDispatchMessage(), msProfGetWindowLong(), msProfListboxInsert1(), msProfListboxInsert2(), msProfListboxInsert3(), msProfRegisterClass(), msProfSendMessage(), msProfSetWindowLong(), msProfTranslateMessage(), msProfUpdateWindow(), and SendMessageDiffThreadFunc().

01417 { 01418 WNDCLASSEX wc; 01419 01420 /* 01421 * On 64-bit plaforms we'll have 32-bits of padding between style and 01422 * lpfnWndProc in WNDCLASS, so start the copy from the first 64-bit 01423 * aligned field and hand copy the rest. 01424 */ 01425 RtlCopyMemory(&(wc.lpfnWndProc), &(lpWndClass->lpfnWndProc), sizeof(WNDCLASS) - FIELD_OFFSET(WNDCLASS, lpfnWndProc)); 01426 wc.style = lpWndClass->style; 01427 wc.hIconSm = NULL; 01428 wc.cbSize = sizeof(WNDCLASSEX); 01429 01430 return TEXT_FN(RegisterClassExWOW)(&wc, NULL, 0); 01431 }

ATOM WINAPI TEXT_FN( RegisterClassEx)(CONST WNDCLASSEX *lpWndClass)
 

Definition at line 1441 of file cltxt.h.

Referenced by InitWindowClass(), and RegisterSoftKeyboard().

01443 { 01444 if (lpWndClass->cbSize != sizeof(WNDCLASSEX)) { 01445 RIPERR1(ERROR_INVALID_PARAMETER, 01446 RIP_WARNING, 01447 "RegisterClassEx: cbsize is wrong %lX", 01448 lpWndClass->cbSize); 01449 01450 return 0; 01451 } else { 01452 return TEXT_FN(RegisterClassExWOW)((LPWNDCLASSEX)lpWndClass, 01453 NULL, 0); 01454 } 01455 }


Generated on Sat May 15 19:43:06 2004 for test by doxygen 1.3.7