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

cltxt.h

Go to the documentation of this file.
00001 /**************************************************************************\ 00002 * Module Name: cltxt.h 00003 * 00004 * Neutral Client/Server call related routines involving text. 00005 * 00006 * Copyright (c) 1985 - 1999, Microsoft Corporation 00007 * 00008 * Created: 04-Dec-90 00009 * 00010 * History: 00011 * 04-Dec-90 created by SMeans 00012 * 00013 \**************************************************************************/ 00014 00015 #ifdef UNICODE 00016 #define IS_ANSI FALSE 00017 #else 00018 #define IS_ANSI TRUE 00019 #if IS_ANSI != CW_FLAGS_ANSI 00020 # error("IS_ANSI != CW_FLAGS_ANSI) 00021 #endif 00022 #endif 00023 #include "ntsend.h" 00024 #include "powrprof.h" 00025 00026 /***************************************************************************\ 00027 * CreateWindowEx (API) 00028 * 00029 * A complete Thank cannot be generated for CreateWindowEx because its last 00030 * parameter (lpParam) is polymorphic depending on the window's class. If 00031 * the window class is "MDIClient" then lpParam points to a CLIENTCREATESTRUCT. 00032 * 00033 * History: 00034 * 04-23-91 DarrinM Created. 00035 * 04-Feb-92 IanJa Unicode/ANSI neutral 00036 \***************************************************************************/ 00037 00038 HWND WINAPI CreateWindowEx( 00039 DWORD dwExStyle, 00040 LPCTSTR lpClassName, 00041 LPCTSTR lpWindowName, 00042 DWORD dwStyle, 00043 int X, 00044 int Y, 00045 int nWidth, 00046 int nHeight, 00047 HWND hWndParent, 00048 HMENU hMenu, 00049 HINSTANCE hModule, 00050 LPVOID lpParam) 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 } 00066 00067 /***************************************************************************\ 00068 * fnHkINLPCWPSTRUCT 00069 * 00070 * This gets thunked through the message thunks, so it has the format 00071 * of a c/s message thunk call. 00072 * 00073 * 05-09-91 ScottLu Created. 00074 * 04-Feb-92 IanJa Unicode/ANSI neutral 00075 \***************************************************************************/ 00076 00077 LRESULT TEXT_FN(fnHkINLPCWPSTRUCT)( 00078 PWND pwnd, 00079 UINT message, 00080 WPARAM wParam, 00081 LPARAM lParam, 00082 ULONG_PTR xParam) 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 } 00095 00096 LRESULT TEXT_FN(fnHkINLPCWPRETSTRUCT)( 00097 PWND pwnd, 00098 UINT message, 00099 WPARAM wParam, 00100 LPARAM lParam, 00101 ULONG_PTR xParam) 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 } 00116 00117 /***************************************************************************\ 00118 * DispatchHook 00119 * 00120 * This routine exists simply to remember the hook type in the CTI structure 00121 * so that later inside of CallNextHookEx we know how to thunk the hook 00122 * call. 00123 * 00124 * 05-09-91 ScottLu Created. 00125 * 04-Feb-92 IanJa Unicode/ANSI neutral 00126 \***************************************************************************/ 00127 00128 LRESULT TEXT_FN(DispatchHook)( 00129 int dw, 00130 WPARAM wParam, 00131 LPARAM lParam, 00132 HOOKPROC pfn) 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 } 00379 00380 00381 /***************************************************************************\ 00382 * GetWindowLong, SetWindowLong, GetClassLong 00383 * 00384 * History: 00385 * 02-Feb-92 IanJa Neutral version. 00386 \***************************************************************************/ 00387 00388 LONG_PTR APIENTRY GetWindowLongPtr(HWND hwnd, int nIndex) 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 } 00407 00408 LONG_PTR APIENTRY SetWindowLongPtr(HWND hWnd, int nIndex, LONG_PTR dwNewLong) 00409 { 00410 return _SetWindowLongPtr(hWnd, nIndex, dwNewLong, IS_ANSI); 00411 } 00412 00413 #ifdef _WIN64 00414 LONG APIENTRY GetWindowLong(HWND hwnd, int nIndex) 00415 { 00416 PWND pwnd; 00417 00418 pwnd = ValidateHwnd(hwnd); 00419 00420 if (pwnd == NULL) 00421 return 0; 00422 00423 try { 00424 return _GetWindowLong(pwnd, nIndex, IS_ANSI); 00425 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00426 RIPERR1(ERROR_INVALID_WINDOW_HANDLE, 00427 RIP_WARNING, 00428 "Window %x no longer valid", 00429 hwnd); 00430 return 0; 00431 } 00432 } 00433 00434 LONG APIENTRY SetWindowLong(HWND hWnd, int nIndex, LONG dwNewLong) 00435 { 00436 return _SetWindowLong(hWnd, nIndex, dwNewLong, IS_ANSI); 00437 } 00438 #endif 00439 00440 ULONG_PTR APIENTRY GetClassLongPtr(HWND hWnd, int nIndex) 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 } 00459 00460 #ifdef _WIN64 00461 DWORD APIENTRY GetClassLong(HWND hWnd, int nIndex) 00462 { 00463 PWND pwnd; 00464 00465 pwnd = ValidateHwnd(hWnd); 00466 00467 if (pwnd == NULL) 00468 return 0; 00469 00470 try { 00471 return _GetClassLong(pwnd, nIndex, IS_ANSI); 00472 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00473 RIPERR1(ERROR_INVALID_WINDOW_HANDLE, 00474 RIP_WARNING, 00475 "Window %x no longer valid", 00476 hWnd); 00477 return 0; 00478 } 00479 } 00480 #endif 00481 00482 00483 BOOL APIENTRY PeekMessage( 00484 LPMSG lpMsg, 00485 HWND hWnd, 00486 UINT wMsgFilterMin, 00487 UINT wMsgFilterMax, 00488 UINT wRemoveMsg) 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 } 00628 00629 LRESULT APIENTRY DefWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) 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 } 00651 00652 LRESULT APIENTRY SendMessage(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) 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 } 00695 00696 00697 LRESULT APIENTRY SendMessageTimeout(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, 00698 UINT fuFlags, UINT uTimeout, PULONG_PTR lpdwResult) 00699 00700 { 00701 return SendMessageTimeoutWorker(hwnd, message, wParam, lParam, 00702 fuFlags, uTimeout, lpdwResult, IS_ANSI); 00703 } 00704 00705 00706 /***************************************************************************\ 00707 * SendDlgItemMessage 00708 * 00709 * Translates the message, calls SendDlgItemMessage on server side. The 00710 * dialog item's ID is passed as the xParam. On the server side, a stub 00711 * rearranges the parameters to put the ID where it belongs and calls 00712 * xxxSendDlgItemMessage. 00713 * 00714 * 04-17-91 DarrinM Created. 00715 \***************************************************************************/ 00716 00717 LRESULT WINAPI SendDlgItemMessage( 00718 HWND hwnd, 00719 int id, 00720 UINT message, 00721 WPARAM wParam, 00722 LPARAM lParam) 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 } 00732 00733 /***************************************************************************\ 00734 * GetDlgItemText 00735 * 00736 * History: 00737 * 04 Feb 1992 GregoryW Neutral ANSI/Unicode version 00738 \***************************************************************************/ 00739 00740 UINT GetDlgItemText( 00741 HWND hwnd, 00742 int id, 00743 LPTSTR lpch, 00744 int cchMax) 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 } 00759 00760 00761 /***************************************************************************\ 00762 * SetDlgItemText 00763 * 00764 * History: 00765 * 04 Feb 1992 GregoryW Neutral ANSI/Unicode version 00766 \***************************************************************************/ 00767 00768 BOOL SetDlgItemText( 00769 HWND hwnd, 00770 int id, 00771 LPCTSTR lpch) 00772 { 00773 if ((hwnd = GetDlgItem(hwnd, id)) != NULL) { 00774 return SetWindowText(hwnd, lpch); 00775 } 00776 00777 return FALSE; 00778 } 00779 00780 00781 int WINAPI GetWindowText( 00782 HWND hwnd, 00783 LPTSTR lpName, 00784 int nMaxCount) 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 } 00824 00825 int WINAPI GetWindowTextLength( 00826 HWND hwnd) 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 } 00846 00847 00848 BOOL WINAPI SetWindowText( 00849 HWND hwnd, 00850 LPCTSTR pString) 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 } 00872 00873 00874 LRESULT APIENTRY DispatchMessage(CONST MSG *lpMsg) 00875 { 00876 extern LRESULT DispatchMessageWorker(CONST MSG *lpMsg, BOOL fAnsi); 00877 00878 return DispatchMessageWorker(lpMsg, IS_ANSI); 00879 } 00880 00881 #if IS_ANSI 00882 void CopyLogFontAtoW( 00883 PLOGFONTW pdest, 00884 PLOGFONTA psrc) 00885 { 00886 LPSTR lpstrFont = (LPSTR)(&psrc->lfFaceName); 00887 LPWSTR lpstrFontW = (LPWSTR)(&pdest->lfFaceName); 00888 00889 memcpy((LPBYTE)pdest, psrc, sizeof(LOGFONTA) - LF_FACESIZE); 00890 memset(pdest->lfFaceName, 0, LF_FACESIZE * sizeof(WCHAR)); 00891 MBToWCS(lpstrFont, -1, &lpstrFontW, LF_FACESIZE, FALSE); 00892 } 00893 00894 void CopyLogFontWtoA( 00895 PLOGFONTA pdest, 00896 PLOGFONTW psrc) 00897 { 00898 LPSTR lpstrFont = (LPSTR)(&pdest->lfFaceName); 00899 00900 memcpy((LPBYTE)pdest, (LPBYTE)psrc, sizeof(LOGFONTA) - LF_FACESIZE); 00901 memset(pdest->lfFaceName, 0, LF_FACESIZE); 00902 WCSToMB(psrc->lfFaceName, -1, &lpstrFont, LF_FACESIZE, FALSE); 00903 } 00904 #else 00905 00906 /**************************************************************************\ 00907 * SetVideoTimeout 00908 * 00909 * Updates the video timeout values in the current power profile. 00910 * 00911 * 15-Apr-1999 JerrySh Created. 00912 \**************************************************************************/ 00913 00914 typedef BOOLEAN (*PFNGETACTIVEPWRSCHEME)(PUINT); 00915 typedef BOOLEAN (*PFNSETACTIVEPWRSCHEME)(UINT, PGLOBAL_POWER_POLICY, PPOWER_POLICY); 00916 typedef BOOLEAN (*PFNREADPWRSCHEME)(UINT, PPOWER_POLICY); 00917 00918 BOOL SetVideoTimeout( 00919 DWORD dwVideoTimeout) 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 } 00951 #endif // IS_ANSI 00952 00953 /***************************************************************************\ 00954 * SystemParametersInfo 00955 * 00956 * 00957 \***************************************************************************/ 00958 00959 BOOL APIENTRY SystemParametersInfo( 00960 UINT wFlag, 00961 UINT wParam, 00962 PVOID lParam, 00963 UINT flags) 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 } 01385 01386 01387 HANDLE APIENTRY GetProp(HWND hwnd, LPCTSTR pString) { 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 } 01405 01406 01407 /***************************************************************************\ 01408 * RegisterClassW(API) 01409 * 01410 * History: 01411 * 28-Jul-1992 ChandanC Created. 01412 \***************************************************************************/ 01413 ATOM 01414 WINAPI 01415 TEXT_FN(RegisterClass)( 01416 CONST WNDCLASS *lpWndClass ) 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 } 01432 01433 /***************************************************************************\ 01434 * RegisterClassExW(API) 01435 * 01436 * History: 01437 * 28-Jul-1992 ChandanC Created. 01438 \***************************************************************************/ 01439 ATOM 01440 WINAPI 01441 TEXT_FN(RegisterClassEx)( 01442 CONST WNDCLASSEX *lpWndClass) 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 } 01456 01457 /***************************************************************************\ 01458 * GetMenuItemInfoInternal 01459 * 01460 * History: 01461 * 07-22-96 GerardoB - Added header and Fixed up for 5.0 01462 \***************************************************************************/ 01463 BOOL TEXT_FN(GetMenuItemInfoInternal) (HMENU hMenu, UINT uID, BOOL fByPosition, 01464 LPMENUITEMINFOW lpInfo) 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 } 01605 /***************************************************************************\ 01606 * GetMenuString() 01607 * 01608 * History: 01609 * 07-22-96 GerardoB - Added header and Fixed up for 5.0 01610 \***************************************************************************/ 01611 int GetMenuString(HMENU hMenu, UINT wID, LPTSTR lpsz, int cchMax, UINT flags) 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 } 01629 01630 /***************************************************************************\ 01631 * GetMenuItemInfo 01632 * 01633 * 1) converts a MENUITEMINFO95 or a new-MENUITEMINFO-with-old-flags to a new 01634 * MENUITEMINFO -- this way all internal code can assume one look for the 01635 * structure 01636 * 2) calls the internal GetMenuItemInfo which performs validation and work 01637 * 3) converts the new MENUITEMINFO back to the original MENUITEMINFO 01638 * 01639 * History: 01640 * 07-22-96 GerardoB - Fixed up for 5.0 01641 \***************************************************************************/ 01642 01643 BOOL GetMenuItemInfo(HMENU hMenu, UINT wID, BOOL fByPos, LPMENUITEMINFO lpmii) 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 } 01679 /***************************************************************************\ 01680 * SetMenuItemInfo 01681 * 01682 * History: 01683 * 07-22-96 GerardoB - Added header and Fixed up for 5.0 01684 \***************************************************************************/ 01685 BOOL SetMenuItemInfo(HMENU hMenu, UINT uID, BOOL fByPosition, LPCMENUITEMINFO lpmii) 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 } 01696 /***************************************************************************\ 01697 * InsertMenuItem 01698 * 01699 * History: 01700 * 07-22-96 GerardoB - Added header and Fixed up for 5.0 01701 \***************************************************************************/ 01702 BOOL InsertMenuItem (HMENU hMenu, UINT uID, BOOL fByPosition, LPCMENUITEMINFO lpmii) 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 } 01713 01714 /***************************************************************************\ 01715 * InsertMenu 01716 * 01717 * History: 01718 * 07-22-96 GerardoB - Added header and Fixed up for 5.0 01719 \***************************************************************************/ 01720 BOOL InsertMenu(HMENU hMenu, UINT uPosition, UINT uFlags, UINT_PTR uIDNewItem, LPCTSTR lpNewItem) 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 } 01727 01728 /***************************************************************************\ 01729 * AppendMenu 01730 * 01731 * History: 01732 * 07-22-96 GerardoB - Added header and Fixed up for 5.0 01733 \***************************************************************************/ 01734 BOOL AppendMenu(HMENU hMenu, UINT uFlags, UINT_PTR uIDNewItem, LPCTSTR lpNewItem) 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 } 01741 /***************************************************************************\ 01742 * ModifyMenu 01743 * 01744 * History: 01745 * 07-22-96 GerardoB - Added header and Fixed up for 5.0 01746 \***************************************************************************/ 01747 BOOL ModifyMenu(HMENU hMenu, UINT uPosition, UINT uFlags, UINT_PTR uIDNewItem, LPCTSTR lpNewItem) { 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 } 01753 01754 /***************************************************************************\ 01755 * BroadcastSystemMessage 01756 * 01757 * History: 01758 * 07-22-96 GerardoB - Added header 01759 \***************************************************************************/ 01760 WINUSERAPI LONG BroadcastSystemMessage(DWORD dwFlags, LPDWORD lpdwRecipients, 01761 UINT uiMessage, WPARAM wParam, LPARAM lParam) 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 } 01769 01770 WINUSERAPI UINT WINAPI 01771 GetWindowModuleFileName(HWND hwnd, LPTSTR pszFileName, UINT cchFileNameMax) 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 } 01783 01784 /***************************************************************************\ 01785 * RegisterDeviceNotification 01786 * 01787 * History: 01788 * 01-23-97 PaulaT - Added header 01789 \***************************************************************************/ 01790 01791 WINUSERAPI HDEVNOTIFY WINAPI 01792 RegisterDeviceNotification( 01793 IN HANDLE hRecipient, 01794 IN LPVOID NotificationFilter, 01795 IN DWORD Flags 01796 ) 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 } 01812 01813 01814 01815 /***************************************************************************\ 01816 * GetMonitorInfo 01817 * 01818 * History: 01819 * 31-Mar-1997 adams Doesn't call into kernel. 01820 * 06-Jul-1998 MCostea Has to call into kernel #190510 01821 \***************************************************************************/ 01822 01823 BOOL WINUSERAPI 01824 GetMonitorInfo(HMONITOR hMonitor, LPMONITORINFO lpmi) 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 }

Generated on Sat May 15 19:39:26 2004 for test by doxygen 1.3.7