Skip to content

Commit bd30463

Browse files
committed
[Win32k]
- Move the system command Move and Size to Win32k. Fix most redraw issues. ATM this will be plugged in after User32 DefWnd cleanup. - Move more DefWindowProc functions into Win32k, these too will been needed soon. - Added more server side support functions. - See CORE-7447. svn path=/trunk/; revision=62744
1 parent 1823418 commit bd30463

File tree

8 files changed

+842
-25
lines changed

8 files changed

+842
-25
lines changed

reactos/win32ss/user/ntuser/cursoricon.c

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,55 @@ IntCleanupCurIcons(struct _EPROCESS *Process, PPROCESSINFO Win32Process)
330330
}
331331
}
332332

333+
HCURSOR FASTCALL
334+
IntSetCursor(
335+
HCURSOR hCursor)
336+
{
337+
PCURICON_OBJECT pcurOld, pcurNew;
338+
HCURSOR hOldCursor = NULL;
339+
340+
if (hCursor)
341+
{
342+
pcurNew = UserGetCurIconObject(hCursor);
343+
if (!pcurNew)
344+
{
345+
EngSetLastError(ERROR_INVALID_CURSOR_HANDLE);
346+
goto leave;
347+
}
348+
}
349+
else
350+
{
351+
pcurNew = NULL;
352+
}
353+
354+
pcurOld = UserSetCursor(pcurNew, FALSE);
355+
if (pcurOld)
356+
{
357+
hOldCursor = (HCURSOR)pcurOld->Self;
358+
UserDereferenceObject(pcurOld);
359+
}
360+
leave:
361+
return hOldCursor;
362+
}
363+
364+
BOOL FASTCALL
365+
IntDestroyCursor(
366+
HANDLE hCurIcon,
367+
BOOL bForce)
368+
{
369+
PCURICON_OBJECT CurIcon;
370+
BOOL ret;
371+
372+
if (!(CurIcon = UserGetCurIconObject(hCurIcon)))
373+
{
374+
return FALSE;
375+
}
376+
377+
ret = IntDestroyCurIconObject(CurIcon, PsGetCurrentProcessWin32Process());
378+
/* Note: IntDestroyCurIconObject will remove our reference for us! */
379+
380+
return ret;
381+
}
333382

334383
/*
335384
* @implemented

reactos/win32ss/user/ntuser/cursoricon.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon);
113113
BOOL UserSetCursorPos( INT x, INT y, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook);
114114
BOOL APIENTRY UserClipCursor(RECTL *prcl);
115115
PSYSTEM_CURSORINFO IntGetSysCursorInfo(VOID);
116+
HCURSOR FASTCALL IntSetCursor(HCURSOR hCursor);
117+
BOOL FASTCALL IntDestroyCursor(HANDLE hCurIcon, BOOL bForce);
116118

117119
#define IntReleaseCurIconObject(CurIconObj) \
118120
UserDereferenceObject(CurIconObj)

reactos/win32ss/user/ntuser/cursoricon_new.c

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,66 @@ IntCleanupCurIcons(struct _EPROCESS *Process, PPROCESSINFO Win32Process)
246246
}
247247
}
248248

249+
HCURSOR FASTCALL
250+
IntSetCursor(
251+
HCURSOR hCursor)
252+
{
253+
PCURICON_OBJECT pcurOld, pcurNew;
254+
HCURSOR hOldCursor = NULL;
255+
256+
if (hCursor)
257+
{
258+
pcurNew = UserGetCurIconObject(hCursor);
259+
if (!pcurNew)
260+
{
261+
EngSetLastError(ERROR_INVALID_CURSOR_HANDLE);
262+
goto leave;
263+
}
264+
pcurNew->CURSORF_flags |= CURSORF_CURRENT;
265+
}
266+
else
267+
{
268+
pcurNew = NULL;
269+
}
270+
271+
pcurOld = UserSetCursor(pcurNew, FALSE);
272+
if (pcurOld)
273+
{
274+
hOldCursor = pcurOld->head.h;
275+
pcurOld->CURSORF_flags &= ~CURSORF_CURRENT;
276+
if(UserObjectInDestroy(hOldCursor))
277+
{
278+
/* Destroy it once and for all */
279+
IntDestroyCurIconObject(pcurOld, TRUE);
280+
hOldCursor = NULL;
281+
}
282+
else
283+
{
284+
UserDereferenceObject(pcurOld);
285+
}
286+
}
287+
leave:
288+
return hOldCursor;
289+
}
290+
291+
BOOL FASTCALL
292+
IntDestroyCursor(
293+
HANDLE hCurIcon,
294+
BOOL bForce)
295+
{
296+
PCURICON_OBJECT CurIcon;
297+
BOOL ret;
298+
299+
if (!(CurIcon = UserGetCurIconObject(hCurIcon)))
300+
{
301+
RETURN(FALSE);
302+
}
303+
304+
ret = IntDestroyCurIconObject(CurIcon, bForce);
305+
/* Note: IntDestroyCurIconObject will remove our reference for us! */
306+
307+
return ret;
308+
}
249309

250310
/*
251311
* @implemented

0 commit comments

Comments
 (0)