#define NDEBUG
#include <debug.h>
-
-/* dialog resources appear to pass this in 16 bits, handle them properly */
-#define CW_USEDEFAULT16 (0x8000)
-
#define POINT_IN_RECT(p, r) (((r.bottom >= p.y) && (r.top <= p.y))&&((r.left <= p.x )&&( r.right >= p.x )))
/* PRIVATE FUNCTIONS **********************************************************/
if (Flags & ~(UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE))
{
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
switch (Action)
{
case UIS_INITIALIZE:
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
case UIS_SET:
ti = GetW32ThreadInfo();
if (ti == NULL)
{
- SetLastWin32Error(ERROR_ACCESS_DENIED);
+ EngSetLastError(ERROR_ACCESS_DENIED);
return NULL;
}
}
if (!hWnd)
{
- SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
+ EngSetLastError(ERROR_INVALID_WINDOW_HANDLE);
return NULL;
}
Window = (PWND)UserGetObject(gHandleTable, hWnd, otWindow);
if (!Window || 0 != (Window->state & WNDS_DESTROYED))
{
- SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
+ EngSetLastError(ERROR_INVALID_WINDOW_HANDLE);
return NULL;
}
for (Child = Window->spwndChild; Child; Child = Child->spwndNext)
++NumChildren;
- List = ExAllocatePoolWithTag(PagedPool, (NumChildren + 1) * sizeof(HWND), TAG_WINLIST);
+ List = ExAllocatePoolWithTag(PagedPool, (NumChildren + 1) * sizeof(HWND), USERTAG_WINDOWLIST);
if(!List)
{
DPRINT1("Failed to allocate memory for children array\n");
- SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
+ EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
for (Child = Window->spwndChild, Index = 0;
PCLIENTINFO ClientInfo = GetWin32ClientInfo();
if (!Wnd) return;
-
+
if (ClientInfo->CallbackWnd.pWnd == DesktopHeapAddressToUser(Wnd))
{
ClientInfo->CallbackWnd.hWnd = NULL;
DestroyTimersForWindow(ThreadData, Window);
- HOOK_DestroyThreadHooks(ThreadData->pEThread); // This is needed here too!
+ /* Unregister hot keys */
+ UnregisterWindowHotKeys (Window);
/* flush the message queue */
MsqRemoveWindowMessagesFromQueue(Window);
ThreadData->rpdesk->rpwinstaParent->ShellListView = NULL;
}
- /* Unregister hot keys */
- UnregisterWindowHotKeys (Window);
-
/* FIXME: do we need to fake QS_MOUSEMOVE wakebit? */
#if 0 /* FIXME */
TIMER_RemoveWindowTimers(Window->head.h);
#endif
- if (!(Window->style & WS_CHILD) && Window->IDMenu
- && (Menu = UserGetMenuObject((HMENU)Window->IDMenu)))
+ if ( ((Window->style & (WS_CHILD|WS_POPUP)) != WS_CHILD) &&
+ Window->IDMenu &&
+ (Menu = UserGetMenuObject((HMENU)Window->IDMenu)))
{
IntDestroyMenuObject(Menu, TRUE, TRUE);
Window->IDMenu = 0;
if(Window->hrgnClip)
{
GreDeleteObject(Window->hrgnClip);
+ Window->hrgnClip = NULL;
}
// ASSERT(Window != NULL);
return Ret;
}
-// Move this to user space!
-BOOL FASTCALL
-IntGetWindowInfo(PWND Wnd, PWINDOWINFO pwi)
-{
- pwi->cbSize = sizeof(WINDOWINFO);
- pwi->rcWindow = Wnd->rcWindow;
- pwi->rcClient = Wnd->rcClient;
- pwi->dwStyle = Wnd->style;
- pwi->dwExStyle = Wnd->ExStyle;
- pwi->dwWindowStatus = (UserGetForegroundWindow() == Wnd->head.h); /* WS_ACTIVECAPTION */
- IntGetWindowBorderMeasures(Wnd, &pwi->cxWindowBorders, &pwi->cyWindowBorders);
- pwi->atomWindowType = (Wnd->pcls ? Wnd->pcls->atomClassName : 0);
- pwi->wCreatorVersion = 0x400; /* FIXME - return a real version number */
- return TRUE;
-}
-
static BOOL FASTCALL
IntSetMenu(
PWND Wnd,
if ((Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
{
- SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
+ EngSetLastError(ERROR_INVALID_WINDOW_HANDLE);
return FALSE;
}
{
IntReleaseMenuObject(OldMenu);
}
- SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
+ EngSetLastError(ERROR_INVALID_MENU_HANDLE);
return FALSE;
}
if (NULL != NewMenu->MenuInfo.Wnd)
{
IntReleaseMenuObject(OldMenu);
}
- SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
+ EngSetLastError(ERROR_INVALID_MENU_HANDLE);
return FALSE;
}
}
-#if 0
-HWND FASTCALL
-IntGetFocusWindow(VOID)
-{
- PUSER_MESSAGE_QUEUE Queue;
- PDESKTOP pdo = IntGetActiveDesktop();
-
- if( !pdo )
- return NULL;
-
- Queue = (PUSER_MESSAGE_QUEUE)pdo->ActiveMessageQueue;
-
- if (Queue == NULL)
- return(NULL);
- else
- return(Queue->FocusWindow);
-}
-#endif
-
PMENU_OBJECT FASTCALL
IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu)
{
PWND Window;
Window = BaseWindow;
- while (Window)
+ while (Window && ((Window->style & (WS_POPUP|WS_CHILD)) == WS_CHILD))
{
if (Window == Parent)
{
return(TRUE);
}
- if(!(Window->style & WS_CHILD))
- {
- break;
- }
Window = Window->spwndParent;
}
}
-/*
- link the window into siblings list
+/*
+ link the window into siblings list
children and parent are kept in place.
*/
VOID FASTCALL
{
if (hWndPrev == HWND_NOTOPMOST)
{
- if (!(Wnd->ExStyle & WS_EX_TOPMOST) &&
+ if (!(Wnd->ExStyle & WS_EX_TOPMOST) &&
(Wnd->ExStyle2 & WS_EX2_LINKED)) return; /* nothing to do */
Wnd->ExStyle &= ~WS_EX_TOPMOST;
hWndPrev = HWND_TOP; /* fallback to the HWND_TOP case */
}
IntUnlinkWindow(Wnd); /* unlink it from the previous location */
-
+
if (hWndPrev == HWND_BOTTOM)
{
/* Link in the bottom of the list */
IntLinkWindow(Wnd, WndInsertAfter);
/* Fix the WS_EX_TOPMOST flag */
- if (!(WndInsertAfter->ExStyle & WS_EX_TOPMOST))
+ if (!(WndInsertAfter->ExStyle & WS_EX_TOPMOST))
{
Wnd->ExStyle &= ~WS_EX_TOPMOST;
}
PWND FASTCALL
co_IntSetParent(PWND Wnd, PWND WndNewParent)
{
- PWND WndOldParent;
+ PWND WndOldParent, pWndExam;
BOOL WasVisible;
ASSERT(Wnd);
ASSERT_REFS_CO(Wnd);
ASSERT_REFS_CO(WndNewParent);
+ if (Wnd == Wnd->head.rpdesk->spwndMessage)
+ {
+ EngSetLastError(ERROR_ACCESS_DENIED);
+ return( NULL);
+ }
+
/* Some applications try to set a child as a parent */
if (IntIsChildWindow(Wnd, WndNewParent))
{
- SetLastWin32Error( ERROR_INVALID_PARAMETER );
+ EngSetLastError( ERROR_INVALID_PARAMETER );
return NULL;
}
+ pWndExam = WndNewParent; // Load parent Window to examine.
+ // Now test for set parent to parent hit.
+ while (pWndExam)
+ {
+ if (Wnd == pWndExam)
+ {
+ EngSetLastError(ERROR_INVALID_PARAMETER);
+ return NULL;
+ }
+ pWndExam = pWndExam->spwndParent;
+ }
+
/*
* Windows hides the window first, then shows it again
* including the WM_SHOWWINDOW messages and all
return WndOldParent;
}
+HWND FASTCALL
+co_UserSetParent(HWND hWndChild, HWND hWndNewParent)
+{
+ PWND Wnd = NULL, WndParent = NULL, WndOldParent;
+ HWND hWndOldParent = NULL;
+ USER_REFERENCE_ENTRY Ref, ParentRef;
+
+ if (IntIsBroadcastHwnd(hWndChild) || IntIsBroadcastHwnd(hWndNewParent))
+ {
+ EngSetLastError(ERROR_INVALID_PARAMETER);
+ return( NULL);
+ }
+
+ if (hWndChild == IntGetDesktopWindow())
+ {
+ EngSetLastError(ERROR_ACCESS_DENIED);
+ return( NULL);
+ }
+
+ if (hWndNewParent)
+ {
+ if (!(WndParent = UserGetWindowObject(hWndNewParent)))
+ {
+ return( NULL);
+ }
+ }
+ else
+ {
+ if (!(WndParent = UserGetWindowObject(IntGetDesktopWindow())))
+ {
+ return( NULL);
+ }
+ }
+
+ if (!(Wnd = UserGetWindowObject(hWndChild)))
+ {
+ return( NULL);
+ }
+
+ UserRefObjectCo(Wnd, &Ref);
+ UserRefObjectCo(WndParent, &ParentRef);
+
+ WndOldParent = co_IntSetParent(Wnd, WndParent);
+
+ UserDerefObjectCo(WndParent);
+ UserDerefObjectCo(Wnd);
+
+ if (WndOldParent)
+ {
+ hWndOldParent = WndOldParent->head.h;
+ UserDereferenceObject(WndOldParent);
+ }
+
+ return( hWndOldParent);
+}
+
BOOL FASTCALL
IntSetSystemMenu(PWND Window, PMENU_OBJECT Menu)
{
{
if (Wnd->spwndNext)
Wnd->spwndNext->spwndPrev = Wnd->spwndPrev;
-
+
if (Wnd->spwndPrev)
Wnd->spwndPrev->spwndNext = Wnd->spwndNext;
if (Wnd->spwndParent && Wnd->spwndParent->spwndChild == Wnd)
Wnd->spwndParent->spwndChild = Wnd->spwndNext;
-
+
Wnd->spwndPrev = Wnd->spwndNext = NULL;
}
/* FUNCTIONS *****************************************************************/
-/*
- * @unimplemented
- */
-DWORD APIENTRY
-NtUserAlterWindowStyle(DWORD Unknown0,
- DWORD Unknown1,
- DWORD Unknown2)
-{
- UNIMPLEMENTED
-
- return(0);
-}
-
/*
* As best as I can figure, this function is used by EnumWindows,
* EnumChildWindows, EnumDesktopWindows, & EnumThreadWindows.
ObDereferenceObject(Desktop);
}
}
- else
+ else // Build EnumThreadWindows list!
{
PETHREAD Thread;
PTHREADINFO W32Thread;
PWND Window;
Status = PsLookupThreadByThreadId((HANDLE)dwThreadId, &Thread);
- if(!NT_SUCCESS(Status))
+ if (!NT_SUCCESS(Status))
{
+ DPRINT1("Thread Id is not valid!\n");
return ERROR_INVALID_PARAMETER;
}
- if(!(W32Thread = (PTHREADINFO)Thread->Tcb.Win32Thread))
+ if (!(W32Thread = (PTHREADINFO)Thread->Tcb.Win32Thread))
{
ObDereferenceObject(Thread);
- DPRINT("Thread is not a GUI Thread!\n");
+ DPRINT1("Thread is not initialized!\n");
return ERROR_INVALID_PARAMETER;
}
Current = W32Thread->WindowListHead.Flink;
- while(Current != &(W32Thread->WindowListHead))
+ while (Current != &(W32Thread->WindowListHead))
{
Window = CONTAINING_RECORD(Current, WND, ThreadListEntry);
ASSERT(Window);
- if(bChildren || Window->spwndOwner != NULL)
+ if (dwCount < *pBufSize && pWnd)
{
- if(dwCount < *pBufSize && pWnd)
- {
- Status = MmCopyToCaller(pWnd++, &Window->head.h, sizeof(HWND));
- if(!NT_SUCCESS(Status))
- {
- SetLastNtError(Status);
- break;
- }
- }
- dwCount++;
+ _SEH2_TRY
+ {
+ ProbeForWrite(pWnd, sizeof(HWND), 1);
+ *pWnd = Window->head.h;
+ pWnd++;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = _SEH2_GetExceptionCode();
+ }
+ _SEH2_END
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("Failure to build window list!\n");
+ SetLastNtError(Status);
+ break;
+ }
}
- Current = Current->Flink;
+ dwCount++;
+ Current = Window->ThreadListEntry.Flink;
}
ObDereferenceObject(Thread);
{
co_IntSendMessage( pWindow->spwndParent->head.h,
WM_PARENTNOTIFY,
- MAKEWPARAM( msg, pWindow->IDMenu),
+ MAKEWPARAM( msg, pWindow->IDMenu),
(LPARAM)pWindow->head.h );
}
}
}
/* Allocates and initializes a window*/
-PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
- PLARGE_STRING WindowName,
+PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
+ PLARGE_STRING WindowName,
PCLS Class,
PWND ParentWindow,
PWND OwnerWindow)
Cs->dwExStyle |= WS_EX_LAYOUTRTL;
}
else
- {/*
+ {/*
Note from MSDN http://msdn.microsoft.com/en-us/library/aa913269.aspx :
Dialog boxes and message boxes do not inherit layout, so you must
Cs->dwExStyle |= WS_EX_LAYOUTRTL;
}
}
- }
+ }
}
/* Automatically add WS_EX_WINDOWEDGE */
if (bUnicodeWindow)
{
if (GETPFNCLIENTA(pWnd->pcls->fnid) == pWnd->lpfnWndProc)
- pWnd->lpfnWndProc = GETPFNCLIENTW(pWnd->pcls->fnid);
+ pWnd->lpfnWndProc = GETPFNCLIENTW(pWnd->pcls->fnid);
}
else
{
}
/* BugBoy Comments: if the window being created is a edit control, ATOM 0xCxxx,
- then my testing shows that windows (2k and XP) creates a CallProc for it immediately
+ then my testing shows that windows (2k and XP) creates a CallProc for it immediately
Dont understand why it does this. */
if (Class->atomClassName == gpsi->atomSysClass[ICLS_EDIT])
{
if (!CallProc)
{
- SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
+ EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
DPRINT1("Warning: Unable to create CallProc for edit control. Control may not operate correctly! hwnd %x\n",hWnd);
}
else
RtlCopyMemory(pWnd->strName.Buffer, WindowName->Buffer, WindowName->Length);
pWnd->strName.Buffer[WindowName->Length / sizeof(WCHAR)] = L'\0';
pWnd->strName.Length = WindowName->Length;
+ pWnd->strName.MaximumLength = WindowName->Length + sizeof(UNICODE_NULL);
}
/* Correct the window style. */
if(pWnd)
UserDereferenceObject(pWnd);
-
+
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
return NULL;
}
{
PWND Window = NULL, ParentWindow = NULL, OwnerWindow;
HWND hWnd, hWndParent, hWndOwner, hwndInsertAfter;
- DWORD dwStyle;
PWINSTATION_OBJECT WinSta;
PCLS Class = NULL;
SIZE Size;
LRESULT Result;
USER_REFERENCE_ENTRY ParentRef, Ref;
PTHREADINFO pti;
- ANSI_STRING asClassName;
DWORD dwShowMode = SW_SHOW;
- CREATESTRUCTW *pCsw;
+ CREATESTRUCTW *pCsw = NULL;
+ PVOID pszClass = NULL, pszName = NULL;
DECLARE_RETURN(PWND);
/* Get the current window station and reference it */
pCsw = NULL;
pCbtCreate = NULL;
- RtlInitAnsiString(&asClassName, NULL);
/* Get the class and reference it*/
Class = IntGetAndReferenceClass(ClassName, Cs->hInstance);
else if ((Cs->style & (WS_CHILD|WS_POPUP)) == WS_CHILD)
{
DPRINT1("Cannot create a child window without a parrent!\n");
- SetLastWin32Error(ERROR_TLW_WITH_WSCHILD);
+ EngSetLastError(ERROR_TLW_WITH_WSCHILD);
RETURN(NULL); /* WS_CHILD needs a parent, but WS_POPUP doesn't */
}
OwnerWindow = UserGetAncestor(OwnerWindow, GA_ROOT);
/* Fix the position and the size of the window */
- if (ParentWindow)
+ if (ParentWindow)
{
UserRefObjectCo(ParentWindow, &ParentRef);
IntFixWindowCoordinates(Cs, ParentWindow, &dwShowMode);
}
/* Allocate and initialize the new window */
- Window = IntCreateWindow(Cs,
- WindowName,
- Class,
- ParentWindow,
+ Window = IntCreateWindow(Cs,
+ WindowName,
+ Class,
+ ParentWindow,
OwnerWindow);
if(!Window)
{
}
hWnd = UserHMGetHandle(Window);
+ hwndInsertAfter = HWND_TOP;
UserRefObjectCo(Window, &Ref);
ObDereferenceObject(WinSta);
- //// Call the WH_CBT hook ////
-
- // Allocate the calling structures Justin Case this goes Global.
- pCsw = ExAllocatePoolWithTag(NonPagedPool, sizeof(CREATESTRUCTW), TAG_HOOK);
- pCbtCreate = ExAllocatePoolWithTag(NonPagedPool, sizeof(CBT_CREATEWNDW), TAG_HOOK);
-
- /* Fill the new CREATESTRUCTW */
- pCsw->lpCreateParams = Cs->lpCreateParams;
- pCsw->hInstance = Cs->hInstance;
- pCsw->hMenu = Cs->hMenu;
- pCsw->hwndParent = Cs->hwndParent;
- pCsw->cx = Cs->cx;
- pCsw->cy = Cs->cy;
- pCsw->x = Cs->x;
- pCsw->y = Cs->y;
- pCsw->dwExStyle = Cs->dwExStyle;
- dwStyle = Cs->style; // Save it anyway.
- pCsw->style = Window->style; /* HCBT_CREATEWND needs the real window style */
+ //// Check for a hook to eliminate overhead. ////
+ if ( ISITHOOKED(WH_CBT) || (pti->rpdesk->pDeskInfo->fsHooks & HOOKID_TO_FLAG(WH_CBT)) )
+ {
+ // Allocate the calling structures Justin Case this goes Global.
+ pCsw = ExAllocatePoolWithTag(NonPagedPool, sizeof(CREATESTRUCTW), TAG_HOOK);
+ pCbtCreate = ExAllocatePoolWithTag(NonPagedPool, sizeof(CBT_CREATEWNDW), TAG_HOOK);
- pCsw->lpszName = (LPCWSTR) WindowName->Buffer;
- pCsw->lpszClass = (LPCWSTR) ClassName->Buffer;
+ /* Fill the new CREATESTRUCTW */
+ RtlCopyMemory(pCsw, Cs, sizeof(CREATESTRUCTW));
+ pCsw->style = Window->style; /* HCBT_CREATEWND needs the real window style */
- if (Window->state & WNDS_ANSICREATOR)
- {
+ // Based on the assumption this is from "unicode source" user32, ReactOS, answer is yes.
if (!IS_ATOM(ClassName->Buffer))
{
- RtlUnicodeStringToAnsiString(&asClassName, ClassName, TRUE);
- pCsw->lpszClass = (LPCWSTR) asClassName.Buffer;
+ if (Window->state & WNDS_ANSICREATOR)
+ {
+ ANSI_STRING AnsiString;
+ AnsiString.MaximumLength = RtlUnicodeStringToAnsiSize(ClassName)+sizeof(CHAR);
+ pszClass = UserHeapAlloc(AnsiString.MaximumLength);
+ RtlZeroMemory(pszClass, AnsiString.MaximumLength);
+ AnsiString.Buffer = (PCHAR)pszClass;
+ RtlUnicodeStringToAnsiString(&AnsiString, ClassName, FALSE);
+ }
+ else
+ {
+ UNICODE_STRING UnicodeString;
+ UnicodeString.MaximumLength = ClassName->Length + sizeof(UNICODE_NULL);
+ pszClass = UserHeapAlloc(UnicodeString.MaximumLength);
+ RtlZeroMemory(pszClass, UnicodeString.MaximumLength);
+ UnicodeString.Buffer = (PWSTR)pszClass;
+ RtlCopyUnicodeString(&UnicodeString, ClassName);
+ }
+ if (pszClass) pCsw->lpszClass = UserHeapAddressToUser(pszClass);
+ }
+ if (WindowName->Length)
+ {
+ UNICODE_STRING Name;
+ Name.Buffer = WindowName->Buffer;
+ Name.Length = WindowName->Length;
+ Name.MaximumLength = WindowName->MaximumLength;
+
+ if (Window->state & WNDS_ANSICREATOR)
+ {
+ ANSI_STRING AnsiString;
+ AnsiString.MaximumLength = RtlUnicodeStringToAnsiSize(&Name)+sizeof(CHAR);
+ pszName = UserHeapAlloc(AnsiString.MaximumLength);
+ RtlZeroMemory(pszName, AnsiString.MaximumLength);
+ AnsiString.Buffer = (PCHAR)pszName;
+ RtlUnicodeStringToAnsiString(&AnsiString, &Name, FALSE);
+ }
+ else
+ {
+ UNICODE_STRING UnicodeString;
+ UnicodeString.MaximumLength = Name.Length + sizeof(UNICODE_NULL);
+ pszName = UserHeapAlloc(UnicodeString.MaximumLength);
+ RtlZeroMemory(pszName, UnicodeString.MaximumLength);
+ UnicodeString.Buffer = (PWSTR)pszName;
+ RtlCopyUnicodeString(&UnicodeString, &Name);
+ }
+ if (pszName) pCsw->lpszName = UserHeapAddressToUser(pszName);
}
- }
- pCbtCreate->lpcs = pCsw;
- pCbtCreate->hwndInsertAfter = HWND_TOP;
+ pCbtCreate->lpcs = pCsw;
+ pCbtCreate->hwndInsertAfter = hwndInsertAfter;
- Result = co_HOOK_CallHooks(WH_CBT, HCBT_CREATEWND, (WPARAM) hWnd, (LPARAM) pCbtCreate);
- if (Result != 0)
- {
- DPRINT1("WH_CBT HCBT_CREATEWND hook failed! 0x%x\n", Result);
- RETURN( (PWND) NULL);
+ //// Call the WH_CBT hook ////
+ Result = co_HOOK_CallHooks(WH_CBT, HCBT_CREATEWND, (WPARAM) hWnd, (LPARAM) pCbtCreate);
+ if (Result != 0)
+ {
+ DPRINT1("WH_CBT HCBT_CREATEWND hook failed! 0x%x\n", Result);
+ RETURN( (PWND) NULL);
+ }
+ // Write back changes.
+ Cs->cx = pCsw->cx;
+ Cs->cy = pCsw->cy;
+ Cs->x = pCsw->x;
+ Cs->y = pCsw->y;
+ hwndInsertAfter = pCbtCreate->hwndInsertAfter;
}
- // Write back changes.
- Cs->cx = pCsw->cx;
- Cs->cy = pCsw->cy;
- Cs->x = pCsw->x;
- Cs->y = pCsw->y;
- hwndInsertAfter = pCbtCreate->hwndInsertAfter;
- Cs->style = dwStyle; /* NCCREATE and WM_NCCALCSIZE need the original values*/
+ /* NCCREATE and WM_NCCALCSIZE need the original values */
+ Cs->lpszName = (LPCWSTR) WindowName;
+ Cs->lpszClass = (LPCWSTR) ClassName;
/* Send the WM_GETMINMAXINFO message*/
Size.cx = Cs->cx;
Size.cy = Cs->cy;
- if ((dwStyle & WS_THICKFRAME) || !(dwStyle & (WS_POPUP | WS_CHILD)))
+ if ((Cs->style & WS_THICKFRAME) || !(Cs->style & (WS_POPUP | WS_CHILD)))
{
POINT MaxSize, MaxPos, MinTrack, MaxTrack;
Window->rcWindow.bottom = Cs->y + Size.cy;
if (0 != (Window->style & WS_CHILD) && ParentWindow)
{
- RECTL_vOffsetRect(&Window->rcWindow,
+ RECTL_vOffsetRect(&Window->rcWindow,
ParentWindow->rcClient.left,
ParentWindow->rcClient.top);
}
Window->rcClient = Window->rcWindow;
-
/* Link the window*/
if (NULL != ParentWindow)
{
/* link the window into the siblings list */
- if ((dwStyle & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD)
+ if ((Cs->style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD)
IntLinkHwnd(Window, HWND_BOTTOM);
else
- IntLinkHwnd(Window, HWND_TOP);
+ IntLinkHwnd(Window, hwndInsertAfter);
}
-
+
/* Send the NCCREATE message */
Result = co_IntSendMessage(UserHMGetHandle(Window), WM_NCCREATE, 0, (LPARAM) Cs);
if (!Result)
CLEANUP:
if (!_ret_)
{
+ DPRINT("co_UserCreateWindowEx(): Error Created window!\n");
/* If the window was created, the class will be dereferenced by co_UserDestroyWindow */
- if (Window)
+ if (Window)
co_UserDestroyWindow(Window);
else if (Class)
IntDereferenceClass(Class, pti->pDeskInfo, pti->ppi);
if (pCsw) ExFreePoolWithTag(pCsw, TAG_HOOK);
if (pCbtCreate) ExFreePoolWithTag(pCbtCreate, TAG_HOOK);
- RtlFreeAnsiString(&asClassName);
+ if (pszName) UserHeapFree(pszName);
+ if (pszClass) UserHeapFree(pszClass);
if (Window)
{
Cs.cy = nHeight;
Cs.x = x;
Cs.y = y;
-// Cs.lpszName = (LPCWSTR) WindowName->Buffer;
-// Cs.lpszClass = (LPCWSTR) ClassName->Buffer;
- Cs.lpszName = (LPCWSTR) plstrWindowName;
- Cs.lpszClass = (LPCWSTR) &ustrClassName;
+ Cs.lpszName = (LPCWSTR) plstrWindowName->Buffer;
+ if (IS_ATOM(plstrClassName))
+ Cs.lpszClass = (LPCWSTR) plstrClassName;
+ else
+ Cs.lpszClass = (LPCWSTR) plstrClassName->Buffer;
Cs.dwExStyle = dwExStyle;
UserEnterExclusive();
return hwnd;
}
-/*
- * @unimplemented
- */
-HDWP APIENTRY
-NtUserDeferWindowPos(HDWP WinPosInfo,
- HWND Wnd,
- HWND WndInsertAfter,
- int x,
- int y,
- int cx,
- int cy,
- UINT Flags)
-{
- UNIMPLEMENTED
-
- return 0;
-}
-
BOOLEAN FASTCALL co_UserDestroyWindow(PWND Window)
{
if ( (Window->head.pti->pEThread != PsGetCurrentThread()) ||
Window->head.pti != PsGetCurrentThreadWin32Thread() )
{
- SetLastWin32Error(ERROR_ACCESS_DENIED);
+ EngSetLastError(ERROR_ACCESS_DENIED);
return FALSE;
}
msg.wParam = IntGetSysCursorInfo()->ButtonsDown;
msg.lParam = MAKELPARAM(gpsi->ptCursor.x, gpsi->ptCursor.y);
msg.pt = gpsi->ptCursor;
- MsqInsertSystemMessage(&msg);
+ co_MsqInsertMouseMessage(&msg);
if (!IntIsWindow(Window->head.h))
{
}
-
-/*
- * @unimplemented
- */
-DWORD
-APIENTRY
-NtUserDrawMenuBarTemp(
- HWND hWnd,
- HDC hDC,
- PRECT hRect,
- HMENU hMenu,
- HFONT hFont)
-{
- /* we'll use this function just for caching the menu bar */
- UNIMPLEMENTED
- return 0;
-}
-
-
-/*
- * @unimplemented
- */
-DWORD APIENTRY
-NtUserEndDeferWindowPosEx(DWORD Unknown0,
- DWORD Unknown1)
-{
- UNIMPLEMENTED
-
- return 0;
-}
-
-
-/*
- * FillWindow: Called from User; Dialog, Edit and ListBox procs during a WM_ERASEBKGND.
- */
-/*
- * @unimplemented
- */
-BOOL APIENTRY
-NtUserFillWindow(HWND hWndPaint,
- HWND hWndPaint1,
- HDC hDC,
- HBRUSH hBrush)
-{
- UNIMPLEMENTED
-
- return 0;
-}
-
-
static HWND FASTCALL
IntFindWindow(PWND Parent,
PWND ChildAfter,
CurrentWindowName.Buffer = Child->strName.Buffer;
CurrentWindowName.Length = Child->strName.Length;
CurrentWindowName.MaximumLength = Child->strName.MaximumLength;
- if(!CheckWindowName ||
+ if(!CheckWindowName ||
(Child->strName.Length < 0xFFFF &&
!RtlCompareUnicodeString(WindowName, &CurrentWindowName, TRUE)))
{
}
else if (!IS_ATOM(ClassName.Buffer))
{
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
_SEH2_LEAVE;
}
if (ClassName.Length == 0 && ClassName.Buffer != NULL &&
!IS_ATOM(ClassName.Buffer))
{
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
RETURN(NULL);
}
else if (ClassAtom == (RTL_ATOM)0)
ustr.Buffer = TopLevelWindow->strName.Buffer;
ustr.Length = TopLevelWindow->strName.Length;
ustr.MaximumLength = TopLevelWindow->strName.MaximumLength;
- WindowMatches = !CheckWindowName ||
- (TopLevelWindow->strName.Length < 0xFFFF &&
+ WindowMatches = !CheckWindowName ||
+ (TopLevelWindow->strName.Length < 0xFFFF &&
!RtlCompareUnicodeString(&WindowName, &ustr, TRUE));
ClassMatches = (ClassAtom == (RTL_ATOM)0) ||
ClassAtom == TopLevelWindow->pcls->atomClassName;
}
-/*
- * @unimplemented
- */
-BOOL APIENTRY
-NtUserFlashWindowEx(IN PFLASHWINFO pfwi)
-{
- UNIMPLEMENTED
-
- return 0;
-}
-
-
/*
* @implemented
*/
sizeof(POINT),
1);
}
-
+
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
}
_SEH2_END;
- wndpl.length = sizeof(WINDOWPLACEMENT);
+ wndpl.length = sizeof(WINDOWPLACEMENT);
if (IntGetWindowPlacement(Window, &wndpl) && !Hit)
{
{
RtlCopyMemory(ptIcon, &wndpl.ptMinPosition, sizeof(POINT));
}
-
+
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
END_CLEANUP;
}
-
-HWND FASTCALL
-co_UserSetParent(HWND hWndChild, HWND hWndNewParent)
-{
- PWND Wnd = NULL, WndParent = NULL, WndOldParent;
- HWND hWndOldParent = NULL;
- USER_REFERENCE_ENTRY Ref, ParentRef;
-
- if (IntIsBroadcastHwnd(hWndChild) || IntIsBroadcastHwnd(hWndNewParent))
- {
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
- return( NULL);
- }
-
- if (hWndChild == IntGetDesktopWindow())
- {
- SetLastWin32Error(ERROR_ACCESS_DENIED);
- return( NULL);
- }
-
- if (hWndNewParent)
- {
- if (!(WndParent = UserGetWindowObject(hWndNewParent)))
- {
- return( NULL);
- }
- }
- else
- {
- if (!(WndParent = UserGetWindowObject(IntGetDesktopWindow())))
- {
- return( NULL);
- }
- }
-
- if (!(Wnd = UserGetWindowObject(hWndChild)))
- {
- return( NULL);
- }
-
- UserRefObjectCo(Wnd, &Ref);
- UserRefObjectCo(WndParent, &ParentRef);
-
- WndOldParent = co_IntSetParent(Wnd, WndParent);
-
- UserDerefObjectCo(WndParent);
- UserDerefObjectCo(Wnd);
-
- if (WndOldParent)
- {
- hWndOldParent = WndOldParent->head.h;
- UserDereferenceObject(WndOldParent);
- }
-
- return( hWndOldParent);
-}
-
/*
* NtUserSetParent
*
if (hWnd == IntGetDesktopWindow())
{
- SetLastWin32Error(STATUS_ACCESS_DENIED);
+ EngSetLastError(STATUS_ACCESS_DENIED);
return( 0);
}
{
if ((Index + sizeof(LONG)) > Window->cbwndExtra)
{
- SetLastWin32Error(ERROR_INVALID_INDEX);
+ EngSetLastError(ERROR_INVALID_INDEX);
return( 0);
}
if ( Window->head.pti->ppi != PsGetCurrentProcessWin32Process() ||
Window->fnid & FNID_FREED)
{
- SetLastWin32Error(ERROR_ACCESS_DENIED);
+ EngSetLastError(ERROR_ACCESS_DENIED);
return( 0);
}
OldValue = (LONG)IntSetWindowProc(Window,
default:
DPRINT1("NtUserSetWindowLong(): Unsupported index %d\n", Index);
- SetLastWin32Error(ERROR_INVALID_INDEX);
+ EngSetLastError(ERROR_INVALID_INDEX);
OldValue = 0;
break;
}
default:
if (Index < 0)
{
- SetLastWin32Error(ERROR_INVALID_INDEX);
+ EngSetLastError(ERROR_INVALID_INDEX);
RETURN( 0);
}
}
if (Index > Window->cbwndExtra - sizeof(WORD))
{
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
RETURN( 0);
}
END_CLEANUP;
}
-
/*
- * @unimplemented
- */
-BOOL APIENTRY
-NtUserLockWindowUpdate(HWND hWnd)
-{
- UNIMPLEMENTED
-
- return 0;
-}
-
-
-/*
- * @implemented
- */
-BOOL APIENTRY
-NtUserMoveWindow(
- HWND hWnd,
- int X,
- int Y,
- int nWidth,
- int nHeight,
- BOOL bRepaint)
-{
- return NtUserSetWindowPos(hWnd, 0, X, Y, nWidth, nHeight,
- (bRepaint ? SWP_NOZORDER | SWP_NOACTIVATE :
- SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW));
-}
-
-/*
- QueryWindow based on KJK::Hyperion and James Tabor.
+ QueryWindow based on KJK::Hyperion and James Tabor.
0 = QWUniqueProcessId
1 = QWUniqueThreadId
}
-/*
- * @unimplemented
- */
-DWORD APIENTRY
-NtUserRealChildWindowFromPoint(DWORD Unknown0,
- DWORD Unknown1,
- DWORD Unknown2)
-{
- UNIMPLEMENTED
-
- return 0;
-}
-
-
/*
* @implemented
*/
if(MessageNameUnsafe == NULL)
{
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
RETURN( 0);
}
}
-/*
- * @unimplemented
- */
-DWORD APIENTRY
-NtUserSetImeOwnerWindow(DWORD Unknown0,
- DWORD Unknown1)
-{
- UNIMPLEMENTED
-
- return 0;
-}
-
-
-/*
- * @unimplemented
- */
-DWORD APIENTRY
-NtUserSetInternalWindowPos(
- HWND hwnd,
- UINT showCmd,
- LPRECT rect,
- LPPOINT pt)
-{
- UNIMPLEMENTED
-
- return 0;
-
-}
-
-
-/*
- * @unimplemented
- */
-BOOL APIENTRY
-NtUserSetLayeredWindowAttributes(HWND hwnd,
- COLORREF crKey,
- BYTE bAlpha,
- DWORD dwFlags)
-{
- UNIMPLEMENTED;
- return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-BOOL APIENTRY
-NtUserSetLogonNotifyWindow(HWND hWnd)
-{
- UNIMPLEMENTED
-
- return 0;
-}
-
-
/*
* @implemented
*/
RETURN( FALSE);
}
- if (Wnd->pcls)
- { // From user land we only set these.
- if ((fnID != FNID_DESTROY) || ((fnID < FNID_BUTTON) && (fnID > FNID_IME)) )
- {
- RETURN( FALSE);
- }
- else
- Wnd->pcls->fnid |= fnID;
- }
- RETURN( TRUE);
-
-CLEANUP:
- DPRINT("Leave NtUserSetWindowFNID\n");
- UserLeave();
- END_CLEANUP;
-}
-
-
-/*
- * @implemented
- */
-BOOL APIENTRY
-NtUserSetWindowPlacement(HWND hWnd,
- WINDOWPLACEMENT *lpwndpl)
-{
- PWND Wnd;
- WINDOWPLACEMENT Safepl;
- NTSTATUS Status;
- DECLARE_RETURN(BOOL);
- USER_REFERENCE_ENTRY Ref;
-
- DPRINT("Enter NtUserSetWindowPlacement\n");
- UserEnterExclusive();
-
- if (!(Wnd = UserGetWindowObject(hWnd)))
- {
- RETURN( FALSE);
- }
-
- Status = MmCopyFromCaller(&Safepl, lpwndpl, sizeof(WINDOWPLACEMENT));
- if(!NT_SUCCESS(Status))
- {
- SetLastNtError(Status);
- RETURN( FALSE);
- }
- if(Safepl.length != sizeof(WINDOWPLACEMENT))
+ if (Wnd->head.pti->ppi != PsGetCurrentProcessWin32Process())
{
+ EngSetLastError(ERROR_ACCESS_DENIED);
RETURN( FALSE);
}
- UserRefObjectCo(Wnd, &Ref);
-
- if ((Wnd->style & (WS_MAXIMIZE | WS_MINIMIZE)) == 0)
- {
- co_WinPosSetWindowPos(Wnd, NULL,
- Safepl.rcNormalPosition.left, Safepl.rcNormalPosition.top,
- Safepl.rcNormalPosition.right - Safepl.rcNormalPosition.left,
- Safepl.rcNormalPosition.bottom - Safepl.rcNormalPosition.top,
- SWP_NOZORDER | SWP_NOACTIVATE);
- }
-
- /* FIXME - change window status */
- co_WinPosShowWindow(Wnd, Safepl.showCmd);
-
- Wnd->InternalPosInitialized = TRUE;
- Wnd->InternalPos.NormalRect = Safepl.rcNormalPosition;
- Wnd->InternalPos.IconPos = Safepl.ptMinPosition;
- Wnd->InternalPos.MaxPos = Safepl.ptMaxPosition;
-
- UserDerefObjectCo(Wnd);
- RETURN(TRUE);
-
-CLEANUP:
- DPRINT("Leave NtUserSetWindowPlacement, ret=%i\n",_ret_);
- UserLeave();
- END_CLEANUP;
-}
-
-
-/*
- * @implemented
- */
-BOOL APIENTRY
-NtUserSetWindowPos(
- HWND hWnd,
- HWND hWndInsertAfter,
- int X,
- int Y,
- int cx,
- int cy,
- UINT uFlags)
-{
- DECLARE_RETURN(BOOL);
- PWND Window;
- BOOL ret;
- USER_REFERENCE_ENTRY Ref;
-
- DPRINT("Enter NtUserSetWindowPos\n");
- UserEnterExclusive();
-
- if (!(Window = UserGetWindowObject(hWnd)))
- {
- RETURN(FALSE);
- }
-
- /* First make sure that coordinates are valid for WM_WINDOWPOSCHANGING */
- if (!(uFlags & SWP_NOMOVE))
- {
- if (X < -32768) X = -32768;
- else if (X > 32767) X = 32767;
- if (Y < -32768) Y = -32768;
- else if (Y > 32767) Y = 32767;
- }
- if (!(uFlags & SWP_NOSIZE))
- {
- if (cx < 0) cx = 0;
- else if (cx > 32767) cx = 32767;
- if (cy < 0) cy = 0;
- else if (cy > 32767) cy = 32767;
- }
-
- UserRefObjectCo(Window, &Ref);
- ret = co_WinPosSetWindowPos(Window, hWndInsertAfter, X, Y, cx, cy, uFlags);
- UserDerefObjectCo(Window);
-
- RETURN(ret);
-
-CLEANUP:
- DPRINT("Leave NtUserSetWindowPos, ret=%i\n",_ret_);
- UserLeave();
- END_CLEANUP;
-}
-
-
-INT FASTCALL
-IntGetWindowRgn(PWND Window, HRGN hRgn)
-{
- INT Ret;
- HRGN VisRgn;
- ROSRGNDATA *pRgn;
-
- if(!Window)
- {
- return ERROR;
- }
- if(!hRgn)
- {
- return ERROR;
- }
-
- /* Create a new window region using the window rectangle */
- VisRgn = IntSysCreateRectRgnIndirect(&Window->rcWindow);
- NtGdiOffsetRgn(VisRgn, -Window->rcWindow.left, -Window->rcWindow.top);
- /* if there's a region assigned to the window, combine them both */
- if(Window->hrgnClip && !(Window->style & WS_MINIMIZE))
- NtGdiCombineRgn(VisRgn, VisRgn, Window->hrgnClip, RGN_AND);
- /* Copy the region into hRgn */
- NtGdiCombineRgn(hRgn, VisRgn, NULL, RGN_COPY);
-
- if((pRgn = RGNOBJAPI_Lock(hRgn, NULL)))
- {
- Ret = REGION_Complexity(pRgn);
- RGNOBJAPI_Unlock(pRgn);
- }
- else
- Ret = ERROR;
-
- REGION_FreeRgnByHandle(VisRgn);
-
- return Ret;
-}
-
-INT FASTCALL
-IntGetWindowRgnBox(PWND Window, RECTL *Rect)
-{
- INT Ret;
- HRGN VisRgn;
- ROSRGNDATA *pRgn;
-
- if(!Window)
- {
- return ERROR;
- }
- if(!Rect)
- {
- return ERROR;
- }
-
- /* Create a new window region using the window rectangle */
- VisRgn = IntSysCreateRectRgnIndirect(&Window->rcWindow);
- NtGdiOffsetRgn(VisRgn, -Window->rcWindow.left, -Window->rcWindow.top);
- /* if there's a region assigned to the window, combine them both */
- if(Window->hrgnClip && !(Window->style & WS_MINIMIZE))
- NtGdiCombineRgn(VisRgn, VisRgn, Window->hrgnClip, RGN_AND);
-
- if((pRgn = RGNOBJAPI_Lock(VisRgn, NULL)))
- {
- Ret = REGION_Complexity(pRgn);
- *Rect = pRgn->rdh.rcBound;
- RGNOBJAPI_Unlock(pRgn);
- }
- else
- Ret = ERROR;
-
- REGION_FreeRgnByHandle(VisRgn);
-
- return Ret;
-}
-
-
-/*
- * @implemented
- */
-INT APIENTRY
-NtUserSetWindowRgn(
- HWND hWnd,
- HRGN hRgn,
- BOOL bRedraw)
-{
- HRGN hrgnCopy;
- PWND Window;
- DECLARE_RETURN(INT);
-
- DPRINT("Enter NtUserSetWindowRgn\n");
- UserEnterExclusive();
-
- if (!(Window = UserGetWindowObject(hWnd)))
- {
- RETURN( 0);
- }
-
- if (hRgn) // The region will be deleted in user32.
- {
- if (GDIOBJ_ValidateHandle(hRgn, GDI_OBJECT_TYPE_REGION))
+ // From user land we only set these.
+ if (fnID != FNID_DESTROY)
+ { // Hacked so we can mark desktop~!
+ if ( (/*(fnID < FNID_BUTTON)*/ (fnID < FNID_FIRST) && (fnID > FNID_GHOST)) ||
+ Wnd->fnid != 0 )
{
- hrgnCopy = IntSysCreateRectRgn(0, 0, 0, 0);
- NtGdiCombineRgn(hrgnCopy, hRgn, 0, RGN_COPY);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
+ RETURN( FALSE);
}
- else
- RETURN( 0);
}
- else
- hrgnCopy = (HRGN) 1;
- if (Window->hrgnClip)
- {
- /* Delete no longer needed region handle */
- GreDeleteObject(Window->hrgnClip);
- }
- Window->hrgnClip = hrgnCopy;
-
- /* FIXME - send WM_WINDOWPOSCHANGING and WM_WINDOWPOSCHANGED messages to the window */
-
- if(bRedraw)
- {
- USER_REFERENCE_ENTRY Ref;
- UserRefObjectCo(Window, &Ref);
- co_UserRedrawWindow(Window, NULL, NULL, RDW_INVALIDATE);
- UserDerefObjectCo(Window);
- }
-
- RETURN( (INT)hRgn);
-
-CLEANUP:
- DPRINT("Leave NtUserSetWindowRgn, ret=%i\n",_ret_);
- UserLeave();
- END_CLEANUP;
-}
-
-
-/*
- * @implemented
- */
-BOOL APIENTRY
-NtUserShowWindow(HWND hWnd, LONG nCmdShow)
-{
- PWND Window;
- BOOL ret;
- DECLARE_RETURN(BOOL);
- USER_REFERENCE_ENTRY Ref;
-
- DPRINT("Enter NtUserShowWindow\n");
- UserEnterExclusive();
-
- if (!(Window = UserGetWindowObject(hWnd)))
- {
- RETURN(FALSE);
- }
-
- UserRefObjectCo(Window, &Ref);
- ret = co_WinPosShowWindow(Window, nCmdShow);
- UserDerefObjectCo(Window);
-
- RETURN(ret);
+ Wnd->fnid |= fnID;
+ RETURN( TRUE);
CLEANUP:
- DPRINT("Leave NtUserShowWindow, ret=%i\n",_ret_);
+ DPRINT("Leave NtUserSetWindowFNID\n");
UserLeave();
END_CLEANUP;
}
-
-/*
- * @unimplemented
- */
-BOOL APIENTRY
-NtUserShowWindowAsync(HWND hWnd, LONG nCmdShow)
-{
-#if 0
- UNIMPLEMENTED
- return 0;
-#else
- return NtUserShowWindow(hWnd, nCmdShow);
-#endif
-}
-
-
-/*
- * @unimplemented
- */
-BOOL
-APIENTRY
-NtUserUpdateLayeredWindow(
- HWND hwnd,
- HDC hdcDst,
- POINT *pptDst,
- SIZE *psize,
- HDC hdcSrc,
- POINT *pptSrc,
- COLORREF crKey,
- BLENDFUNCTION *pblend,
- DWORD dwFlags,
- RECT *prcDirty)
-{
- UNIMPLEMENTED
-
- return 0;
-}
-
-/*
- * @unimplemented
- */
-HWND APIENTRY
-NtUserWindowFromPhysicalPoint(POINT Point)
-{
- UNIMPLEMENTED
-
- return NULL;
-}
-
/*
* @implemented
*/
POINT pt;
HWND Ret;
PWND DesktopWindow = NULL, Window = NULL;
+ USHORT hittest;
DECLARE_RETURN(HWND);
USER_REFERENCE_ENTRY Ref;
UserRefObjectCo(DesktopWindow, &Ref);
pti = PsGetCurrentThreadWin32Thread();
- co_WinPosWindowFromPoint(DesktopWindow, pti->MessageQueue, &pt, &Window);
+ Window = co_WinPosWindowFromPoint(DesktopWindow, &pt, &hittest);
if(Window)
{
}
else
{
- SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
+ EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
Ret = FALSE;
goto Exit;
}
if(lpString && (nMaxCount <= 1))
{
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
RETURN( 0);
}
PUSER_HANDLE_ENTRY entry;
if (!(entry = handle_to_entry(gHandleTable, handle )))
{
- SetLastWin32Error(ERROR_INVALID_HANDLE);
+ EngSetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
uType = entry->type;
return UserGetCallProcInfo( handle, &Proc );
}
default:
- SetLastWin32Error(ERROR_INVALID_HANDLE);
+ EngSetLastError(ERROR_INVALID_HANDLE);
}
}
else