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
2025
January
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
April 2007
----- 2025 -----
January 2025
----- 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
19 participants
380 discussions
Start a n
N
ew thread
[arty] 26573: Get back to call into kernel.
by arty@svn.reactos.org
Author: arty Date: Sun Apr 29 07:58:12 2007 New Revision: 26573 URL:
http://svn.reactos.org/svn/reactos?rev=26573&view=rev
Log: Get back to call into kernel. Modified: branches/powerpc/reactos/boot/freeldr/freeldr/reactos/reactos.c Modified: branches/powerpc/reactos/boot/freeldr/freeldr/reactos/reactos.c URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/fr…
============================================================================== --- branches/powerpc/reactos/boot/freeldr/freeldr/reactos/reactos.c (original) +++ branches/powerpc/reactos/boot/freeldr/freeldr/reactos/reactos.c Sun Apr 29 07:58:12 2007 @@ -415,6 +415,11 @@ rc = RegQueryValue(hOrderKey, GroupName, NULL, (PUCHAR)OrderList, &BufferSize); if (rc != ERROR_SUCCESS) OrderList[0] = 0; +#ifdef _M_PPC + for (TagIndex = 0; TagIndex < BufferSize / sizeof(OrderList[0]); TagIndex++) + OrderList[TagIndex] = SWAPD(OrderList[TagIndex]); +#endif + /* enumerate all drivers */ for (TagIndex = 1; TagIndex <= OrderList[0]; TagIndex++) { @@ -452,6 +457,11 @@ DriverGroupSize = sizeof(DriverGroup); rc = RegQueryValue(hDriverKey, L"Group", NULL, (PUCHAR)DriverGroup, &DriverGroupSize); DbgPrint((DPRINT_REACTOS, " Group: '%S' \n", DriverGroup)); + +#ifdef _M_PPC + StartValue = SWAPD(StartValue); + TagValue = SWAPD(TagValue); +#endif /* Make sure it should be started */ if ((StartValue == 0) &&
17 years, 9 months
1
0
0
0
[arty] 26572: Fix selection of CurrentControlSet.
by arty@svn.reactos.org
Author: arty Date: Sun Apr 29 07:35:21 2007 New Revision: 26572 URL:
http://svn.reactos.org/svn/reactos?rev=26572&view=rev
Log: Fix selection of CurrentControlSet. Modified: branches/powerpc/reactos/boot/freeldr/freeldr/reactos/registry.c Modified: branches/powerpc/reactos/boot/freeldr/freeldr/reactos/registry.c URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/fr…
============================================================================== --- branches/powerpc/reactos/boot/freeldr/freeldr/reactos/registry.c (original) +++ branches/powerpc/reactos/boot/freeldr/freeldr/reactos/registry.c Sun Apr 29 07:35:21 2007 @@ -141,6 +141,10 @@ CurrentSet = (LastKnownGood == TRUE) ? LastKnownGoodSet : DefaultSet; wcscpy(ControlSetKeyName, L"ControlSet"); + // Swap this binary value for now. We'll decide on a policy for these later +#ifdef _M_PPC + CurrentSet = SWAPD(CurrentSet); +#endif switch(CurrentSet) { case 1:
17 years, 9 months
1
0
0
0
[arty] 26571: QEMU now gets to RegOpenKey.
by arty@svn.reactos.org
Author: arty Date: Sun Apr 29 07:07:27 2007 New Revision: 26571 URL:
http://svn.reactos.org/svn/reactos?rev=26571&view=rev
Log: QEMU now gets to RegOpenKey. Modified: branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/prep_ide.c Modified: branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/fr…
============================================================================== --- branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c (original) +++ branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c Sun Apr 29 07:07:27 2007 @@ -381,32 +381,22 @@ { } -ULONG SignExtend24(ULONG Base, ULONG Delta) -{ - Delta = (Base & 0xfffffc) + Delta; - return (Base & 0xff000003) | (Delta & 0xfffffc); -} - /*++ - * FrLdrMapKernel + * FrLdrMapModule * INTERNAL * - * Maps the Kernel into memory, does PE Section Mapping, initalizes the - * uninitialized data sections, and relocates the image. + * Loads the indicated elf image as PE. The target will appear to be + * a PE image whose ImageBase has ever been KernelAddr. * * Params: - * KernelImage - FILE Structure representing the ntoskrnl image file. - * - * Returns: - * TRUE if the Kernel was mapped. - * - * Remarks: - * None. - * + * Image -- File to load + * ImageName -- Name of image for the modules list + * MemLoadAddr -- Freeldr address of module + * KernelAddr -- Kernel address of module *--*/ BOOLEAN NTAPI -FrLdrMapKernel(FILE *KernelImage) +FrLdrMapModule(FILE *KernelImage, PCHAR ImageName, PCHAR MemLoadAddr, ULONG KernelAddr) { PIMAGE_DOS_HEADER ImageHeader = 0; PIMAGE_NT_HEADERS NtHeader = 0; @@ -421,14 +411,7 @@ Elf32_Ehdr ehdr; Elf32_Shdr *shdr; - /* Get Kernel Base */ - FrLdrGetKernelBase(); - - /* Allocate kernel memory */ - KernelMemory = MmAllocateMemory(KernelMemorySize); - printf("Kernel Memory @%x\n", (int)KernelMemory); - - printf("Loading ntoskrnl (elf at %x)\n", KernelBase); + printf("Loading file (elf at %x)\n", KernelAddr); /* Load the first 1024 bytes of the kernel image so we can read the PE header */ if (!FsReadFile(KernelImage, sizeof(ehdr), NULL, &ehdr)) { @@ -492,7 +475,7 @@ } /* Save the Image Size */ - NtHeader->OptionalHeader.ImageBase = SWAPD(KernelBase); + NtHeader->OptionalHeader.ImageBase = SWAPD(KernelAddr); /* Load the file image */ Section = IMAGE_FIRST_SECTION(NtHeader); @@ -518,14 +501,14 @@ if (shdr->sh_type == SHT_PROGBITS) { /* Content area */ - printf("Loading section %d at %x\n", i, KernelBase + SectionAddr); + printf("Loading section %d at %x\n", i, KernelAddr + SectionAddr); FsSetFilePointer(KernelImage, shdr->sh_offset); FsReadFile(KernelImage, shdr->sh_size, NULL, KernelMemory + SectionAddr); } else if (shdr->sh_type == SHT_NOBITS) { /* Zero it out */ - printf("BSS section %d at %x\n", i, KernelBase + SectionAddr); + printf("BSS section %d at %x\n", i, KernelAddr + SectionAddr); memset(KernelMemory + SectionAddr, 0, ROUND_UP(shdr->sh_size, SWAPD(NtHeader->OptionalHeader.SectionAlignment))); @@ -579,9 +562,9 @@ FsReadFile(KernelImage, sizeof(symbol), NULL, &symbol); /* Compute addends */ - S = symbol.st_value + KernelBase + SectionOffsets[symbol.st_shndx]; + S = symbol.st_value + KernelAddr + SectionOffsets[symbol.st_shndx]; A = reloc.r_addend; - P = reloc.r_offset + KernelBase + SectionOffsets[targetSection]; + P = reloc.r_offset + KernelAddr + SectionOffsets[targetSection]; Target32 = (ULONG*)(((PCHAR)KernelMemory) + SectionOffsets[targetSection]); @@ -595,7 +578,7 @@ *Target32 = S + A; break; case R_PPC_UADDR32: /* Special: Treat as RVA */ - *Target32 = S + A - KernelBase; + *Target32 = S + A - KernelAddr; break; case R_PPC_ADDR24: *Target32 = (ADDR24_MASK & (S+A)) | (*Target32 & ~ADDR24_MASK); @@ -622,7 +605,7 @@ if(!(i & 0xf)) { if(i) printf("\n"); for (j = 0; j < 8; j++) - printf("%x", (((KernelBase + i) << (j * 4)) >> 28) & 0xf); + printf("%x", (((KernelAddr + i) << (j * 4)) >> 28) & 0xf); printf(": "); } printf("%x%x ", @@ -637,11 +620,43 @@ /* Increase the next Load Base */ NextModuleBase = ROUND_UP((ULONG)KernelMemory + ImageSize, PAGE_SIZE); ModuleData->ModEnd = NextModuleBase; - ModuleData->String = (ULONG)"ntoskrnl.exe"; + ModuleData->String = (ULONG)MmAllocateMemory(strlen(ImageName)+1); + strcpy((PCHAR)ModuleData->String, ImageName); LoaderBlock.ModsCount++; /* Return Success */ return TRUE; +} + +/*++ + * FrLdrMapKernel + * INTERNAL + * + * Maps the Kernel into memory, does PE Section Mapping, initalizes the + * uninitialized data sections, and relocates the image. + * + * Params: + * KernelImage - FILE Structure representing the ntoskrnl image file. + * + * Returns: + * TRUE if the Kernel was mapped. + * + * Remarks: + * None. + * + *--*/ +BOOLEAN +NTAPI +FrLdrMapKernel(FILE *KernelImage) +{ + /* Get Kernel Base */ + FrLdrGetKernelBase(); + + /* Allocate kernel memory */ + KernelMemory = MmAllocateMemory(KernelMemorySize); + printf("Kernel Memory @%x\n", (int)KernelMemory); + + return FrLdrMapModule(KernelImage, "ntoskrnl.exe", KernelMemory, KernelBase); } ULONG_PTR Modified: branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/prep_ide.c URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/fr…
============================================================================== --- branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/prep_ide.c (original) +++ branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/prep_ide.c Sun Apr 29 07:07:27 2007 @@ -16,7 +16,7 @@ void ide_seek( void *extension, int low, int high ) { idectl_desc *desc = (idectl_desc *)extension; - long long seekto = ((((long long)high) << 32) | (low & 0xffffffff)) / desc->bytespersec; + long long seekto = ((((long long)high) << 32) | (low & 0xffffffff)); /* order = sector, head, cylinder */ desc->seek_sector = seekto % desc->sectors; seekto /= desc->sectors; @@ -50,7 +50,6 @@ int ide_read( void *extension, char *buffer, int bytes ) { idectl_desc *desc = (idectl_desc *)extension; short *databuf = (short *)buffer; - short in; int inwords; ide_bsy( extension ); @@ -62,9 +61,7 @@ SetPhysByte(desc->port+7, 0x20); for( inwords = 0; inwords < desc->bytespersec / sizeof(short); inwords++ ) { - in = GetPhysHalf(desc->port); - databuf[inwords] = SWAP_W(in); - sync(); + databuf[inwords] = GetPhysHalf(desc->port); } desc->seekto += desc->bytespersec;
17 years, 9 months
1
0
0
0
[jimtabor] 26570: Implement NtGdiOpenDCW.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sun Apr 29 06:02:17 2007 New Revision: 26570 URL:
http://svn.reactos.org/svn/reactos?rev=26570&view=rev
Log: Implement NtGdiOpenDCW. Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Sun Apr 29 06:02:17 2007 @@ -1063,16 +1063,62 @@ } HDC STDCALL -NtGdiOpenDCW( PUNICODE_STRING pustrDevice, - DEVMODEW *pdm, +NtGdiOpenDCW( PUNICODE_STRING Device, + DEVMODEW *InitData, PUNICODE_STRING pustrLogAddr, ULONG iType, HANDLE hspool, VOID *pDriverInfo2, VOID *pUMdhpdev ) { - UNIMPLEMENTED; - return 0; + UNICODE_STRING SafeDevice; + DEVMODEW SafeInitData; + HDC Ret; + NTSTATUS Status = STATUS_SUCCESS; + + if(InitData) + { + _SEH_TRY + { + ProbeForRead(InitData, + sizeof(DEVMODEW), + 1); + RtlCopyMemory(&SafeInitData, + InitData, + sizeof(DEVMODEW)); + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + if(!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + return NULL; + } + /* FIXME - InitData can have some more bytes! */ + } + + if(Device) + { + Status = IntSafeCopyUnicodeString(&SafeDevice, Device); + if(!NT_SUCCESS(Status)) + { + RtlFreeUnicodeString(&SafeDevice); + SetLastNtError(Status); + return NULL; + } + } + + Ret = IntGdiCreateDC(NULL == Device ? NULL : &SafeDevice, + NULL, + NULL, + NULL == InitData ? NULL : &SafeInitData, + (BOOL) iType); // FALSE 0 DCW, TRUE 1 ICW + + return Ret; + } BOOL STDCALL @@ -2196,7 +2242,8 @@ PDC NewDC; HDC hDC; PWSTR Buf = NULL; - +// PDC_ATTR DC_Attr = NULL; + if (Driver != NULL) { Buf = ExAllocatePoolWithTag(PagedPool, Driver->MaximumLength, TAG_DC); @@ -2217,9 +2264,8 @@ return NULL; } #if 0 -#define TAG_DCATTR TAG('D', 'C', 'A', 'T') PVOID NewMem = NULL; - ULONG MemSize = PAGE_SIZE; //sizeof(DC_ATTR); + ULONG MemSize = sizeof(DC_ATTR); //PAGE_SIZE it will allocate that size NTSTATUS Status = ZwAllocateVirtualMemory(NtCurrentProcess(), &NewMem, 0, @@ -2235,11 +2281,11 @@ { RtlZeroMemory(NewMem, MemSize); Entry->UserData = NewMem; - DPRINT1("DC_ATTR allocated! 0x%x\n",NewMem); + DPRINT("DC_ATTR allocated! 0x%x\n",NewMem); } else { - DPRINT1("DC_ATTR not allocated!\n"); + DPRINT("DC_ATTR not allocated!\n"); } } KeLeaveCriticalRegion(); @@ -2250,6 +2296,7 @@ if(NewMem) { NewDC->pDc_Attr = NewMem; // Store pointer + DC_Attr = NewMem; } #endif if (Driver != NULL) @@ -2258,26 +2305,52 @@ NewDC->DriverName.Buffer = Buf; } +// gxf_long a; +// a.f = 1.0f; + NewDC->w.xformWorld2Wnd.eM11 = 1.0f; - NewDC->w.xformWorld2Wnd.eM12 = 0.0f; +// DC_Attr->mxWorldToPage.efM11.lExp = XFPEXP(a); +// DC_Attr->mxWorldToPage.efM11.lMant = XFPMANT(a); + + NewDC->w.xformWorld2Wnd.eM12 = 0.0f; //Already Zero! NewDC->w.xformWorld2Wnd.eM21 = 0.0f; + NewDC->w.xformWorld2Wnd.eM22 = 1.0f; - NewDC->w.xformWorld2Wnd.eDx = 0.0f; +// DC_Attr->mxWorldToPage.efM22.lExp = XFPEXP(a); +// DC_Attr->mxWorldToPage.efM22.lMant = XFPMANT(a); + + NewDC->w.xformWorld2Wnd.eDx = 0.0f; //Already Zero! NewDC->w.xformWorld2Wnd.eDy = 0.0f; + NewDC->w.xformWorld2Vport = NewDC->w.xformWorld2Wnd; +// DC_Attr->mxWorldToDevice = DC_Attr->mxWorldToPage; + NewDC->w.xformVport2World = NewDC->w.xformWorld2Wnd; +// DC_Attr->mxDevicetoWorld = DC_Attr->mxWorldToPage; + NewDC->w.vport2WorldValid = TRUE; +// DC_Attr->flXform = DEVICE_TO_PAGE_INVALID; // More research. + NewDC->w.MapMode = MM_TEXT; +// DC_Attr->iMapMode = MM_TEXT; + NewDC->wndExtX = 1.0f; NewDC->wndExtY = 1.0f; NewDC->vportExtX = 1.0f; NewDC->vportExtY = 1.0f; + NewDC->w.textColor = 0; +// NewDC->pDc_Attr->ulForegroundClr = 0; Already Zero +// NewDC->pDc_Attr->crForegroundClr = 0; + NewDC->w.backgroundColor = 0xffffff; +// DC_Attr->ulBackgroundClr = 0xffffff; +// DC_Attr->crBackgroundClr = 0xffffff; NewDC->w.hFont = NtGdiGetStockObject(SYSTEM_FONT); TextIntRealizeFont(NewDC->w.hFont); - +// DC_Attr->hlfntNew = NtGdiGetStockObject(SYSTEM_FONT); + NewDC->w.hPalette = NtGdiGetStockObject(DEFAULT_PALETTE); DC_UnlockDc(NewDC); @@ -2322,12 +2395,16 @@ PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index]; if(Entry->UserData) { - ULONG MemSize = PAGE_SIZE; + ULONG MemSize = sizeof(DC_ATTR); //PAGE_SIZE; NTSTATUS Status = ZwFreeVirtualMemory(NtCurrentProcess(), &Entry->UserData, &MemSize, MEM_DECOMMIT); - if (NT_SUCCESS(Status)) Entry->UserData = NULL; + if (NT_SUCCESS(Status)) + { + DPRINT("DC_FreeDC DC_ATTR 0x%x\n", Entry->UserData); + Entry->UserData = NULL; + } } } KeLeaveCriticalRegion();
17 years, 9 months
1
0
0
0
[tkreuzer] 26569: gdi32_test: a lot of testcases especially for GetObject
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Apr 29 05:43:41 2007 New Revision: 26569 URL:
http://svn.reactos.org/svn/reactos?rev=26569&view=rev
Log: gdi32_test: a lot of testcases especially for GetObject Added: trunk/rostests/win32/gdi32/ trunk/rostests/win32/gdi32/gdi32_test.c trunk/rostests/win32/gdi32/gdi32_test.rbuild trunk/rostests/win32/gdi32/gditest.h trunk/rostests/win32/gdi32/testlist.c trunk/rostests/win32/gdi32/tests/ trunk/rostests/win32/gdi32/tests/CreateCompatibleDC.c trunk/rostests/win32/gdi32/tests/CreatePen.c trunk/rostests/win32/gdi32/tests/ExtCreatePen.c trunk/rostests/win32/gdi32/tests/GetObject.c trunk/rostests/win32/gdi32/tests/GetStockObject.c trunk/rostests/win32/gdi32/tests/SelectObject.c trunk/rostests/win32/gdi32/tests/SetDCPenColor.c trunk/rostests/win32/gdi32/tests/SetSysColors.c Modified: trunk/rostests/win32/testsets.rbuild Added: trunk/rostests/win32/gdi32/gdi32_test.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/gdi32_test.c?…
============================================================================== --- trunk/rostests/win32/gdi32/gdi32_test.c (added) +++ trunk/rostests/win32/gdi32/gdi32_test.c Sun Apr 29 05:43:41 2007 @@ -1,0 +1,49 @@ +#include <stdio.h> +#include <stdlib.h> + +#include "gditest.h" + +int main(int argc, char *argv[]) +{ + INT Num = NumTests(); + INT i, j; + INT passed, failed, opassed, ofailed; + + opassed = 0; + ofailed = 0; + printf("GDI tests\n"); + if (argc > 1) + { + for (i = 1; i < argc; i++) + { + for (j = 0; j < NumTests(); j++) + { + if (stricmp(argv[i], TestList[j].Test) == 0) + { + passed = 0; + failed = 0; + TestList[j].Proc(&passed, &failed); + opassed += passed; + ofailed += failed; + printf(" tests: %d, passed: %d, failed: %d\n\n", passed+failed, passed, failed); + } + } + } + } + else + { + for (i = 0; i < Num; i++) + { + passed = 0; + failed = 0; + printf("Test: %s\n", TestList[i].Test); + TestList[i].Proc(&passed, &failed); + opassed += passed; + ofailed += failed; + printf(" tests: %d, passed: %d, failed: %d\n\n", passed+failed, passed, failed); + } + } + printf("\nOverall tests: %d, passed: %d, failed: %d\n", opassed+ofailed, opassed, ofailed); + + return ofailed; +} Added: trunk/rostests/win32/gdi32/gdi32_test.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/gdi32_test.rb…
============================================================================== --- trunk/rostests/win32/gdi32/gdi32_test.rbuild (added) +++ trunk/rostests/win32/gdi32/gdi32_test.rbuild Sun Apr 29 05:43:41 2007 @@ -1,0 +1,10 @@ +<module name="gdi32_test" type="win32cui"> + <include base="gdi32_test">.</include> + <define name="__USE_W32API" /> + <define name="_WIN32_WINNT">0x0501</define> + <library>kernel32</library> + <library>user32</library> + <library>gdi32</library> + <file>gdi32_test.c</file> + <file>testlist.c</file> +</module> Added: trunk/rostests/win32/gdi32/gditest.h URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/gditest.h?rev…
============================================================================== --- trunk/rostests/win32/gdi32/gditest.h (added) +++ trunk/rostests/win32/gdi32/gditest.h Sun Apr 29 05:43:41 2007 @@ -1,0 +1,72 @@ +#ifndef _GDITEST_H +#define _GDITEST_H + +#define WINVER 0x501 + +//#include <stdio.h> +#include <stdlib.h> + +#include <stdarg.h> +#include <stdio.h> +#include <windows.h> + +#define TEST(x) \ + if (x)\ + {\ + (*passed)++;\ + } else {\ + (*failed)++;\ + printf("Test failed in file %s line %d\n", __FILE__, __LINE__);\ + }; + +#define GDI_HANDLE_INDEX_MASK 0x00003fff // (GDI_HANDLE_COUNT - 1) +#define GDI_HANDLE_TYPE_MASK 0x007f0000 +#define GDI_HANDLE_STOCK_MASK 0x00800000 +#define GDI_HANDLE_REUSE_MASK 0xff000000 + +#define GDI_HANDLE_GET_INDEX(h) \ + (((ULONG_PTR)(h)) & GDI_HANDLE_INDEX_MASK) + +#define GDI_HANDLE_GET_TYPE(h) \ + (((ULONG_PTR)(h)) & GDI_HANDLE_TYPE_MASK) + +#define GDI_HANDLE_PEN_TO_BRUSH(h) \ + (HBRUSH)((((ULONG_PTR)(h)) & ~GDI_HANDLE_TYPE_MASK) | GDI_OBJECT_TYPE_PEN) + + +#define GDI_OBJECT_TYPE_DC 0x00010000 +#define GDI_OBJECT_TYPE_REGION 0x00040000 +#define GDI_OBJECT_TYPE_BITMAP 0x00050000 +#define GDI_OBJECT_TYPE_PALETTE 0x00080000 +#define GDI_OBJECT_TYPE_FONT 0x000a0000 +#define GDI_OBJECT_TYPE_BRUSH 0x00100000 +#define GDI_OBJECT_TYPE_EMF 0x00210000 +#define GDI_OBJECT_TYPE_PEN 0x00300000 +#define GDI_OBJECT_TYPE_EXTPEN 0x00500000 +#define GDI_OBJECT_TYPE_COLORSPACE 0x00090000 +#define GDI_OBJECT_TYPE_METADC 0x00660000 +#define GDI_OBJECT_TYPE_METAFILE 0x00260000 +#define GDI_OBJECT_TYPE_ENHMETAFILE 0x00460000 +/* Following object types made up for ROS */ +#define GDI_OBJECT_TYPE_ENHMETADC 0x00740000 +#define GDI_OBJECT_TYPE_MEMDC 0x00750000 +#define GDI_OBJECT_TYPE_DCE 0x00770000 +#define GDI_OBJECT_TYPE_DONTCARE 0x007f0000 + + +/* The type definitions */ +typedef BOOL (*TESTPROC)(INT*, INT*); + +typedef struct tagTEST +{ + CHAR* Test; + TESTPROC Proc; +} TEST, *PTEST; + + +extern TEST TestList[]; +INT NumTests(void); + +#endif /* _GDITEST_H */ + +/* EOF */ Added: trunk/rostests/win32/gdi32/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/testlist.c?re…
============================================================================== --- trunk/rostests/win32/gdi32/testlist.c (added) +++ trunk/rostests/win32/gdi32/testlist.c Sun Apr 29 05:43:41 2007 @@ -1,0 +1,37 @@ +#ifndef _GDITESTLIST_H +#define _GDITESTLIST_H + +#include "gditest.h" + +/* include the tests */ +#include "tests/CreateCompatibleDC.c" +#include "tests/CreatePen.c" +#include "tests/ExtCreatePen.c" +#include "tests/GetObject.c" +#include "tests/GetStockObject.c" +#include "tests/SelectObject.c" +#include "tests/SetDCPenColor.c" +#include "tests/SetSysColors.c" + +/* The List of tests */ +TEST TestList[] = +{ + { "CreateCompatibleDC", Test_CreateCompatibleDC }, + { "CreatePen", Test_CreatePen }, + { "ExtCreatePen", Test_ExtCreatePen }, + { "GetStockObject", Test_GetStockObject }, + { "SetSysColors", Test_SetSysColors }, + { "SelectObject", Test_SelectObject }, + { "SetDCPenColor", Test_SetDCPenColor }, + { "GetObject", Test_GetObject } +}; + +/* The function that gives us the number of tests */ +INT NumTests(void) +{ + return sizeof(TestList) / sizeof(TEST); +} + +#endif /* _GDITESTLIST_H */ + +/* EOF */ Added: trunk/rostests/win32/gdi32/tests/CreateCompatibleDC.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/tests/CreateC…
============================================================================== --- trunk/rostests/win32/gdi32/tests/CreateCompatibleDC.c (added) +++ trunk/rostests/win32/gdi32/tests/CreateCompatibleDC.c Sun Apr 29 05:43:41 2007 @@ -1,0 +1,37 @@ +#include "..\gditest.h" + +BOOL Test_CreateCompatibleDC(INT* passed, INT* failed) +{ + HDC hDCScreen, hOldDC, hDC, hDC2; + + // Create a DC + hDCScreen = GetDC(NULL); + if (hDCScreen == NULL) + { + return FALSE; + } + + hDC = CreateCompatibleDC(hDCScreen); + TEST(hDC != NULL); + + // Test if first selected pen is BLACK_PEN (? or same as screen DC's pen?) + TEST(SelectObject(hDC, GetStockObject(DC_PEN)) == GetStockObject(BLACK_PEN)); + TEST(SelectObject(hDC, GetStockObject(BLACK_PEN)) == GetStockObject(DC_PEN)); + + // Test for the starting Color == RGB(0,0,0) + TEST(SetDCPenColor(hDC, RGB(1,2,3)) == RGB(0,0,0)); + + // Check for reuse counter + hOldDC = hDC; + DeleteDC(hDC); + hDC = CreateCompatibleDC(hDCScreen); + hDC2 = CreateCompatibleDC(hOldDC); + TEST(hDC2 == NULL); + if (hDC2 != NULL) DeleteDC(hDC2); + + // cleanup + DeleteDC(hDC); + + ReleaseDC(NULL, hDCScreen); + return TRUE; +} Added: trunk/rostests/win32/gdi32/tests/CreatePen.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/tests/CreateP…
============================================================================== --- trunk/rostests/win32/gdi32/tests/CreatePen.c (added) +++ trunk/rostests/win32/gdi32/tests/CreatePen.c Sun Apr 29 05:43:41 2007 @@ -1,0 +1,17 @@ +#include "..\gditest.h" + +BOOL +Test_CreatePen(INT* passed, INT* failed) +{ + HPEN hPen; + + hPen = CreatePen(PS_COSMETIC, 1, RGB(1,2,3)); + if (!hPen) return FALSE; + + /* Test if we have a PEN */ + TEST(GDI_HANDLE_GET_TYPE(hPen) == GDI_OBJECT_TYPE_PEN); + + DeleteObject(hPen); + return TRUE; +} + Added: trunk/rostests/win32/gdi32/tests/ExtCreatePen.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/tests/ExtCrea…
============================================================================== --- trunk/rostests/win32/gdi32/tests/ExtCreatePen.c (added) +++ trunk/rostests/win32/gdi32/tests/ExtCreatePen.c Sun Apr 29 05:43:41 2007 @@ -1,0 +1,23 @@ +#include "..\gditest.h" + +BOOL +Test_ExtCreatePen(INT* passed, INT* failed) +{ + HPEN hPen; + LOGBRUSH logbrush; + + logbrush.lbStyle = BS_SOLID; + logbrush.lbColor = RGB(1,2,3); + logbrush.lbHatch = 0; + hPen = ExtCreatePen(PS_COSMETIC, 1,&logbrush, 0, 0); + if (!hPen) return FALSE; + + /* Test if we have an EXTPEN */ + TEST(GDI_HANDLE_GET_TYPE(hPen) == GDI_OBJECT_TYPE_EXTPEN); + + + DeleteObject(hPen); + return TRUE; +} + + Added: trunk/rostests/win32/gdi32/tests/GetObject.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/tests/GetObje…
============================================================================== --- trunk/rostests/win32/gdi32/tests/GetObject.c (added) +++ trunk/rostests/win32/gdi32/tests/GetObject.c Sun Apr 29 05:43:41 2007 @@ -1,0 +1,398 @@ +#include "..\gditest.h" + +BOOL +Test_General(INT* passed, INT* failed) +{ + /* Test null pointer and invalid handles */ + SetLastError(ERROR_SUCCESS); + TEST(GetObjectA(0, 0, NULL) == 0); + TEST(GetObjectA((HANDLE)-1, 0, NULL) == 0); + TEST(GetObjectA((HANDLE)0x00380000, 0, NULL) == 0); + TEST(GetLastError() == ERROR_SUCCESS); + + SetLastError(ERROR_SUCCESS); + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_DC, 0, NULL) == 0); + TEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_DC, 0, NULL) == 0); + TEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_REGION, 0, NULL) == 0); + TEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_REGION, 0, NULL) == 0); + TEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_EMF, 0, NULL) == 0); + TEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_EMF, 0, NULL) == 0); + TEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METAFILE, 0, NULL) == 0); + TEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_METAFILE, 0, NULL) == 0); + TEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_ENHMETAFILE, 0, NULL) == 0); + TEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_ENHMETAFILE, 0, NULL) == 0); + TEST(GetLastError() == ERROR_INVALID_HANDLE); + + return TRUE; +} + +BOOL +Test_Bitmap(INT* passed, INT* failed) +{ + HBITMAP hBitmap; + BITMAP bitmap; + DIBSECTION dibsection; + BYTE bData[100] = {0}; + BYTE Buffer[100] = {48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,0}; + + FillMemory(&bitmap, sizeof(BITMAP), 0x77); + hBitmap = CreateBitmap(10,10,1,8,bData); + if (!hBitmap) return FALSE; + + SetLastError(ERROR_SUCCESS); + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP)); + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP)); + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, sizeof(BITMAP), NULL) == sizeof(BITMAP)); + TEST(GetObjectA(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP)); + TEST(GetObjectA(hBitmap, 0, NULL) == sizeof(BITMAP)); + TEST(GetObjectA((HANDLE)((UINT)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP)); + TEST(GetObjectA(hBitmap, 5, NULL) == sizeof(BITMAP)); + TEST(GetObjectA(hBitmap, -5, NULL) == sizeof(BITMAP)); + TEST(GetObjectA(hBitmap, 0, Buffer) == 0); + TEST(GetObjectA(hBitmap, 5, Buffer) == 0); + TEST(GetObjectA(hBitmap, sizeof(BITMAP), &bitmap) == sizeof(BITMAP)); + TEST(GetObjectA(hBitmap, sizeof(BITMAP)+2, &bitmap) == sizeof(BITMAP)); + TEST(GetObjectA(hBitmap, sizeof(DIBSECTION), &dibsection) == sizeof(BITMAP)); + TEST(GetObjectA(hBitmap, -5, &bitmap) == sizeof(BITMAP)); + TEST(GetLastError() == ERROR_SUCCESS); + + // todo: test invalid handle + buffer + + DeleteObject(hBitmap); + return TRUE; +} + +BOOL +Test_Dibsection(INT* passed, INT* failed) +{ + BITMAPINFO bmi = {{sizeof(BITMAPINFOHEADER), 10, 10, 1, 8, BI_RGB, 0, 10, 10, 0,0}}; + HBITMAP hBitmap; + DIBSECTION dibsection; + PVOID pData; + + FillMemory(&dibsection, sizeof(DIBSECTION), 0x77); + HDC hDC = GetDC(0); + hBitmap = CreateDIBSection(hDC, &bmi, DIB_RGB_COLORS, &pData, NULL, 0); + if(!hBitmap) return FALSE; + + SetLastError(ERROR_SUCCESS); + TEST(GetObject(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP)); + TEST(GetObject(hBitmap, 0, NULL) == sizeof(BITMAP)); + TEST(GetObject(hBitmap, 5, NULL) == sizeof(BITMAP)); + TEST(GetObject(hBitmap, -5, NULL) == sizeof(BITMAP)); + TEST(GetObject(hBitmap, 0, &dibsection) == 0); + TEST(GetObject(hBitmap, 5, &dibsection) == 0); + TEST(GetObject(hBitmap, sizeof(BITMAP), &dibsection) == sizeof(BITMAP)); + TEST(GetObject(hBitmap, sizeof(BITMAP)+2, &dibsection) == sizeof(BITMAP)); + TEST(GetObject(hBitmap, sizeof(DIBSECTION), &dibsection) == sizeof(DIBSECTION)); + TEST(GetObject(hBitmap, sizeof(DIBSECTION)+2, &dibsection) == sizeof(DIBSECTION)); + TEST(GetObject(hBitmap, -5, &dibsection) == sizeof(DIBSECTION)); + TEST(GetLastError() == ERROR_SUCCESS); + DeleteObject(hBitmap); + ReleaseDC(0, hDC); + + return TRUE; +} + +BOOL Test_Palette(INT* passed, INT* failed) +{ + LOGPALETTE logpal; + HPALETTE hPalette; + WORD wPalette; + + FillMemory(&wPalette, sizeof(WORD), 0x77); + logpal.palVersion = 0x0300; + logpal.palNumEntries = 1; + logpal.palPalEntry[0].peRed = 0; + logpal.palPalEntry[0].peGreen = 0; + logpal.palPalEntry[0].peBlue = 0; + logpal.palPalEntry[0].peFlags = PC_EXPLICIT; + hPalette = CreatePalette(&logpal); + if (!hPalette) return FALSE; + + SetLastError(ERROR_SUCCESS); + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD)); + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD)); + TEST(GetObject(hPalette, sizeof(WORD), NULL) == sizeof(WORD)); + TEST(GetObject(hPalette, 0, NULL) == sizeof(WORD)); + TEST(GetObject(hPalette, 5, NULL) == sizeof(WORD)); + TEST(GetObject(hPalette, -5, NULL) == sizeof(WORD)); + TEST(GetObject(hPalette, sizeof(WORD), &wPalette) == sizeof(WORD)); + TEST(GetObject(hPalette, sizeof(WORD)+2, &wPalette) == sizeof(WORD)); + TEST(GetObject(hPalette, 0, &wPalette) == 0); + TEST(GetObject(hPalette, 1, &wPalette) == 0); + TEST(GetObject(hPalette, -1, &wPalette) == sizeof(WORD)); + TEST(GetLastError() == ERROR_SUCCESS); + DeleteObject(hPalette); + return TRUE; +} + +BOOL Test_Brush(INT* passed, INT* failed) +{ + LOGBRUSH logbrush; + HBRUSH hBrush; + + FillMemory(&logbrush, sizeof(LOGBRUSH), 0x77); + hBrush = CreateSolidBrush(RGB(1,2,3)); + if (!hBrush) return FALSE; + + SetLastError(ERROR_SUCCESS); + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BRUSH, 0, NULL) == sizeof(LOGBRUSH)); + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BRUSH, 0, NULL) == sizeof(LOGBRUSH)); + TEST(GetObject(hBrush, sizeof(WORD), NULL) == sizeof(LOGBRUSH)); + TEST(GetObject(hBrush, 0, NULL) == sizeof(LOGBRUSH)); + TEST(GetObject(hBrush, 5, NULL) == sizeof(LOGBRUSH)); + TEST(GetObject(hBrush, -5, NULL) == sizeof(LOGBRUSH)); + + TEST(GetObject(hBrush, 0, &logbrush) == 0); + TEST(logbrush.lbStyle == 0x77777777); + TEST(GetObject(hBrush, 5, &logbrush) == sizeof(LOGBRUSH)); + TEST(logbrush.lbStyle == 0); + TEST(logbrush.lbColor == 0x77777701); + + TEST(GetObject(hBrush, sizeof(LOGBRUSH), &logbrush) == sizeof(LOGBRUSH)); + TEST(GetObject(hBrush, sizeof(LOGBRUSH)+2, &logbrush) == sizeof(LOGBRUSH)); + TEST(GetObject(hBrush, -1, &logbrush) == sizeof(LOGBRUSH)); + // TODO: test all members + + TEST(GetLastError() == ERROR_SUCCESS); + DeleteObject(hBrush); + return TRUE; +} + +BOOL Test_Pen(INT* passed, INT* failed) +{ + LOGPEN logpen; + HPEN hPen; + + FillMemory(&logpen, sizeof(LOGPEN), 0x77); + hPen = CreatePen(PS_SOLID, 3, RGB(4,5,6)); + if (!hPen) return FALSE; + SetLastError(ERROR_SUCCESS); + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_PEN, 0, NULL) == sizeof(LOGPEN)); + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PEN, 0, NULL) == sizeof(LOGPEN)); + TEST(GetObject(hPen, sizeof(BITMAP), NULL) == sizeof(LOGPEN)); + TEST(GetObject(hPen, 0, NULL) == sizeof(LOGPEN)); + TEST(GetObject(hPen, 5, NULL) == sizeof(LOGPEN)); + TEST(GetObject(hPen, -5, NULL) == sizeof(LOGPEN)); + TEST(GetObject(hPen, sizeof(LOGPEN), &logpen) == sizeof(LOGPEN)); + TEST(GetObject(hPen, sizeof(LOGPEN)+2, &logpen) == sizeof(LOGPEN)); + TEST(GetObject(hPen, 0, &logpen) == 0); + TEST(GetObject(hPen, 5, &logpen) == 0); + TEST(GetObject(hPen, -5, &logpen) == sizeof(LOGPEN)); + TEST(GetLastError() == ERROR_SUCCESS); + DeleteObject(hPen); + return TRUE; +} + +BOOL Test_ExtPen(INT* passed, INT* failed) +{ + HPEN hPen; + EXTLOGPEN extlogpen; + LOGBRUSH logbrush; + + SetLastError(ERROR_SUCCESS); + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0); + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0); + TEST(GetLastError() == ERROR_INVALID_PARAMETER); + + FillMemory(&extlogpen, sizeof(EXTLOGPEN), 0x77); + logbrush.lbStyle = BS_SOLID; + logbrush.lbColor = RGB(1,2,3); + logbrush.lbHatch = 0; + hPen = ExtCreatePen(PS_GEOMETRIC | PS_SOLID, 5, &logbrush, 0, NULL); + + TEST(GDI_HANDLE_GET_TYPE(hPen) == GDI_OBJECT_TYPE_EXTPEN); + TEST(GetObject((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0); + TEST(GetObject(hPen, sizeof(EXTLOGPEN), NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD)); + TEST(GetObject(hPen, 0, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD)); + TEST(GetObject((HANDLE)GDI_HANDLE_GET_INDEX(hPen), 0, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD)); + TEST(GetObject(hPen, 5, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD)); + TEST(GetObject(hPen, -5, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD)); + TEST(GetObject(hPen, 0, &extlogpen) == 0); + TEST(GetObject(hPen, 4, &extlogpen) == 0); + + /* Nothing should be filled */ + TEST(extlogpen.elpPenStyle == 0x77777777); + TEST(extlogpen.elpWidth == 0x77777777); + + TEST(GetObject(hPen, sizeof(EXTLOGPEN), &extlogpen) == sizeof(EXTLOGPEN)-sizeof(DWORD)); + TEST(GetObject(hPen, sizeof(EXTLOGPEN)+2, &extlogpen) == sizeof(EXTLOGPEN)-sizeof(DWORD)); + TEST(GetObject(hPen, -5, &extlogpen) == sizeof(EXTLOGPEN)-sizeof(DWORD)); + + /* test if the fields are filled correctly */ + TEST(extlogpen.elpPenStyle == PS_GEOMETRIC); + TEST(extlogpen.elpWidth == 5); + TEST(extlogpen.elpBrushStyle == 0); + TEST(extlogpen.elpColor == RGB(1,2,3)); + TEST(extlogpen.elpHatch == 0); + TEST(extlogpen.elpNumEntries == 0); + DeleteObject(hPen); + return TRUE; +} + +BOOL Test_Font(INT* passed, INT* failed) +{ + HFONT hFont; + LOGFONTA logfonta; + LOGFONTW logfontw; + EXTLOGFONTA extlogfonta; + EXTLOGFONTW extlogfontw; + ENUMLOGFONTEXA enumlogfontexa; + ENUMLOGFONTEXW enumlogfontexw; + ENUMLOGFONTEXDVA enumlogfontexdva; + ENUMLOGFONTEXDVW enumlogfontexdvw; + ENUMLOGFONTA enumlogfonta; + ENUMLOGFONTW enumlogfontw; + BYTE bData[270]; + + FillMemory(&logfonta, sizeof(LOGFONTA), 0x77); + hFont = CreateFont(8, 8, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, + ANSI_CHARSET, OUT_CHARACTER_PRECIS, CLIP_CHARACTER_PRECIS, + ANTIALIASED_QUALITY, DEFAULT_PITCH, "testfont"); + TEST(hFont); + + SetLastError(ERROR_SUCCESS); + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, 0, NULL) == sizeof(LOGFONTA)); + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, 0, NULL) == sizeof(LOGFONTW)); + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(LOGFONTA), NULL) == sizeof(LOGFONTA)); // 60 + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTA), NULL) == sizeof(LOGFONTA)); // 156 + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXA), NULL) == sizeof(LOGFONTA)); // 188 + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(EXTLOGFONTA), NULL) == sizeof(LOGFONTA)); // 192 + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVA), NULL) == sizeof(LOGFONTA)); // 260 + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVA)+1, NULL) == sizeof(LOGFONTA)); // 260 + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW)); // 92 + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTW), NULL) == sizeof(LOGFONTW)); // 284 + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(EXTLOGFONTW), NULL) == sizeof(LOGFONTW)); // 320 + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXW), NULL) == sizeof(LOGFONTW)); // 348 + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW), NULL) == sizeof(LOGFONTW)); // 420 + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW)+1, NULL) == sizeof(LOGFONTW)); // 356! + + TEST(GetObjectA(hFont, sizeof(LOGFONTA), NULL) == sizeof(LOGFONTA)); + TEST(GetObjectA(hFont, 0, NULL) == sizeof(LOGFONTA)); + TEST(GetObjectA(hFont, 5, NULL) == sizeof(LOGFONTA)); + TEST(GetObjectA(hFont, -5, NULL) == sizeof(LOGFONTA)); + TEST(GetObjectA(hFont, 0, &logfonta) == 0); + TEST(logfonta.lfHeight == 0x77777777); + + TEST(GetObjectA(hFont, 5, &logfonta) == 5); + TEST(logfonta.lfHeight == 8); + TEST(logfonta.lfWidth == 0x77777708); + + TEST(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA)); // 60 + TEST(GetObjectA(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTA)); // 92 + TEST(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA)); // 192 + TEST(GetObjectA(hFont, sizeof(EXTLOGFONTA)+1, &extlogfonta) == sizeof(EXTLOGFONTA)+1); // 192 + TEST(GetObjectA(hFont, sizeof(EXTLOGFONTW), &extlogfontw) == sizeof(ENUMLOGFONTEXDVA)); // 320 + + TEST(GetObjectA(hFont, 261, &bData) == 260); // no + + /* LOGFONT / GetObjectW */ + FillMemory(&logfontw, sizeof(LOGFONTW), 0x77); + + TEST(GetObjectW(hFont, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW)); + TEST(GetObjectW(hFont, 0, NULL) == sizeof(LOGFONTW)); + TEST(GetObjectW(hFont, 5, NULL) == sizeof(LOGFONTW)); + TEST(GetObjectW(hFont, -5, NULL) == sizeof(LOGFONTW)); + TEST(GetObjectW(hFont, 0, &logfontw) == 0); + TEST(logfontw.lfHeight == 0x77777777); + + TEST(GetObjectW(hFont, 5, &logfontw) == 5); + TEST(logfontw.lfHeight == 8); + TEST(logfontw.lfWidth == 0x77777708); + + TEST(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA)); // 60 + TEST(logfonta.lfHeight == 8); + TEST(GetObjectA(hFont, sizeof(ENUMLOGFONTA), &enumlogfonta) == sizeof(ENUMLOGFONTA)); // 156 + TEST(GetObjectA(hFont, sizeof(ENUMLOGFONTEXA), &enumlogfontexa) == sizeof(ENUMLOGFONTEXA)); // 188 + TEST(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA)); // 192 + TEST(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA), &enumlogfontexdva) == sizeof(ENUMLOGFONTEXDVA)); // 260 + TEST(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA)+1, &enumlogfontexdva) == sizeof(ENUMLOGFONTEXDVA)); // 260 + + TEST(GetObjectW(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTW)); // 92 + TEST(GetObjectW(hFont, sizeof(ENUMLOGFONTW), &enumlogfontw) == sizeof(ENUMLOGFONTW)); // 284 + TEST(GetObjectW(hFont, sizeof(EXTLOGFONTW), &extlogfontw) == sizeof(EXTLOGFONTW)); // 320 + TEST(GetObjectW(hFont, sizeof(ENUMLOGFONTEXW), &enumlogfontexw) == sizeof(ENUMLOGFONTEXW)); // 348 + TEST(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW), &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD)); // 420 + TEST(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW)+1, &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD)); // 356! + + TEST(GetObjectW(hFont, 356, &bData) == 356); + TEST(GetLastError() == ERROR_SUCCESS); + + DeleteObject(hFont); + + return TRUE; +} + +BOOL Test_Colorspace(INT* passed, INT* failed) +{ + SetLastError(ERROR_SUCCESS); + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL) == 60);// FIXME: what structure? + TEST(GetLastError() == ERROR_INSUFFICIENT_BUFFER); + SetLastError(ERROR_SUCCESS); + TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL) == 0); + TEST(GetLastError() == ERROR_INSUFFICIENT_BUFFER); + + return TRUE; +} + +BOOL Test_MetaDC(INT* passed, INT* failed) +{ + /* Windows does not SetLastError() on a metadc, but it doesn't seem to do anything with it */ + HDC hMetaDC; + BYTE buffer[100]; + + hMetaDC = CreateMetaFile(NULL); + if(!hMetaDC) return FALSE; + if(((UINT)hMetaDC & GDI_HANDLE_TYPE_MASK) != GDI_OBJECT_TYPE_METADC) return FALSE; + + SetLastError(ERROR_SUCCESS); + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 0, NULL) == 0); + TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 100, &buffer) == 0); + TEST(GetObjectA(hMetaDC, 0, NULL) == 0); + TEST(GetObjectA(hMetaDC, 100, &buffer) == 0); + TEST(GetLastError() == ERROR_SUCCESS); + return TRUE; +} + +BOOL Test_GetObject(INT* passed, INT* failed) +{ + + HRGN hRgn; + hRgn = CreateRectRgn(0,0,5,5); + SetLastError(ERROR_SUCCESS); + TEST(GetObjectW(hRgn, 0, NULL) == 0); + TEST(GetLastError() == ERROR_INVALID_HANDLE); + DeleteObject(hRgn); + + Test_Font(passed, failed); + Test_Colorspace(passed, failed); + Test_General(passed, failed); + Test_Bitmap(passed, failed); + Test_Dibsection(passed, failed); + Test_Palette(passed, failed); + Test_Brush(passed, failed); + Test_Pen(passed, failed); +// Test_ExtPpen(passed, failed); // not implemented yet in ROS + Test_MetaDC(passed, failed); + + return TRUE; +} Added: trunk/rostests/win32/gdi32/tests/GetStockObject.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/tests/GetStoc…
============================================================================== --- trunk/rostests/win32/gdi32/tests/GetStockObject.c (added) +++ trunk/rostests/win32/gdi32/tests/GetStockObject.c Sun Apr 29 05:43:41 2007 @@ -1,0 +1,26 @@ +#include "..\gditest.h" + +BOOL Test_GetStockObject(INT* passed, INT* failed) +{ + /* Test limits and error */ + SetLastError(ERROR_SUCCESS); + TEST(GetStockObject(0) != NULL); + TEST(GetStockObject(21) != NULL); + TEST(GetStockObject(-1) == NULL); + TEST(GetStockObject(9) == NULL); + TEST(GetStockObject(22) == NULL); + TEST(GetLastError() == ERROR_SUCCESS); + + /* Test for the stock bit */ + TEST((UINT)GetStockObject(WHITE_BRUSH) && GDI_HANDLE_STOCK_MASK); + + /* Test for correct types */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_PEN)) == GDI_OBJECT_TYPE_PEN); + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_PEN)) == GDI_OBJECT_TYPE_PEN); + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(ANSI_VAR_FONT)) == GDI_OBJECT_TYPE_FONT); + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEFAULT_PALETTE)) == GDI_OBJECT_TYPE_PALETTE); + + return TRUE; +} Added: trunk/rostests/win32/gdi32/tests/SelectObject.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/tests/SelectO…
============================================================================== --- trunk/rostests/win32/gdi32/tests/SelectObject.c (added) +++ trunk/rostests/win32/gdi32/tests/SelectObject.c Sun Apr 29 05:43:41 2007 @@ -1,0 +1,7 @@ +#include "..\gditest.h" + +BOOL Test_SelectObject(INT* passed, INT* failed) +{ + return TRUE; +} + Added: trunk/rostests/win32/gdi32/tests/SetDCPenColor.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/tests/SetDCPe…
============================================================================== --- trunk/rostests/win32/gdi32/tests/SetDCPenColor.c (added) +++ trunk/rostests/win32/gdi32/tests/SetDCPenColor.c Sun Apr 29 05:43:41 2007 @@ -1,0 +1,42 @@ +#include "..\gditest.h" + +BOOL Test_SetDCPenColor(INT* passed, INT* failed) +{ + HDC hScreenDC, hDC; + + // Test an incorrect DC + TEST(SetDCPenColor(0, RGB(0,0,0)) == CLR_INVALID); + + // Get the Screen DC + hScreenDC = GetDC(NULL); + if (hScreenDC == NULL) return FALSE; + + // Test the screen DC + SetDCPenColor(hScreenDC, RGB(1,2,3)); + TEST(SetDCPenColor(hScreenDC, RGB(4,5,6)) == RGB(1,2,3)); + + // Create a new DC + hDC = CreateCompatibleDC(hScreenDC); + ReleaseDC(0, hScreenDC); + if (hDC == NULL) + { + return FALSE; + } + + // Select the DC_PEN and check if the pen returned by a new call is DC_PEN + SelectObject(hDC, GetStockObject(DC_PEN)); + TEST(SelectObject(hDC, GetStockObject(BLACK_PEN)) == GetStockObject(DC_PEN)); + + // Test an incorrect color, yes windows sets the color! + SetDCPenColor(hDC, 0x21123456); + TEST(SetDCPenColor(hDC, RGB(0,0,0)) == 0x21123456); + + // Test CLR_INVALID, it sets CLR_INVALID! + SetDCPenColor(hDC, CLR_INVALID); + TEST(SetDCPenColor(hDC, RGB(0,0,0)) == CLR_INVALID); + + // Delete the DC + DeleteDC(hDC); + + return TRUE; +} Added: trunk/rostests/win32/gdi32/tests/SetSysColors.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/tests/SetSysC…
============================================================================== --- trunk/rostests/win32/gdi32/tests/SetSysColors.c (added) +++ trunk/rostests/win32/gdi32/tests/SetSysColors.c Sun Apr 29 05:43:41 2007 @@ -1,0 +1,32 @@ +#include "..\gditest.h" + +#define NUM_SYSCOLORS 31 + +BOOL Test_SetSysColors(INT* passed, INT* failed) +{ + INT i; + INT nElements[NUM_SYSCOLORS]; + COLORREF crOldColors[NUM_SYSCOLORS]; + COLORREF crColors[3] = {RGB(212, 208, 200),2,3}; + +return TRUE; // This is because codeblocks doesn't like changing syscolors ;-( + + /* First save the Old colors */ + for (i = 0; i < NUM_SYSCOLORS; i++) + { + nElements[i] = i; + crOldColors[i] = GetSysColor(i); + } + + TEST((UINT)SetSysColors(0, nElements, crColors) == 1); + TEST((UINT)SetSysColors(1, nElements, crColors) == 1); + TEST((UINT)SetSysColors(2, nElements, crColors) == 1); + + /* try more than NUM_SYSCOLORS */ + TEST((UINT)SetSysColors(55, nElements, crColors) == 1); + + /* restore old SysColors */ + SetSysColors(NUM_SYSCOLORS, nElements, crOldColors); + + return TRUE; +} Modified: trunk/rostests/win32/testsets.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/testsets.rbuild?rev…
============================================================================== --- trunk/rostests/win32/testsets.rbuild (original) +++ trunk/rostests/win32/testsets.rbuild Sun Apr 29 05:43:41 2007 @@ -3,6 +3,9 @@ <group> <directory name="cmd"> <xi:include href="cmd/cmd_test.rbuild" /> +</directory> +<directory name="gdi32"> + <xi:include href="gdi32/gdi32_test.rbuild" /> </directory> <directory name="kernel32"> <xi:include href="kernel32/directory.rbuild" />
17 years, 9 months
1
0
0
0
[tkreuzer] 26559: winetsts build fix - add needed #includes to test.h - add windef.h including psdk/windef.h
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Apr 28 12:58:18 2007 New Revision: 26559 URL:
http://svn.reactos.org/svn/reactos?rev=26559&view=rev
Log: winetsts build fix - add needed #includes to test.h - add windef.h including psdk/windef.h Added: trunk/reactos/include/reactos/wine/windef.h Modified: trunk/reactos/include/reactos/wine/test.h Modified: trunk/reactos/include/reactos/wine/test.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/test.…
============================================================================== --- trunk/reactos/include/reactos/wine/test.h (original) +++ trunk/reactos/include/reactos/wine/test.h Sat Apr 28 12:58:18 2007 @@ -25,6 +25,8 @@ #include <stdlib.h> #include <windef.h> #include <winbase.h> +#include <wingdi.h> +#include <winreg.h> #ifdef __WINE_WINE_LIBRARY_H #error wine/library.h should not be used in Wine tests Added: trunk/reactos/include/reactos/wine/windef.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/winde…
============================================================================== --- trunk/reactos/include/reactos/wine/windef.h (added) +++ trunk/reactos/include/reactos/wine/windef.h Sat Apr 28 12:58:18 2007 @@ -1,0 +1,3 @@ +#include "../../psdk/windef.h" + +
17 years, 9 months
2
1
0
0
[jimtabor] 26568: Now we can turn on GdiReleaseDC.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sun Apr 29 03:46:30 2007 New Revision: 26568 URL:
http://svn.reactos.org/svn/reactos?rev=26568&view=rev
Log: Now we can turn on GdiReleaseDC. Modified: trunk/reactos/dll/win32/user32/windows/dc.c Modified: trunk/reactos/dll/win32/user32/windows/dc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/d…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/dc.c (original) +++ trunk/reactos/dll/win32/user32/windows/dc.c Sun Apr 29 03:46:30 2007 @@ -88,8 +88,7 @@ if (!hDC) return FALSE; // Null hDC return zero. - // FIXME: Uncomment once GdiReleaseDC() is implemented - //GdiReleaseDC ( hDC ); // Release locals. + GdiReleaseDC ( hDC ); // Release locals. // Win 3.1 throw back, hWnd should be ignored and not used. // Replace with NtUserCallOneParam ((DWORD) hDC, ONEPARAM_ROUTINE_RELEASEDC); return NtUserReleaseDC(hWnd, hDC);
17 years, 9 months
1
0
0
0
[jimtabor] 26567: Fix compile.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sun Apr 29 03:42:38 2007 New Revision: 26567 URL:
http://svn.reactos.org/svn/reactos?rev=26567&view=rev
Log: Fix compile. Modified: trunk/reactos/dll/win32/gdi32/misc/misc.c Modified: trunk/reactos/dll/win32/gdi32/misc/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/misc.…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/misc.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/misc.c Sun Apr 29 03:42:38 2007 @@ -128,9 +128,8 @@ */ BOOL STDCALL -GdiReleaseDC(HDC hdc) +GdiReleaseLocalDC(HDC hdc) { - GdiReleaseLocalDC(hdc); return 0; } @@ -140,9 +139,9 @@ */ BOOL STDCALL -GdiReleaseLocalDC(HDC hdc) +GdiReleaseDC(HDC hdc) { + GdiReleaseLocalDC(hdc); return 0; } -
17 years, 9 months
1
0
0
0
[jimtabor] 26566: Allow for the deallocation of the local DC structure once the new create I and DC are ready.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sun Apr 29 03:40:51 2007 New Revision: 26566 URL:
http://svn.reactos.org/svn/reactos?rev=26566&view=rev
Log: Allow for the deallocation of the local DC structure once the new create I and DC are ready. Modified: trunk/reactos/dll/win32/gdi32/misc/misc.c trunk/reactos/dll/win32/gdi32/misc/stubs.c Modified: trunk/reactos/dll/win32/gdi32/misc/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/misc.…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/misc.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/misc.c Sun Apr 29 03:40:51 2007 @@ -123,3 +123,26 @@ } +/* + * @unimplemented + */ +BOOL +STDCALL +GdiReleaseDC(HDC hdc) +{ + GdiReleaseLocalDC(hdc); + return 0; +} + + +/* + * @unimplemented + */ +BOOL +STDCALL +GdiReleaseLocalDC(HDC hdc) +{ + return 0; +} + + Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c Sun Apr 29 03:40:51 2007 @@ -1774,30 +1774,6 @@ BOOL STDCALL GdiIsPlayMetafileDC(HDC hdc) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - -/* - * @unimplemented - */ -BOOL -STDCALL -GdiReleaseDC(HDC hdc) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - -/* - * @unimplemented - */ -BOOL -STDCALL -GdiReleaseLocalDC(HDC hdc) { UNIMPLEMENTED; SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
17 years, 9 months
1
0
0
0
[tkreuzer] 26565: BRUSH_GetObject: - return sizeof(LOBRUSH) not BRUSHOBJ - don't return 0 on too small usermode buffer NtGdiExtGetObjectW: - remove unnecessary hacks - no need to align usermode buffer to words - add ENUMLOGFONTEXDVW, wich should be the biggest structure needed more fixes for fonts and extpens needed in the corresponding subfunctions, but all of my other tests pass now.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Apr 29 01:53:06 2007 New Revision: 26565 URL:
http://svn.reactos.org/svn/reactos?rev=26565&view=rev
Log: BRUSH_GetObject: - return sizeof(LOBRUSH) not BRUSHOBJ - don't return 0 on too small usermode buffer NtGdiExtGetObjectW: - remove unnecessary hacks - no need to align usermode buffer to words - add ENUMLOGFONTEXDVW, wich should be the biggest structure needed more fixes for fonts and extpens needed in the corresponding subfunctions, but all of my other tests pass now. Modified: trunk/reactos/subsystems/win32/win32k/objects/brush.c trunk/reactos/subsystems/win32/win32k/objects/dc.c Modified: trunk/reactos/subsystems/win32/win32k/objects/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/brush.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/brush.c Sun Apr 29 01:53:06 2007 @@ -52,9 +52,8 @@ INT FASTCALL BRUSH_GetObject (PGDIBRUSHOBJ BrushObject, INT Count, LPLOGBRUSH Buffer) { - if( Buffer == NULL ) return sizeof(BRUSHOBJ); + if( Buffer == NULL ) return sizeof(LOGBRUSH); if (Count == 0) return 0; - if ((UINT)Count < sizeof(BRUSHOBJ)) return 0; /* Set colour */ Buffer->lbColor = BrushObject->BrushAttr.lbColor; @@ -106,7 +105,7 @@ */ /* FIXME */ - return sizeof(BRUSHOBJ); + return sizeof(LOGBRUSH); } Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Sun Apr 29 01:53:06 2007 @@ -1817,92 +1817,44 @@ OUT LPVOID lpBuffer) { INT iRetCount = 0; - INT iObjectType; - INT cbRealCount = cbCount; + INT cbCopyCount; union { - BITMAP bmpObject; - DIBSECTION disObject; - LOGPEN lgpObject; - LOGBRUSH lgbObject; - LOGFONTW lgfObject; - EXTLOGFONTW elgfObject; + BITMAP bitmap; + DIBSECTION dibsection; + LOGPEN logpen; + LOGBRUSH logbrush; + LOGFONTW logfontw; + EXTLOGFONTW extlogfontw; + ENUMLOGFONTEXDVW enumlogfontexdvw; } Object; - // - // Get the object type - // - iObjectType = GDIOBJ_GetObjectType(hGdiObj); - - // - // Check if the given size is too large - // - if (cbCount > sizeof(Object)) - { - // - // Normalize to the largest supported object size - // - DPRINT1("cbCount too big!\n"); - cbCount = sizeof(Object); - } - - // - // Check if this is a brush - // - if (iObjectType == GDI_OBJECT_TYPE_BRUSH) - { - // - // Windows GDI Hack: Manually correct the size - // - cbCount = sizeof(LOGBRUSH); - } - - // + // Normalize to the largest supported object size + cbCount = min((UINT)cbCount, sizeof(Object)); + // Now do the actual call - // iRetCount = IntGdiGetObject(hGdiObj, cbCount, lpBuffer ? &Object : NULL); - - // - // Check if this is a brush - // - if (iObjectType == GDI_OBJECT_TYPE_BRUSH) - { - // - // Fixup the size to account for our previous fixup - // - cbCount = min(cbCount, cbRealCount); - } - - // - // Make sure we have a buffer and a return size - // - if ((iRetCount) && (lpBuffer)) - { - // + cbCopyCount = min((UINT)cbCount, (UINT)iRetCount); + + // Make sure we have a buffer and a copy size + if ((cbCopyCount) && (lpBuffer)) + { // Enter SEH for buffer transfer - // _SEH_TRY { - // // Probe the buffer and copy it - // - ProbeForWrite(lpBuffer, min(cbCount, cbRealCount), sizeof(WORD)); - RtlCopyMemory(lpBuffer, &Object, min(cbCount, cbRealCount)); + ProbeForWrite(lpBuffer, cbCopyCount, 1); + RtlCopyMemory(lpBuffer, &Object, cbCopyCount); } _SEH_HANDLE { - // // Clear the return value. // Do *NOT* set last error here! - // iRetCount = 0; } _SEH_END; } - - // // Return the count - // return iRetCount; }
17 years, 9 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
38
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Results per page:
10
25
50
100
200