Get rid of our old cursoricon implementation. Rename cursoricon_new.c to cursoricon.c and remove all traces of NEW_CURSORICON

svn path=/trunk/; revision=66526
This commit is contained in:
Timo Kreuzer 2015-03-01 17:36:12 +00:00
parent 400b4d9289
commit 5e781d44e0
19 changed files with 3263 additions and 7481 deletions

View file

@ -1,6 +1,5 @@
set(USE_DIBLIB FALSE)
set(USE_NEW_CURSORICON TRUE)
# Give WIN32 subsystem its own project.
PROJECT(WIN32SS)
@ -11,10 +10,6 @@ if(USE_DIBLIB)
add_subdirectory(gdi/diblib)
endif()
if(USE_NEW_CURSORICON)
add_definitions(-DNEW_CURSORICON)
endif()
add_subdirectory(gdi/gdi32)
add_subdirectory(reactx)
add_subdirectory(user/user32)
@ -106,6 +101,7 @@ list(APPEND SOURCE
user/ntuser/class.c
user/ntuser/clipboard.c
user/ntuser/csr.c
user/ntuser/cursoricon.c
user/ntuser/dde.c
user/ntuser/defwnd.c
user/ntuser/desktop.c
@ -198,12 +194,6 @@ else()
${GENDIB_FILES})
endif()
if(USE_NEW_CURSORICON)
list(APPEND SOURCE user/ntuser/cursoricon_new.c)
else()
list(APPEND SOURCE user/ntuser/cursoricon.c)
endif()
if(ARCH STREQUAL "i386")
list(APPEND ASM_SOURCE
gdi/dib/i386/dib24bpp_hline.s

View file

@ -435,7 +435,7 @@ typedef struct tagPOPUPMENU
struct _WND *spwndPrevPopup;
PMENU spmenu;
PMENU spmenuAlternate;
struct _WND *spwndActivePopup;
struct _WND *spwndActivePopup;
struct tagPOPUPMENU *ppopupmenuRoot;
struct tagPOPUPMENU *ppmDelayedFree;
UINT posSelectedItem;
@ -545,24 +545,12 @@ typedef struct _CLS
INT cbclsExtra;
INT cbwndExtra;
HINSTANCE hModule;
#ifdef NEW_CURSORICON
struct _CURICON_OBJECT *spicn;
struct _CURICON_OBJECT *spcur;
#else
HANDLE hIcon; /* FIXME - Use pointer! */
HANDLE hCursor; /* FIXME - Use pointer! */
#endif
HBRUSH hbrBackground;
PWSTR lpszMenuName; /* kernel use */
PSTR lpszAnsiClassName; /* " */
#ifdef NEW_CURSORICON
struct _CURICON_OBJECT *spicnSm;
#else
HANDLE hIconSm; /* FIXME - Use pointer! */
//// ReactOS doesn't support cache icons. */
HICON hIconSmIntern; /* Internal small icon, derived from hIcon */
#endif
////
UINT Unicode:1; // !CSF_ANSIPROC
UINT Global:1; // CS_GLOBALCLASS or CSF_SERVERSIDEPROC
@ -2990,8 +2978,6 @@ NtUserSetCursorContents(
HANDLE Handle,
PICONINFO IconInfo);
#ifdef NEW_CURSORICON
BOOL
NTAPI
NtUserSetCursorIconData(
@ -3014,28 +3000,6 @@ NtUserFindExistingCursorIcon(
_In_ PUNICODE_STRING pustrRsrc,
_In_ FINDEXISTINGCURICONPARAM *param);
#else /* NEW_CURSORICON */
BOOL
NTAPI
NtUserSetCursorIconData(
HANDLE Handle,
PBOOL fIcon,
POINT *Hotspot,
HMODULE hModule,
HRSRC hRsrc,
HRSRC hGroupRsrc);
HICON
NTAPI
NtUserFindExistingCursorIcon(
HMODULE hModule,
HRSRC hRsrc,
LONG cx,
LONG cy);
#endif /* NEW_CURSORICON */
DWORD
NTAPI
NtUserSetDbgTag(

View file

@ -265,7 +265,6 @@ IntDestroyClass(IN OUT PCLS Class)
IntFreeClassMenuName(Class);
}
#ifdef NEW_CURSORICON
if (Class->spicn)
UserDereferenceObject(Class->spicn);
if (Class->spcur)
@ -278,10 +277,6 @@ IntDestroyClass(IN OUT PCLS Class)
&& !(UserObjectInDestroy(UserHMGetHandle(Class->spicnSm))))
IntDestroyCurIconObject(Class->spicnSm);
}
#else
if (Class->hIconSmIntern)
IntClassDestroyIcon(Class->hIconSmIntern);
#endif
pDesk = Class->rpdeskParent;
Class->rpdeskParent = NULL;
@ -377,14 +372,14 @@ RegisterControlAtoms(VOID)
RTL_ATOM Atom;
UNICODE_STRING ClassName;
INT i = 0;
while ( i < ICLS_DESKTOP)
{
RtlInitUnicodeString(&ClassName, ControlsList[i]);
if (IntRegisterClassAtom(&ClassName, &Atom))
{
gpsi->atomSysClass[i] = Atom;
ERR("Reg Control Atoms 0x%x\n",Atom);
ERR("Reg Control Atoms 0x%x\n",Atom);
}
i++;
}
@ -648,7 +643,6 @@ IntGetClassForDesktop(IN OUT PCLS BaseClass,
/* Simply clone the class */
RtlCopyMemory( Class, BaseClass, ClassSize);
#ifdef NEW_CURSORICON
/* Reference our objects */
if (Class->spcur)
UserReferenceObject(Class->spcur);
@ -656,7 +650,6 @@ IntGetClassForDesktop(IN OUT PCLS BaseClass,
UserReferenceObject(Class->spicn);
if (Class->spicnSm)
UserReferenceObject(Class->spicnSm);
#endif
TRACE("Clone Class 0x%p hM 0x%p\n %S\n",Class, Class->hModule, Class->lpszClientUnicodeMenuName);
@ -884,15 +877,12 @@ IntMoveClassToSharedHeap(IN OUT PCLS Class,
NewClass->rpdeskParent = NULL;
NewClass->pclsBase = NewClass;
#ifdef NEW_CURSORICON
if (NewClass->spcur)
UserReferenceObject(NewClass->spcur);
if (NewClass->spicn)
UserReferenceObject(NewClass->spicn);
if (NewClass->spicnSm)
UserReferenceObject(NewClass->spicnSm);
#endif
/* Replace the class in the list */
(void)InterlockedExchangePointer((PVOID*)*ClassLinkPtr,
@ -1086,15 +1076,9 @@ IntCreateClass(IN CONST WNDCLASSEXW* lpwcx,
Class->cbclsExtra = lpwcx->cbClsExtra;
Class->cbwndExtra = lpwcx->cbWndExtra;
Class->hModule = lpwcx->hInstance;
#ifdef NEW_CURSORICON
Class->spicn = lpwcx->hIcon ? UserGetCurIconObject(lpwcx->hIcon) : NULL;
Class->spcur = lpwcx->hCursor ? UserGetCurIconObject(lpwcx->hCursor) : NULL;
Class->spicnSm = lpwcx->hIconSm ? UserGetCurIconObject(lpwcx->hIconSm) : NULL;
#else
Class->hIcon = lpwcx->hIcon;
Class->hIconSm = lpwcx->hIconSm;
Class->hCursor = lpwcx->hCursor;
#endif
////
Class->hbrBackground = lpwcx->hbrBackground;
@ -1808,29 +1792,6 @@ IntSetClassMenuName(IN PCLS Class,
return Ret;
}
#ifndef NEW_CURSORICON
BOOL FASTCALL
IntClassDestroyIcon(HANDLE hCurIcon)
{
PCURICON_OBJECT CurIcon;
BOOL Ret;
if (!(CurIcon = UserGetCurIconObject(hCurIcon)))
{
ERR("hCurIcon was not found!\n");
return FALSE;
}
/* Note: IntDestroyCurIconObject will remove our reference for us! */
Ret = IntDestroyCurIconObject(CurIcon, GetW32ProcessInfo());
if (!Ret)
{
ERR("hCurIcon was not Destroyed!\n");
}
return Ret;
}
#endif
ULONG_PTR
UserSetClassLongPtr(IN PCLS Class,
IN INT Index,
@ -1838,9 +1799,6 @@ UserSetClassLongPtr(IN PCLS Class,
IN BOOL Ansi)
{
ULONG_PTR Ret = 0;
#ifndef NEW_CURSORICON
HANDLE hIconSmIntern = NULL;
#endif
/* NOTE: For GCLP_MENUNAME and GCW_ATOM this function may raise an exception! */
@ -1912,7 +1870,6 @@ UserSetClassLongPtr(IN PCLS Class,
}
break;
#ifdef NEW_CURSORICON
case GCLP_HCURSOR:
{
PCURICON_OBJECT NewCursor = NULL;
@ -1959,21 +1916,6 @@ UserSetClassLongPtr(IN PCLS Class,
break;
}
#else
case GCLP_HCURSOR:
/* FIXME: Get handle from pointer to CURSOR object */
Ret = (ULONG_PTR)Class->hCursor;
Class->hCursor = (HANDLE)NewLong;
/* Update the clones */
Class = Class->pclsClone;
while (Class != NULL)
{
Class->hCursor = (HANDLE)NewLong;
Class = Class->pclsNext;
}
break;
#endif
// MSDN:
// hIconSm, A handle to a small icon that is associated with the window class.
@ -1981,7 +1923,6 @@ UserSetClassLongPtr(IN PCLS Class,
// the hIcon member for an icon of the appropriate size to use as the small icon.
//
case GCLP_HICON:
#ifdef NEW_CURSORICON
{
PCURICON_OBJECT NewIcon = NULL;
PCURICON_OBJECT NewSmallIcon = NULL;
@ -2076,38 +2017,8 @@ UserSetClassLongPtr(IN PCLS Class,
}
break;
}
#else
/* FIXME: Get handle from pointer to ICON object */
Ret = (ULONG_PTR)Class->hIcon;
if (Class->hIcon == (HANDLE)NewLong) break;
if (Ret && Class->hIconSmIntern)
{
IntClassDestroyIcon(Class->hIconSmIntern);
Class->CSF_flags &= ~CSF_CACHEDSMICON;
Class->hIconSmIntern = NULL;
}
if (NewLong && !Class->hIconSm)
{
hIconSmIntern = Class->hIconSmIntern = co_IntCopyImage( (HICON)NewLong, IMAGE_ICON,
UserGetSystemMetrics( SM_CXSMICON ),
UserGetSystemMetrics( SM_CYSMICON ), 0 );
Class->CSF_flags |= CSF_CACHEDSMICON;
}
Class->hIcon = (HANDLE)NewLong;
/* Update the clones */
Class = Class->pclsClone;
while (Class != NULL)
{
Class->hIcon = (HANDLE)NewLong;
Class->hIconSmIntern = hIconSmIntern;
Class = Class->pclsNext;
}
break;
#endif
case GCLP_HICONSM:
#ifdef NEW_CURSORICON
{
PCURICON_OBJECT NewSmallIcon = NULL;
BOOLEAN NewIconFromCache = FALSE;
@ -2199,41 +2110,6 @@ UserSetClassLongPtr(IN PCLS Class,
}
}
break;
#else
/* FIXME: Get handle from pointer to ICON object */
Ret = (ULONG_PTR)Class->hIconSm;
if (Class->hIconSm == (HANDLE)NewLong) break;
if (Class->CSF_flags & CSF_CACHEDSMICON)
{
if (Class->hIconSmIntern)
{
IntClassDestroyIcon(Class->hIconSmIntern);
Class->hIconSmIntern = NULL;
}
Class->CSF_flags &= ~CSF_CACHEDSMICON;
}
if (Class->hIcon && !Class->hIconSmIntern)
{
hIconSmIntern = Class->hIconSmIntern = co_IntCopyImage( Class->hIcon, IMAGE_ICON,
UserGetSystemMetrics( SM_CXSMICON ),
UserGetSystemMetrics( SM_CYSMICON ), 0 );
if (hIconSmIntern) Class->CSF_flags |= CSF_CACHEDSMICON;
//// FIXME: Very hacky here but it passes the tests....
Ret = 0; // Fixes 1009
}
Class->hIconSm = (HANDLE)NewLong;
/* Update the clones */
Class = Class->pclsClone;
while (Class != NULL)
{
Class->hIconSm = (HANDLE)NewLong;
Class->hIconSmIntern = hIconSmIntern;
Class = Class->pclsNext;
}
break;
#endif
case GCLP_HMODULE:
Ret = (ULONG_PTR)Class->hModule;
@ -2325,16 +2201,9 @@ UserGetClassInfo(IN PCLS Class,
lpwcx->cbClsExtra = Class->cbclsExtra;
lpwcx->cbWndExtra = Class->cbwndExtra;
#ifdef NEW_CURSORICON
lpwcx->hIcon = Class->spicn ? UserHMGetHandle(Class->spicn) : NULL;
lpwcx->hCursor = Class->spcur ? UserHMGetHandle(Class->spcur) : NULL;
lpwcx->hIconSm = Class->spicnSm ? UserHMGetHandle(Class->spicnSm) : NULL;
#else
lpwcx->hIcon = Class->hIcon; /* FIXME: Get handle from pointer */
lpwcx->hCursor = Class->hCursor; /* FIXME: Get handle from pointer */
/* FIXME: Get handle from pointer */
lpwcx->hIconSm = Class->hIconSm ? Class->hIconSm : Class->hIconSmIntern;
#endif
lpwcx->hbrBackground = Class->hbrBackground;
/* Copy non-string to user first. */

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,6 @@
#define MAXCURICONHANDLES 4096
#ifdef NEW_CURSORICON
typedef struct _CURICON_OBJECT
{
PROCMARKHEAD head;
@ -49,32 +48,6 @@ IntCleanupCurIconCache(PPROCESSINFO Win32Process);
void FreeCurIconObject(PVOID Object);
#else
typedef struct tagCURICON_PROCESS
{
LIST_ENTRY ListEntry;
PPROCESSINFO Process;
} CURICON_PROCESS, *PCURICON_PROCESS;
typedef struct _CURICON_OBJECT
{
PROCMARKHEAD head;
LIST_ENTRY ListEntry;
HANDLE Self;
LIST_ENTRY ProcessList;
HMODULE hModule;
HRSRC hRsrc;
HRSRC hGroupRsrc;
SIZE Size;
BYTE Shadow;
ICONINFO IconInfo;
} CURICON_OBJECT, *PCURICON_OBJECT;
BOOLEAN FASTCALL IntDestroyCurIconObject(PCURICON_OBJECT CurIcon, PPROCESSINFO ppi);
BOOL FASTCALL IntDestroyCursor(HANDLE hCurIcon, BOOL bForce);
HCURSOR FASTCALL IntSetCursor(HCURSOR hCursor);
#endif
typedef struct _CURSORACCELERATION_INFO
{
UINT FirstThreshold;

File diff suppressed because it is too large Load diff

View file

@ -301,11 +301,7 @@ DefWndDoSizeMove(PWND pwnd, WORD wParam)
RECT sizingRect, mouseRect, origRect, unmodRect;
HDC hdc;
LONG hittest = (LONG)(wParam & 0x0f);
#ifdef NEW_CURSORICON
PCURICON_OBJECT DragCursor = NULL, OldCursor = NULL;
#else
HCURSOR hDragCursor = 0, hOldCursor = 0;
#endif
POINT minTrack, maxTrack;
POINT capturePoint, pt;
ULONG Style, ExStyle;
@ -413,7 +409,6 @@ DefWndDoSizeMove(PWND pwnd, WORD wParam)
}
hdc = UserGetDCEx( pWndParent, 0, DCX_CACHE );
#ifdef NEW_CURSORICON
if (iconic)
{
DragCursor = pwnd->pcls->spicn;
@ -434,14 +429,6 @@ DefWndDoSizeMove(PWND pwnd, WORD wParam)
}
}
}
#else
if ( iconic ) /* create a cursor for dragging */
{
hDragCursor = pwnd->pcls->hIcon;
if ( !hDragCursor ) hDragCursor = (HCURSOR)co_IntSendMessage( UserHMGetHandle(pwnd), WM_QUERYDRAGICON, 0, 0 );
if ( !hDragCursor ) iconic = FALSE;
}
#endif
/* repaint the window before moving it around */
co_UserRedrawWindow( pwnd, NULL, 0, RDW_UPDATENOW | RDW_ALLCHILDREN);
@ -500,11 +487,7 @@ DefWndDoSizeMove(PWND pwnd, WORD wParam)
moved = TRUE;
if ( iconic ) /* ok, no system popup tracking */
{
#ifdef NEW_CURSORICON
OldCursor = UserSetCursor(DragCursor, FALSE);
#else
hOldCursor = IntSetCursor(hDragCursor);
#endif
UserShowCursor( TRUE );
}
else if(!DragFullWindows)
@ -588,21 +571,14 @@ DefWndDoSizeMove(PWND pwnd, WORD wParam)
if ( moved ) /* restore cursors, show icon title later on */
{
UserShowCursor( FALSE );
#ifdef NEW_CURSORICON
OldCursor = UserSetCursor(OldCursor, FALSE);
#else
IntSetCursor( hOldCursor );
#endif
}
#ifdef NEW_CURSORICON
/* It could be that the cursor was already changed while we were proceeding,
* so we must unreference whatever cursor was current at the time we restored the old one.
* Maybe it is DragCursor, but maybe it is another one and DragCursor got already freed.
*/
if (OldCursor) UserDereferenceObject(OldCursor);
#else
IntDestroyCursor( hDragCursor, FALSE );
#endif
}
else if ( moved && !DragFullWindows )
UserDrawMovingFrame( hdc, &sizingRect, thickframe );
@ -831,7 +807,7 @@ DefWndHandleSetCursor(PWND pWnd, WPARAM wParam, LPARAM lParam)
{
if (pwndPopUP)
{
FLASHWINFO fwi =
FLASHWINFO fwi =
{sizeof(FLASHWINFO),
UserHMGetHandle(pwndPopUP),
FLASHW_ALL,
@ -1112,7 +1088,6 @@ IntDefWindowProc(
hDC = IntBeginPaint(Wnd, &Ps);
if (hDC)
{
#ifdef NEW_CURSORICON
if (((Wnd->style & WS_MINIMIZE) != 0) && (Wnd->pcls->spicn))
{
RECT ClientRect;
@ -1124,22 +1099,7 @@ IntDefWindowProc(
y = (ClientRect.bottom - ClientRect.top - UserGetSystemMetrics(SM_CYICON)) / 2;
UserDrawIconEx(hDC, x, y, Wnd->pcls->spicn, 0, 0, 0, 0, DI_NORMAL | DI_COMPAT | DI_DEFAULTSIZE);
}
#else
HICON hIcon;
if (((Wnd->style & WS_MINIMIZE) != 0) && (hIcon = Wnd->pcls->hIcon))
{
RECT ClientRect;
INT x, y;
PCURICON_OBJECT pIcon;
if (!(pIcon = UserGetCurIconObject(hIcon))) return 0;
ERR("Doing Paint and Client area is empty!\n");
IntGetClientRect(Wnd, &ClientRect);
x = (ClientRect.right - ClientRect.left - UserGetSystemMetrics(SM_CXICON)) / 2;
y = (ClientRect.bottom - ClientRect.top - UserGetSystemMetrics(SM_CYICON)) / 2;
UserDrawIconEx( hDC, x, y, pIcon, 0, 0, 0, 0, DI_NORMAL | DI_COMPAT | DI_DEFAULTSIZE );
UserDereferenceObject(pIcon);
}
#endif
IntEndPaint(Wnd, &Ps);
}
return (0);
@ -1245,15 +1205,11 @@ PCURICON_OBJECT FASTCALL NC_IconForWindow( PWND pWnd )
hIcon = UserGetProp(pWnd, gpsi->atomIconSmProp);
if (!hIcon) hIcon = UserGetProp(pWnd, gpsi->atomIconProp);
#ifdef NEW_CURSORICON
if (!hIcon && pWnd->pcls->spicnSm)
return pWnd->pcls->spicnSm;
if (!hIcon && pWnd->pcls->spicn)
return pWnd->pcls->spicn;
#else
if (!hIcon) hIcon = pWnd->pcls->hIconSm;
if (!hIcon) hIcon = pWnd->pcls->hIcon;
#endif
if (!hIcon && (pWnd->style & DS_MODALFRAME))
{

View file

@ -666,15 +666,12 @@ DesktopWindowProc(PWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *lRe
{
return TRUE;
}
#ifdef NEW_CURSORICON
pcurNew->CURSORF_flags |= CURSORF_CURRENT;
#endif
pcurOld = UserSetCursor(pcurNew, FALSE);
if (pcurOld)
{
#ifdef NEW_CURSORICON
pcurOld->CURSORF_flags &= ~CURSORF_CURRENT;
#endif
UserDereferenceObject(pcurOld);
}
return TRUE;

View file

@ -220,10 +220,8 @@ UserProcessDestroy(PEPROCESS Process)
ppiCurrent->hdeskStartup = NULL;
}
#ifdef NEW_CURSORICON
/* Clean up the process icon cache */
IntCleanupCurIconCache(ppiCurrent);
#endif
return STATUS_SUCCESS;
}

View file

@ -118,7 +118,6 @@ UserSetCursor(
if (NewCursor)
{
/* Call GDI to set the new screen cursor */
#ifdef NEW_CURSORICON
PCURICON_OBJECT CursorFrame = NewCursor;
if(NewCursor->CURSORF_flags & CURSORF_ACON)
{
@ -133,16 +132,6 @@ UserSetCursor(
gpsi->ptCursor.x,
gpsi->ptCursor.y,
CursorFrame->hbmAlpha ? SPS_ALPHA : 0);
#else
GreSetPointerShape(hdcScreen,
NewCursor->IconInfo.hbmMask,
NewCursor->IconInfo.hbmColor,
NewCursor->IconInfo.xHotspot,
NewCursor->IconInfo.yHotspot,
gpsi->ptCursor.x,
gpsi->ptCursor.y,
0);
#endif
}
else /* Note: OldCursor != NewCursor so we have to hide cursor */
{
@ -663,7 +652,6 @@ co_MsqInsertMouseMessage(MSG* Msg, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook
if(CurInfo->CurrentCursorObject != MessageQueue->CursorObject)
{
/* Call GDI to set the new screen cursor */
#ifdef NEW_CURSORICON
GreSetPointerShape(hdcScreen,
MessageQueue->CursorObject->hbmAlpha ?
NULL : MessageQueue->CursorObject->hbmMask,
@ -674,16 +662,7 @@ co_MsqInsertMouseMessage(MSG* Msg, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook
gpsi->ptCursor.x,
gpsi->ptCursor.y,
MessageQueue->CursorObject->hbmAlpha ? SPS_ALPHA : 0);
#else
GreSetPointerShape(hdcScreen,
MessageQueue->CursorObject->IconInfo.hbmMask,
MessageQueue->CursorObject->IconInfo.hbmColor,
MessageQueue->CursorObject->IconInfo.xHotspot,
MessageQueue->CursorObject->IconInfo.yHotspot,
gpsi->ptCursor.x,
gpsi->ptCursor.y,
0);
#endif
} else
GreMovePointer(hdcScreen, Msg->pt.x, Msg->pt.y);
}

View file

@ -218,11 +218,7 @@ static const struct
{ NULL, NULL, NULL }, /* TYPE_FREE */
{ AllocDeskThreadObject, co_UserDestroyWindow, FreeDeskThreadObject }, /* TYPE_WINDOW */
{ AllocDeskProcObject, UserDestroyMenuObject, FreeDeskProcObject }, /* TYPE_MENU */
#ifndef NEW_CURSORICON
{ AllocProcMarkObject, /*UserCursorCleanup*/NULL, FreeProcMarkObject }, /* TYPE_CURSOR */
#else
{ AllocProcMarkObject, IntDestroyCurIconObject, FreeCurIconObject }, /* TYPE_CURSOR */
#endif
{ AllocSysObject, /*UserSetWindowPosCleanup*/NULL, FreeSysObject }, /* TYPE_SETWINDOWPOS */
{ AllocDeskThreadObject, IntRemoveHook, FreeDeskThreadObject }, /* TYPE_HOOK */
{ AllocSysObject, /*UserClipDataCleanup*/NULL,FreeSysObject }, /* TYPE_CLIPDATA */
@ -694,43 +690,6 @@ UserReferenceObjectByHandle(HANDLE handle, HANDLE_TYPE type)
return object;
}
#ifndef NEW_CURSORICON
VOID
FASTCALL
UserSetObjectOwner(PVOID obj, HANDLE_TYPE type, PVOID owner)
{
PUSER_HANDLE_ENTRY entry = handle_to_entry(gHandleTable, ((PHEAD)obj)->h );
PPROCESSINFO ppi, oldppi;
/* This must be called with a valid object */
ASSERT(entry);
/* For now, only supported for CursorIcon object */
switch(type)
{
case TYPE_CURSOR:
ppi = (PPROCESSINFO)owner;
entry->pi = ppi;
oldppi = ((PPROCMARKHEAD)obj)->ppi;
((PPROCMARKHEAD)obj)->ppi = ppi;
break;
default:
ASSERT(FALSE);
return;
}
#if DBG
oldppi->DbgHandleCount[type]--;
ppi->DbgHandleCount[type]++;
#endif
oldppi->UserHandleCount--;
IntDereferenceProcessInfo(oldppi);
ppi->UserHandleCount++;
IntReferenceProcessInfo(ppi);
}
#endif
BOOLEAN
UserDestroyObjectsForOwner(PUSER_HANDLE_TABLE Table, PVOID Owner)
{
@ -750,19 +709,6 @@ UserDestroyObjectsForOwner(PUSER_HANDLE_TABLE Table, PVOID Owner)
if (Entry->flags & HANDLEENTRY_INDESTROY)
continue;
#ifndef NEW_CURSORICON
/* Spcial case for cursors until cursoricon_new is there */
if (Entry->type == TYPE_CURSOR)
{
UserReferenceObject(Entry->ptr);
if (!IntDestroyCurIconObject(Entry->ptr, Owner))
{
Ret = FALSE;
}
continue;
}
#endif
/* Call destructor */
if (!ObjectCallbacks[Entry->type].ObjectDestroy(Entry->ptr))
{
@ -774,7 +720,7 @@ UserDestroyObjectsForOwner(PUSER_HANDLE_TABLE Table, PVOID Owner)
return Ret;
}
/*
* NtUserValidateHandleSecure W2k3 has one argument.
*

View file

@ -17,9 +17,6 @@ PVOID UserGetObjectNoErr(PUSER_HANDLE_TABLE, HANDLE, HANDLE_TYPE);
BOOL FASTCALL UserCreateHandleTable(VOID);
BOOL FASTCALL UserObjectInDestroy(HANDLE);
void DbgUserDumpHandleTable();
#ifndef NEW_CURSORICON
VOID FASTCALL UserSetObjectOwner(PVOID obj, HANDLE_TYPE type, PVOID owner);
#endif
PVOID FASTCALL ValidateHandle(HANDLE handle, HANDLE_TYPE type);
BOOLEAN UserDestroyObjectsForOwner(PUSER_HANDLE_TABLE Table, PVOID Owner);

View file

@ -403,11 +403,7 @@ UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
Flags |= DCX_CLIPCHILDREN;
}
/* If minized with icon in the set, we are forced to be cheap! */
#ifdef NEW_CURSORICON
if (Wnd->style & WS_MINIMIZE && Wnd->pcls->spicn)
#else
if (Wnd->style & WS_MINIMIZE && Wnd->pcls->hIcon)
#endif
{
Flags |= DCX_CACHE;
}

View file

@ -125,7 +125,7 @@ IntSetStyle( PWND pwnd, ULONG set_bits, ULONG clear_bits )
pwnd->style = styleNew;
if ((styleOld ^ styleNew) & WS_VISIBLE) // State Change.
{
if (styleOld & WS_VISIBLE) pwnd->head.pti->cVisWindows--;
if (styleOld & WS_VISIBLE) pwnd->head.pti->cVisWindows--;
if (styleNew & WS_VISIBLE) pwnd->head.pti->cVisWindows++;
DceResetActiveDCEs( pwnd );
}
@ -340,7 +340,7 @@ IntGetWindow(HWND hWnd,
if (Wnd->spwndPrev != NULL)
FoundWnd = Wnd->spwndPrev;
break;
case GW_CHILD:
if (Wnd->spwndChild != NULL)
FoundWnd = Wnd->spwndChild;
@ -563,7 +563,7 @@ LRESULT co_UserFreeWindow(PWND Window,
/* Fixes dialog test_focus breakage due to r66237. */
if (ThreadData->MessageQueue->spwndFocus == Window)
ThreadData->MessageQueue->spwndFocus = NULL;
if (ThreadData->MessageQueue->spwndActive == Window)
ThreadData->MessageQueue->spwndActive = NULL;
@ -1450,7 +1450,7 @@ NtUserBuildHwndList(
dwCount++;
}
}
}
}
ObDereferenceObject(Thread);
}
@ -1671,7 +1671,7 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
}
pWnd->head.pti->cWindows++;
#ifdef NEW_CURSORICON
if (Class->spicn && !Class->spicnSm)
{
HICON IconSmHandle = NULL;
@ -1702,16 +1702,6 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
Class->CSF_flags |= CSF_CACHEDSMICON;
}
}
#else
if (Class->hIcon && !Class->hIconSm)
{
Class->hIconSmIntern = co_IntCopyImage( Class->hIcon, IMAGE_ICON,
UserGetSystemMetrics( SM_CXSMICON ),
UserGetSystemMetrics( SM_CYSMICON ), 0 );
TRACE("IntCreateWindow hIconSmIntern %p\n",Class->hIconSmIntern);
Class->CSF_flags |= CSF_CACHEDSMICON;
}
#endif
if (pWnd->pcls->CSF_flags & CSF_SERVERSIDEPROC)
pWnd->state |= WNDS_SERVERSIDEWINDOWPROC;
@ -2135,7 +2125,7 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
if (ParentWindow != co_GetDesktopWindow(Window))
{
Cs->x += ParentWindow->rcClient.left;
Cs->y += ParentWindow->rcClient.top;
Cs->y += ParentWindow->rcClient.top;
}
}
@ -2168,7 +2158,7 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
/* correct child window coordinates if mirroring on parent is enabled */
if (ParentWindow != NULL)
{
if ( ((Cs->style & WS_CHILD) == WS_CHILD) &&
if ( ((Cs->style & WS_CHILD) == WS_CHILD) &&
((ParentWindow->ExStyle & WS_EX_LAYOUTRTL) == WS_EX_LAYOUTRTL))
{
Window->rcWindow.right = ParentWindow->rcClient.right - (Window->rcWindow.left - ParentWindow->rcClient.left);
@ -2433,7 +2423,7 @@ NtUserCreateWindowEx(
ASSERT(plstrWindowName);
if ( (dwStyle & (WS_POPUP|WS_CHILD)) != WS_CHILD)
if ( (dwStyle & (WS_POPUP|WS_CHILD)) != WS_CHILD)
{
/* check hMenu is valid handle */
if (hMenu && !UserGetMenuObject(hMenu))
@ -2442,7 +2432,7 @@ NtUserCreateWindowEx(
EngSetLastError(ERROR_INVALID_MENU_HANDLE);
return NULL;
}
}
}
/* Copy the window name to kernel mode */
Status = ProbeAndCaptureLargeString(&lstrWindowName, plstrWindowName);
@ -3244,7 +3234,7 @@ NtUserGetComboBoxInfo(
SetLastNtError(_SEH2_GetExceptionCode());
}
_SEH2_END;
RETURN( Ret);
CLEANUP:
@ -3332,7 +3322,7 @@ NtUserGetListBoxInfo(
SetLastNtError(_SEH2_GetExceptionCode());
}
_SEH2_END;
RETURN( Ret);
CLEANUP:
@ -3712,7 +3702,7 @@ NtUserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
ret = co_IntSetWindowLong(hWnd, Index, NewValue, Ansi, FALSE);
UserLeave();
return ret;
}
@ -3733,7 +3723,7 @@ NtUserAlterWindowStyle(HWND hWnd, DWORD Index, LONG NewValue)
ret = co_IntSetWindowLong(hWnd, Index, NewValue, FALSE, TRUE);
UserLeave();
return ret;
}

View file

@ -40,7 +40,7 @@ list(APPEND SOURCE
windows/caret.c
windows/class.c
windows/clipboard.c
# windows/cursoricon.c
windows/cursoricon.c
windows/dc.c
windows/defwnd.c
windows/dialog.c
@ -63,12 +63,6 @@ list(APPEND SOURCE
${CMAKE_CURRENT_BINARY_DIR}/user32_stubs.c
include/user32.h)
if(USE_NEW_CURSORICON)
list(APPEND SOURCE windows/cursoricon_new.c)
else()
list(APPEND SOURCE windows/cursoricon.c)
endif()
add_library(user32 SHARED
${SOURCE}
user32.rc

View file

@ -712,7 +712,7 @@ IntGetClassLongA(PWND Wnd, PCLS Class, int nIndex)
case GCW_ATOM:
Ret = (ULONG_PTR)Class->atomClassName;
break;
#ifdef NEW_CURSORICON
case GCLP_HCURSOR:
Ret = Class->spcur ? (ULONG_PTR)((PPROCMARKHEAD)SharedPtrToUser(Class->spcur))->h : 0;
break;
@ -724,22 +724,6 @@ IntGetClassLongA(PWND Wnd, PCLS Class, int nIndex)
case GCLP_HICONSM:
Ret = Class->spicnSm ? (ULONG_PTR)((PPROCMARKHEAD)SharedPtrToUser(Class->spicnSm))->h : 0;
break;
#else
case GCLP_HCURSOR:
/* FIXME - get handle from pointer to CURSOR object */
Ret = (ULONG_PTR)Class->hCursor;
break;
case GCLP_HICON:
/* FIXME - get handle from pointer to ICON object */
Ret = (ULONG_PTR)Class->hIcon;
break;
case GCLP_HICONSM:
/* FIXME - get handle from pointer to ICON object */
Ret = (ULONG_PTR)(Class->hIconSm ? Class->hIconSm : Class->hIconSmIntern);
break;
#endif
case GCLP_WNDPROC:
Ret = IntGetClsWndProc(Wnd, Class, TRUE);
@ -803,7 +787,6 @@ IntGetClassLongW (PWND Wnd, PCLS Class, int nIndex)
Ret = (ULONG_PTR)Class->atomClassName;
break;
#ifdef NEW_CURSORICON
case GCLP_HCURSOR:
Ret = Class->spcur ? (ULONG_PTR)((PPROCMARKHEAD)SharedPtrToUser(Class->spcur))->h : 0;
break;
@ -815,22 +798,6 @@ IntGetClassLongW (PWND Wnd, PCLS Class, int nIndex)
case GCLP_HICONSM:
Ret = Class->spicnSm ? (ULONG_PTR)((PPROCMARKHEAD)SharedPtrToUser(Class->spicnSm))->h : 0;
break;
#else
case GCLP_HCURSOR:
/* FIXME - get handle from pointer to CURSOR object */
Ret = (ULONG_PTR)Class->hCursor;
break;
case GCLP_HICON:
/* FIXME - get handle from pointer to ICON object */
Ret = (ULONG_PTR)Class->hIcon;
break;
case GCLP_HICONSM:
/* FIXME - get handle from pointer to ICON object */
Ret = (ULONG_PTR)(Class->hIconSm ? Class->hIconSm : Class->hIconSmIntern);
break;
#endif
case GCLP_WNDPROC:
Ret = IntGetClsWndProc(Wnd, Class, FALSE);

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -379,11 +379,7 @@ SVC_(UserEnumDisplaySettings, 4)
SVC_(UserEvent, 1)
SVC_(UserExcludeUpdateRgn, 2)
SVC_(UserFillWindow, 4)
#ifdef NEW_CURSORICON
SVC_(UserFindExistingCursorIcon, 3)
#else
SVC_(UserFindExistingCursorIcon, 4)
#endif
SVC_(UserFindWindowEx, 5)
SVC_(UserFlashWindowEx, 1)
SVC_(UserGetAltTabInfo, 6)
@ -519,11 +515,7 @@ SVC_(UserSetClipboardViewer, 1)
SVC_(UserSetConsoleReserveKeys, 2)
SVC_(UserSetCursor, 1)
SVC_(UserSetCursorContents, 2)
#ifdef NEW_CURSORICON
SVC_(UserSetCursorIconData, 4)
#else
SVC_(UserSetCursorIconData, 6)
#endif
SVC_(UserSetDbgTag, 2)
SVC_(UserSetFocus, 1)
SVC_(UserSetImeHotKey, 5)