ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
July 2009
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
27 participants
605 discussions
Start a n
N
ew thread
[fireball] 42300: - Uncomment access check for setting class info, but still leave the STATUS_ACCESS_DENIED case commented out with a mandatory debug print for debugging if it ever happens.
by fireball@svn.reactos.org
Author: fireball Date: Thu Jul 30 15:08:50 2009 New Revision: 42300 URL:
http://svn.reactos.org/svn/reactos?rev=42300&view=rev
Log: - Uncomment access check for setting class info, but still leave the STATUS_ACCESS_DENIED case commented out with a mandatory debug print for debugging if it ever happens. Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/class.c Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/class.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/wine/class.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/wine/class.c [iso-8859-1] Thu Jul 30 15:08:50 2009 @@ -223,14 +223,12 @@ struct window_class *class = get_window_class( req->window ); if (!class) return; -DPRINT1("Fixme!\n"); -#if 0 if (req->flags && class->process != PsGetCurrentProcessWin32Process()) { - set_error( STATUS_ACCESS_DENIED ); - return; - } -#endif + //set_error( STATUS_ACCESS_DENIED ); + //return; + DPRINT1("Fixme, should deny access!\n"); + } if (req->extra_size > sizeof(req->extra_value) || req->extra_offset < -1 || req->extra_offset > class->nb_extra_bytes - (int)req->extra_size)
15 years, 4 months
1
0
0
0
[fireball] 42299: - Bring in a modified GetIconInfo implementation to get rid of a graphics driver api change.
by fireball@svn.reactos.org
Author: fireball Date: Thu Jul 30 11:52:21 2009 New Revision: 42299 URL:
http://svn.reactos.org/svn/reactos?rev=42299&view=rev
Log: - Bring in a modified GetIconInfo implementation to get rid of a graphics driver api change. Modified: branches/arwinss/reactos/dll/win32/winent.drv/userdrv.c Modified: branches/arwinss/reactos/dll/win32/winent.drv/userdrv.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
============================================================================== --- branches/arwinss/reactos/dll/win32/winent.drv/userdrv.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winent.drv/userdrv.c [iso-8859-1] Thu Jul 30 11:52:21 2009 @@ -171,29 +171,100 @@ return -1; } -void CDECL RosDrv_SetCursor( HCURSOR hCursor ) +/*********************************************************************** + * get_bitmap_width_bytes + * + * Return number of bytes taken by a scanline of 16-bit aligned Windows DDB + * data. + * from user32/cursoricon.c:168 + */ +static int get_bitmap_width_bytes( int width, int bpp ) +{ + switch(bpp) + { + case 1: + return 2 * ((width+15) / 16); + case 4: + return 2 * ((width+3) / 4); + case 24: + width *= 3; + /* fall through */ + case 8: + return width + (width & 1); + case 16: + case 15: + return width * 2; + case 32: + return width * 4; + default: + WARN("Unknown depth %d, please report.\n", bpp ); + } + return -1; +} + +VOID CDECL RosDrv_GetIconInfo(CURSORICONINFO *ciconinfo, PICONINFO iconinfo) +{ + INT height; + BITMAP bitmap; + static const WORD ICON_HOTSPOT = 0x4242; /* From user32/cursoricon.c:128 */ + + TRACE("%p => %dx%d, %d bpp\n", ciconinfo, + ciconinfo->nWidth, ciconinfo->nHeight, ciconinfo->bBitsPerPixel); + + if ( (ciconinfo->ptHotSpot.x == ICON_HOTSPOT) && + (ciconinfo->ptHotSpot.y == ICON_HOTSPOT) ) + { + iconinfo->fIcon = TRUE; + iconinfo->xHotspot = ciconinfo->nWidth / 2; + iconinfo->yHotspot = ciconinfo->nHeight / 2; + } + else + { + iconinfo->fIcon = FALSE; + iconinfo->xHotspot = ciconinfo->ptHotSpot.x; + iconinfo->yHotspot = ciconinfo->ptHotSpot.y; + } + + height = ciconinfo->nHeight; + + if (ciconinfo->bBitsPerPixel > 1) + { + iconinfo->hbmColor = CreateBitmap( ciconinfo->nWidth, ciconinfo->nHeight, + ciconinfo->bPlanes, ciconinfo->bBitsPerPixel, + (char *)(ciconinfo + 1) + + ciconinfo->nHeight * + get_bitmap_width_bytes (ciconinfo->nWidth,1) ); + if( GetObjectW(iconinfo->hbmColor, sizeof(bitmap), &bitmap)) + RosGdiCreateBitmap(NULL, iconinfo->hbmColor, &bitmap, bitmap.bmBits); + } + else + { + iconinfo->hbmColor = 0; + height *= 2; + } + + /* Create the mask bitmap */ + iconinfo->hbmMask = CreateBitmap ( ciconinfo->nWidth, height, + 1, 1, ciconinfo + 1); + if( GetObjectW(iconinfo->hbmMask, sizeof(bitmap), &bitmap)) + RosGdiCreateBitmap(NULL, iconinfo->hbmMask, &bitmap, bitmap.bmBits); +} + +void CDECL RosDrv_SetCursor( CURSORICONINFO *lpCursor ) { ICONINFO IconInfo; - BITMAP bitmap; - - if (hCursor == NULL) + + if (lpCursor == NULL) { RosUserSetCursor(NULL); } else { - if( GetIconInfo(hCursor, &IconInfo) ) - { - /* Create handle mappings for IconInfo.hbmMask and - IconInfo.hbmColor in kernel mode */ - if( GetObjectW(IconInfo.hbmMask, sizeof(bitmap), &bitmap)) - RosGdiCreateBitmap(NULL, IconInfo.hbmMask, &bitmap, bitmap.bmBits); - - if( GetObjectW(IconInfo.hbmColor, sizeof(bitmap), &bitmap)) - RosGdiCreateBitmap(NULL, IconInfo.hbmColor, &bitmap, bitmap.bmBits); - - RosUserSetCursor( &IconInfo ); - } + /* Create cursor bitmaps */ + RosDrv_GetIconInfo( lpCursor, &IconInfo ); + + /* Set the cursor */ + RosUserSetCursor( &IconInfo ); } } @@ -485,8 +556,6 @@ void CDECL RosDrv_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) { DWORD changed; - RECT rcWnd, rcClient; - INT x,y,cx,cy; if (hwnd == GetDesktopWindow()) return; changed = style->styleNew ^ style->styleOld;
15 years, 4 months
1
0
0
0
[janderwald] 42298: - Implement KsFreeEventList, KsDisableEvent
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Jul 30 11:43:54 2009 New Revision: 42298 URL:
http://svn.reactos.org/svn/reactos?rev=42298&view=rev
Log: - Implement KsFreeEventList, KsDisableEvent Modified: trunk/reactos/drivers/ksfilter/ks/event.c trunk/reactos/drivers/ksfilter/ks/kstypes.h Modified: trunk/reactos/drivers/ksfilter/ks/event.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/event.…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/event.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/event.c [iso-8859-1] Thu Jul 30 11:43:54 2009 @@ -7,6 +7,69 @@ */ #include "priv.h" + +BOOLEAN +KspSynchronizedEventRoutine( + IN KSEVENTS_LOCKTYPE EventsFlags, + IN PVOID EventsLock, + IN PKSEVENT_SYNCHRONIZED_ROUTINE SynchronizedRoutine, + IN PKSEVENT_CTX Ctx) +{ + BOOLEAN Result = FALSE; + KIRQL OldLevel; + + if (EventsFlags == KSEVENTS_NONE) + { + /* no synchronization required */ + Result = SynchronizedRoutine(Ctx); + } + else if (EventsFlags == KSEVENTS_SPINLOCK) + { + /* use spin lock */ + KeAcquireSpinLock((PKSPIN_LOCK)EventsLock, &OldLevel); + Result = SynchronizedRoutine(Ctx); + KeReleaseSpinLock((PKSPIN_LOCK)EventsLock, OldLevel); + } + else if (EventsFlags == KSEVENTS_MUTEX) + { + /* use a mutex */ + KeWaitForSingleObject(EventsLock, Executive, KernelMode, FALSE, NULL); + Result = SynchronizedRoutine(Ctx); + KeReleaseMutex((PRKMUTEX)EventsLock, FALSE); + } + else if (EventsFlags == KSEVENTS_FMUTEX) + { + /* use a fast mutex */ + ExAcquireFastMutex((PFAST_MUTEX)EventsLock); + Result = SynchronizedRoutine(Ctx); + ExReleaseFastMutex((PFAST_MUTEX)EventsLock); + } + else if (EventsFlags == KSEVENTS_FMUTEXUNSAFE) + { + /* acquire fast mutex unsafe */ + KeEnterCriticalRegion(); + ExAcquireFastMutexUnsafe((PFAST_MUTEX)EventsLock); + Result = SynchronizedRoutine(Ctx); + ExReleaseFastMutexUnsafe((PFAST_MUTEX)EventsLock); + KeLeaveCriticalRegion(); + } + else if (EventsFlags == KSEVENTS_INTERRUPT) + { + /* use interrupt for locking */ + Result = KeSynchronizeExecution((PKINTERRUPT)EventsLock, (PKSYNCHRONIZE_ROUTINE)SynchronizedRoutine, (PVOID)Ctx); + } + else if (EventsFlags == KSEVENTS_ERESOURCE) + { + /* use an eresource */ + KeEnterCriticalRegion(); + ExAcquireResourceExclusiveLite((PERESOURCE)EventsLock, TRUE); + Result = SynchronizedRoutine(Ctx); + ExReleaseResourceLite((PERESOURCE)EventsLock); + KeLeaveCriticalRegion(); + } + + return Result; +} /* @@ -47,9 +110,53 @@ return STATUS_UNSUCCESSFUL; } - -/* - @unimplemented +BOOLEAN +NTAPI +KspDisableEvent( + IN PKSEVENT_CTX Ctx) +{ + PIO_STACK_LOCATION IoStack; + PKSEVENTDATA EventData; + PKSEVENT_ENTRY EventEntry; + PLIST_ENTRY Entry; + + /* get current irp stack location */ + IoStack = IoGetCurrentIrpStackLocation(Ctx->Irp); + + /* get event data */ + EventData = (PKSEVENTDATA)IoStack->Parameters.DeviceIoControl.Type3InputBuffer; + + if (!Ctx || !Ctx->List || !Ctx->FileObject || !Ctx->Irp) + { + /* invalid parameter */ + return FALSE; + } + + /* point to first entry */ + Entry = Ctx->List->Flink; + + while(Entry != Ctx->List) + { + /* get event entry */ + EventEntry = (PKSEVENT_ENTRY)CONTAINING_RECORD(Entry, KSEVENT_ENTRY, ListEntry); + + if (EventEntry->EventData == EventData && EventEntry->FileObject == Ctx->FileObject) + { + /* found the entry */ + RemoveEntryList(&EventEntry->ListEntry); + Ctx->EventEntry = EventEntry; + return TRUE; + } + + /* move to next item */ + Entry = Entry->Flink; + } + /* entry not found */ + return TRUE; +} + +/* + @implemented */ KSDDKAPI NTSTATUS @@ -60,8 +167,46 @@ IN KSEVENTS_LOCKTYPE EventsFlags, IN PVOID EventsLock) { - UNIMPLEMENTED; - return STATUS_UNSUCCESSFUL; + PIO_STACK_LOCATION IoStack; + KSEVENT_CTX Ctx; + + /* get current irp stack location */ + IoStack = IoGetCurrentIrpStackLocation(Irp); + + /* is there a event entry */ + if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(KSEVENTDATA)) + { + if (IoStack->Parameters.DeviceIoControl.InputBufferLength == 0) + { + /* caller wants to free event items */ + KsFreeEventList(IoStack->FileObject, EventsList, EventsFlags, EventsLock); + return STATUS_SUCCESS; + } + /* invalid parameter */ + return STATUS_INVALID_BUFFER_SIZE; + } + + /* setup event ctx */ + Ctx.List = EventsList; + Ctx.FileObject = IoStack->FileObject; + Ctx.Irp = Irp; + Ctx.EventEntry = NULL; + + if (KspSynchronizedEventRoutine(EventsFlags, EventsLock, KspDisableEvent, &Ctx)) + { + /* was the event entry found */ + if (Ctx.EventEntry) + { + /* discard event */ + KsDiscardEvent(Ctx.EventEntry); + return STATUS_SUCCESS; + } + /* event was not found */ + return STATUS_UNSUCCESSFUL; + } + + /* invalid parameters */ + return STATUS_INVALID_PARAMETER; } /* @@ -77,8 +222,38 @@ } -/* - @unimplemented +BOOLEAN +NTAPI +KspFreeEventList( + IN PKSEVENT_CTX Ctx) +{ + PLIST_ENTRY Entry; + PKSEVENT_ENTRY EventEntry; + + /* check valid input */ + if (!Ctx || !Ctx->List) + return FALSE; + + /* remove first entry */ + Entry = RemoveHeadList(Ctx->List); + if (!Entry) + { + /* list is empty, bye-bye */ + return FALSE; + } + + /* get event entry */ + EventEntry = (PKSEVENT_ENTRY)CONTAINING_RECORD(Entry, KSEVENT_ENTRY, ListEntry); + + /* store event entry */ + Ctx->EventEntry = EventEntry; + /* return success */ + return TRUE; +} + + +/* + @implemented */ KSDDKAPI VOID @@ -89,7 +264,20 @@ IN KSEVENTS_LOCKTYPE EventsFlags, IN PVOID EventsLock) { - UNIMPLEMENTED; + KSEVENT_CTX Ctx; + + /* setup event ctx */ + Ctx.List = EventsList; + Ctx.FileObject = FileObject; + Ctx.EventEntry = NULL; + + while(KspSynchronizedEventRoutine(EventsFlags, EventsLock, KspFreeEventList, &Ctx)) + { + if (Ctx.EventEntry) + { + KsDiscardEvent(Ctx.EventEntry); + } + } } @@ -153,7 +341,7 @@ } /* - @unimplemented + @implemented */ NTSTATUS NTAPI Modified: trunk/reactos/drivers/ksfilter/ks/kstypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/kstype…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] Thu Jul 30 11:43:54 2009 @@ -122,4 +122,14 @@ KEVENT Event; }KSREMOVE_BUS_INTERFACE_CTX, *PKSREMOVE_BUS_INTERFACE_CTX; +typedef struct +{ + PLIST_ENTRY List; + PFILE_OBJECT FileObject; + PKSEVENT_ENTRY EventEntry; + PIRP Irp; +}KSEVENT_CTX, *PKSEVENT_CTX; + +typedef BOOLEAN (NTAPI *PKSEVENT_SYNCHRONIZED_ROUTINE)(PKSEVENT_CTX Context); + #endif
15 years, 4 months
1
0
0
0
[fireball] 42297: - Usermode GDI handles are per-process, not global! Fix this assumption when mapping usermode handles to global kernelmode handles. Fixes a lot of weird crashes happening due to wrong surface objects usage.
by fireball@svn.reactos.org
Author: fireball Date: Thu Jul 30 10:59:02 2009 New Revision: 42297 URL:
http://svn.reactos.org/svn/reactos?rev=42297&view=rev
Log: - Usermode GDI handles are per-process, not global! Fix this assumption when mapping usermode handles to global kernelmode handles. Fixes a lot of weird crashes happening due to wrong surface objects usage. Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/gdiobj.c Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/gdiobj.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gre/gdiobj.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gre/gdiobj.c [iso-8859-1] Thu Jul 30 10:59:02 2009 @@ -209,6 +209,7 @@ { HGDIOBJ hUser; HGDIOBJ hKernel; + HANDLE hProcessId; LIST_ENTRY Entry; } HMAPPING, *PHMAPPING; @@ -223,12 +224,19 @@ VOID NTAPI GDI_AddHandleMapping(HGDIOBJ hKernel, HGDIOBJ hUser) { + HGDIOBJ hExisting; PHMAPPING pMapping = ExAllocatePool(NonPagedPool, sizeof(HMAPPING)); if (!pMapping) return; /* Set mapping */ pMapping->hUser = hUser; pMapping->hKernel = hKernel; + pMapping->hProcessId = PsGetCurrentProcessId(); + + /* Debug check: see if we already have this mapping */ + hExisting = GDI_MapUserHandle(hUser); + if (hExisting) + DPRINT1("Trying to map already existing mapping %x -> %x to %x!\n", hUser, hExisting, hKernel); /* Add it to the list */ ExInterlockedInsertHeadList(&HandleMapping, &pMapping->Entry, &HandleMappingLock); @@ -241,6 +249,7 @@ PLIST_ENTRY Current; PHMAPPING Mapping; HGDIOBJ Found = 0; + HANDLE hProcessId = PsGetCurrentProcessId(); /* Acquire the lock and check if the list is empty */ KeAcquireSpinLock(&HandleMappingLock, &OldIrql); @@ -252,7 +261,7 @@ Mapping = CONTAINING_RECORD(Current, HMAPPING, Entry); /* Check if it's our entry */ - if (Mapping->hUser == hUser) + if (Mapping->hUser == hUser && Mapping->hProcessId == hProcessId) { /* Found it, save it and break out of the loop */ Found = Mapping->hKernel; @@ -274,6 +283,7 @@ KIRQL OldIrql; PLIST_ENTRY Current; PHMAPPING Mapping; + HANDLE hProcessId = PsGetCurrentProcessId(); /* Acquire the lock and check if the list is empty */ KeAcquireSpinLock(&HandleMappingLock, &OldIrql); @@ -285,7 +295,7 @@ Mapping = CONTAINING_RECORD(Current, HMAPPING, Entry); /* Check if it's our entry */ - if (Mapping->hUser == hUser) + if (Mapping->hUser == hUser && Mapping->hProcessId == hProcessId) { /* Remove and free it */ RemoveEntryList(Current);
15 years, 4 months
1
0
0
0
[janderwald] 42296: - Implement KsAddEvent, KsDefaultAddEventHandler, KsPinAttachAndGate, KsPinAttachOrGate, KsPinGetAndGate
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Jul 30 09:31:41 2009 New Revision: 42296 URL:
http://svn.reactos.org/svn/reactos?rev=42296&view=rev
Log: - Implement KsAddEvent, KsDefaultAddEventHandler, KsPinAttachAndGate, KsPinAttachOrGate, KsPinGetAndGate Modified: trunk/reactos/drivers/ksfilter/ks/event.c trunk/reactos/drivers/ksfilter/ks/filter.c trunk/reactos/drivers/ksfilter/ks/filterfactory.c trunk/reactos/drivers/ksfilter/ks/kstypes.h trunk/reactos/drivers/ksfilter/ks/pin.c Modified: trunk/reactos/drivers/ksfilter/ks/event.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/event.…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/event.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/event.c [iso-8859-1] Thu Jul 30 09:31:41 2009 @@ -138,7 +138,7 @@ } /* - @unimplemented + @implemented */ KSDDKAPI VOID @@ -147,7 +147,9 @@ IN PVOID Object, IN PKSEVENT_ENTRY EventEntry) { - UNIMPLEMENTED + PKSBASIC_HEADER Header = (PKSBASIC_HEADER)((ULONG_PTR)Object - sizeof(KSBASIC_HEADER)); + + ExInterlockedInsertTailList(&Header->EventList, &EventEntry->ListEntry, &Header->EventListLock); } /* @@ -160,9 +162,30 @@ IN PKSEVENTDATA EventData, IN OUT PKSEVENT_ENTRY EventEntry) { - UNIMPLEMENTED - return STATUS_NOT_IMPLEMENTED; -} + PIO_STACK_LOCATION IoStack; + PKSIOBJECT_HEADER ObjectHeader; + PKSBASIC_HEADER Header; + + /* first get the io stack location */ + IoStack = IoGetCurrentIrpStackLocation(Irp); + + /* now get the object header */ + ObjectHeader =(PKSIOBJECT_HEADER)IoStack->FileObject->FsContext; + + /* sanity check */ + ASSERT(ObjectHeader->ObjectType); + + /* obtain basic header */ + Header = (PKSBASIC_HEADER)((ULONG_PTR)ObjectHeader->ObjectType - sizeof(KSBASIC_HEADER)); + + /* now insert the event entry */ + ExInterlockedInsertTailList(&Header->EventList, &EventEntry->ListEntry, &Header->EventListLock); + + /* done */ + return STATUS_SUCCESS; +} + + /* @unimplemented Modified: trunk/reactos/drivers/ksfilter/ks/filter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/filter…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/filter.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/filter.c [iso-8859-1] Thu Jul 30 09:31:41 2009 @@ -1060,6 +1060,10 @@ This->Header.Parent.KsFilterFactory = iface->lpVtbl->GetStruct(iface); This->Header.Type = KsObjectTypeFilter; KeInitializeMutex(&This->Header.ControlMutex, 0); + InitializeListHead(&This->Header.EventList); + KeInitializeSpinLock(&This->Header.EventListLock); + + Modified: trunk/reactos/drivers/ksfilter/ks/filterfactory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/filter…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/filterfactory.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/filterfactory.c [iso-8859-1] Thu Jul 30 09:31:41 2009 @@ -189,6 +189,12 @@ This->Header.Parent.KsDevice = &DeviceExtension->DeviceHeader->KsDevice; This->DeviceHeader = DeviceExtension->DeviceHeader; + /* unused fields */ + KeInitializeMutex(&This->Header.ControlMutex, 0); + InitializeListHead(&This->Header.EventList); + KeInitializeSpinLock(&This->Header.EventListLock); + + InitializeListHead(&This->SymbolicLinkList); InitializeListHead(&This->FilterInstanceList); Modified: trunk/reactos/drivers/ksfilter/ks/kstypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/kstype…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] Thu Jul 30 09:31:41 2009 @@ -60,6 +60,9 @@ KSOBJECTTYPE Type; PKSDEVICE KsDevice; KMUTEX ControlMutex; + LIST_ENTRY EventList; + KSPIN_LOCK EventListLock; + union { PKSDEVICE KsDevice; Modified: trunk/reactos/drivers/ksfilter/ks/pin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/pin.c?…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/pin.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/pin.c [iso-8859-1] Thu Jul 30 09:31:41 2009 @@ -21,6 +21,9 @@ LONG ref; KMUTEX ProcessingMutex; PFILE_OBJECT FileObject; + + PKSGATE AttachedGate; + BOOL OrGate; PFNKSPINPOWER Sleep; PFNKSPINPOWER Wake; @@ -262,7 +265,7 @@ } /* - @unimplemented + @implemented */ VOID NTAPI @@ -270,11 +273,16 @@ IN PKSPIN Pin, IN PKSGATE AndGate OPTIONAL) { - UNIMPLEMENTED -} - -/* - @unimplemented + IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(Pin, IKsPinImpl, Pin); + + /* FIXME attach to filter's and gate (filter-centric processing) */ + + This->AttachedGate = AndGate; + This->OrGate = FALSE; +} + +/* + @implemented */ VOID NTAPI @@ -282,8 +290,27 @@ IN PKSPIN Pin, IN PKSGATE OrGate OPTIONAL) { - UNIMPLEMENTED -} + IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(Pin, IKsPinImpl, Pin); + + /* FIXME attach to filter's and gate (filter-centric processing) */ + + This->AttachedGate = OrGate; + This->OrGate = TRUE; +} + +/* + @implemented +*/ +PKSGATE +NTAPI +KsPinGetAndGate( + IN PKSPIN Pin) +{ + IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(Pin, IKsPinImpl, Pin); + + return This->AttachedGate; +} + /* @unimplemented */ @@ -322,18 +349,6 @@ { UNIMPLEMENTED return STATUS_NOT_IMPLEMENTED; -} - -/* - @unimplemented -*/ -PKSGATE -NTAPI -KsPinGetAndGate( - IN PKSPIN Pin) -{ - UNIMPLEMENTED - return NULL; } /* @@ -887,7 +902,6 @@ KsDispatchFastReadFailure }; - NTSTATUS KspCreatePin( IN PDEVICE_OBJECT DeviceObject, @@ -940,6 +954,8 @@ This->BasicHeader.Type = KsObjectTypePin; This->BasicHeader.Parent.KsFilter = Filter->lpVtbl->GetStruct(Filter); KeInitializeMutex(&This->BasicHeader.ControlMutex, 0); + InitializeListHead(&This->BasicHeader.EventList); + KeInitializeSpinLock(&This->BasicHeader.EventListLock); /* initialize pin */ This->lpVtbl = &vt_IKsPin;
15 years, 4 months
1
0
0
0
[janderwald] 42295: - Implement KsDeviceSetBusData, KsDeviceGetBusData, KsGetPinFromIrp
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Jul 30 08:29:24 2009 New Revision: 42295 URL:
http://svn.reactos.org/svn/reactos?rev=42295&view=rev
Log: - Implement KsDeviceSetBusData, KsDeviceGetBusData, KsGetPinFromIrp Modified: trunk/reactos/drivers/ksfilter/ks/api.c trunk/reactos/drivers/ksfilter/ks/irp.c trunk/reactos/drivers/ksfilter/ks/kstypes.h trunk/reactos/drivers/ksfilter/ks/pin.c Modified: trunk/reactos/drivers/ksfilter/ks/api.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/api.c?…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/api.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/api.c [iso-8859-1] Thu Jul 30 08:29:24 2009 @@ -1583,8 +1583,80 @@ return STATUS_UNSUCCESSFUL; } -/* - @unimplemented + NTSTATUS +NTAPI +KspSetGetBusDataCompletion( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN PVOID Context) +{ + /* signal completion */ + KeSetEvent((PRKEVENT)Context, IO_NO_INCREMENT, FALSE); + + /* more work needs be done, so dont free the irp */ + return STATUS_MORE_PROCESSING_REQUIRED; + +} + +NTSTATUS +KspDeviceSetGetBusData( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG DataType, + IN PVOID Buffer, + IN ULONG Offset, + IN ULONG Length, + IN BOOL bGet) +{ + PIO_STACK_LOCATION IoStack; + PIRP Irp; + NTSTATUS Status; + KEVENT Event; + + /* allocate the irp */ + Irp = IoAllocateIrp(1, /*FIXME */ + FALSE); + + if (!Irp) + return STATUS_INSUFFICIENT_RESOURCES; + + /* initialize the event */ + KeInitializeEvent(&Event, NotificationEvent, FALSE); + + /* get next stack location */ + IoStack = IoGetNextIrpStackLocation(Irp); + + /* setup a completion routine */ + IoSetCompletionRoutine(Irp, KspSetGetBusDataCompletion, (PVOID)&Event, TRUE, TRUE, TRUE); + + /* setup parameters */ + IoStack->Parameters.ReadWriteConfig.Buffer = Buffer; + IoStack->Parameters.ReadWriteConfig.Length = Length; + IoStack->Parameters.ReadWriteConfig.Offset = Offset; + IoStack->Parameters.ReadWriteConfig.WhichSpace = DataType; + /* setup function code */ + IoStack->MajorFunction = IRP_MJ_PNP; + IoStack->MinorFunction = (bGet ? IRP_MN_READ_CONFIG : IRP_MN_WRITE_CONFIG); + + /* lets call the driver */ + Status = IoCallDriver(DeviceObject, Irp); + + /* is the request still pending */ + if (Status == STATUS_PENDING) + { + /* have a nap */ + KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); + /* update status */ + Status = Irp->IoStatus.Status; + } + + /* free the irp */ + IoFreeIrp(Irp); + /* done */ + return Status; +} + +/* + @implemented */ KSDDKAPI ULONG @@ -1596,13 +1668,13 @@ IN ULONG Offset, IN ULONG Length) { - UNIMPLEMENTED - return 0; -} - - -/* - @unimplemented + return KspDeviceSetGetBusData(Device->PhysicalDeviceObject, /* is this right? */ + DataType, Buffer, Offset, Length, FALSE); +} + + +/* + @implemented */ KSDDKAPI ULONG @@ -1614,8 +1686,9 @@ IN ULONG Offset, IN ULONG Length) { - UNIMPLEMENTED - return 0; + return KspDeviceSetGetBusData(Device->PhysicalDeviceObject, /* is this right? */ + DataType, Buffer, Offset, Length, TRUE); + } /* @@ -1788,6 +1861,28 @@ return STATUS_UNSUCCESSFUL; } +VOID +NTAPI +KspRemoveBusInterface( + PVOID Ctx) +{ + PKSREMOVE_BUS_INTERFACE_CTX Context =(PKSREMOVE_BUS_INTERFACE_CTX)Ctx; + + /* TODO + * get SWENUM_INSTALL_INTERFACE struct + * open device key and delete the keys + */ + + UNIMPLEMENTED + + /* set status */ + Context->Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; + + + /* signal completion */ + KeSetEvent(&Context->Event, IO_NO_INCREMENT, FALSE); +} + /* @unimplemented */ @@ -1797,10 +1892,42 @@ KsRemoveBusEnumInterface( IN PIRP Irp) { - UNIMPLEMENTED - return STATUS_UNSUCCESSFUL; -} - + KPROCESSOR_MODE Mode; + LUID luid; + KSREMOVE_BUS_INTERFACE_CTX Ctx; + WORK_QUEUE_ITEM WorkItem; + + /* get previous mode */ + Mode = ExGetPreviousMode(); + + /* convert to luid */ + luid = RtlConvertUlongToLuid(SE_LOAD_DRIVER_PRIVILEGE); + + /* perform access check */ + if (!SeSinglePrivilegeCheck(luid, Mode)) + { + /* insufficient privileges */ + return STATUS_PRIVILEGE_NOT_HELD; + } + /* initialize event */ + KeInitializeEvent(&Ctx.Event, NotificationEvent, FALSE); + + /* store irp in ctx */ + Ctx.Irp = Irp; + + /* initialize work item */ + ExInitializeWorkItem(&WorkItem, KspRemoveBusInterface, (PVOID)&Ctx); + + /* now queue the work item */ + ExQueueWorkItem(&WorkItem, DelayedWorkQueue); + + /* wait for completion */ + KeWaitForSingleObject(&Ctx.Event, Executive, KernelMode, FALSE, NULL); + + /* return result */ + return Ctx.Irp->IoStatus.Status; + +} /* Modified: trunk/reactos/drivers/ksfilter/ks/irp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/irp.c?…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/irp.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/irp.c [iso-8859-1] Thu Jul 30 08:29:24 2009 @@ -1622,15 +1622,3 @@ return (ULONG)-1; } -/* - @unimplemented -*/ -KSDDKAPI -PKSPIN -NTAPI -KsGetPinFromIrp( - IN PIRP Irp) -{ - UNIMPLEMENTED - return NULL; -} Modified: trunk/reactos/drivers/ksfilter/ks/kstypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/kstype…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] Thu Jul 30 08:29:24 2009 @@ -113,5 +113,10 @@ PIO_WORKITEM WorkItem; }PNP_POSTSTART_CONTEXT, *PPNP_POSTSTART_CONTEXT; +typedef struct +{ + PIRP Irp; + KEVENT Event; +}KSREMOVE_BUS_INTERFACE_CTX, *PKSREMOVE_BUS_INTERFACE_CTX; #endif Modified: trunk/reactos/drivers/ksfilter/ks/pin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/pin.c?…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/pin.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/pin.c [iso-8859-1] Thu Jul 30 08:29:24 2009 @@ -511,6 +511,27 @@ } /* + @implemented +*/ +KSDDKAPI +PKSPIN +NTAPI +KsGetPinFromIrp( + IN PIRP Irp) +{ + PKSIOBJECT_HEADER ObjectHeader; + PIO_STACK_LOCATION IoStack = IoGetCurrentIrpStackLocation(Irp); + + /* get object header */ + ObjectHeader = (PKSIOBJECT_HEADER)IoStack->FileObject->FsContext; + /* return object type */ + return (PKSPIN)ObjectHeader->ObjectType; + +} + + + +/* @unimplemented */ VOID
15 years, 4 months
1
0
0
0
[janderwald] 42294: - Add RtlConvertLongToLuid, RtlConvertUlongToLuid
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Jul 30 08:26:28 2009 New Revision: 42294 URL:
http://svn.reactos.org/svn/reactos?rev=42294&view=rev
Log: - Add RtlConvertLongToLuid, RtlConvertUlongToLuid Modified: trunk/reactos/include/ddk/winddk.h Modified: trunk/reactos/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winddk.h?rev=4…
============================================================================== --- trunk/reactos/include/ddk/winddk.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/winddk.h [iso-8859-1] Thu Jul 30 08:26:28 2009 @@ -5992,17 +5992,39 @@ IN PSTRING String2, BOOLEAN CaseInSensitive); -NTSYSAPI +#if !defined(MIDL_PASS) + +FORCEINLINE LUID NTAPI RtlConvertLongToLuid( - IN LONG Long); - -NTSYSAPI + IN LONG Val) +{ + LUID Luid; + LARGE_INTEGER Temp; + + Temp.QuadPart = Val; + Luid.LowPart = Temp.u.LowPart; + Luid.HighPart = Temp.u.HighPart; + + return Luid; +} + +FORCEINLINE LUID NTAPI RtlConvertUlongToLuid( - ULONG Ulong); + IN ULONG Val) +{ + LUID Luid; + + Luid.LowPart = Val; + Luid.HighPart = 0; + + return Luid; +} +#endif + NTSYSAPI VOID
15 years, 4 months
1
0
0
0
[jimtabor] 42293: - Fix Class ids.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Jul 30 03:37:02 2009 New Revision: 42293 URL:
http://svn.reactos.org/svn/reactos?rev=42293&view=rev
Log: - Fix Class ids. Modified: trunk/reactos/include/reactos/win32k/ntuser.h Modified: trunk/reactos/include/reactos/win32k/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Thu Jul 30 03:37:02 2009 @@ -549,19 +549,19 @@ #define ICLS_DDEMLSERVERA 13 #define ICLS_DDEMLSERVERW 14 #define ICLS_IME 15 -#define ICLS_DESKTOP 16 -#define ICLS_DIALOG 17 -#define ICLS_MENU 18 -#define ICLS_SWITCH 19 -#define ICLS_ICONTITLE 20 -#define ICLS_TOOLTIPS 21 +#define ICLS_GHOST 16 +#define ICLS_DESKTOP 17 +#define ICLS_DIALOG 18 +#define ICLS_MENU 19 +#define ICLS_SWITCH 20 +#define ICLS_ICONTITLE 21 +#define ICLS_TOOLTIPS 22 #if (_WIN32_WINNT <= 0x0501) #define ICLS_UNKNOWN 22 #define ICLS_NOTUSED 23 #else -#define ICLS_SYSSHADOW 22 -#define ICLS_HWNDMESSAGE 23 -#define ICLS_UNKNOWN 24 +#define ICLS_SYSSHADOW 23 +#define ICLS_HWNDMESSAGE 24 #define ICLS_NOTUSED 25 #endif #define ICLS_END 31
15 years, 4 months
1
0
0
0
[fireball] 42292: - Unstub get_atom_information request.
by fireball@svn.reactos.org
Author: fireball Date: Wed Jul 29 22:39:39 2009 New Revision: 42292 URL:
http://svn.reactos.org/svn/reactos?rev=42292&view=rev
Log: - Unstub get_atom_information request. Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/atom.c branches/arwinss/reactos/subsystems/win32/win32k/wine/stubs.c Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/atom.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/wine/atom.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/wine/atom.c [iso-8859-1] Wed Jul 29 22:39:39 2009 @@ -420,7 +420,6 @@ } /* get global atom name */ -#if 0 DECL_HANDLER(get_atom_information) { struct atom_table *table = get_table( req->table, 0 ); @@ -439,7 +438,7 @@ release_object( table ); } } -#endif + /* set global atom name */ DECL_HANDLER(set_atom_information) { Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/stubs.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/wine/stubs.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/wine/stubs.c [iso-8859-1] Wed Jul 29 22:39:39 2009 @@ -555,11 +555,6 @@ UNIMPLEMENTED; } -DECL_HANDLER(get_atom_information) -{ - UNIMPLEMENTED; -} - DECL_HANDLER(get_process_idle_event) { UNIMPLEMENTED;
15 years, 4 months
1
0
0
0
[gschneider] 42291: user32: - Restructure and simplify CreateCursorFromData - Call CreateIconFromResourceEx properly allowing it to create colored icons (although it doesn't care about that yet) - Fix some comment typos win32k: - Don't just copy the pointer to an XLATEOBJ, copy instead. The caller will free it, EngSetPointerShape will do so too (causing either double-frees or memory write errors)
by gschneider@svn.reactos.org
Author: gschneider Date: Wed Jul 29 20:28:11 2009 New Revision: 42291 URL:
http://svn.reactos.org/svn/reactos?rev=42291&view=rev
Log: user32: - Restructure and simplify CreateCursorFromData - Call CreateIconFromResourceEx properly allowing it to create colored icons (although it doesn't care about that yet) - Fix some comment typos win32k: - Don't just copy the pointer to an XLATEOBJ, copy instead. The caller will free it, EngSetPointerShape will do so too (causing either double-frees or memory write errors) Modified: trunk/reactos/dll/win32/user32/windows/bitmap.c trunk/reactos/dll/win32/user32/windows/icon.c trunk/reactos/subsystems/win32/win32k/eng/mouse.c Modified: trunk/reactos/dll/win32/user32/windows/bitmap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/b…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/bitmap.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/bitmap.c [iso-8859-1] Wed Jul 29 20:28:11 2009 @@ -56,7 +56,7 @@ #include "poppack.h" -/* forward declerations... actually in user32\windows\icon.c but usful here */ +/* forward declarations... actually in user32\windows\icon.c but useful here */ HICON ICON_CreateIconFromData(HDC hDC, PVOID ImageData, ICONIMAGE* IconImage, int cxDesired, int cyDesired, int xHotspot, int yHotspot); CURSORICONDIRENTRY *CURSORICON_FindBestIcon( CURSORICONDIR *dir, int width, int height, int colors); CURSORICONDIRENTRY *CURSORICON_FindBestCursor( CURSORICONDIR *dir, int width, int height, int colors); @@ -265,7 +265,7 @@ hIcon = CreateIconFromResourceEx((PBYTE)ResIcon, SizeofResource(hinst, hResInfo), Icon, 0x00030000, width, height, - fuLoad & (LR_DEFAULTCOLOR | LR_MONOCHROME)); + (fuLoad & (LR_DEFAULTSIZE | LR_SHARED)) | LR_DEFAULTCOLOR); if (hIcon && 0 != (fuLoad & LR_SHARED)) { Modified: trunk/reactos/dll/win32/user32/windows/icon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/i…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/icon.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/icon.c [iso-8859-1] Wed Jul 29 20:28:11 2009 @@ -98,13 +98,25 @@ BITMAPINFO *bwBIH = (BITMAPINFO *)BitmapInfoBuffer; BITMAPINFO *orgBIH = (BITMAPINFO *)IconImage; ICONINFO IconInfo; - PVOID XORImageData = ImageData; IconInfo.fIcon = FALSE; IconInfo.xHotspot = xHotspot; IconInfo.yHotspot = yHotspot; - /* Create a BITMAPINFO header for the monochrome part of the icon */ + /* Handle the color part of the cursor */ + if (IconImage->icHeader.biBitCount == 1) + { + IconInfo.hbmColor = (HBITMAP)0; + } + else + { + FIXME("loading %d bpp color cursor\n", IconImage->icHeader.biBitCount); + IconInfo.hbmColor = CreateDIBitmap(hDC, &IconImage->icHeader, CBM_INIT, + ImageData, (BITMAPINFO*)IconImage, + DIB_RGB_COLORS); + } + + /* Create a BITMAPINFO header for the monochrome part of the cursor */ bwBIH->bmiHeader.biBitCount = 1; bwBIH->bmiHeader.biWidth = IconImage->icHeader.biWidth; bwBIH->bmiHeader.biHeight = IconImage->icHeader.biHeight; @@ -127,29 +139,13 @@ bwBIH->bmiColors[1].rgbRed = 0xff; bwBIH->bmiColors[1].rgbReserved = 0; - /* Load the AND bitmap */ + /* Load the monochrome bitmap */ IconInfo.hbmMask = CreateDIBitmap(hDC, &bwBIH->bmiHeader, 0, - XORImageData, bwBIH, DIB_RGB_COLORS); + ImageData, bwBIH, DIB_RGB_COLORS); if (IconInfo.hbmMask) { SetDIBits(hDC, IconInfo.hbmMask, 0, IconImage->icHeader.biHeight, - XORImageData, orgBIH, DIB_RGB_COLORS); - } - - if (IconImage->icHeader.biBitCount == 1) - { - IconInfo.hbmColor = (HBITMAP)0; - } - else - { - /* Create the color part of the icon */ - IconInfo.hbmColor = CreateDIBitmap(hDC, &IconImage->icHeader, 0, - XORImageData, orgBIH, DIB_RGB_COLORS); - if (IconInfo.hbmColor) - { - SetDIBits(hDC, IconInfo.hbmColor, 0, IconImage->icHeader.biHeight, - XORImageData, orgBIH, DIB_RGB_COLORS); - } + ImageData, orgBIH, DIB_RGB_COLORS); } /* Create the icon based on everything we have so far */ Modified: trunk/reactos/subsystems/win32/win32k/eng/mouse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/mouse.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/mouse.c [iso-8859-1] Wed Jul 29 20:28:11 2009 @@ -426,7 +426,8 @@ } else { - pgp->XlateObject = pxlo; + pgp->XlateObject = EngAllocMem(0, sizeof(XLATEOBJ), TAG_XLATEOBJ); + memcpy(pgp->XlateObject, pxlo, sizeof(XLATEOBJ)); } /* Create surface for saving the pixels under the cursor. */
15 years, 4 months
1
0
0
0
← Newer
1
2
3
4
5
6
...
61
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Results per page:
10
25
50
100
200