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
March 2012
----- 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
22 participants
351 discussions
Start a n
N
ew thread
[tkreuzer] 56062: [WIN32K] Implement NtGdiGetFontData / PFE_ulQueryTrueTypeTable
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Mar 6 15:03:28 2012 New Revision: 56062 URL:
http://svn.reactos.org/svn/reactos?rev=56062&view=rev
Log: [WIN32K] Implement NtGdiGetFontData / PFE_ulQueryTrueTypeTable Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fntdrvsup.c branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fontdata.c branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/include/font.h Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fntdrvsup.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/subsyst…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fntdrvsup.c [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fntdrvsup.c [iso-8859-1] Tue Mar 6 15:03:28 2012 @@ -49,22 +49,6 @@ ASSERT(gbAttachedCSRSS); KeUnstackDetachProcess(pApcState); gbAttachedCSRSS = FALSE; -} - -VOID -NTAPI -RFONT_vInitDeviceMetrics( - PRFONT prfnt) -{ - PPDEVOBJ ppdev = (PPDEVOBJ)prfnt->hdevProducer; - - ppdev->pldev->pfn.QueryFontData(prfnt->dhpdev, - &prfnt->fobj, - QFD_MAXEXTENTS, - -1, - NULL, - &prfnt->fddm, - sizeof(FD_DEVICEMETRICS)); } static @@ -113,6 +97,40 @@ //ppfe->aiFamilyName[]; } + +ULONG +NTAPI +PFE_ulQueryTrueTypeTable( + PPFE ppfe, + ULONG ulTableTag, + PTRDIFF dpStart, + ULONG cjBuffer, + PVOID pvBuffer) +{ + PPDEVOBJ ppdev = (PDEVOBJ*)ppfe->pPFF->hdev; + KAPC_STATE ApcState; + ULONG ulResult; + + /* Attach to CSRSS */ + AttachCSRSS(&ApcState); + + /* Call the driver to copy the requested data */ + ulResult = ppdev->pfn.QueryTrueTypeTable(ppfe->pPFF->hff, + ppfe->iFont, + ulTableTag, + dpStart, + cjBuffer, + pvBuffer, + NULL, + NULL); + + /* Detach from CSRSS */ + DetachCSRSS(&ApcState); + + /* Return the result */ + return ulResult; +} + static VOID Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fontdata.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/subsyst…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fontdata.c [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fontdata.c [iso-8859-1] Tue Mar 6 15:03:28 2012 @@ -18,11 +18,75 @@ IN HDC hdc, IN DWORD dwTable, IN DWORD dwOffset, - OUT OPTIONAL PVOID pvBuf, - IN ULONG cjBuf) -{ - ASSERT(FALSE); - return 0; + OUT OPTIONAL PVOID pvBuffer, + IN ULONG cjBuffer) +{ + PDC pdc; + PRFONT prfnt; + PVOID pvTempBuffer; + ULONG ulResult; + + /* Check if the caller provides a buffer */ + if (cjBuffer) + { + /* Must have a buffer */ + if (!pvBuffer) return GDI_ERROR; + + /* Allocate a temp buffer */ + pvTempBuffer = ExAllocatePoolWithTag(PagedPool, cjBuffer, GDITAG_TEMP); + if (!pvTempBuffer) + { + return GDI_ERROR; + } + } + else + { + /* Don't provide a buffer */ + pvTempBuffer = NULL; + } + + /* Lock the DC */ + pdc = DC_LockDc(hdc); + if (!pdc) + { + ulResult = GDI_ERROR; + goto leave; + } + + /* Get the RFONT from the DC */ + prfnt = DC_prfnt(pdc); + + /* Query the table data */ + ulResult = PFE_ulQueryTrueTypeTable(prfnt->ppfe, + dwTable, + dwOffset, + cjBuffer, + pvTempBuffer); + + /* Copy the data back, if requested */ + if (cjBuffer && (ulResult != GDI_ERROR)) + { + _SEH2_TRY + { + /* Probe and copy the data */ + ProbeForWrite(pvBuffer, cjBuffer, 1); + RtlCopyMemory(pvBuffer, pvTempBuffer, cjBuffer); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + ulResult = GDI_ERROR; + } + _SEH2_END; + } + + /* Unlock the DC */ + DC_UnlockDc(pdc); + +leave: + /* Free the temp buffer */ + if (pvTempBuffer) ExFreePoolWithTag(pvTempBuffer, GDITAG_TEMP); + + return ulResult; } W32KAPI Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/include/font.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/subsyst…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/include/font.h [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/include/font.h [iso-8859-1] Tue Mar 6 15:03:28 2012 @@ -392,6 +392,12 @@ NTAPI LFONT_ppfe(PLFONT plfnt); +PRFONT +NTAPI +LFONT_prfntFindLinkedRFONT( + _In_ PLFONT plfnt, + _In_ PMATRIX pmxWorldToDevice); + VOID NTAPI UpcaseString( @@ -403,6 +409,15 @@ NTAPI CalculateNameHash( PWSTR pwszName); + +ULONG +NTAPI +PFE_ulQueryTrueTypeTable( + PPFE ppfe, + ULONG ulTableTag, + PTRDIFF dpStart, + ULONG cjBuffer, + PVOID pvBuffer); BOOL NTAPI
12 years, 9 months
1
0
0
0
[tkreuzer] 56061: [WIN32K] Initialize the DC's CombinedClip when creating the DC. Fixes a crash caused by Explorer++
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Mar 6 10:33:28 2012 New Revision: 56061 URL:
http://svn.reactos.org/svn/reactos?rev=56061&view=rev
Log: [WIN32K] Initialize the DC's CombinedClip when creating the DC. Fixes a crash caused by Explorer++ Modified: trunk/reactos/subsystems/win32/win32k/objects/dclife.c Modified: trunk/reactos/subsystems/win32/win32k/objects/dclife.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] Tue Mar 6 10:33:28 2012 @@ -112,6 +112,8 @@ void DC_InitHack(PDC pdc) { + HRGN hVisRgn; + TextIntRealizeFont(pdc->pdcattr->hlfntNew,NULL); pdc->pdcattr->iCS_CP = ftGdiGetTextCharsetInfo(pdc,NULL,0); @@ -121,6 +123,11 @@ /* Select regions */ pdc->rosdc.hClipRgn = NULL; pdc->rosdc.hGCClipRgn = NULL; + + hVisRgn = IntSysCreateRectRgn(0, 0, 1, 1); + ASSERT(hVisRgn); + GdiSelectVisRgn(pdc->BaseObject.hHmgr, hVisRgn); + GreDeleteObject(hVisRgn); } VOID
12 years, 9 months
1
0
0
0
[sginsberg] 56060: - Stop using ObfXXX and IofXXX in C code. This is bad style. Always use the non-f versions in C code. - Fix the way we undefined IoCallDriver and IoCompleteRequest so existing an...
by sginsberg@svn.reactos.org
Author: sginsberg Date: Mon Mar 5 20:43:47 2012 New Revision: 56060 URL:
http://svn.reactos.org/svn/reactos?rev=56060&view=rev
Log: - Stop using ObfXXX and IofXXX in C code. This is bad style. Always use the non-f versions in C code. - Fix the way we undefined IoCallDriver and IoCompleteRequest so existing and future code in irp.c will use the correct function when using the Io* versions. Part 1 of 2. Modified: trunk/reactos/drivers/bus/acpi/cmbatt/cmbatt.c trunk/reactos/drivers/bus/acpi/cmbatt/cmbpnp.c trunk/reactos/drivers/bus/acpi/cmbatt/cmbwmi.c trunk/reactos/drivers/bus/acpi/compbatt/compmisc.c trunk/reactos/drivers/bus/acpi/compbatt/comppnp.c trunk/reactos/drivers/bus/pcix/dispatch.c trunk/reactos/drivers/bus/pcix/enum.c trunk/reactos/drivers/bus/pcix/pci/config.c trunk/reactos/drivers/filters/mountmgr/device.c trunk/reactos/drivers/filters/mountmgr/mountmgr.c trunk/reactos/drivers/filters/mountmgr/notify.c trunk/reactos/drivers/filters/mountmgr/symlink.c trunk/reactos/hal/halx86/acpi/halpnpdd.c trunk/reactos/hal/halx86/legacy/halpnpdd.c trunk/reactos/ntoskrnl/fsrtl/notify.c trunk/reactos/ntoskrnl/fsrtl/pnp.c trunk/reactos/ntoskrnl/io/iomgr/irp.c Modified: trunk/reactos/drivers/bus/acpi/cmbatt/cmbatt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/cmbatt/cm…
============================================================================== --- trunk/reactos/drivers/bus/acpi/cmbatt/cmbatt.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/cmbatt/cmbatt.c [iso-8859-1] Mon Mar 5 20:43:47 2012 @@ -258,7 +258,7 @@ { /* Get rid of it */ ExUnregisterCallback(CmBattPowerCallBackRegistration); - ObfDereferenceObject(CmBattPowerCallBackObject); + ObDereferenceObject(CmBattPowerCallBackObject); } /* Free the registry buffer if it exists */ @@ -339,7 +339,7 @@ /* Release lock and complete request */ ExReleaseFastMutex(&DeviceExtension->FastMutex); Irp->IoStatus.Status = Status; - IofCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); return Status; } @@ -361,7 +361,7 @@ { /* It's too late, fail */ Irp->IoStatus.Status = STATUS_DEVICE_REMOVED; - IofCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_DEVICE_REMOVED; } @@ -514,7 +514,7 @@ { /* Complete the request */ Irp->IoStatus.Status = Status; - IofCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); } else { @@ -1312,7 +1312,7 @@ } else { - ObfDereferenceObject(CmBattPowerCallBackObject); + ObDereferenceObject(CmBattPowerCallBackObject); if (CmBattDebug & CMBATT_GENERIC_WARNING) DbgPrint("CmBattRegisterPowerCallBack: ExRegisterCallback failed.\n"); } Modified: trunk/reactos/drivers/bus/acpi/cmbatt/cmbpnp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/cmbatt/cm…
============================================================================== --- trunk/reactos/drivers/bus/acpi/cmbatt/cmbpnp.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/cmbatt/cmbpnp.c [iso-8859-1] Mon Mar 5 20:43:47 2012 @@ -250,7 +250,7 @@ { /* Complete the request here */ Status = Irp->IoStatus.Status; - IofCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); } /* Return status */ @@ -281,7 +281,7 @@ { /* Complete the request */ Irp->IoStatus.Status = STATUS_DEVICE_REMOVED; - IofCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_DEVICE_REMOVED; } @@ -485,7 +485,7 @@ } /* Release the remove lock and complete the request */ - IofCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); IoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return Status; @@ -514,7 +514,7 @@ { /* Complete the request */ Status = Irp->IoStatus.Status; - IofCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); } /* Release the remove lock and return status */ Modified: trunk/reactos/drivers/bus/acpi/cmbatt/cmbwmi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/cmbatt/cm…
============================================================================== --- trunk/reactos/drivers/bus/acpi/cmbatt/cmbwmi.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/cmbatt/cmbwmi.c [iso-8859-1] Mon Mar 5 20:43:47 2012 @@ -161,7 +161,7 @@ { /* It's too late, fail */ Irp->IoStatus.Status = STATUS_DEVICE_REMOVED; - IofCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_DEVICE_REMOVED; } @@ -192,7 +192,7 @@ /* Complete it here */ if (CmBattDebug & 2) DbgPrint("CmBatt: SystemControl: Irp Not Completed.\n"); - IofCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); break; case IrpForward: Modified: trunk/reactos/drivers/bus/acpi/compbatt/compmisc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/compbatt/…
============================================================================== --- trunk/reactos/drivers/bus/acpi/compbatt/compmisc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/compbatt/compmisc.c [iso-8859-1] Mon Mar 5 20:43:47 2012 @@ -43,7 +43,7 @@ if (Irp) { /* Call the class driver miniport */ - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { /* Wait for result */ Modified: trunk/reactos/drivers/bus/acpi/compbatt/comppnp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/compbatt/…
============================================================================== --- trunk/reactos/drivers/bus/acpi/compbatt/comppnp.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/compbatt/comppnp.c [iso-8859-1] Mon Mar 5 20:43:47 2012 @@ -145,8 +145,8 @@ if (NT_SUCCESS(Status)) { /* Reference the DO and drop the FO */ - ObfReferenceObject(BatteryData->DeviceObject); - ObfDereferenceObject(FileObject); + ObReferenceObject(BatteryData->DeviceObject); + ObDereferenceObject(FileObject); /* Allocate the battery IRP */ Irp = IoAllocateIrp(BatteryData->DeviceObject->StackSize + 1, 0); @@ -187,7 +187,7 @@ if (CompBattDebug & 8) DbgPrint("CompBatt: Couldn't allocate new battery Irp\n"); Status = STATUS_INSUFFICIENT_RESOURCES; - ObfDereferenceObject(BatteryData->DeviceObject); + ObDereferenceObject(BatteryData->DeviceObject); } } else if (CompBattDebug & 8) @@ -227,7 +227,7 @@ if (BatteryData) { /* Dereference and free it */ - ObfDereferenceObject(BatteryData->DeviceObject); + ObDereferenceObject(BatteryData->DeviceObject); ExFreePool(BatteryData); /* Notify class driver */ Modified: trunk/reactos/drivers/bus/pcix/dispatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/dispatch.…
============================================================================== --- trunk/reactos/drivers/bus/pcix/dispatch.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/dispatch.c [iso-8859-1] Mon Mar 5 20:43:47 2012 @@ -49,7 +49,7 @@ IoSetCompletionRoutine(Irp, PciSetEventCompletion, &Event, TRUE, TRUE, TRUE); /* Call the attached device */ - Status = IofCallDriver(DeviceExtension->AttachedDeviceObject, Irp); + Status = IoCallDriver(DeviceExtension->AttachedDeviceObject, Irp); if (Status == STATUS_PENDING) { /* Wait for it to complete the request, and get its status */ @@ -83,7 +83,7 @@ { /* For a normal IRP, just call the next driver in the stack */ IoSkipCurrentIrpStackLocation(Irp); - Status = IofCallDriver(DeviceExtension->AttachedDeviceObject, Irp); + Status = IoCallDriver(DeviceExtension->AttachedDeviceObject, Irp); } /* Return the status back to the caller */ @@ -245,7 +245,7 @@ if (IoStackLocation->MajorFunction == IRP_MJ_POWER) PoStartNextPowerIrp(Irp); /* And now this IRP can be completed */ - IofCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); } /* And the status returned back to the caller */ Modified: trunk/reactos/drivers/bus/pcix/enum.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/enum.c?re…
============================================================================== --- trunk/reactos/drivers/bus/pcix/enum.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/enum.c [iso-8859-1] Mon Mar 5 20:43:47 2012 @@ -2130,7 +2130,7 @@ { /* Reference it and add it to the array */ DeviceObject = PdoExtension->PhysicalDeviceObject; - ObfReferenceObject(DeviceObject); + ObReferenceObject(DeviceObject); *ObjectArray++ = DeviceObject; } Modified: trunk/reactos/drivers/bus/pcix/pci/config.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/pci/confi…
============================================================================== --- trunk/reactos/drivers/bus/pcix/pci/config.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/pci/config.c [iso-8859-1] Mon Mar 5 20:43:47 2012 @@ -205,12 +205,12 @@ } /* Dereference the device object because we took a reference earlier */ - ObfDereferenceObject(AttachedDevice); + ObDereferenceObject(AttachedDevice); } else { /* Failure path, dereference the device object and set failure code */ - if (AttachedDevice) ObfDereferenceObject(AttachedDevice); + if (AttachedDevice) ObDereferenceObject(AttachedDevice); ExFreePoolWithTag(PciInterface, 0); Status = STATUS_INSUFFICIENT_RESOURCES; } Modified: trunk/reactos/drivers/filters/mountmgr/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/d…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/device.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/device.c [iso-8859-1] Mon Mar 5 20:43:47 2012 @@ -353,12 +353,12 @@ /* FT volume can't be removable */ if (FileDeviceObject->Characteristics & FILE_REMOVABLE_MEDIA) { - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); return FALSE; } - ObfDereferenceObject(FileObject); + ObDereferenceObject(FileObject); /* Get partition information */ KeInitializeEvent(&Event, NotificationEvent, FALSE); @@ -373,18 +373,18 @@ &IoStatusBlock); if (!Irp) { - ObfDereferenceObject(DeviceObject); + ObDereferenceObject(DeviceObject); return FALSE; } - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); Status = IoStatusBlock.Status; } - ObfDereferenceObject(DeviceObject); + ObDereferenceObject(DeviceObject); if (!NT_SUCCESS(Status)) { return FALSE; @@ -1449,7 +1449,7 @@ if (FOReferenced) { - ObfDereferenceObject(FileObject); + ObDereferenceObject(FileObject); } return Status; @@ -1596,7 +1596,7 @@ Complete: Irp->IoStatus.Status = Status; - IofCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); return Status; } Modified: trunk/reactos/drivers/filters/mountmgr/mountmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/m…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/mountmgr.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/mountmgr.c [iso-8859-1] Mon Mar 5 20:43:47 2012 @@ -240,7 +240,7 @@ /* The associate FO can't have a file name */ if (FileObject->FileName.Length) { - ObfDereferenceObject(FileObject); + ObDereferenceObject(FileObject); return STATUS_OBJECT_NAME_NOT_FOUND; } @@ -275,12 +275,12 @@ &IoStatusBlock); if (!Irp) { - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); return STATUS_INSUFFICIENT_RESOURCES; } - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -322,12 +322,12 @@ &IoStatusBlock); if (!Irp) { - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); return STATUS_INSUFFICIENT_RESOURCES; } - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -361,12 +361,12 @@ &IoStatusBlock); if (!Irp) { - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); return STATUS_INSUFFICIENT_RESOURCES; } - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -392,8 +392,8 @@ Name = AllocatePool(sizeof(MOUNTDEV_NAME)); if (!Name) { - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); return STATUS_INSUFFICIENT_RESOURCES; } @@ -419,7 +419,7 @@ Stack = IoGetNextIrpStackLocation(Irp); Stack->FileObject = FileObject; - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -437,8 +437,8 @@ Name = AllocatePool(Size); if (!Name) { - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); return STATUS_INSUFFICIENT_RESOURCES; } @@ -464,7 +464,7 @@ Stack = IoGetNextIrpStackLocation(Irp); Stack->FileObject = FileObject; - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -524,15 +524,15 @@ if (!Irp) { FreePool(Id); - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); return STATUS_INSUFFICIENT_RESOURCES; } Stack = IoGetNextIrpStackLocation(Irp); Stack->FileObject = FileObject; - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -550,8 +550,8 @@ Id = AllocatePool(Size); if (!Id) { - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); return STATUS_INSUFFICIENT_RESOURCES; } @@ -577,7 +577,7 @@ Stack = IoGetNextIrpStackLocation(Irp); Stack->FileObject = FileObject; - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -622,15 +622,15 @@ &IoStatusBlock); if (!Irp) { - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); return STATUS_INSUFFICIENT_RESOURCES; } Stack = IoGetNextIrpStackLocation(Irp); Stack->FileObject = FileObject; - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -640,8 +640,8 @@ *HasGuid = NT_SUCCESS(Status); } - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); return Status; } @@ -1693,7 +1693,7 @@ Irp->IoStatus.Information = 0; Irp->IoStatus.Status = STATUS_CANCELLED; - IofCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); } /* Modified: trunk/reactos/drivers/filters/mountmgr/notify.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/n…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/notify.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/notify.c [iso-8859-1] Mon Mar 5 20:43:47 2012 @@ -75,15 +75,15 @@ Stack = IoGetNextIrpStackLocation(Irp); Stack->FileObject = FileObject; - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); } Cleanup: - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); return; } @@ -301,7 +301,7 @@ DeviceInformation->TargetDeviceNotificationEntry = NULL; } - ObfDereferenceObject(FileObject); + ObDereferenceObject(FileObject); return; } @@ -341,7 +341,7 @@ *((PULONG)Irp->AssociatedIrp.SystemBuffer) = DeviceExtension->EpicNumber; Irp->IoStatus.Information = sizeof(DeviceExtension->EpicNumber); - IofCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); } } @@ -412,8 +412,8 @@ &IoStatusBlock); if (!Irp) { - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); } Stack = IoGetNextIrpStackLocation(Irp); @@ -428,15 +428,15 @@ Stack->FileObject = FileObject; /* And call driver */ - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); Status = IoStatusBlock.Status; } - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); if (!NT_SUCCESS(Status)) { @@ -466,7 +466,7 @@ &DeviceNotification, NULL, NULL); - ObfDereferenceObject(DeviceObject); + ObDereferenceObject(DeviceObject); return; } @@ -609,8 +609,8 @@ if (InterlockedExchange((PLONG)&(WorkItem->Event), 0) != 0) { - ObfDereferenceObject(FileObject); - ObfDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); RemoveWorkItem(WorkItem); return; } @@ -634,16 +634,16 @@ TRUE, TRUE, TRUE); if (!NT_SUCCESS(Status)) { - ObfDereferenceObject(FileObject); - ObfDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); RemoveWorkItem(WorkItem); return; } /* Call the driver */ - IofCallDriver(DeviceObject, Irp); - ObfDereferenceObject(FileObject); - ObfDereferenceObject(DeviceObject); + IoCallDriver(DeviceObject, Irp); + ObDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); } /* @@ -673,13 +673,13 @@ /* And then, get attached device */ DeviceObject = IoGetAttachedDeviceReference(FileObject->DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(FileObject); /* Allocate a work item */ WorkItem = AllocatePool(sizeof(UNIQUE_ID_WORK_ITEM)); if (!WorkItem) { - ObfDereferenceObject(DeviceObject); + ObDereferenceObject(DeviceObject); return; } @@ -687,7 +687,7 @@ WorkItem->WorkItem = IoAllocateWorkItem(DeviceExtension->DeviceObject); if (!WorkItem->WorkItem) { - ObfDereferenceObject(DeviceObject); + ObDereferenceObject(DeviceObject); goto Cleanup; } @@ -696,7 +696,7 @@ /* Already provide the IRP */ WorkItem->Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE); - ObfDereferenceObject(DeviceObject); + ObDereferenceObject(DeviceObject); if (!WorkItem->Irp) { Modified: trunk/reactos/drivers/filters/mountmgr/symlink.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/s…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/symlink.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/symlink.c [iso-8859-1] Mon Mar 5 20:43:47 2012 @@ -218,7 +218,7 @@ Stack = IoGetNextIrpStackLocation(Irp); Stack->FileObject = FileObject; - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -245,7 +245,7 @@ Stack->FileObject = FileObject; /* Really notify */ - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -257,8 +257,8 @@ FreePool(Name); } - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); return; } @@ -322,7 +322,7 @@ Stack = IoGetNextIrpStackLocation(Irp); Stack->FileObject = FileObject; - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -349,7 +349,7 @@ Stack->FileObject = FileObject; /* Really notify */ - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -361,8 +361,8 @@ FreePool(Name); } - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); return; } @@ -740,7 +740,7 @@ IoStackLocation->FileObject = FileObject; /* And ask */ - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, @@ -782,7 +782,7 @@ IoStackLocation = IoGetNextIrpStackLocation(Irp); IoStackLocation->FileObject = FileObject; - Status = IofCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, @@ -817,8 +817,8 @@ FreePool(IoCtlSuggested); Dereference: - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); return Status; } Modified: trunk/reactos/hal/halx86/acpi/halpnpdd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/acpi/halpnpdd.c…
============================================================================== --- trunk/reactos/hal/halx86/acpi/halpnpdd.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/acpi/halpnpdd.c [iso-8859-1] Mon Mar 5 20:43:47 2012 @@ -253,7 +253,7 @@ { /* Save our own PDO and reference it */ *ObjectEntry++ = PdoExtension->PhysicalDeviceObject; - ObfReferenceObject(PdoExtension->PhysicalDeviceObject); + ObReferenceObject(PdoExtension->PhysicalDeviceObject); /* Go to our next PDO */ PdoExtension = PdoExtension->Next; @@ -281,7 +281,7 @@ /* Fill it out and reference us */ PdoRelations->Count = 1; PdoRelations->Objects[0] = DeviceObject; - ObfReferenceObject(DeviceObject); + ObReferenceObject(DeviceObject); /* Return it */ *DeviceRelations = PdoRelations; Modified: trunk/reactos/hal/halx86/legacy/halpnpdd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/legacy/halpnpdd…
============================================================================== --- trunk/reactos/hal/halx86/legacy/halpnpdd.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/legacy/halpnpdd.c [iso-8859-1] Mon Mar 5 20:43:47 2012 @@ -245,7 +245,7 @@ { /* Save our own PDO and reference it */ *ObjectEntry++ = PdoExtension->PhysicalDeviceObject; - ObfReferenceObject(PdoExtension->PhysicalDeviceObject); + ObReferenceObject(PdoExtension->PhysicalDeviceObject); /* Go to our next PDO */ PdoExtension = PdoExtension->Next; @@ -273,7 +273,7 @@ /* Fill it out and reference us */ PdoRelations->Count = 1; PdoRelations->Objects[0] = DeviceObject; - ObfReferenceObject(DeviceObject); + ObReferenceObject(DeviceObject); /* Return it */ *DeviceRelations = PdoRelations; Modified: trunk/reactos/ntoskrnl/fsrtl/notify.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/notify.c?re…
============================================================================== --- trunk/reactos/ntoskrnl/fsrtl/notify.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fsrtl/notify.c [iso-8859-1] Mon Mar 5 20:43:47 2012 @@ -200,7 +200,7 @@ Completion: IoMarkIrpPending(Irp); Irp->IoStatus.Status = Status; - IofCompleteRequest(Irp, EVENT_INCREMENT); + IoCompleteRequest(Irp, EVENT_INCREMENT); } /* @@ -537,7 +537,7 @@ { IoMarkIrpPending(NotifyIrp); NotifyIrp->IoStatus.Status = STATUS_NOTIFY_CLEANUP; - IofCompleteRequest(NotifyIrp, EVENT_INCREMENT); + IoCompleteRequest(NotifyIrp, EVENT_INCREMENT); _SEH2_LEAVE; } @@ -550,14 +550,14 @@ { IoMarkIrpPending(NotifyIrp); NotifyIrp->IoStatus.Status = STATUS_NOTIFY_CLEANUP; - IofCompleteRequest(NotifyIrp, EVENT_INCREMENT); + IoCompleteRequest(NotifyIrp, EVENT_INCREMENT); } /* Or if it's about to be deleted, complete */ else if (NotifyChange->Flags & DELETE_IN_PROCESS) { IoMarkIrpPending(NotifyIrp); NotifyIrp->IoStatus.Status = STATUS_DELETE_PENDING; - IofCompleteRequest(NotifyIrp, EVENT_INCREMENT); + IoCompleteRequest(NotifyIrp, EVENT_INCREMENT); } /* Complete if there is directory enumeration and no buffer available any more */ if ((NotifyChange->Flags & INVALIDATE_BUFFERS) && (NotifyChange->Flags & ENUMERATE_DIR)) @@ -565,7 +565,7 @@ NotifyChange->Flags &= ~INVALIDATE_BUFFERS; IoMarkIrpPending(NotifyIrp); NotifyIrp->IoStatus.Status = STATUS_NOTIFY_ENUM_DIR; - IofCompleteRequest(NotifyIrp, EVENT_INCREMENT); + IoCompleteRequest(NotifyIrp, EVENT_INCREMENT); } /* If no data yet, or directory enumeration, handle */ else if (NotifyChange->DataLength == 0 || (NotifyChange->Flags & ENUMERATE_DIR)) Modified: trunk/reactos/ntoskrnl/fsrtl/pnp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/pnp.c?rev=5…
============================================================================== --- trunk/reactos/ntoskrnl/fsrtl/pnp.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fsrtl/pnp.c [iso-8859-1] Mon Mar 5 20:43:47 2012 @@ -111,7 +111,7 @@ Status = STATUS_SUCCESS; } - ObfDereferenceObject(DeviceObject); + ObDereferenceObject(DeviceObject); return Status; } Modified: trunk/reactos/ntoskrnl/io/iomgr/irp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/irp.c?re…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] Mon Mar 5 20:43:47 2012 @@ -13,10 +13,6 @@ #include <ntoskrnl.h> #define NDEBUG #include <debug.h> - -/* Undefine some macros we implement here */ -#undef IoCallDriver -#undef IoCompleteRequest PIRP IopDeadIrp; @@ -1099,6 +1095,7 @@ /* * @implemented */ +#undef IoCallDriver NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, @@ -1108,9 +1105,12 @@ return IofCallDriver(DeviceObject, Irp); } -/* - * @implemented - */ +#define IoCallDriver IofCallDriver + +/* + * @implemented + */ +#undef IoCompleteRequest VOID NTAPI IoCompleteRequest(IN PIRP Irp, @@ -1119,6 +1119,8 @@ /* Call the fastcall */ IofCompleteRequest(Irp, PriorityBoost); } + +#define IoCompleteRequest IofCompleteRequest /* * @implemented
12 years, 9 months
1
0
0
0
[jgardou] 56059: There are days like that, when you'd better refrain from commit anything.
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Mar 5 20:34:50 2012 New Revision: 56059 URL:
http://svn.reactos.org/svn/reactos?rev=56059&view=rev
Log: There are days like that, when you'd better refrain from commit anything. Modified: trunk/reactos/dll/win32/uxtheme/system.c Modified: trunk/reactos/dll/win32/uxtheme/system.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/system.c…
============================================================================== --- trunk/reactos/dll/win32/uxtheme/system.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/uxtheme/system.c [iso-8859-1] Mon Mar 5 20:34:50 2012 @@ -680,11 +680,13 @@ HRESULT WINAPI SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList) { - if(!IsWindow(hwnd)) + HRESULT hr; + TRACE("(%p,%s,%s)\n", hwnd, debugstr_w(pszSubAppName), + debugstr_w(pszSubIdList)); + + if(!IsWindow(hwnd)) return E_HANDLE; - HRESULT hr; - TRACE("(%p,%s,%s)\n", hwnd, debugstr_w(pszSubAppName), hr = UXTHEME_SetWindowProperty(hwnd, atSubAppName, pszSubAppName); if(SUCCEEDED(hr)) hr = UXTHEME_SetWindowProperty(hwnd, atSubIdList, pszSubIdList);
12 years, 9 months
1
0
0
0
[jgardou] 56058: [UXTHEME] - fix a few winetest Patch by Ben Pye (bfhben __ gmail __ com)
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Mar 5 20:21:43 2012 New Revision: 56058 URL:
http://svn.reactos.org/svn/reactos?rev=56058&view=rev
Log: [UXTHEME] - fix a few winetest Patch by Ben Pye (bfhben __ gmail __ com) Modified: trunk/reactos/dll/win32/uxtheme/system.c Modified: trunk/reactos/dll/win32/uxtheme/system.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/system.c…
============================================================================== --- trunk/reactos/dll/win32/uxtheme/system.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/uxtheme/system.c [iso-8859-1] Mon Mar 5 20:21:43 2012 @@ -630,6 +630,9 @@ LPCWSTR pszUseClassList; HTHEME hTheme = NULL; TRACE("(%p,%s)\n", hwnd, debugstr_w(pszClassList)); + + if(pszClassList == NULL) + SetLastError(E_POINTER); if(bThemeActive) { @@ -645,6 +648,7 @@ if(IsWindow(hwnd)) SetPropW(hwnd, (LPCWSTR)MAKEINTATOM(atWindowTheme), hTheme); TRACE(" = %p\n", hTheme); + return hTheme; } @@ -662,6 +666,9 @@ HTHEME WINAPI GetWindowTheme(HWND hwnd) { TRACE("(%p)\n", hwnd); + if(!IsWindow(hwnd)) + SetLastError(E_HANDLE); + return GetPropW(hwnd, (LPCWSTR)MAKEINTATOM(atWindowTheme)); } @@ -673,9 +680,11 @@ HRESULT WINAPI SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList) { + if(!IsWindow(hwnd)) + return E_HANDLE; + HRESULT hr; TRACE("(%p,%s,%s)\n", hwnd, debugstr_w(pszSubAppName), - debugstr_w(pszSubIdList)); hr = UXTHEME_SetWindowProperty(hwnd, atSubAppName, pszSubAppName); if(SUCCEEDED(hr)) hr = UXTHEME_SetWindowProperty(hwnd, atSubIdList, pszSubIdList);
12 years, 9 months
1
0
0
0
[rharabien] 56057: [CMAKE] - Fix GCC warnings when building cmlib
by rharabien@svn.reactos.org
Author: rharabien Date: Mon Mar 5 20:20:50 2012 New Revision: 56057 URL:
http://svn.reactos.org/svn/reactos?rev=56057&view=rev
Log: [CMAKE] - Fix GCC warnings when building cmlib Modified: trunk/reactos/CMakeLists.txt Modified: trunk/reactos/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/CMakeLists.txt?rev=56057&r…
============================================================================== --- trunk/reactos/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/CMakeLists.txt [iso-8859-1] Mon Mar 5 20:20:50 2012 @@ -52,7 +52,7 @@ endif() add_definitions(/Dinline=__inline) else() - add_compile_flags("-fshort-wchar") + add_compile_flags("-fshort-wchar -Wno-multichar") endif() include_directories(include/host)
12 years, 9 months
1
0
0
0
[rharabien] 56056: [GDIPLUS_WINETEST] - Sync to Wine 1.3.37
by rharabien@svn.reactos.org
Author: rharabien Date: Mon Mar 5 20:18:32 2012 New Revision: 56056 URL:
http://svn.reactos.org/svn/reactos?rev=56056&view=rev
Log: [GDIPLUS_WINETEST] - Sync to Wine 1.3.37 Modified: trunk/rostests/winetests/gdiplus/brush.c trunk/rostests/winetests/gdiplus/font.c trunk/rostests/winetests/gdiplus/graphics.c trunk/rostests/winetests/gdiplus/graphicspath.c trunk/rostests/winetests/gdiplus/image.c trunk/rostests/winetests/gdiplus/matrix.c trunk/rostests/winetests/gdiplus/pathiterator.c trunk/rostests/winetests/gdiplus/region.c Modified: trunk/rostests/winetests/gdiplus/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/brush.c…
============================================================================== --- trunk/rostests/winetests/gdiplus/brush.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/brush.c [iso-8859-1] Mon Mar 5 20:18:32 2012 @@ -286,9 +286,14 @@ static void test_gradientgetrect(void) { GpLineGradient *brush; + GpMatrix *transform; + REAL elements[6]; GpRectF rectf; GpStatus status; GpPointF pt1, pt2; + + status = GdipCreateMatrix(&transform); + expect(Ok, status); pt1.X = pt1.Y = 1.0; pt2.X = pt2.Y = 100.0; @@ -301,7 +306,21 @@ expectf(1.0, rectf.Y); expectf(99.0, rectf.Width); expectf(99.0, rectf.Height); + status = GdipGetLineTransform(brush, transform); + todo_wine expect(Ok, status); + if (status == Ok) + { + status = GdipGetMatrixElements(transform, elements); + expect(Ok, status); + expectf(1.0, elements[0]); + expectf(1.0, elements[1]); + expectf(-1.0, elements[2]); + expectf(1.0, elements[3]); + expectf(50.50, elements[4]); + expectf(-50.50, elements[5]); + } status = GdipDeleteBrush((GpBrush*)brush); + expect(Ok, status); /* vertical gradient */ pt1.X = pt1.Y = pt2.X = 0.0; pt2.Y = 10.0; @@ -314,7 +333,21 @@ expectf(0.0, rectf.Y); expectf(10.0, rectf.Width); expectf(10.0, rectf.Height); + status = GdipGetLineTransform(brush, transform); + todo_wine expect(Ok, status); + if (status == Ok) + { + status = GdipGetMatrixElements(transform, elements); + expect(Ok, status); + expectf(0.0, elements[0]); + expectf(1.0, elements[1]); + expectf(-1.0, elements[2]); + expectf(0.0, elements[3]); + expectf(5.0, elements[4]); + expectf(5.0, elements[5]); + } status = GdipDeleteBrush((GpBrush*)brush); + expect(Ok, status); /* horizontal gradient */ pt1.X = pt1.Y = pt2.Y = 0.0; pt2.X = 10.0; @@ -327,7 +360,21 @@ expectf(-5.0, rectf.Y); expectf(10.0, rectf.Width); expectf(10.0, rectf.Height); + status = GdipGetLineTransform(brush, transform); + todo_wine expect(Ok, status); + if (status == Ok) + { + status = GdipGetMatrixElements(transform, elements); + expect(Ok, status); + expectf(1.0, elements[0]); + expectf(0.0, elements[1]); + expectf(0.0, elements[2]); + expectf(1.0, elements[3]); + expectf(0.0, elements[4]); + expectf(0.0, elements[5]); + } status = GdipDeleteBrush((GpBrush*)brush); + expect(Ok, status); /* slope = -1 */ pt1.X = pt1.Y = 0.0; pt2.X = 20.0; @@ -341,7 +388,21 @@ expectf(-20.0, rectf.Y); expectf(20.0, rectf.Width); expectf(20.0, rectf.Height); + status = GdipGetLineTransform(brush, transform); + todo_wine expect(Ok, status); + if (status == Ok) + { + status = GdipGetMatrixElements(transform, elements); + expect(Ok, status); + expectf(1.0, elements[0]); + expectf(-1.0, elements[1]); + expectf(1.0, elements[2]); + expectf(1.0, elements[3]); + expectf(10.0, elements[4]); + expectf(10.0, elements[5]); + } status = GdipDeleteBrush((GpBrush*)brush); + expect(Ok, status); /* slope = 1/100 */ pt1.X = pt1.Y = 0.0; pt2.X = 100.0; @@ -355,7 +416,35 @@ expectf(0.0, rectf.Y); expectf(100.0, rectf.Width); expectf(1.0, rectf.Height); + status = GdipGetLineTransform(brush, transform); + todo_wine expect(Ok, status); + if (status == Ok) + { + status = GdipGetMatrixElements(transform, elements); + expect(Ok,status); + expectf(1.0, elements[0]); + expectf(0.01, elements[1]); + expectf(-0.02, elements[2]); + /* expectf(2.0, elements[3]); */ + expectf(0.01, elements[4]); + /* expectf(-1.0, elements[5]); */ + } status = GdipDeleteBrush((GpBrush*)brush); + expect(Ok,status); + /* zero height rect */ + rectf.X = rectf.Y = 10.0; + rectf.Width = 100.0; + rectf.Height = 0.0; + status = GdipCreateLineBrushFromRect(&rectf, 0, 0, LinearGradientModeVertical, + WrapModeTile, &brush); + expect(OutOfMemory, status); + /* zero width rect */ + rectf.X = rectf.Y = 10.0; + rectf.Width = 0.0; + rectf.Height = 100.0; + status = GdipCreateLineBrushFromRect(&rectf, 0, 0, LinearGradientModeHorizontal, + WrapModeTile, &brush); + expect(OutOfMemory, status); /* from rect with LinearGradientModeHorizontal */ rectf.X = rectf.Y = 10.0; rectf.Width = rectf.Height = 100.0; @@ -369,7 +458,21 @@ expectf(10.0, rectf.Y); expectf(100.0, rectf.Width); expectf(100.0, rectf.Height); + status = GdipGetLineTransform(brush, transform); + todo_wine expect(Ok, status); + if (status == Ok) + { + status = GdipGetMatrixElements(transform, elements); + expect(Ok,status); + expectf(1.0, elements[0]); + expectf(0.0, elements[1]); + expectf(0.0, elements[2]); + expectf(1.0, elements[3]); + expectf(0.0, elements[4]); + expectf(0.0, elements[5]); + } status = GdipDeleteBrush((GpBrush*)brush); + expect(Ok,status); /* passing negative Width/Height to LinearGradientModeHorizontal */ rectf.X = rectf.Y = 10.0; rectf.Width = rectf.Height = -100.0; @@ -383,7 +486,23 @@ expectf(10.0, rectf.Y); expectf(-100.0, rectf.Width); expectf(-100.0, rectf.Height); + status = GdipGetLineTransform(brush, transform); + todo_wine expect(Ok, status); + if (status == Ok) + { + status = GdipGetMatrixElements(transform, elements); + expect(Ok,status); + expectf(1.0, elements[0]); + expectf(0.0, elements[1]); + expectf(0.0, elements[2]); + expectf(1.0, elements[3]); + expectf(0.0, elements[4]); + expectf(0.0, elements[5]); + } status = GdipDeleteBrush((GpBrush*)brush); + expect(Ok,status); + + GdipDeleteMatrix(transform); } static void test_lineblend(void) @@ -400,6 +519,10 @@ REAL res_factors[6] = {0.3f, 0.0f, 0.0f, 0.0f, 0.0f}; REAL res_positions[6] = {0.3f, 0.0f, 0.0f, 0.0f, 0.0f}; ARGB res_colors[6] = {0xdeadbeef, 0, 0, 0, 0}; + + pt1.X = pt1.Y = pt2.Y = pt2.X = 1.0; + status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush); + expect(OutOfMemory, status); pt1.X = pt1.Y = 1.0; pt2.X = pt2.Y = 100.0; Modified: trunk/rostests/winetests/gdiplus/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/font.c?…
============================================================================== --- trunk/rostests/winetests/gdiplus/font.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/font.c [iso-8859-1] Mon Mar 5 20:18:32 2012 @@ -34,6 +34,7 @@ static const WCHAR TimesNewRoman[] = {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n','\0'}; static const WCHAR CourierNew[] = {'C','o','u','r','i','e','r',' ','N','e','w','\0'}; static const WCHAR Tahoma[] = {'T','a','h','o','m','a',0}; +static const WCHAR LiberationSerif[] = {'L','i','b','e','r','a','t','i','o','n',' ','S','e','r','i','f',0}; static void test_createfont(void) { @@ -129,7 +130,8 @@ expect(0, lfa2.lfItalic); expect(0, lfa2.lfUnderline); expect(0, lfa2.lfStrikeOut); - expect(GetTextCharset(hdc), lfa2.lfCharSet); + ok(lfa2.lfCharSet == GetTextCharset(hdc) || lfa2.lfCharSet == ANSI_CHARSET, + "Expected %x or %x, got %x\n", GetTextCharset(hdc), ANSI_CHARSET, lfa2.lfCharSet); expect(0, lfa2.lfOutPrecision); expect(0, lfa2.lfClipPrecision); expect(0, lfa2.lfQuality); @@ -159,7 +161,8 @@ expect(TRUE, lfa2.lfItalic); expect(TRUE, lfa2.lfUnderline); expect(TRUE, lfa2.lfStrikeOut); - expect(GetTextCharset(hdc), lfa2.lfCharSet); + ok(lfa2.lfCharSet == GetTextCharset(hdc) || lfa2.lfCharSet == ANSI_CHARSET, + "Expected %x or %x, got %x\n", GetTextCharset(hdc), ANSI_CHARSET, lfa2.lfCharSet); expect(0, lfa2.lfOutPrecision); expect(0, lfa2.lfClipPrecision); expect(0, lfa2.lfQuality); @@ -252,6 +255,7 @@ ok(result == 1854, "Expected 1854, got %d\n", result); result = 0; stat = GdipGetCellDescent(FontFamily, FontStyleRegular, &result); + expect(Ok, stat); ok(result == 434, "Expected 434, got %d\n", result); GdipDeleteFontFamily(FontFamily); } @@ -275,65 +279,68 @@ ok(result == 1825, "Expected 1825, got %d\n", result); result = 0; stat = GdipGetCellDescent(FontFamily, FontStyleRegular, &result); + expect(Ok, stat); ok(result == 443, "Expected 443 got %d\n", result); GdipDeleteFontFamily(FontFamily); } } +static void check_family(const char* context, GpFontFamily *family, WCHAR *name) +{ + GpStatus stat; + GpFont* font; + + *name = 0; + stat = GdipGetFamilyName(family, name, LANG_NEUTRAL); + ok(stat == Ok, "could not get the %s family name: %.8x\n", context, stat); + + stat = GdipCreateFont(family, 12, FontStyleRegular, UnitPixel, &font); + ok(stat == Ok, "could not create a font for the %s family: %.8x\n", context, stat); + if (stat == Ok) + { + stat = GdipDeleteFont(font); + ok(stat == Ok, "could not delete the %s family font: %.8x\n", context, stat); + } + + stat = GdipDeleteFontFamily(family); + ok(stat == Ok, "could not delete the %s family: %.8x\n", context, stat); +} + static void test_getgenerics (void) { GpStatus stat; - GpFontFamily* family; - WCHAR familyName[LF_FACESIZE]; - ZeroMemory(familyName, sizeof(familyName)/sizeof(WCHAR)); - - stat = GdipGetGenericFontFamilySansSerif (&family); + GpFontFamily *family; + WCHAR sansname[LF_FACESIZE], serifname[LF_FACESIZE], mononame[LF_FACESIZE]; + int missingfonts = 0; + + stat = GdipGetGenericFontFamilySansSerif(&family); + expect (Ok, stat); if (stat == FontFamilyNotFound) - { - skip("Microsoft Sans Serif not installed\n"); - goto serif; - } - expect (Ok, stat); - stat = GdipGetFamilyName (family, familyName, LANG_NEUTRAL); - expect (Ok, stat); - if (!lstrcmpiW(familyName, Tahoma)) - todo_wine ok ((lstrcmpiW(familyName, MicrosoftSansSerif) == 0), - "Expected Microsoft Sans Serif, got Tahoma\n"); + missingfonts = 1; else - ok ((lstrcmpiW(familyName, MicrosoftSansSerif) == 0), - "Expected Microsoft Sans Serif, got %s\n", wine_dbgstr_w(familyName)); - stat = GdipDeleteFontFamily (family); - expect (Ok, stat); - -serif: - stat = GdipGetGenericFontFamilySerif (&family); + check_family("Sans Serif", family, sansname); + + stat = GdipGetGenericFontFamilySerif(&family); + expect (Ok, stat); if (stat == FontFamilyNotFound) - { - skip("Times New Roman not installed\n"); - goto monospace; - } - expect (Ok, stat); - stat = GdipGetFamilyName (family, familyName, LANG_NEUTRAL); - expect (Ok, stat); - ok (lstrcmpiW(familyName, TimesNewRoman) == 0, - "Expected Times New Roman, got %s\n", wine_dbgstr_w(familyName)); - stat = GdipDeleteFontFamily (family); - expect (Ok, stat); - -monospace: - stat = GdipGetGenericFontFamilyMonospace (&family); + missingfonts = 1; + else + check_family("Serif", family, serifname); + + stat = GdipGetGenericFontFamilyMonospace(&family); + expect (Ok, stat); if (stat == FontFamilyNotFound) - { - skip("Courier New not installed\n"); - return; - } - expect (Ok, stat); - stat = GdipGetFamilyName (family, familyName, LANG_NEUTRAL); - expect (Ok, stat); - ok (lstrcmpiW(familyName, CourierNew) == 0, - "Expected Courier New, got %s\n", wine_dbgstr_w(familyName)); - stat = GdipDeleteFontFamily (family); - expect (Ok, stat); + missingfonts = 1; + else + check_family("Monospace", family, mononame); + + if (missingfonts && strcmp(winetest_platform, "wine") == 0) + trace("You may need to install either the Microsoft Web Fonts or the Liberation Fonts\n"); + + /* Check that the family names are all different */ + ok(lstrcmpiW(sansname, serifname) != 0, "Sans Serif and Serif families should be different: %s\n", wine_dbgstr_w(sansname)); + ok(lstrcmpiW(sansname, mononame) != 0, "Sans Serif and Monospace families should be different: %s\n", wine_dbgstr_w(sansname)); + ok(lstrcmpiW(serifname, mononame) != 0, "Serif and Monospace families should be different: %s\n", wine_dbgstr_w(serifname)); } static void test_installedfonts (void) Modified: trunk/rostests/winetests/gdiplus/graphics.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/graphic…
============================================================================== --- trunk/rostests/winetests/gdiplus/graphics.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/graphics.c [iso-8859-1] Mon Mar 5 20:18:32 2012 @@ -230,6 +230,139 @@ ReleaseDC(hwnd, hdc); } +static void test_GdipFillClosedCurve2(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + GpSolidFill *brush = NULL; + HDC hdc = GetDC( hwnd ); + GpPointF points[3]; + + points[0].X = 0; + points[0].Y = 0; + + points[1].X = 40; + points[1].Y = 20; + + points[2].X = 10; + points[2].Y = 40; + + /* make a graphics object and brush object */ + ok(hdc != NULL, "Expected HDC to be initialized\n"); + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + GdipCreateSolidFill((ARGB)0xdeadbeef, &brush); + + /* InvalidParameter cases: null graphics, null brush, null points */ + status = GdipFillClosedCurve2(NULL, NULL, NULL, 3, 0.5, FillModeAlternate); + expect(InvalidParameter, status); + + status = GdipFillClosedCurve2(graphics, NULL, NULL, 3, 0.5, FillModeAlternate); + expect(InvalidParameter, status); + + status = GdipFillClosedCurve2(NULL, (GpBrush*)brush, NULL, 3, 0.5, FillModeAlternate); + expect(InvalidParameter, status); + + status = GdipFillClosedCurve2(NULL, NULL, points, 3, 0.5, FillModeAlternate); + expect(InvalidParameter, status); + + status = GdipFillClosedCurve2(graphics, (GpBrush*)brush, NULL, 3, 0.5, FillModeAlternate); + expect(InvalidParameter, status); + + status = GdipFillClosedCurve2(graphics, NULL, points, 3, 0.5, FillModeAlternate); + expect(InvalidParameter, status); + + status = GdipFillClosedCurve2(NULL, (GpBrush*)brush, points, 3, 0.5, FillModeAlternate); + expect(InvalidParameter, status); + + /* InvalidParameter cases: invalid count */ + status = GdipFillClosedCurve2(graphics, (GpBrush*)brush, points, -1, 0.5, FillModeAlternate); + expect(InvalidParameter, status); + + status = GdipFillClosedCurve2(graphics, (GpBrush*)brush, points, 0, 0.5, FillModeAlternate); + expect(InvalidParameter, status); + + /* Valid test cases */ + status = GdipFillClosedCurve2(graphics, (GpBrush*)brush, points, 1, 0.5, FillModeAlternate); + expect(Ok, status); + + status = GdipFillClosedCurve2(graphics, (GpBrush*)brush, points, 2, 0.5, FillModeAlternate); + expect(Ok, status); + + status = GdipFillClosedCurve2(graphics, (GpBrush*)brush, points, 3, 0.5, FillModeAlternate); + expect(Ok, status); + + GdipDeleteGraphics(graphics); + GdipDeleteBrush((GpBrush*)brush); + + ReleaseDC(hwnd, hdc); +} + +static void test_GdipFillClosedCurve2I(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + GpSolidFill *brush = NULL; + HDC hdc = GetDC( hwnd ); + GpPoint points[3]; + + points[0].X = 0; + points[0].Y = 0; + + points[1].X = 40; + points[1].Y = 20; + + points[2].X = 10; + points[2].Y = 40; + + /* make a graphics object and brush object */ + ok(hdc != NULL, "Expected HDC to be initialized\n"); + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + GdipCreateSolidFill((ARGB)0xdeadbeef, &brush); + + /* InvalidParameter cases: null graphics, null brush */ + /* Note: GdipFillClosedCurveI and GdipFillClosedCurve2I hang in Windows + when points == NULL, so don't test this condition */ + status = GdipFillClosedCurve2I(NULL, NULL, points, 3, 0.5, FillModeAlternate); + expect(InvalidParameter, status); + + status = GdipFillClosedCurve2I(graphics, NULL, points, 3, 0.5, FillModeAlternate); + expect(InvalidParameter, status); + + status = GdipFillClosedCurve2I(NULL, (GpBrush*)brush, points, 3, 0.5, FillModeAlternate); + expect(InvalidParameter, status); + + /* InvalidParameter cases: invalid count */ + status = GdipFillClosedCurve2I(graphics, (GpBrush*)brush, points, 0, 0.5, FillModeAlternate); + expect(InvalidParameter, status); + + /* OutOfMemory cases: large (unsigned) int */ + status = GdipFillClosedCurve2I(graphics, (GpBrush*)brush, points, -1, 0.5, FillModeAlternate); + expect(OutOfMemory, status); + + /* Valid test cases */ + status = GdipFillClosedCurve2I(graphics, (GpBrush*)brush, points, 1, 0.5, FillModeAlternate); + expect(Ok, status); + + status = GdipFillClosedCurve2I(graphics, (GpBrush*)brush, points, 2, 0.5, FillModeAlternate); + expect(Ok, status); + + status = GdipFillClosedCurve2I(graphics, (GpBrush*)brush, points, 3, 0.5, FillModeAlternate); + expect(Ok, status); + + GdipDeleteGraphics(graphics); + GdipDeleteBrush((GpBrush*)brush); + + ReleaseDC(hwnd, hdc); +} + static void test_GdipDrawArc(void) { GpStatus status; @@ -413,8 +546,9 @@ status = GdipBeginContainer2(graphics, &cont1); expect(Ok, status); - GdipCreateMatrix2(defTrans[0], defTrans[1], defTrans[2], defTrans[3], + status = GdipCreateMatrix2(defTrans[0], defTrans[1], defTrans[2], defTrans[3], defTrans[4], defTrans[5], &transform); + expect(Ok, status); GdipSetWorldTransform(graphics, transform); GdipDeleteMatrix(transform); transform = NULL; @@ -422,7 +556,8 @@ status = GdipBeginContainer2(graphics, &cont2); expect(Ok, status); - GdipCreateMatrix2(10, 20, 30, 40, 50, 60, &transform); + status = GdipCreateMatrix2(10, 20, 30, 40, 50, 60, &transform); + expect(Ok, status); GdipSetWorldTransform(graphics, transform); GdipDeleteMatrix(transform); transform = NULL; @@ -430,7 +565,8 @@ status = GdipEndContainer(graphics, cont2); expect(Ok, status); - GdipCreateMatrix(&transform); + status = GdipCreateMatrix(&transform); + expect(Ok, status); GdipGetWorldTransform(graphics, transform); GdipGetMatrixElements(transform, elems); ok(fabs(defTrans[0] - elems[0]) < 0.0001 && @@ -460,6 +596,7 @@ GdipSetClipRect(graphics, 2, 4, 6, 8, CombineModeReplace); status = GdipEndContainer(graphics, cont2); + expect(Ok, status); GdipGetClipBounds(graphics, &clip); ok(fabs(defClip[0] - clip.X) < 0.0001 && @@ -471,6 +608,7 @@ clip.X, clip.Y, clip.Width, clip.Height); status = GdipEndContainer(graphics, cont1); + expect(Ok, status); /* nesting */ status = GdipBeginContainer2(graphics, &cont1); @@ -995,6 +1133,60 @@ ReleaseDC(hwnd, hdc); } +static void test_GdipDrawImagePointsRect(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + GpPointF ptf[4]; + GpBitmap *bm = NULL; + BYTE rbmi[sizeof(BITMAPINFOHEADER)]; + BYTE buff[400]; + BITMAPINFO *bmi = (BITMAPINFO*)rbmi; + HDC hdc = GetDC( hwnd ); + if (!hdc) + return; + + memset(rbmi, 0, sizeof(rbmi)); + bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmi->bmiHeader.biWidth = 10; + bmi->bmiHeader.biHeight = 10; + bmi->bmiHeader.biPlanes = 1; + bmi->bmiHeader.biBitCount = 32; + bmi->bmiHeader.biCompression = BI_RGB; + status = GdipCreateBitmapFromGdiDib(bmi, buff, &bm); + expect(Ok, status); + ok(NULL != bm, "Expected bitmap to be initialized\n"); + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ptf[0].X = 0; + ptf[0].Y = 0; + ptf[1].X = 10; + ptf[1].Y = 0; + ptf[2].X = 0; + ptf[2].Y = 10; + ptf[3].X = 10; + ptf[3].Y = 10; + status = GdipDrawImagePointsRect(graphics, (GpImage*)bm, ptf, 4, 0, 0, 10, 10, UnitPixel, NULL, NULL, NULL); + expect(NotImplemented, status); + status = GdipDrawImagePointsRect(graphics, (GpImage*)bm, ptf, 2, 0, 0, 10, 10, UnitPixel, NULL, NULL, NULL); + expect(InvalidParameter, status); + status = GdipDrawImagePointsRect(graphics, (GpImage*)bm, ptf, 3, 0, 0, 10, 10, UnitPixel, NULL, NULL, NULL); + expect(Ok, status); + status = GdipDrawImagePointsRect(graphics, NULL, ptf, 3, 0, 0, 10, 10, UnitPixel, NULL, NULL, NULL); + expect(InvalidParameter, status); + status = GdipDrawImagePointsRect(graphics, (GpImage*)bm, NULL, 3, 0, 0, 10, 10, UnitPixel, NULL, NULL, NULL); + expect(InvalidParameter, status); + status = GdipDrawImagePointsRect(graphics, (GpImage*)bm, ptf, 3, 0, 0, 0, 0, UnitPixel, NULL, NULL, NULL); + expect(Ok, status); + memset(ptf, 0, sizeof(ptf)); + status = GdipDrawImagePointsRect(graphics, (GpImage*)bm, ptf, 3, 0, 0, 10, 10, UnitPixel, NULL, NULL, NULL); + expect(Ok, status); + + GdipDisposeImage((GpImage*)bm); + GdipDeleteGraphics(graphics); + ReleaseDC(hwnd, hdc); +} + static void test_GdipDrawLinesI(void) { GpStatus status; @@ -1043,6 +1235,139 @@ GdipFree(ptf); GdipDeletePen(pen); GdipDeleteGraphics(graphics); + + ReleaseDC(hwnd, hdc); +} + +static void test_GdipFillClosedCurve(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + GpSolidFill *brush = NULL; + HDC hdc = GetDC( hwnd ); + GpPointF points[3]; + + points[0].X = 0; + points[0].Y = 0; + + points[1].X = 40; + points[1].Y = 20; + + points[2].X = 10; + points[2].Y = 40; + + /* make a graphics object and brush object */ + ok(hdc != NULL, "Expected HDC to be initialized\n"); + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + GdipCreateSolidFill((ARGB)0xdeadbeef, &brush); + + /* InvalidParameter cases: null graphics, null brush, null points */ + status = GdipFillClosedCurve(NULL, NULL, NULL, 3); + expect(InvalidParameter, status); + + status = GdipFillClosedCurve(graphics, NULL, NULL, 3); + expect(InvalidParameter, status); + + status = GdipFillClosedCurve(NULL, (GpBrush*)brush, NULL, 3); + expect(InvalidParameter, status); + + status = GdipFillClosedCurve(NULL, NULL, points, 3); + expect(InvalidParameter, status); + + status = GdipFillClosedCurve(graphics, (GpBrush*)brush, NULL, 3); + expect(InvalidParameter, status); + + status = GdipFillClosedCurve(graphics, NULL, points, 3); + expect(InvalidParameter, status); + + status = GdipFillClosedCurve(NULL, (GpBrush*)brush, points, 3); + expect(InvalidParameter, status); + + /* InvalidParameter cases: invalid count */ + status = GdipFillClosedCurve(graphics, (GpBrush*)brush, points, -1); + expect(InvalidParameter, status); + + status = GdipFillClosedCurve(graphics, (GpBrush*)brush, points, 0); + expect(InvalidParameter, status); + + /* Valid test cases */ + status = GdipFillClosedCurve(graphics, (GpBrush*)brush, points, 1); + expect(Ok, status); + + status = GdipFillClosedCurve(graphics, (GpBrush*)brush, points, 2); + expect(Ok, status); + + status = GdipFillClosedCurve(graphics, (GpBrush*)brush, points, 3); + expect(Ok, status); + + GdipDeleteGraphics(graphics); + GdipDeleteBrush((GpBrush*)brush); + + ReleaseDC(hwnd, hdc); +} + +static void test_GdipFillClosedCurveI(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + GpSolidFill *brush = NULL; + HDC hdc = GetDC( hwnd ); + GpPoint points[3]; + + points[0].X = 0; + points[0].Y = 0; + + points[1].X = 40; + points[1].Y = 20; + + points[2].X = 10; + points[2].Y = 40; + + /* make a graphics object and brush object */ + ok(hdc != NULL, "Expected HDC to be initialized\n"); + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + GdipCreateSolidFill((ARGB)0xdeadbeef, &brush); + + /* InvalidParameter cases: null graphics, null brush */ + /* Note: GdipFillClosedCurveI and GdipFillClosedCurve2I hang in Windows + when points == NULL, so don't test this condition */ + status = GdipFillClosedCurveI(NULL, NULL, points, 3); + expect(InvalidParameter, status); + + status = GdipFillClosedCurveI(graphics, NULL, points, 3); + expect(InvalidParameter, status); + + status = GdipFillClosedCurveI(NULL, (GpBrush*)brush, points, 3); + expect(InvalidParameter, status); + + /* InvalidParameter cases: invalid count */ + status = GdipFillClosedCurveI(graphics, (GpBrush*)brush, points, 0); + expect(InvalidParameter, status); + + /* OutOfMemory cases: large (unsigned) int */ + status = GdipFillClosedCurveI(graphics, (GpBrush*)brush, points, -1); + expect(OutOfMemory, status); + + /* Valid test cases */ + status = GdipFillClosedCurveI(graphics, (GpBrush*)brush, points, 1); + expect(Ok, status); + + status = GdipFillClosedCurveI(graphics, (GpBrush*)brush, points, 2); + expect(Ok, status); + + status = GdipFillClosedCurveI(graphics, (GpBrush*)brush, points, 3); + expect(Ok, status); + + GdipDeleteGraphics(graphics); + GdipDeleteBrush((GpBrush*)brush); ReleaseDC(hwnd, hdc); } @@ -1108,7 +1433,8 @@ rectf[i].Width = (REAL)rect[i].Width; } - GdipCreateMatrix(&m); + status = GdipCreateMatrix(&m); + expect(Ok, status); GdipCreateRegion(®ion); GdipCreateSolidFill((ARGB)0xdeadbeef, &brush); GdipCreatePath(FillModeAlternate, &path); @@ -1148,189 +1474,194 @@ expect(ObjectBusy, status); /* try all Graphics calls here */ - status = Ok; status = GdipDrawArc(graphics, pen, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawArcI(graphics, pen, 0, 0, 1, 1, 0.0, 0.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawBezier(graphics, pen, 0.0, 10.0, 20.0, 15.0, 35.0, -10.0, 10.0, 10.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawBezierI(graphics, pen, 0, 0, 0, 0, 0, 0, 0, 0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawBeziers(graphics, pen, ptf, 5); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawBeziersI(graphics, pen, pt, 5); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawClosedCurve(graphics, pen, ptf, 5); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawClosedCurveI(graphics, pen, pt, 5); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawClosedCurve2(graphics, pen, ptf, 5, 1.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawClosedCurve2I(graphics, pen, pt, 5, 1.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawCurve(graphics, pen, ptf, 5); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawCurveI(graphics, pen, pt, 5); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawCurve2(graphics, pen, ptf, 5, 1.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawCurve2I(graphics, pen, pt, 5, 1.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawEllipse(graphics, pen, 0.0, 0.0, 100.0, 50.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawEllipseI(graphics, pen, 0, 0, 100, 50); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); /* GdipDrawImage/GdipDrawImageI */ /* GdipDrawImagePointsRect/GdipDrawImagePointsRectI */ /* GdipDrawImageRectRect/GdipDrawImageRectRectI */ /* GdipDrawImageRect/GdipDrawImageRectI */ status = GdipDrawLine(graphics, pen, 0.0, 0.0, 100.0, 200.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawLineI(graphics, pen, 0, 0, 100, 200); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawLines(graphics, pen, ptf, 5); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawLinesI(graphics, pen, pt, 5); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawPath(graphics, pen, path); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawPie(graphics, pen, 0.0, 0.0, 100.0, 100.0, 0.0, 90.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawPieI(graphics, pen, 0, 0, 100, 100, 0.0, 90.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawRectangle(graphics, pen, 0.0, 0.0, 100.0, 300.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawRectangleI(graphics, pen, 0, 0, 100, 300); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawRectangles(graphics, pen, rectf, 2); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawRectanglesI(graphics, pen, rect, 2); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); /* GdipDrawString */ status = GdipFillClosedCurve2(graphics, (GpBrush*)brush, ptf, 5, 1.0, FillModeAlternate); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipFillClosedCurve2I(graphics, (GpBrush*)brush, pt, 5, 1.0, FillModeAlternate); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); + status = GdipFillClosedCurve(graphics, (GpBrush*)brush, ptf, 5); + expect(ObjectBusy, status); + status = GdipFillClosedCurveI(graphics, (GpBrush*)brush, pt, 5); + expect(ObjectBusy, status); status = GdipFillEllipse(graphics, (GpBrush*)brush, 0.0, 0.0, 100.0, 100.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipFillEllipseI(graphics, (GpBrush*)brush, 0, 0, 100, 100); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipFillPath(graphics, (GpBrush*)brush, path); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipFillPie(graphics, (GpBrush*)brush, 0.0, 0.0, 100.0, 100.0, 0.0, 15.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipFillPieI(graphics, (GpBrush*)brush, 0, 0, 100, 100, 0.0, 15.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipFillPolygon(graphics, (GpBrush*)brush, ptf, 5, FillModeAlternate); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipFillPolygonI(graphics, (GpBrush*)brush, pt, 5, FillModeAlternate); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipFillPolygon2(graphics, (GpBrush*)brush, ptf, 5); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipFillPolygon2I(graphics, (GpBrush*)brush, pt, 5); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipFillRectangle(graphics, (GpBrush*)brush, 0.0, 0.0, 100.0, 100.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipFillRectangleI(graphics, (GpBrush*)brush, 0, 0, 100, 100); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipFillRectangles(graphics, (GpBrush*)brush, rectf, 2); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipFillRectanglesI(graphics, (GpBrush*)brush, rect, 2); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipFillRegion(graphics, (GpBrush*)brush, region); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipFlush(graphics, FlushIntentionFlush); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipGetClipBounds(graphics, rectf); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipGetClipBoundsI(graphics, rect); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipGetCompositingMode(graphics, &compmode); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipGetCompositingQuality(graphics, &quality); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipGetInterpolationMode(graphics, &intmode); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipGetNearestColor(graphics, &color); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipGetPageScale(graphics, &r); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipGetPageUnit(graphics, &unit); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipGetPixelOffsetMode(graphics, &offsetmode); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipGetSmoothingMode(graphics, &smoothmode); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipGetTextRenderingHint(graphics, &texthint); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipGetWorldTransform(graphics, m); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipGraphicsClear(graphics, 0xdeadbeef); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipIsVisiblePoint(graphics, 0.0, 0.0, &res); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipIsVisiblePointI(graphics, 0, 0, &res); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); /* GdipMeasureCharacterRanges */ /* GdipMeasureString */ status = GdipResetClip(graphics); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipResetWorldTransform(graphics); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); /* GdipRestoreGraphics */ status = GdipRotateWorldTransform(graphics, 15.0, MatrixOrderPrepend); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); /* GdipSaveGraphics */ status = GdipScaleWorldTransform(graphics, 1.0, 1.0, MatrixOrderPrepend); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipSetCompositingMode(graphics, CompositingModeSourceOver); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipSetCompositingQuality(graphics, CompositingQualityDefault); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipSetInterpolationMode(graphics, InterpolationModeDefault); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipSetPageScale(graphics, 1.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipSetPageUnit(graphics, UnitWorld); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipSetPixelOffsetMode(graphics, PixelOffsetModeDefault); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipSetSmoothingMode(graphics, SmoothingModeDefault); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipSetTextRenderingHint(graphics, TextRenderingHintSystemDefault); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipSetWorldTransform(graphics, m); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipTranslateWorldTransform(graphics, 0.0, 0.0, MatrixOrderPrepend); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipSetClipHrgn(graphics, hrgn, CombineModeReplace); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipSetClipPath(graphics, path, CombineModeReplace); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipSetClipRect(graphics, 0.0, 0.0, 10.0, 10.0, CombineModeReplace); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipSetClipRectI(graphics, 0, 0, 10, 10, CombineModeReplace); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipSetClipRegion(graphics, clip, CombineModeReplace); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipTranslateClip(graphics, 0.0, 0.0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipTranslateClipI(graphics, 0, 0); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawPolygon(graphics, pen, ptf, 5); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipDrawPolygonI(graphics, pen, pt, 5); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipGetDpiX(graphics, &r); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipGetDpiY(graphics, &r); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipMultiplyWorldTransform(graphics, m, MatrixOrderPrepend); + expect(ObjectBusy, status); status = GdipGetClip(graphics, region); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); status = GdipTransformPoints(graphics, CoordinateSpacePage, CoordinateSpaceWorld, ptf, 5); - expect(ObjectBusy, status); status = Ok; + expect(ObjectBusy, status); + /* try to delete before release */ status = GdipDeleteGraphics(graphics); expect(ObjectBusy, status); @@ -1487,6 +1818,7 @@ rect.Height = rect.Width = 100.0; status = GdipCreateRegionRect(&rect, &clip); + expect(Ok, status); /* NULL arguments */ status = GdipGetClip(NULL, NULL); @@ -1608,6 +1940,7 @@ status = GdipGetTextContrast(graphics, NULL); expect(InvalidParameter, status); status = GdipGetTextContrast(graphics, &contrast); + expect(Ok, status); expect(4, contrast); GdipDeleteGraphics(graphics); @@ -1625,6 +1958,8 @@ LOGFONTA logfont; HDC hdc = GetDC( hwnd ); static const WCHAR string[] = {'T','e','s','t',0}; + static const PointF positions[4] = {{0,0}, {1,1}, {2,2}, {3,3}}; + GpMatrix *matrix; memset(&logfont,0,sizeof(logfont)); strcpy(logfont.lfFaceName,"Arial"); @@ -1656,6 +1991,34 @@ status = GdipDrawString(graphics, string, 4, fnt, &rect, format, brush); expect(Ok, status); + status = GdipCreateMatrix(&matrix); + expect(Ok, status); + + status = GdipDrawDriverString(NULL, string, 4, fnt, brush, positions, DriverStringOptionsCmapLookup, matrix); + expect(InvalidParameter, status); + + status = GdipDrawDriverString(graphics, NULL, 4, fnt, brush, positions, DriverStringOptionsCmapLookup, matrix); + expect(InvalidParameter, status); + + status = GdipDrawDriverString(graphics, string, 4, NULL, brush, positions, DriverStringOptionsCmapLookup, matrix); + expect(InvalidParameter, status); + + status = GdipDrawDriverString(graphics, string, 4, fnt, NULL, positions, DriverStringOptionsCmapLookup, matrix); + expect(InvalidParameter, status); + + status = GdipDrawDriverString(graphics, string, 4, fnt, brush, NULL, DriverStringOptionsCmapLookup, matrix); + expect(InvalidParameter, status); + + status = GdipDrawDriverString(graphics, string, 4, fnt, brush, positions, DriverStringOptionsCmapLookup|0x10, matrix); + expect(Ok, status); + + status = GdipDrawDriverString(graphics, string, 4, fnt, brush, positions, DriverStringOptionsCmapLookup, NULL); + expect(Ok, status); + + status = GdipDrawDriverString(graphics, string, 4, fnt, brush, positions, DriverStringOptionsCmapLookup, matrix); + expect(Ok, status); + + GdipDeleteMatrix(matrix); GdipDeleteGraphics(graphics); GdipDeleteBrush(brush); GdipDeleteFont(fnt); @@ -1887,6 +2250,8 @@ GpGraphics *graphics = NULL; GpBitmap *bitmap = NULL; BYTE bits[48] = {0}; + HDC hdc=NULL; + COLORREF color; status = GdipCreateBitmapFromScan0(4, 4, 12, PixelFormat24bppRGB, bits, &bitmap); expect(Ok, status); @@ -1900,7 +2265,51 @@ GdipDeleteGraphics(graphics); /* drawing writes to the memory provided */ - todo_wine expect(0x68, bits[10]); + expect(0x68, bits[10]); + + status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); + expect(Ok, status); + + status = GdipGetDC(graphics, &hdc); + expect(Ok, status); + ok(hdc != NULL, "got NULL hdc\n"); + + color = GetPixel(hdc, 0, 0); + /* The HDC is write-only, and native fills with a solid color to figure out + * which pixels have changed. */ + todo_wine expect(0x0c0b0d, color); + + SetPixel(hdc, 0, 0, 0x797979); + SetPixel(hdc, 1, 0, 0x0c0b0d); + + status = GdipReleaseDC(graphics, hdc); + expect(Ok, status); + + GdipDeleteGraphics(graphics); + + expect(0x79, bits[0]); + todo_wine expect(0x68, bits[3]); + + GdipDisposeImage((GpImage*)bitmap); + + /* We get the same kind of write-only HDC for a "normal" bitmap */ + status = GdipCreateBitmapFromScan0(4, 4, 12, PixelFormat24bppRGB, NULL, &bitmap); + expect(Ok, status); + + status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); + expect(Ok, status); + + status = GdipGetDC(graphics, &hdc); + expect(Ok, status); + ok(hdc != NULL, "got NULL hdc\n"); + + color = GetPixel(hdc, 0, 0); + todo_wine expect(0x0c0b0d, color); + + status = GdipReleaseDC(graphics, hdc); + expect(Ok, status); + + GdipDeleteGraphics(graphics); GdipDisposeImage((GpImage*)bitmap); } @@ -2347,33 +2756,42 @@ status = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat48bppRGB, NULL, &bitmap); expect(Ok, status); - status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); - expect(Ok, status); - status = GdipGetNearestColor(graphics, &color); - expect(Ok, status); - expect(0xdeadbeef, color); - GdipDeleteGraphics(graphics); - GdipDisposeImage((GpImage*)bitmap); + if (status == Ok) + { + status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); + expect(Ok, status); + status = GdipGetNearestColor(graphics, &color); + expect(Ok, status); + expect(0xdeadbeef, color); + GdipDeleteGraphics(graphics); + GdipDisposeImage((GpImage*)bitmap); + } status = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat64bppARGB, NULL, &bitmap); expect(Ok, status); - status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); - expect(Ok, status); - status = GdipGetNearestColor(graphics, &color); - expect(Ok, status); - expect(0xdeadbeef, color); - GdipDeleteGraphics(graphics); - GdipDisposeImage((GpImage*)bitmap); + if (status == Ok) + { + status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); + expect(Ok, status); + status = GdipGetNearestColor(graphics, &color); + expect(Ok, status); + expect(0xdeadbeef, color); + GdipDeleteGraphics(graphics); + GdipDisposeImage((GpImage*)bitmap); + } status = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat64bppPARGB, NULL, &bitmap); expect(Ok, status); - status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); - expect(Ok, status); - status = GdipGetNearestColor(graphics, &color); - expect(Ok, status); - expect(0xdeadbeef, color); - GdipDeleteGraphics(graphics); - GdipDisposeImage((GpImage*)bitmap); + if (status == Ok) + { + status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); + expect(Ok, status); + status = GdipGetNearestColor(graphics, &color); + expect(Ok, status); + expect(0xdeadbeef, color); + GdipDeleteGraphics(graphics); + GdipDisposeImage((GpImage*)bitmap); + } status = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat16bppRGB565, NULL, &bitmap); expect(Ok, status); @@ -2413,6 +2831,7 @@ HDC hdc = GetDC( hwnd ); const WCHAR fontname[] = {'T','a','h','o','m','a',0}; const WCHAR teststring[] = {'M','M',' ','M','\n','M',0}; + const WCHAR teststring2[] = {'j',0}; REAL char_width, char_height; INT codepointsfitted, linesfilled; GpStringFormat *format; @@ -2420,6 +2839,8 @@ GpRegion *regions[4] = {0}; BOOL region_isempty[4]; int i; + PointF position; + GpMatrix *identity; ok(hdc != NULL, "Expected HDC to be initialized\n"); status = GdipCreateFromHDC(hdc, &graphics); @@ -2619,6 +3040,96 @@ for (i=0; i<4; i++) GdipDeleteRegion(regions[i]); + status = GdipCreateMatrix(&identity); + expect(Ok, status); + + position.X = 0; + position.Y = 0; + + rc.X = 0; + rc.Y = 0; + rc.Width = 0; + rc.Height = 0; + status = GdipMeasureDriverString(NULL, teststring, 6, font, &position, + DriverStringOptionsCmapLookup|DriverStringOptionsRealizedAdvance, + identity, &rc); + expect(InvalidParameter, status); + + status = GdipMeasureDriverString(graphics, NULL, 6, font, &position, + DriverStringOptionsCmapLookup|DriverStringOptionsRealizedAdvance, + identity, &rc); + expect(InvalidParameter, status); + + status = GdipMeasureDriverString(graphics, teststring, 6, NULL, &position, + DriverStringOptionsCmapLookup|DriverStringOptionsRealizedAdvance, + identity, &rc); + expect(InvalidParameter, status); + + status = GdipMeasureDriverString(graphics, teststring, 6, font, NULL, + DriverStringOptionsCmapLookup|DriverStringOptionsRealizedAdvance, + identity, &rc); + expect(InvalidParameter, status); + + status = GdipMeasureDriverString(graphics, teststring, 6, font, &position, + 0x100, identity, &rc); + expect(Ok, status); + + status = GdipMeasureDriverString(graphics, teststring, 6, font, &position, + DriverStringOptionsCmapLookup|DriverStringOptionsRealizedAdvance, + NULL, &rc); + expect(Ok, status); + + status = GdipMeasureDriverString(graphics, teststring, 6, font, &position, + DriverStringOptionsCmapLookup|DriverStringOptionsRealizedAdvance, + identity, NULL); + expect(InvalidParameter, status); + + rc.X = 0; + rc.Y = 0; + rc.Width = 0; + rc.Height = 0; + status = GdipMeasureDriverString(graphics, teststring, 6, font, &position, + DriverStringOptionsCmapLookup|DriverStringOptionsRealizedAdvance, + identity, &rc); + expect(Ok, status); + + expectf(0.0, rc.X); + ok(rc.Y < 0.0, "unexpected Y %0.2f\n", rc.Y); + ok(rc.Width > 0.0, "unexpected Width %0.2f\n", rc.Width); + ok(rc.Height > 0.0, "unexpected Y %0.2f\n", rc.Y); + + char_width = rc.Width; + char_height = rc.Height; + + rc.X = 0; + rc.Y = 0; + rc.Width = 0; + rc.Height = 0; + status = GdipMeasureDriverString(graphics, teststring, 4, font, &position, + DriverStringOptionsCmapLookup|DriverStringOptionsRealizedAdvance, + identity, &rc); + expect(Ok, status); + + expectf(0.0, rc.X); + ok(rc.Y < 0.0, "unexpected Y %0.2f\n", rc.Y); + ok(rc.Width < char_width, "got Width %0.2f, expecting less than %0.2f\n", rc.Width, char_width); + expectf(char_height, rc.Height); + + rc.X = 0; + rc.Y = 0; + rc.Width = 0; + rc.Height = 0; + status = GdipMeasureDriverString(graphics, teststring2, 1, font, &position, + DriverStringOptionsCmapLookup|DriverStringOptionsRealizedAdvance, + identity, &rc); + expect(Ok, status); + + expectf(rc.X, 0.0); + ok(rc.Y < 0.0, "unexpected Y %0.2f\n", rc.Y); + ok(rc.Width > 0, "unexpected Width %0.2f\n", rc.Width); + expectf(rc.Height, char_height); + + GdipDeleteMatrix(identity); GdipDeleteStringFormat(format); GdipDeleteBrush(brush); GdipDeleteFont(font); @@ -2626,6 +3137,171 @@ GdipDeleteGraphics(graphics); ReleaseDC(hwnd, hdc); +} + +static void test_get_set_interpolation(void) +{ + GpGraphics *graphics; + HDC hdc = GetDC( hwnd ); + GpStatus status; + InterpolationMode mode; + + ok(hdc != NULL, "Expected HDC to be initialized\n"); + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + status = GdipGetInterpolationMode(NULL, &mode); + expect(InvalidParameter, status); + + if (0) + { + /* Crashes on Windows XP */ + status = GdipGetInterpolationMode(graphics, NULL); + expect(InvalidParameter, status); + } + + status = GdipSetInterpolationMode(NULL, InterpolationModeNearestNeighbor); + expect(InvalidParameter, status); + + /* out of range */ + status = GdipSetInterpolationMode(graphics, InterpolationModeHighQualityBicubic+1); + expect(InvalidParameter, status); + + status = GdipSetInterpolationMode(graphics, InterpolationModeInvalid); + expect(InvalidParameter, status); + + status = GdipGetInterpolationMode(graphics, &mode); + expect(Ok, status); + expect(InterpolationModeBilinear, mode); + + status = GdipSetInterpolationMode(graphics, InterpolationModeNearestNeighbor); + expect(Ok, status); + + status = GdipGetInterpolationMode(graphics, &mode); + expect(Ok, status); + expect(InterpolationModeNearestNeighbor, mode); + + status = GdipSetInterpolationMode(graphics, InterpolationModeDefault); + expect(Ok, status); + + status = GdipGetInterpolationMode(graphics, &mode); + expect(Ok, status); + expect(InterpolationModeBilinear, mode); + + status = GdipSetInterpolationMode(graphics, InterpolationModeLowQuality); + expect(Ok, status); + + status = GdipGetInterpolationMode(graphics, &mode); + expect(Ok, status); + expect(InterpolationModeBilinear, mode); + + status = GdipSetInterpolationMode(graphics, InterpolationModeHighQuality); + expect(Ok, status); + + status = GdipGetInterpolationMode(graphics, &mode); + expect(Ok, status); + expect(InterpolationModeHighQualityBicubic, mode); + + GdipDeleteGraphics(graphics); + + ReleaseDC(hwnd, hdc); +} + +static void test_get_set_textrenderinghint(void) +{ + GpGraphics *graphics; + HDC hdc = GetDC( hwnd ); + GpStatus status; + TextRenderingHint hint; + + ok(hdc != NULL, "Expected HDC to be initialized\n"); + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + status = GdipGetTextRenderingHint(NULL, &hint); + expect(InvalidParameter, status); + + status = GdipGetTextRenderingHint(graphics, NULL); + expect(InvalidParameter, status); + + status = GdipSetTextRenderingHint(NULL, TextRenderingHintAntiAlias); + expect(InvalidParameter, status); + + /* out of range */ + status = GdipSetTextRenderingHint(graphics, TextRenderingHintClearTypeGridFit+1); + expect(InvalidParameter, status); + + status = GdipGetTextRenderingHint(graphics, &hint); + expect(Ok, status); + expect(TextRenderingHintSystemDefault, hint); + + status = GdipSetTextRenderingHint(graphics, TextRenderingHintSystemDefault); + expect(Ok, status); + + status = GdipGetTextRenderingHint(graphics, &hint); + expect(Ok, status); + expect(TextRenderingHintSystemDefault, hint); + + status = GdipSetTextRenderingHint(graphics, TextRenderingHintAntiAliasGridFit); + expect(Ok, status); + + status = GdipGetTextRenderingHint(graphics, &hint); + expect(Ok, status); + expect(TextRenderingHintAntiAliasGridFit, hint); + + GdipDeleteGraphics(graphics); + + ReleaseDC(hwnd, hdc); +} + +static void test_getdc_scaled(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + GpBitmap *bitmap = NULL; + HDC hdc=NULL; + HBRUSH hbrush, holdbrush; + ARGB color; + + status = GdipCreateBitmapFromScan0(10, 10, 12, PixelFormat24bppRGB, NULL, &bitmap); + expect(Ok, status); + + status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); + expect(Ok, status); + + status = GdipScaleWorldTransform(graphics, 2.0, 2.0, MatrixOrderPrepend); + expect(Ok, status); + + status = GdipGetDC(graphics, &hdc); + expect(Ok, status); + ok(hdc != NULL, "got NULL hdc\n"); + + hbrush = CreateSolidBrush(RGB(255, 0, 0)); + + holdbrush = SelectObject(hdc, hbrush); + + Rectangle(hdc, 2, 2, 6, 6); + + SelectObject(hdc, holdbrush); + + DeleteObject(hbrush); + + status = GdipReleaseDC(graphics, hdc); + expect(Ok, status); + + GdipDeleteGraphics(graphics); + + status = GdipBitmapGetPixel(bitmap, 3, 3, &color); + expect(Ok, status); + expect(0xffff0000, color); + + status = GdipBitmapGetPixel(bitmap, 8, 8, &color); + expect(Ok, status); + expect(0xff000000, color); + + GdipDisposeImage((GpImage*)bitmap); } START_TEST(graphics) @@ -2656,6 +3332,8 @@ test_constructor_destructor(); test_save_restore(); + test_GdipFillClosedCurve2(); + test_GdipFillClosedCurve2I(); test_GdipDrawBezierI(); test_GdipDrawArc(); test_GdipDrawArcI(); @@ -2667,6 +3345,9 @@ test_GdipDrawCurve3I(); test_GdipDrawLineI(); test_GdipDrawLinesI(); + test_GdipDrawImagePointsRect(); + test_GdipFillClosedCurve(); + test_GdipFillClosedCurveI(); test_GdipDrawString(); test_GdipGetNearestColor(); test_GdipGetVisibleClipBounds(); @@ -2681,6 +3362,9 @@ test_textcontrast(); test_fromMemoryBitmap(); test_string_functions(); + test_get_set_interpolation(); + test_get_set_textrenderinghint(); + test_getdc_scaled(); GdiplusShutdown(gdiplusToken); DestroyWindow( hwnd ); Modified: trunk/rostests/winetests/gdiplus/graphicspath.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/graphic…
============================================================================== --- trunk/rostests/winetests/gdiplus/graphicspath.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/graphicspath.c [iso-8859-1] Mon Mar 5 20:18:32 2012 @@ -1106,6 +1106,34 @@ ReleaseDC(0, hdc); } +static void test_empty_rect(void) +{ + GpPath *path; + GpStatus status; + BOOL result; + + status = GdipCreatePath(FillModeAlternate, &path); + expect(Ok, status); + + status = GdipAddPathRectangle(path, 0.0, 0.0, -5.0, 5.0); + expect(Ok, status); + + status = GdipIsVisiblePathPoint(path, -2.0, 2.0, NULL, &result); + expect(Ok, status); + expect(FALSE, status); + + status = GdipAddPathRectangle(path, 0.0, 0.0, 5.0, -5.0); + expect(Ok, status); + + status = GdipAddPathRectangle(path, 0.0, 0.0, 0.0, 5.0); + expect(Ok, status); + + status = GdipAddPathRectangle(path, 0.0, 0.0, 5.0, 0.0); + expect(Ok, status); + + GdipDeletePath(path); +} + START_TEST(graphicspath) { struct GdiplusStartupInput gdiplusStartupInput; @@ -1135,6 +1163,7 @@ test_addpie(); test_flatten(); test_isvisible(); + test_empty_rect(); GdiplusShutdown(gdiplusToken); } Modified: trunk/rostests/winetests/gdiplus/image.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/image.c…
============================================================================== --- trunk/rostests/winetests/gdiplus/image.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/image.c [iso-8859-1] Mon Mar 5 20:18:32 2012 @@ -516,6 +516,8 @@ GpRect rect; BitmapData bd; const INT WIDTH = 10, HEIGHT = 20; + ARGB color; + int y; bm = NULL; stat = GdipCreateBitmapFromScan0(WIDTH, HEIGHT, 0, PixelFormat24bppRGB, NULL, &bm); @@ -526,14 +528,32 @@ rect.Width = 4; rect.Height = 5; + stat = GdipBitmapSetPixel(bm, 2, 3, 0xffc30000); + expect(Ok, stat); + + stat = GdipBitmapSetPixel(bm, 2, 8, 0xff480000); + expect(Ok, stat); + /* read-only */ stat = GdipBitmapLockBits(bm, &rect, ImageLockModeRead, PixelFormat24bppRGB, &bd); expect(Ok, stat); if (stat == Ok) { + expect(0xc3, ((BYTE*)bd.Scan0)[2]); + expect(0x48, ((BYTE*)bd.Scan0)[2 + bd.Stride * 5]); + + ((char*)bd.Scan0)[2] = 0xff; + stat = GdipBitmapUnlockBits(bm, &bd); expect(Ok, stat); } + + stat = GdipBitmapGetPixel(bm, 2, 3, &color); + expect(Ok, stat); + expect(0xffff0000, color); + + stat = GdipBitmapSetPixel(bm, 2, 3, 0xffc30000); + expect(Ok, stat); /* read-only, with NULL rect -> whole bitmap lock */ stat = GdipBitmapLockBits(bm, NULL, ImageLockModeRead, PixelFormat24bppRGB, &bd); @@ -542,9 +562,15 @@ expect(bd.Height, HEIGHT); if (stat == Ok) { + ((char*)bd.Scan0)[2 + 2*3 + 3*bd.Stride] = 0xff; + stat = GdipBitmapUnlockBits(bm, &bd); expect(Ok, stat); } + + stat = GdipBitmapGetPixel(bm, 2, 3, &color); + expect(Ok, stat); + expect(0xffff0000, color); /* read-only, consecutive */ stat = GdipBitmapLockBits(bm, &rect, ImageLockModeRead, PixelFormat24bppRGB, &bd); @@ -568,6 +594,102 @@ stat = GdipBitmapUnlockBits(bm, &bd); expect(Ok, stat); + + stat = GdipDisposeImage((GpImage*)bm); + expect(Ok, stat); + stat = GdipCreateBitmapFromScan0(WIDTH, HEIGHT, 0, PixelFormat24bppRGB, NULL, &bm); + expect(Ok, stat); + + stat = GdipBitmapSetPixel(bm, 2, 3, 0xffff0000); + expect(Ok, stat); + + stat = GdipBitmapSetPixel(bm, 2, 8, 0xffc30000); + expect(Ok, stat); + + /* write, no conversion */ + stat = GdipBitmapLockBits(bm, &rect, ImageLockModeWrite, PixelFormat24bppRGB, &bd); + expect(Ok, stat); + + if (stat == Ok) { + /* all bits are readable, inside the rect or not */ + expect(0xff, ((BYTE*)bd.Scan0)[2]); + expect(0xc3, ((BYTE*)bd.Scan0)[2 + bd.Stride * 5]); + + stat = GdipBitmapUnlockBits(bm, &bd); + expect(Ok, stat); + } + + /* read, conversion */ + stat = GdipBitmapLockBits(bm, &rect, ImageLockModeRead, PixelFormat32bppARGB, &bd); + expect(Ok, stat); + + if (stat == Ok) { + expect(0xff, ((BYTE*)bd.Scan0)[2]); + if (0) + /* Areas outside the rectangle appear to be uninitialized */ + ok(0xc3 != ((BYTE*)bd.Scan0)[2 + bd.Stride * 5], "original image bits are readable\n"); + + ((BYTE*)bd.Scan0)[2] = 0xc3; + + stat = GdipBitmapUnlockBits(bm, &bd); + expect(Ok, stat); + } + + /* writes do not work in read mode if there was a conversion */ + stat = GdipBitmapGetPixel(bm, 2, 3, &color); + expect(Ok, stat); + expect(0xffff0000, color); + + /* read/write, conversion */ + stat = GdipBitmapLockBits(bm, &rect, ImageLockModeRead|ImageLockModeWrite, PixelFormat32bppARGB, &bd); + expect(Ok, stat); + + if (stat == Ok) { + expect(0xff, ((BYTE*)bd.Scan0)[2]); + ((BYTE*)bd.Scan0)[1] = 0x88; + if (0) + /* Areas outside the rectangle appear to be uninitialized */ + ok(0xc3 != ((BYTE*)bd.Scan0)[2 + bd.Stride * 5], "original image bits are readable\n"); + + stat = GdipBitmapUnlockBits(bm, &bd); + expect(Ok, stat); + } + + stat = GdipBitmapGetPixel(bm, 2, 3, &color); + expect(Ok, stat); + expect(0xffff8800, color); + + /* write, conversion */ + stat = GdipBitmapLockBits(bm, &rect, ImageLockModeWrite, PixelFormat32bppARGB, &bd); + expect(Ok, stat); + + if (stat == Ok) { + if (0) + { + /* This is completely uninitialized. */ + ok(0xff != ((BYTE*)bd.Scan0)[2], "original image bits are readable\n"); + ok(0xc3 != ((BYTE*)bd.Scan0)[2 + bd.Stride * 5], "original image bits are readable\n"); + } + + /* Initialize the buffer so the unlock doesn't access undefined memory */ + for (y=0; y<5; y++) + memset(((BYTE*)bd.Scan0) + bd.Stride * y, 0, 12); + + ((BYTE*)bd.Scan0)[0] = 0x12; + ((BYTE*)bd.Scan0)[1] = 0x34; + ((BYTE*)bd.Scan0)[2] = 0x56; + + stat = GdipBitmapUnlockBits(bm, &bd); + expect(Ok, stat); + } + + stat = GdipBitmapGetPixel(bm, 2, 3, &color); + expect(Ok, stat); + expect(0xff563412, color); + + stat = GdipBitmapGetPixel(bm, 2, 8, &color); + expect(Ok, stat); + expect(0xffc30000, color); stat = GdipDisposeImage((GpImage*)bm); expect(Ok, stat); @@ -609,6 +731,10 @@ expect(Ok, stat); } + stat = GdipBitmapGetPixel(bm, 2, 3, &color); + expect(Ok, stat); + expect(0xffff0000, color); + stat = GdipDisposeImage((GpImage*)bm); expect(Ok, stat); @@ -620,6 +746,102 @@ stat = GdipDisposeImage((GpImage*)bm); expect(Ok, stat); } + +static void test_LockBits_UserBuf(void) +{ + GpStatus stat; + GpBitmap *bm; + GpRect rect; + BitmapData bd; + const INT WIDTH = 10, HEIGHT = 20; + DWORD bits[200]; + ARGB color; + + bm = NULL; + stat = GdipCreateBitmapFromScan0(WIDTH, HEIGHT, 0, PixelFormat32bppARGB, NULL, &bm); + expect(Ok, stat); + + memset(bits, 0xaa, sizeof(bits)); + + rect.X = 2; + rect.Y = 3; + rect.Width = 4; + rect.Height = 5; + + bd.Width = 4; + bd.Height = 6; + bd.Stride = WIDTH * 4; + bd.PixelFormat = PixelFormat32bppARGB; + bd.Scan0 = &bits[2+3*WIDTH]; + bd.Reserved = 0xaaaaaaaa; + + /* read-only */ + stat = GdipBitmapLockBits(bm, &rect, ImageLockModeRead|ImageLockModeUserInputBuf, PixelFormat32bppARGB, &bd); + expect(Ok, stat); + + expect(0xaaaaaaaa, bits[0]); + expect(0, bits[2+3*WIDTH]); + + bits[2+3*WIDTH] = 0xdeadbeef; + + if (stat == Ok) { + stat = GdipBitmapUnlockBits(bm, &bd); + expect(Ok, stat); + } + + stat = GdipBitmapGetPixel(bm, 2, 3, &color); + expect(Ok, stat); + expect(0, color); + + /* write-only */ + stat = GdipBitmapLockBits(bm, &rect, ImageLockModeWrite|ImageLockModeUserInputBuf, PixelFormat32bppARGB, &bd); + expect(Ok, stat); + + expect(0xdeadbeef, bits[2+3*WIDTH]); + bits[2+3*WIDTH] = 0x12345678; + + if (stat == Ok) { + stat = GdipBitmapUnlockBits(bm, &bd); + expect(Ok, stat); + } + + stat = GdipBitmapGetPixel(bm, 2, 3, &color); + expect(Ok, stat); + expect(0x12345678, color); + + bits[2+3*WIDTH] = 0; + + /* read/write */ + stat = GdipBitmapLockBits(bm, &rect, ImageLockModeRead|ImageLockModeWrite|ImageLockModeUserInputBuf, PixelFormat32bppARGB, &bd); + expect(Ok, stat); + + expect(0x12345678, bits[2+3*WIDTH]); + bits[2+3*WIDTH] = 0xdeadbeef; + + if (stat == Ok) { + stat = GdipBitmapUnlockBits(bm, &bd); + expect(Ok, stat); + } + + stat = GdipBitmapGetPixel(bm, 2, 3, &color); + expect(Ok, stat); + expect(0xdeadbeef, color); + + stat = GdipDisposeImage((GpImage*)bm); + expect(Ok, stat); +} + +struct BITMAPINFOWITHBITFIELDS +{ + BITMAPINFOHEADER bmiHeader; + DWORD masks[3]; +}; + +union BITMAPINFOUNION +{ + BITMAPINFO bi; + struct BITMAPINFOWITHBITFIELDS bf; +}; static void test_GdipCreateBitmapFromHBITMAP(void) { @@ -635,8 +857,9 @@ const REAL WIDTH2 = 10; const REAL HEIGHT2 = 20; HDC hdc; - BITMAPINFO bmi; + union BITMAPINFOUNION bmi; BYTE *bits; + PixelFormat format; stat = GdipCreateBitmapFromHBITMAP(NULL, NULL, NULL); expect(InvalidParameter, stat); @@ -670,14 +893,15 @@ hdc = CreateCompatibleDC(0); ok(hdc != NULL, "CreateCompatibleDC failed\n"); - bmi.bmiHeader.biSize = sizeof(bmi.bmiHeader); - bmi.bmiHeader.biHeight = HEIGHT1; - bmi.bmiHeader.biWidth = WIDTH1; - bmi.bmiHeader.biBitCount = 24; - bmi.bmiHeader.biPlanes = 1; - bmi.bmiHeader.biCompression = BI_RGB; - - hbm = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); + bmi.bi.bmiHeader.biSize = sizeof(bmi.bi.bmiHeader); + bmi.bi.bmiHeader.biHeight = HEIGHT1; + bmi.bi.bmiHeader.biWidth = WIDTH1; + bmi.bi.bmiHeader.biBitCount = 24; + bmi.bi.bmiHeader.biPlanes = 1; + bmi.bi.bmiHeader.biCompression = BI_RGB; + bmi.bi.bmiHeader.biClrUsed = 0; + + hbm = CreateDIBSection(hdc, &bmi.bi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); ok(hbm != NULL, "CreateDIBSection failed\n"); bits[0] = 0; @@ -707,15 +931,100 @@ GdipFree(LogPal); stat = GdipCreateBitmapFromHBITMAP(hbm, hpal, &gpbm); - todo_wine - { - expect(Ok, stat); - } + expect(Ok, stat); + if (stat == Ok) GdipDisposeImage((GpImage*)gpbm); DeleteObject(hpal); DeleteObject(hbm); + + /* 16-bit 555 dib, rgb */ + bmi.bi.bmiHeader.biBitCount = 16; + bmi.bi.bmiHeader.biCompression = BI_RGB; + + hbm = CreateDIBSection(hdc, &bmi.bi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); + ok(hbm != NULL, "CreateDIBSection failed\n"); + + bits[0] = 0; + + stat = GdipCreateBitmapFromHBITMAP(hbm, NULL, &gpbm); + expect(Ok, stat); + + if (stat == Ok) + { + stat = GdipGetImageDimension((GpImage*) gpbm, &width, &height); + expect(Ok, stat); + expectf(WIDTH1, width); + expectf(HEIGHT1, height); + + stat = GdipGetImagePixelFormat((GpImage*) gpbm, &format); + expect(Ok, stat); + expect(PixelFormat16bppRGB555, format); + + GdipDisposeImage((GpImage*)gpbm); + } + DeleteObject(hbm); + + /* 16-bit 555 dib, with bitfields */ + bmi.bi.bmiHeader.biSize = sizeof(bmi); + bmi.bi.bmiHeader.biCompression = BI_BITFIELDS; + bmi.bf.masks[0] = 0x7c00; + bmi.bf.masks[1] = 0x3e0; + bmi.bf.masks[2] = 0x1f; + + hbm = CreateDIBSection(hdc, &bmi.bi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); + ok(hbm != NULL, "CreateDIBSection failed\n"); + + bits[0] = 0; + + stat = GdipCreateBitmapFromHBITMAP(hbm, NULL, &gpbm); + expect(Ok, stat); + + if (stat == Ok) + { + stat = GdipGetImageDimension((GpImage*) gpbm, &width, &height); + expect(Ok, stat); + expectf(WIDTH1, width); + expectf(HEIGHT1, height); + + stat = GdipGetImagePixelFormat((GpImage*) gpbm, &format); + expect(Ok, stat); + expect(PixelFormat16bppRGB555, format); + + GdipDisposeImage((GpImage*)gpbm); + } + DeleteObject(hbm); + + /* 16-bit 565 dib, with bitfields */ + bmi.bf.masks[0] = 0xf800; + bmi.bf.masks[1] = 0x7e0; + bmi.bf.masks[2] = 0x1f; + + hbm = CreateDIBSection(hdc, &bmi.bi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); + ok(hbm != NULL, "CreateDIBSection failed\n"); + + bits[0] = 0; + + stat = GdipCreateBitmapFromHBITMAP(hbm, NULL, &gpbm); + expect(Ok, stat); + + if (stat == Ok) + { + stat = GdipGetImageDimension((GpImage*) gpbm, &width, &height); + expect(Ok, stat); + expectf(WIDTH1, width); + expectf(HEIGHT1, height); + + stat = GdipGetImagePixelFormat((GpImage*) gpbm, &format); + expect(Ok, stat); + expect(PixelFormat16bppRGB565, format); + + GdipDisposeImage((GpImage*)gpbm); + } + DeleteObject(hbm); + + DeleteDC(hdc); } static void test_GdipGetImageFlags(void) @@ -734,6 +1043,115 @@ stat = GdipGetImageFlags(img, NULL); expect(InvalidParameter, stat); + + stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat1bppIndexed, NULL, (GpBitmap**)&img); + expect(Ok, stat); + stat = GdipGetImageFlags(img, &flags); + expect(Ok, stat); + expect(ImageFlagsHasAlpha, flags); + GdipDisposeImage(img); + + stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat4bppIndexed, NULL, (GpBitmap**)&img); + expect(Ok, stat); + stat = GdipGetImageFlags(img, &flags); + expect(Ok, stat); + expect(ImageFlagsHasAlpha, flags); + GdipDisposeImage(img); + + stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat8bppIndexed, NULL, (GpBitmap**)&img); + expect(Ok, stat); + stat = GdipGetImageFlags(img, &flags); + expect(Ok, stat); + expect(ImageFlagsHasAlpha, flags); + GdipDisposeImage(img); + + stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat16bppGrayScale, NULL, (GpBitmap**)&img); + expect(Ok, stat); + stat = GdipGetImageFlags(img, &flags); + expect(Ok, stat); + expect(ImageFlagsNone, flags); + GdipDisposeImage(img); + + stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat16bppRGB555, NULL, (GpBitmap**)&img); + expect(Ok, stat); + stat = GdipGetImageFlags(img, &flags); + expect(Ok, stat); + expect(ImageFlagsNone, flags); + GdipDisposeImage(img); + + stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat16bppRGB565, NULL, (GpBitmap**)&img); + expect(Ok, stat); + stat = GdipGetImageFlags(img, &flags); + expect(Ok, stat); + expect(ImageFlagsNone, flags); + GdipDisposeImage(img); + + stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat16bppARGB1555, NULL, (GpBitmap**)&img); + expect(Ok, stat); + stat = GdipGetImageFlags(img, &flags); + expect(Ok, stat); + expect(ImageFlagsHasAlpha, flags); + GdipDisposeImage(img); + + stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat24bppRGB, NULL, (GpBitmap**)&img); + expect(Ok, stat); + stat = GdipGetImageFlags(img, &flags); + expect(Ok, stat); + expect(ImageFlagsNone, flags); + GdipDisposeImage(img); + + stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat32bppRGB, NULL, (GpBitmap**)&img); + expect(Ok, stat); + stat = GdipGetImageFlags(img, &flags); + expect(Ok, stat); + expect(ImageFlagsNone, flags); + GdipDisposeImage(img); + + stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat32bppARGB, NULL, (GpBitmap**)&img); + expect(Ok, stat); + stat = GdipGetImageFlags(img, &flags); + expect(Ok, stat); + expect(ImageFlagsHasAlpha, flags); + GdipDisposeImage(img); + + stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat32bppPARGB, NULL, (GpBitmap**)&img); + expect(Ok, stat); + stat = GdipGetImageFlags(img, &flags); + expect(Ok, stat); + expect(ImageFlagsHasAlpha, flags); + GdipDisposeImage(img); + + stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat48bppRGB, NULL, (GpBitmap**)&img); + expect(Ok, stat); + if (stat == Ok) + { + stat = GdipGetImageFlags(img, &flags); + expect(Ok, stat); + expect(ImageFlagsNone, flags); + GdipDisposeImage(img); + } + + stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat64bppARGB, NULL, (GpBitmap**)&img); + expect(Ok, stat); + if (stat == Ok) + { + expect(Ok, stat); + stat = GdipGetImageFlags(img, &flags); + expect(Ok, stat); + expect(ImageFlagsHasAlpha, flags); + GdipDisposeImage(img); + } + + stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat64bppPARGB, NULL, (GpBitmap**)&img); + expect(Ok, stat); + if (stat == Ok) + { + expect(Ok, stat); + stat = GdipGetImageFlags(img, &flags); + expect(Ok, stat); + expect(ImageFlagsHasAlpha, flags); + GdipDisposeImage(img); + } } static void test_GdipCloneImage(void) @@ -828,6 +1246,7 @@ expect(Ok, stat); expect(ImageTypeBitmap, type); stat = GdipGetImagePixelFormat((GpImage*)bitmap, &format); + expect(Ok, stat); expect(PixelFormat32bppARGB, format); /* raw format */ expect_rawformat(&ImageFormatMemoryBMP, (GpImage*)bitmap, __LINE__, FALSE); @@ -864,6 +1283,7 @@ expect(Ok, stat); expect(ImageTypeBitmap, type); stat = GdipGetImagePixelFormat((GpImage*)bitmap, &format); + expect(Ok, stat); expect(PixelFormat32bppARGB, format); /* raw format */ expect_rawformat(&ImageFormatMemoryBMP, (GpImage*)bitmap, __LINE__, FALSE); @@ -1195,6 +1615,12 @@ expect(32, bm.bmBitsPixel); ok(bm.bmBits != NULL, "got DDB, expected DIB\n"); + if (bm.bmBits) + { + DWORD val = *(DWORD*)bm.bmBits; + ok(val == 0xff686868, "got %x, expected 0xff686868\n", val); + } + hdc = CreateCompatibleDC(NULL); oldhbitmap = SelectObject(hdc, hbitmap); @@ -1204,6 +1630,49 @@ DeleteDC(hdc); expect(0x686868, pixel); + + DeleteObject(hbitmap); + } + + stat = GdipDisposeImage((GpImage*)bitmap); + expect(Ok, stat); + + /* create alpha Bitmap */ + stat = GdipCreateBitmapFromScan0(8, 20, 32, PixelFormat32bppARGB, bits, &bitmap); + expect(Ok, stat); + + /* create HBITMAP */ + stat = GdipCreateHBITMAPFromBitmap(bitmap, &hbitmap, 0); + expect(Ok, stat); + + if (stat == Ok) + { + ret = GetObjectA(hbitmap, sizeof(BITMAP), &bm); + expect(sizeof(BITMAP), ret); + + expect(0, bm.bmType); + expect(8, bm.bmWidth); + expect(20, bm.bmHeight); + expect(32, bm.bmWidthBytes); + expect(1, bm.bmPlanes); + expect(32, bm.bmBitsPixel); + ok(bm.bmBits != NULL, "got DDB, expected DIB\n"); + + if (bm.bmBits) + { + DWORD val = *(DWORD*)bm.bmBits; + ok(val == 0x682a2a2a, "got %x, expected 0x682a2a2a\n", val); + } + + hdc = CreateCompatibleDC(NULL); + + oldhbitmap = SelectObject(hdc, hbitmap); + pixel = GetPixel(hdc, 5, 5); + SelectObject(hdc, oldhbitmap); + + DeleteDC(hdc); + + expect(0x2a2a2a, pixel); DeleteObject(hbitmap); } @@ -1407,6 +1876,7 @@ INT size; BYTE buffer[1040]; ColorPalette *palette=(ColorPalette*)buffer; + ARGB *entries = palette->Entries; ARGB color=0; /* test initial palette from non-indexed bitmap */ @@ -1450,8 +1920,8 @@ expect(PaletteFlagsGrayScale, palette->Flags); expect(2, palette->Count); - expect(0xff000000, palette->Entries[0]); - expect(0xffffffff, palette->Entries[1]); + expect(0xff000000, entries[0]); + expect(0xffffffff, entries[1]); /* test getting/setting pixels */ stat = GdipBitmapGetPixel(bitmap, 0, 0, &color); @@ -1459,7 +1929,7 @@ expect(0xff000000, color); stat = GdipBitmapSetPixel(bitmap, 0, 1, 0xffffffff); - todo_wine ok((stat == Ok) || + ok((stat == Ok) || broken(stat == InvalidParameter) /* pre-win7 */, "stat=%.8x\n", stat); if (stat == Ok) @@ -1492,7 +1962,7 @@ expect(0xff000000, color); stat = GdipBitmapSetPixel(bitmap, 0, 1, 0xffff00ff); - todo_wine ok((stat == Ok) || + ok((stat == Ok) || broken(stat == InvalidParameter) /* pre-win7 */, "stat=%.8x\n", stat); if (stat == Ok) @@ -1525,7 +1995,7 @@ expect(0xff000000, color); stat = GdipBitmapSetPixel(bitmap, 0, 1, 0xffcccccc); - todo_wine ok((stat == Ok) || + ok((stat == Ok) || broken(stat == InvalidParameter) /* pre-win7 */, "stat=%.8x\n", stat); if (stat == Ok) @@ -1536,12 +2006,12 @@ } /* test setting/getting a different palette */ - palette->Entries[1] = 0xffcccccc; + entries[1] = 0xffcccccc; stat = GdipSetImagePalette((GpImage*)bitmap, palette); expect(Ok, stat); - palette->Entries[1] = 0; + entries[1] = 0; stat = GdipGetImagePaletteSize((GpImage*)bitmap, &size); expect(Ok, stat); @@ -1551,7 +2021,7 @@ expect(Ok, stat); expect(PaletteFlagsHalftone, palette->Flags); expect(256, palette->Count); - expect(0xffcccccc, palette->Entries[1]); + expect(0xffcccccc, entries[1]); /* test count < 256 */ palette->Flags = 12345; @@ -1560,8 +2030,8 @@ stat = GdipSetImagePalette((GpImage*)bitmap, palette); expect(Ok, stat); - palette->Entries[1] = 0; - palette->Entries[3] = 0xdeadbeef; + entries[1] = 0; + entries[3] = 0xdeadbeef; stat = GdipGetImagePaletteSize((GpImage*)bitmap, &size); expect(Ok, stat); @@ -1571,8 +2041,8 @@ expect(Ok, stat); expect(12345, palette->Flags); expect(3, palette->Count); - expect(0xffcccccc, palette->Entries[1]); - expect(0xdeadbeef, palette->Entries[3]); + expect(0xffcccccc, entries[1]); + expect(0xdeadbeef, entries[3]); /* test count > 256 */ palette->Count = 257; @@ -1602,6 +2072,12 @@ {0.0,0.0,1.0,0.0,0.0}, {0.0,0.0,0.0,1.0,0.0}, {0.0,0.0,0.0,0.0,1.0}}}; + const ColorMatrix asymmetric = {{ + {0.0,1.0,0.0,0.0,0.0}, + {0.0,0.0,1.0,0.0,0.0}, + {0.0,0.0,0.0,1.0,0.0}, + {1.0,0.0,0.0,0.0,0.0}, + {0.0,0.0,0.0,0.0,1.0}}}; GpBitmap *bitmap1, *bitmap2; GpGraphics *graphics; ARGB color; @@ -1662,13 +2138,13 @@ TRUE, &colormatrix, NULL, ColorMatrixFlagsDefault); expect(Ok, stat); - stat = GdipCreateBitmapFromScan0(1, 1, 0, PixelFormat32bppRGB, NULL, &bitmap1); - expect(Ok, stat); - - stat = GdipCreateBitmapFromScan0(1, 1, 0, PixelFormat32bppRGB, NULL, &bitmap2); - expect(Ok, stat); - - stat = GdipBitmapSetPixel(bitmap1, 0, 0, 0xff40ffff); + stat = GdipCreateBitmapFromScan0(1, 1, 0, PixelFormat32bppARGB, NULL, &bitmap1); + expect(Ok, stat); + + stat = GdipCreateBitmapFromScan0(1, 1, 0, PixelFormat32bppARGB, NULL, &bitmap2); + expect(Ok, stat); + + stat = GdipBitmapSetPixel(bitmap1, 0, 0, 0xff40ccee); expect(Ok, stat); stat = GdipGetImageGraphicsContext((GpImage*)bitmap2, &graphics); @@ -1680,7 +2156,23 @@ stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - todo_wine expect(0xff80ffff, color); + expect(0xff80ccee, color); + + colormatrix = asymmetric; + stat = GdipSetImageAttributesColorMatrix(imageattr, ColorAdjustTypeDefault, + TRUE, &colormatrix, NULL, ColorMatrixFlagsDefault); + expect(Ok, stat); + + stat = GdipBitmapSetPixel(bitmap2, 0, 0, 0); + expect(Ok, stat); + + stat = GdipDrawImageRectRectI(graphics, (GpImage*)bitmap1, 0,0,1,1, 0,0,1,1, + UnitPixel, imageattr, NULL, NULL); + expect(Ok, stat); + + stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); + expect(Ok, stat); + ok(color_match(0xeeff40cc, color, 3), "expected 0xeeff40cc, got 0x%08x\n", color); GdipDeleteGraphics(graphics); GdipDisposeImage((GpImage*)bitmap1); @@ -1742,7 +2234,7 @@ stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - todo_wine ok(color_match(0xff20ffff, color, 1), "Expected ff20ffff, got %.8x\n", color); + ok(color_match(0xff20ffff, color, 1), "Expected ff20ffff, got %.8x\n", color); GdipDeleteGraphics(graphics); GdipDisposeImage((GpImage*)bitmap1); @@ -2141,6 +2633,29 @@ GdipDisposeImageAttributes(imageattr); } +static void test_dispose(void) +{ + GpStatus stat; + GpImage *image; + char invalid_image[256]; + + stat = GdipDisposeImage(NULL); + expect(InvalidParameter, stat); + + stat = GdipCreateBitmapFromScan0(2, 2, 0, PixelFormat32bppARGB, NULL, (GpBitmap**)&image); + expect(Ok, stat); + + stat = GdipDisposeImage(image); + expect(Ok, stat); + + stat = GdipDisposeImage(image); + expect(ObjectBusy, stat); + + memset(invalid_image, 0, 256); + stat = GdipDisposeImage((GpImage*)invalid_image); + expect(ObjectBusy, stat); +} + START_TEST(image) { struct GdiplusStartupInput gdiplusStartupInput; @@ -2161,6 +2676,7 @@ test_SavingImages(); test_encoders(); test_LockBits(); + test_LockBits_UserBuf(); test_GdipCreateBitmapFromHBITMAP(); test_GdipGetImageFlags(); test_GdipCloneImage(); @@ -2180,6 +2696,7 @@ test_rotateflip(); test_remaptable(); test_colorkey(); + test_dispose(); GdiplusShutdown(gdiplusToken); } Modified: trunk/rostests/winetests/gdiplus/matrix.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/matrix.…
============================================================================== --- trunk/rostests/winetests/gdiplus/matrix.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/matrix.c [iso-8859-1] Mon Mar 5 20:18:32 2012 @@ -26,6 +26,7 @@ #include "wine/test.h" #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) +#define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %.2f, got %.2f\n", expected, got) static void test_constructor_destructor(void) { @@ -220,6 +221,87 @@ GdipDeleteMatrix(matrix); } +static void test_constructor3(void) +{ + /* MSDN is on crack. GdipCreateMatrix3 makes a matrix that transforms the + * corners of the given rectangle to the three points given. */ + GpMatrix *matrix; + REAL values[6]; + GpRectF rc; + GpPointF pt[3]; + GpStatus stat; + + rc.X = 10; + rc.Y = 10; + rc.Width = 10; + rc.Height = 10; + + pt[0].X = 10; + pt[0].Y = 10; + pt[1].X = 20; + pt[1].Y = 10; + pt[2].X = 10; + pt[2].Y = 20; + + stat = GdipCreateMatrix3(&rc, pt, &matrix); + expect(Ok, stat); + + stat = GdipGetMatrixElements(matrix, values); + expect(Ok, stat); + + expectf(1.0, values[0]); + expectf(0.0, values[1]); + expectf(0.0, values[2]); + expectf(1.0, values[3]); + expectf(0.0, values[4]); + expectf(0.0, values[5]); + + GdipDeleteMatrix(matrix); + + pt[0].X = 20; + pt[0].Y = 10; + pt[1].X = 40; + pt[1].Y = 10; + pt[2].X = 20; + pt[2].Y = 20; + + stat = GdipCreateMatrix3(&rc, pt, &matrix); + expect(Ok, stat); + + stat = GdipGetMatrixElements(matrix, values); + expect(Ok, stat); + + expectf(2.0, values[0]); + expectf(0.0, values[1]); + expectf(0.0, values[2]); + expectf(1.0, values[3]); + expectf(0.0, values[4]); + expectf(0.0, values[5]); + + GdipDeleteMatrix(matrix); + + pt[0].X = 10; + pt[0].Y = 20; + pt[1].X = 20; + pt[1].Y = 30; + pt[2].X = 10; + pt[2].Y = 30; + + stat = GdipCreateMatrix3(&rc, pt, &matrix); + expect(Ok, stat); + + stat = GdipGetMatrixElements(matrix, values); + expect(Ok, stat); + + expectf(1.0, values[0]); + expectf(1.0, values[1]); + expectf(0.0, values[2]); + expectf(1.0, values[3]); + expectf(0.0, values[4]); + expectf(0.0, values[5]); + + GdipDeleteMatrix(matrix);} + START_TEST(matrix) { struct GdiplusStartupInput gdiplusStartupInput; @@ -237,6 +319,7 @@ test_isinvertible(); test_invert(); test_shear(); + test_constructor3(); GdiplusShutdown(gdiplusToken); } Modified: trunk/rostests/winetests/gdiplus/pathiterator.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/pathite…
============================================================================== --- trunk/rostests/winetests/gdiplus/pathiterator.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/pathiterator.c [iso-8859-1] Mon Mar 5 20:18:32 2012 @@ -124,6 +124,7 @@ expect(4, result); start = end = result = (INT)0xdeadbeef; stat = GdipPathIterNextMarker(iter, &result, &start, &end); + expect(Ok, stat); /* start/end remain unchanged */ expect((INT)0xdeadbeef, start); expect((INT)0xdeadbeef, end); Modified: trunk/rostests/winetests/gdiplus/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/region.…
============================================================================== --- trunk/rostests/winetests/gdiplus/region.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/region.c [iso-8859-1] Mon Mar 5 20:18:32 2012 @@ -22,6 +22,7 @@ #include "gdiplus.h" #include "wingdi.h" #include "wine/test.h" +#include <math.h> #define RGNDATA_RECT 0x10000000 #define RGNDATA_PATH 0x10000001 @@ -32,6 +33,9 @@ #define RGNDATA_MAGIC2 0xdbc01002 #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) + +#define expectf_(expected, got, precision) ok(fabs(expected - got) < precision, "Expected %.2f, got %.2f\n", expected, got) +#define expectf(expected, got) expectf_(expected, got, 0.0001) #define expect_magic(value) ok(*value == RGNDATA_MAGIC || *value == RGNDATA_MAGIC2, "Expected a known magic value, got %8x\n", *value) @@ -1123,6 +1127,251 @@ ReleaseDC(0, hdc); } +static void test_transform(void) +{ + GpRegion *region, *region2; + GpMatrix *matrix; + GpGraphics *graphics; + GpPath *path; + GpRectF rectf; + GpStatus status; + HDC hdc = GetDC(0); + BOOL res; + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + + status = GdipCreatePath(FillModeAlternate, &path); + expect(Ok, status); + + status = GdipCreateRegion(®ion); + expect(Ok, status); + status = GdipCreateRegion(®ion2); + expect(Ok, status); + + status = GdipCreateMatrix(&matrix); + expect(Ok, status); + status = GdipScaleMatrix(matrix, 2.0, 3.0, MatrixOrderAppend); + expect(Ok, status); + + /* NULL */ + status = GdipTransformRegion(NULL, matrix); + expect(InvalidParameter, status); + + status = GdipTransformRegion(region, NULL); + expect(InvalidParameter, status); + + /* infinite */ + status = GdipTransformRegion(region, matrix); + expect(Ok, status); + + res = FALSE; + status = GdipIsEqualRegion(region, region2, graphics, &res); + expect(Ok, status); + ok(res, "Expected to be equal.\n"); + + /* empty */ + status = GdipSetEmpty(region); + expect(Ok, status); + status = GdipTransformRegion(region, matrix); + expect(Ok, status); + + status = GdipSetEmpty(region2); + expect(Ok, status); + + res = FALSE; + status = GdipIsEqualRegion(region, region2, graphics, &res); + expect(Ok, status); + ok(res, "Expected to be equal.\n"); + + /* rect */ + rectf.X = 10.0; + rectf.Y = 0.0; + rectf.Width = rectf.Height = 100.0; + status = GdipCombineRegionRect(region, &rectf, CombineModeReplace); + expect(Ok, status); + rectf.X = 20.0; + rectf.Y = 0.0; + rectf.Width = 200.0; + rectf.Height = 300.0; + status = GdipCombineRegionRect(region2, &rectf, CombineModeReplace); + expect(Ok, status); + status = GdipTransformRegion(region, matrix); + expect(Ok, status); + res = FALSE; + status = GdipIsEqualRegion(region, region2, graphics, &res); + expect(Ok, status); + ok(res, "Expected to be equal.\n"); + + /* path */ + status = GdipAddPathEllipse(path, 0.0, 10.0, 100.0, 150.0); + expect(Ok, status); + status = GdipCombineRegionPath(region, path, CombineModeReplace); + expect(Ok, status); + status = GdipResetPath(path); + expect(Ok, status); + status = GdipAddPathEllipse(path, 0.0, 30.0, 200.0, 450.0); + expect(Ok, status); + status = GdipCombineRegionPath(region2, path, CombineModeReplace); + expect(Ok, status); + status = GdipTransformRegion(region, matrix); + expect(Ok, status); + res = FALSE; + status = GdipIsEqualRegion(region, region2, graphics, &res); + expect(Ok, status); + ok(res, "Expected to be equal.\n"); + + status = GdipDeleteRegion(region); + expect(Ok, status); + status = GdipDeleteRegion(region2); + expect(Ok, status); + status = GdipDeleteGraphics(graphics); + expect(Ok, status); + status = GdipDeletePath(path); + expect(Ok, status); + status = GdipDeleteMatrix(matrix); + expect(Ok, status); + ReleaseDC(0, hdc); +} + +static void test_scans(void) +{ + GpRegion *region; + GpMatrix *matrix; + GpRectF rectf; + GpStatus status; + ULONG count=80085; + INT icount; + GpRectF scans[2]; + GpRect scansi[2]; + + status = GdipCreateRegion(®ion); + expect(Ok, status); + + status = GdipCreateMatrix(&matrix); + expect(Ok, status); + + /* test NULL values */ + status = GdipGetRegionScansCount(NULL, &count, matrix); + expect(InvalidParameter, status); + + status = GdipGetRegionScansCount(region, NULL, matrix); + expect(InvalidParameter, status); + + status = GdipGetRegionScansCount(region, &count, NULL); + expect(InvalidParameter, status); + + status = GdipGetRegionScans(NULL, scans, &icount, matrix); + expect(InvalidParameter, status); + + status = GdipGetRegionScans(region, scans, NULL, matrix); + expect(InvalidParameter, status); + + status = GdipGetRegionScans(region, scans, &icount, NULL); + expect(InvalidParameter, status); + + /* infinite */ + status = GdipGetRegionScansCount(region, &count, matrix); + expect(Ok, status); + expect(1, count); + + status = GdipGetRegionScans(region, NULL, &icount, matrix); + expect(Ok, status); + expect(1, icount); + + status = GdipGetRegionScans(region, scans, &icount, matrix); + expect(Ok, status); + expect(1, icount); + + status = GdipGetRegionScansI(region, scansi, &icount, matrix); + expect(Ok, status); + expect(1, icount); + expect(-0x400000, scansi[0].X); + expect(-0x400000, scansi[0].Y); + expect(0x800000, scansi[0].Width); + expect(0x800000, scansi[0].Height); + + status = GdipGetRegionScans(region, scans, &icount, matrix); + expect(Ok, status); + expect(1, icount); + expectf((double)-0x400000, scans[0].X); + expectf((double)-0x400000, scans[0].Y); + expectf((double)0x800000, scans[0].Width); + expectf((double)0x800000, scans[0].Height); + + /* empty */ + status = GdipSetEmpty(region); + expect(Ok, status); + + status = GdipGetRegionScansCount(region, &count, matrix); + expect(Ok, status); + expect(0, count); + + status = GdipGetRegionScans(region, scans, &icount, matrix); + expect(Ok, status); + expect(0, icount); + + /* single rectangle */ + rectf.X = rectf.Y = 0.0; + rectf.Width = rectf.Height = 5.0; + status = GdipCombineRegionRect(region, &rectf, CombineModeReplace); + expect(Ok, status); + + status = GdipGetRegionScansCount(region, &count, matrix); + expect(Ok, status); + expect(1, count); + + status = GdipGetRegionScans(region, scans, &icount, matrix); + expect(Ok, status); + expect(1, icount); + expectf(0.0, scans[0].X); + expectf(0.0, scans[0].Y); + expectf(5.0, scans[0].Width); + expectf(5.0, scans[0].Height); + + /* two rectangles */ + rectf.X = rectf.Y = 5.0; + rectf.Width = rectf.Height = 5.0; + status = GdipCombineRegionRect(region, &rectf, CombineModeUnion); + expect(Ok, status); + + status = GdipGetRegionScansCount(region, &count, matrix); + expect(Ok, status); + expect(2, count); + + /* Native ignores the initial value of count */ + scans[1].X = scans[1].Y = scans[1].Width = scans[1].Height = 8.0; + icount = 1; + status = GdipGetRegionScans(region, scans, &icount, matrix); + expect(Ok, status); + expect(2, icount); + expectf(0.0, scans[0].X); + expectf(0.0, scans[0].Y); + expectf(5.0, scans[0].Width); + expectf(5.0, scans[0].Height); + expectf(5.0, scans[1].X); + expectf(5.0, scans[1].Y); + expectf(5.0, scans[1].Width); + expectf(5.0, scans[1].Height); + + status = GdipGetRegionScansI(region, scansi, &icount, matrix); + expect(Ok, status); + expect(2, icount); + expect(0, scansi[0].X); + expect(0, scansi[0].Y); + expect(5, scansi[0].Width); + expect(5, scansi[0].Height); + expect(5, scansi[1].X); + expect(5, scansi[1].Y); + expect(5, scansi[1].Width); + expect(5, scansi[1].Height); + + status = GdipDeleteRegion(region); + expect(Ok, status); + status = GdipDeleteMatrix(matrix); + expect(Ok, status); +} + static void test_getbounds(void) { GpRegion *region; @@ -1634,6 +1883,8 @@ test_gethrgn(); test_isequal(); test_translate(); + test_transform(); + test_scans(); test_getbounds(); test_isvisiblepoint(); test_isvisiblerect();
12 years, 9 months
1
0
0
0
[rharabien] 56055: [GDIPLUS] - Sync to Wine 1.3.37
by rharabien@svn.reactos.org
Author: rharabien Date: Mon Mar 5 20:17:42 2012 New Revision: 56055 URL:
http://svn.reactos.org/svn/reactos?rev=56055&view=rev
Log: [GDIPLUS] - Sync to Wine 1.3.37 Added: trunk/reactos/dll/win32/gdiplus/gdiplus.manifest (with props) trunk/reactos/dll/win32/gdiplus/gdiplus.rc (with props) trunk/reactos/dll/win32/gdiplus/metafile.c (with props) Modified: trunk/reactos/dll/win32/gdiplus/CMakeLists.txt trunk/reactos/dll/win32/gdiplus/brush.c trunk/reactos/dll/win32/gdiplus/font.c trunk/reactos/dll/win32/gdiplus/gdiplus.c trunk/reactos/dll/win32/gdiplus/gdiplus.spec trunk/reactos/dll/win32/gdiplus/gdiplus_private.h trunk/reactos/dll/win32/gdiplus/graphics.c trunk/reactos/dll/win32/gdiplus/graphicspath.c trunk/reactos/dll/win32/gdiplus/image.c trunk/reactos/dll/win32/gdiplus/matrix.c trunk/reactos/dll/win32/gdiplus/region.c trunk/reactos/include/psdk/gdiplus.h trunk/reactos/include/psdk/gdiplusenums.h trunk/reactos/include/psdk/gdiplusflat.h trunk/reactos/include/psdk/gdiplusgpstubs.h trunk/reactos/include/psdk/gdiplusimaging.h trunk/reactos/include/psdk/gdiplustypes.h trunk/reactos/media/doc/README.WINE [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/gdiplus/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/CMakeLis…
Modified: trunk/reactos/dll/win32/gdiplus/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/brush.c?…
Modified: trunk/reactos/dll/win32/gdiplus/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/font.c?r…
Modified: trunk/reactos/dll/win32/gdiplus/gdiplus.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus.…
Added: trunk/reactos/dll/win32/gdiplus/gdiplus.manifest URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus.…
Added: trunk/reactos/dll/win32/gdiplus/gdiplus.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus.…
Modified: trunk/reactos/dll/win32/gdiplus/gdiplus.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus.…
Modified: trunk/reactos/dll/win32/gdiplus/gdiplus_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus_…
Modified: trunk/reactos/dll/win32/gdiplus/graphics.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/graphics…
Modified: trunk/reactos/dll/win32/gdiplus/graphicspath.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/graphics…
Modified: trunk/reactos/dll/win32/gdiplus/image.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/image.c?…
Modified: trunk/reactos/dll/win32/gdiplus/matrix.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/matrix.c…
Added: trunk/reactos/dll/win32/gdiplus/metafile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/metafile…
Modified: trunk/reactos/dll/win32/gdiplus/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/region.c…
Modified: trunk/reactos/include/psdk/gdiplus.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/gdiplus.h?rev…
Modified: trunk/reactos/include/psdk/gdiplusenums.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/gdiplusenums.…
Modified: trunk/reactos/include/psdk/gdiplusflat.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/gdiplusflat.h…
Modified: trunk/reactos/include/psdk/gdiplusgpstubs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/gdiplusgpstub…
Modified: trunk/reactos/include/psdk/gdiplusimaging.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/gdiplusimagin…
Modified: trunk/reactos/include/psdk/gdiplustypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/gdiplustypes.…
Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
12 years, 9 months
1
0
0
0
[jgardou] 56054: first cause of broken commits: the headers. Addendum r56048
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Mar 5 20:08:08 2012 New Revision: 56054 URL:
http://svn.reactos.org/svn/reactos?rev=56054&view=rev
Log: first cause of broken commits: the headers. Addendum r56048 Modified: trunk/reactos/tools/cabman/cabinet.h Modified: trunk/reactos/tools/cabman/cabinet.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/cabman/cabinet.h?rev…
============================================================================== --- trunk/reactos/tools/cabman/cabinet.h [iso-8859-1] (original) +++ trunk/reactos/tools/cabman/cabinet.h [iso-8859-1] Mon Mar 5 20:08:08 2012 @@ -296,7 +296,7 @@ CCFDATAStorage(); /* Default destructor */ virtual ~CCFDATAStorage(); - ULONG Create(const char* FileName); + ULONG Create(); ULONG Destroy(); ULONG Truncate(); ULONG Position();
12 years, 9 months
1
0
0
0
[rharabien] 56053: [HIDPARSER] - Implement translating customer page to scan-codes
by rharabien@svn.reactos.org
Author: rharabien Date: Mon Mar 5 19:58:43 2012 New Revision: 56053 URL:
http://svn.reactos.org/svn/reactos?rev=56053&view=rev
Log: [HIDPARSER] - Implement translating customer page to scan-codes Modified: trunk/reactos/lib/drivers/hidparser/api.c trunk/reactos/lib/drivers/hidparser/hidparser.c trunk/reactos/lib/drivers/hidparser/hidparser.h Modified: trunk/reactos/lib/drivers/hidparser/api.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/hidparser/api.…
============================================================================== --- trunk/reactos/lib/drivers/hidparser/api.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/hidparser/api.c [iso-8859-1] Mon Mar 5 19:58:43 2012 @@ -31,6 +31,32 @@ /* F */ 0x0096, 0x009e, 0x009f, 0x0080, 0x0088, 0x00b1, 0x00b2, 0x00b0, 0x008e, 0x0098, 0x00ad, 0x008c, 0x0000, 0x0000, 0x0000, 0x0000, }; +static struct +{ + USAGE Usage; + ULONG ScanCode; +} CustomerScanCodes[] = +{ + { 0x00B5, 0xE019 }, + { 0x00B6, 0xE010 }, + { 0x00B7, 0xE024 }, + { 0x00CD, 0xE022 }, + { 0x00E2, 0xE020 }, + { 0x00E9, 0xE030 }, + { 0x00EA, 0xE02E }, + { 0x0183, 0xE06D }, + { 0x018A, 0xE06C }, + { 0x0192, 0xE021 }, + { 0x0194, 0xE06B }, + { 0x0221, 0xE065 }, + { 0x0223, 0xE032 }, + { 0x0224, 0xE06A }, + { 0x0225, 0xE069 }, + { 0x0226, 0xE068 }, + { 0x0227, 0xE067 }, + { 0x022A, 0xE066 }, +}; + #define NTOHS(n) (((((unsigned short)(n) & 0xFF)) << 8) | (((unsigned short)(n) & 0xFF00) >> 8)) HIDPARSER_STATUS @@ -646,7 +672,7 @@ } ULONG -HidParser_GetScanCode( +HidParser_GetScanCodeFromKbdUsage( IN USAGE Usage) { if (Usage < sizeof(KeyboardScanCodes) / sizeof(KeyboardScanCodes[0])) @@ -655,6 +681,33 @@ // valid usage // return KeyboardScanCodes[Usage]; + } + + // + // invalid usage + // + return 0; +} + +ULONG +HidParser_GetScanCodeFromCustUsage( + IN USAGE Usage) +{ + ULONG i; + + // + // find usage in array + // + for (i = 0; i < sizeof(CustomerScanCodes) / sizeof(CustomerScanCodes[0]); ++i) + { + if (CustomerScanCodes[i].Usage == Usage) + { + // + // valid usage + // + return CustomerScanCodes[i].ScanCode; + } + } // @@ -712,9 +765,8 @@ } } - HIDPARSER_STATUS -HidParser_TranslateUsage( +HidParser_TranslateKbdUsage( IN PHID_PARSER Parser, IN USAGE Usage, IN HIDP_KEYBOARD_DIRECTION KeyAction, @@ -729,7 +781,7 @@ // // get scan code // - ScanCode = HidParser_GetScanCode(Usage); + ScanCode = HidParser_GetScanCodeFromKbdUsage(Usage); if (!ScanCode) { // @@ -775,3 +827,46 @@ // return HIDPARSER_STATUS_SUCCESS; } + +HIDPARSER_STATUS +HidParser_TranslateCustUsage( + IN PHID_PARSER Parser, + IN USAGE Usage, + IN HIDP_KEYBOARD_DIRECTION KeyAction, + IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState, + IN PHIDP_INSERT_SCANCODES InsertCodesProcedure, + IN PVOID InsertCodesContext) +{ + ULONG ScanCode; + + // + // get scan code + // + ScanCode = HidParser_GetScanCodeFromCustUsage(Usage); + if (!ScanCode) + { + // + // invalid lookup or no scan code available + // + DPRINT1("No Scan code for Usage %x\n", Usage); + return HIDPARSER_STATUS_I8042_TRANS_UNKNOWN; + } + + if (ScanCode & 0xFF00) + { + // + // swap scan code + // + ScanCode = NTOHS(ScanCode); + } + + // + // FIXME: translate modifier states + // + HidParser_DispatchKey((PCHAR)&ScanCode, KeyAction, InsertCodesProcedure, InsertCodesContext); + + // + // done + // + return HIDPARSER_STATUS_SUCCESS; +} Modified: trunk/reactos/lib/drivers/hidparser/hidparser.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/hidparser/hidp…
============================================================================== --- trunk/reactos/lib/drivers/hidparser/hidparser.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/hidparser/hidparser.c [iso-8859-1] Mon Mar 5 19:58:43 2012 @@ -681,17 +681,16 @@ if (ChangedUsageList[Index].UsagePage == HID_USAGE_PAGE_KEYBOARD) { // - // process usage + // process keyboard usage // - Status = HidParser_TranslateUsage(Parser, ChangedUsageList[Index].Usage, KeyAction, ModifierState, InsertCodesProcedure, InsertCodesContext); + Status = HidParser_TranslateKbdUsage(Parser, ChangedUsageList[Index].Usage, KeyAction, ModifierState, InsertCodesProcedure, InsertCodesContext); } else if (ChangedUsageList[Index].UsagePage == HID_USAGE_PAGE_CONSUMER) { // - // FIXME: implement me + // process consumer usage // - UNIMPLEMENTED - Status = HIDPARSER_STATUS_NOT_IMPLEMENTED; + Status = HidParser_TranslateCustUsage(Parser, ChangedUsageList[Index].Usage, KeyAction, ModifierState, InsertCodesProcedure, InsertCodesContext); } else { Modified: trunk/reactos/lib/drivers/hidparser/hidparser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/hidparser/hidp…
============================================================================== --- trunk/reactos/lib/drivers/hidparser/hidparser.h [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/hidparser/hidparser.h [iso-8859-1] Mon Mar 5 19:58:43 2012 @@ -430,7 +430,7 @@ IN ULONG ReportLength); HIDPARSER_STATUS -HidParser_TranslateUsage( +HidParser_TranslateKbdUsage( IN PHID_PARSER Parser, IN USAGE Usage, IN HIDP_KEYBOARD_DIRECTION KeyAction, @@ -438,6 +438,15 @@ IN PHIDP_INSERT_SCANCODES InsertCodesProcedure, IN PVOID InsertCodesContext); +HIDPARSER_STATUS +HidParser_TranslateCustUsage( + IN PHID_PARSER Parser, + IN USAGE Usage, + IN HIDP_KEYBOARD_DIRECTION KeyAction, + IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState, + IN PHIDP_INSERT_SCANCODES InsertCodesProcedure, + IN PVOID InsertCodesContext); + HIDAPI NTSTATUS NTAPI
12 years, 9 months
1
0
0
0
← Newer
1
...
21
22
23
24
25
26
27
...
36
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
Results per page:
10
25
50
100
200