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
June 2007
----- 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
21 participants
420 discussions
Start a n
N
ew thread
[arty] 27217: - Some random imports from ntoskrnl (ndis header, bugcodes) - Lean out ntoskrnl entry point to make it more like the new style in trunk - Implement loading by imports in freeldr and move import resolution there - Fix ppcmmu BAT snooping - We'll remove our serial debug hack in KiSystemService once we verify kdcom/kd serial works
by arty@svn.reactos.org
Author: arty Date: Mon Jun 18 01:18:25 2007 New Revision: 27217 URL:
http://svn.reactos.org/svn/reactos?rev=27217&view=rev
Log: - Some random imports from ntoskrnl (ndis header, bugcodes) - Lean out ntoskrnl entry point to make it more like the new style in trunk - Implement loading by imports in freeldr and move import resolution there - Fix ppcmmu BAT snooping - We'll remove our serial debug hack in KiSystemService once we verify kdcom/kd serial works Modified: branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c branches/powerpc/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild branches/powerpc/reactos/boot/freeldr/freeldr/reactos/reactos.c branches/powerpc/reactos/include/ddk/ndis.h branches/powerpc/reactos/include/reactos/bugcodes.h branches/powerpc/reactos/include/reactos/buildno.h branches/powerpc/reactos/include/reactos/errcodes.h branches/powerpc/reactos/include/reactos/ppcmmu/mmu.h branches/powerpc/reactos/ntoskrnl/bugcodes.rc branches/powerpc/reactos/ntoskrnl/include/internal/ntoskrnl.h branches/powerpc/reactos/ntoskrnl/ke/freeldr.c branches/powerpc/reactos/ntoskrnl/ke/powerpc/ppc_irq.c branches/powerpc/reactos/ntoskrnl/ntoskrnl.rbuild 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 Mon Jun 18 01:18:25 2007 @@ -30,7 +30,7 @@ #define NDEBUG #include <debug.h> -static PVOID KernelMemory = 0; +PVOID KernelMemory = 0; extern boot_infos_t BootInfo; /* Bits to shift to convert a Virtual Address into an Offset in the Page Table */ @@ -39,20 +39,6 @@ /* Bits to shift to convert a Virtual Address into an Offset in the Page Directory */ #define PDE_SHIFT 22 #define PDE_SHIFT_PAE 18 - - -/* Converts a Relative Address read from the Kernel into a Physical Address */ -ULONG RaToPa(ULONG p) { - return (ULONG)(KernelMemory) + p; -} - -/* Converts a Phsyical Address Pointer into a Page Frame Number */ -#define PaPtrToPfn(p) \ - (((ULONG_PTR)&p) >> PFN_SHIFT) - -/* Converts a Phsyical Address into a Page Frame Number */ -#define PaToPfn(p) \ - ((p) >> PFN_SHIFT) #define STARTUP_BASE 0xC0000000 #define HYPERSPACE_BASE 0xC0400000 @@ -74,7 +60,7 @@ #define BAT_GRANULARITY (64 * 1024) -#define KernelMemorySize (16 * 1024 * 1024) +#define KernelMemorySize (8 * 1024 * 1024) #define KernelEntryPoint (KernelEntry - KERNEL_BASE_PHYS) + KernelBase #define XROUNDUP(x,n) ((((ULONG)x) + ((n) - 1)) & (~((n) - 1))) @@ -95,6 +81,15 @@ /* Dummy to bring in memmove */ PVOID memmove_dummy = memmove; + +PLOADER_MODULE +NTAPI +LdrGetModuleObject(PCHAR ModuleName); + +NTSTATUS +NTAPI +LdrPEFixupImports(IN PVOID DllBase, + IN PCHAR DllName); /* FUNCTIONS *****************************************************************/ @@ -116,34 +111,6 @@ *--*/ typedef void (*KernelEntryFn)( void * ); - -VOID -DrawDigit(boot_infos_t *BootInfo, ULONG Digit, int x, int y) -{ - int i,j,k; - - for( i = 0; i < 7; i++ ) { - for( j = 0; j < 8; j++ ) { - for( k = 0; k < BootInfo->dispDeviceDepth/8; k++ ) { - SetPhysByte(((ULONG_PTR)BootInfo->dispDeviceBase)+ - k + - (((j+x) * (BootInfo->dispDeviceDepth/8)) + - ((i+y) * (BootInfo->dispDeviceRowBytes))), - BootInfo->dispFont[Digit][i*8+j] == ' ' ? 0 : 255); - } - } - } -} - -VOID -DrawNumber(boot_infos_t *BootInfo, ULONG Number, int x, int y) -{ - int i; - - for( i = 0; i < 8; i++, Number<<=4 ) { - DrawDigit(BootInfo,(Number>>28)&0xf,x+(i*8),y); - } -} int MmuPageMiss(int inst, ppc_trap_frame_t *trap) { @@ -161,24 +128,35 @@ { KernelEntryFn KernelEntryAddress = (KernelEntryFn)(KernelEntry + KernelBase); - ULONG_PTR i, page; + ULONG_PTR i, j, page, count; + PCHAR ModHeader; boot_infos_t *LocalBootInfo = &BootInfo; LocalBootInfo->dispFont = (font_char *)&LocalBootInfo[1]; LoaderBlock.ArchExtra = (ULONG)LocalBootInfo; ppc_map_info_t *info = MmAllocateMemory(0x80 * sizeof(*info)); + for(i = 0; i < LoaderBlock.ModsCount; i++) + { + ModHeader = ((PCHAR)reactos_modules[i].ModStart); + if(ModHeader[0] == 'M' && ModHeader[1] == 'Z') + LdrPEFixupImports + ((PVOID)reactos_modules[i].ModStart, + (PCHAR)reactos_modules[i].String); + } + /* We'll use vsid 1 for freeldr (expendable) */ for(i = 0; i < 8; i++) { MmuAllocVsid(16 + i); - MmuSetVsid(i, i+1, 1); - } + } + MmuSetVsid(0, 8, 1); + /* Vsid 0 is reactos kernel */ for(i = 8; i < 16; i++) { MmuAllocVsid(i); - MmuSetVsid(i, i+1, 0); - } + } + MmuSetVsid(8, 16, 0); MmuSetPageCallback(MmuPageMiss); @@ -197,19 +175,37 @@ MmuMapPage(info, page); /* Map module name strings */ - for( i = 0; i < LoaderBlock.ModsCount; i++ ) + for( count = 0, i = 0; i < LoaderBlock.ModsCount; i++ ) { page = ROUND_DOWN(((ULONG)reactos_modules[i].String), (1<<PFN_SHIFT)); - info[i].flags = MMU_ALL_RW; - info[i].proc = 1; - info[i].addr = page; - info[i].phys = page; // PpcVirt2phys(page, 0); - MmuMapPage(info, 1); - } - - info[i].addr = (ULONG)&LoaderBlock; - info[i].phys = info[i].addr; - MmuMapPage(info, 1); + for( j = 0; j < count; j++ ) + { + if(info[j].addr == page) break; + } + if( j != count ) + { + info[count].flags = MMU_ALL_RW; + info[count].proc = 1; + info[count].addr = page; + info[count].phys = page; // PpcVirt2phys(page, 0); + count++; + } + } + + page = ROUND_DOWN((vaddr_t)&LoaderBlock, (1 << PAGE_SHIFT)); + for( j = 0; j < count; j++ ) + { + if(info[j].addr == page) break; + } + if( j != count ) + { + info[count].flags = MMU_ALL_RW; + info[count].proc = 1; + info[count].addr = page; + info[count].phys = page; // PpcVirt2phys(page, 0); + count++; + } + MmuMapPage(info, count); MmuTurnOn(KernelEntryAddress, (void*)&LoaderBlock); @@ -364,6 +360,16 @@ PCHAR sptr; Elf32_Ehdr ehdr; Elf32_Shdr *shdr; + LPSTR TempName; + + TempName = strrchr(ImageName, '\\'); + if(TempName) TempName++; else TempName = (LPSTR)ImageName; + ModuleData = LdrGetModuleObject(TempName); + + if(ModuleData) + { + return TRUE; + } if(!KernelAddr) KernelAddr = (ULONG)NextModuleBase - (ULONG)KernelMemory + KernelBase; @@ -579,6 +585,11 @@ ModuleData->ModEnd = NextModuleBase; ModuleData->String = (ULONG)MmAllocateMemory(strlen(ImageName)+1); strcpy((PCHAR)ModuleData->String, ImageName); + printf("Module %s (%x-%x) next at %x\n", + ModuleData->String, + ModuleData->ModStart, + ModuleData->ModEnd, + NextModuleBase); LoaderBlock.ModsCount++; /* Return Success */ @@ -627,8 +638,6 @@ LPSTR NameBuffer; LPSTR TempName; - printf("Load module %s at %x\n", ModuleName, (ULONG)NextModuleBase - (ULONG)KernelMemory + KernelBase); - /* Get current module data structure and module name string array */ ModuleData = &reactos_modules[LoaderBlock.ModsCount]; Modified: branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/fr…
============================================================================== --- branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c (original) +++ branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c Mon Jun 18 01:18:25 2007 @@ -34,7 +34,8 @@ BOOLEAN PpcPrepConsKbHit() { - return GetPhysByte(prep_serial+5) & 1; + return 1; + //return GetPhysByte(prep_serial+5) & 1; } int PpcPrepConsGetCh() Modified: branches/powerpc/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/fr…
============================================================================== --- branches/powerpc/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild (original) +++ branches/powerpc/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild Mon Jun 18 01:18:25 2007 @@ -76,6 +76,7 @@ <file>prep_pci.c</file> <file>prep_vga.c</file> <file>mboot.c</file> + <file>loader.c</file> </module> </if> </directory> 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 Mon Jun 18 01:18:25 2007 @@ -35,6 +35,7 @@ unsigned long reactos_disk_count = 0; CHAR szHalName[255]; CHAR szBootPath[255]; +CHAR SystemRoot[255]; static CHAR szLoadingMsg[] = "Loading ReactOS..."; BOOLEAN FrLdrBootType; @@ -199,6 +200,8 @@ CHAR szFileName[256]; ULONG BufferSize; + strcpy(SystemRoot, szSystemRoot); + /* open the codepage key */ rc = RegOpenKey(NULL, L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\CodePage", @@ -300,7 +303,7 @@ return(TRUE); } -static BOOLEAN +BOOLEAN FrLdrLoadDriver(PCHAR szFileName, INT nPos) { @@ -312,6 +315,25 @@ /* Open the Driver */ FilePointer = FsOpenFile(szFileName); + + /* Try under the system root in the main dir and drivers */ + if (FilePointer == NULL) + { + strcpy(value, SystemRoot); + strcat(value, "SYSTEM32\\"); + strcat(value, szFileName); + printf("Trying %s\n", value); + FilePointer = FsOpenFile(value); + } + + if (FilePointer == NULL) + { + strcpy(value, SystemRoot); + strcat(value, "SYSTEM32\\DRIVERS\\"); + strcat(value, szFileName); + printf("Trying %s\n", value); + FilePointer = FsOpenFile(value); + } /* Make sure we did */ if (FilePointer == NULL) { Modified: branches/powerpc/reactos/include/ddk/ndis.h URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/include/ddk/ndi…
============================================================================== --- branches/powerpc/reactos/include/ddk/ndis.h (original) +++ branches/powerpc/reactos/include/ddk/ndis.h Mon Jun 18 01:18:25 2007 @@ -1806,7 +1806,7 @@ VirtualAddress, \ Length) \ { \ - if (VirtualAddress) \ + if (ARGUMENT_PRESENT(VirtualAddress)) \ *((PVOID*)VirtualAddress) = MmGetSystemAddressForMdl(Buffer); \ \ *((PUINT)Length) = MmGetMdlByteCount(Buffer); \ @@ -2022,48 +2022,52 @@ * OUT PNDIS_BUFFER *FirstBuffer OPTIONAL, * OUT PUINT TotalPacketLength OPTIONAL); */ -#define NdisQueryPacket(Packet, \ - PhysicalBufferCount, \ - BufferCount, \ - FirstBuffer, \ - TotalPacketLength) \ -{ \ - if (FirstBuffer) \ - *((PNDIS_BUFFER*)FirstBuffer) = (Packet)->Private.Head; \ - if ((TotalPacketLength) || (BufferCount) || (PhysicalBufferCount)) \ - { \ - if (!(Packet)->Private.ValidCounts) { \ - UINT _Offset; \ - UINT _PacketLength; \ - PNDIS_BUFFER _NdisBuffer; \ - UINT _PhysicalBufferCount = 0; \ - UINT _TotalPacketLength = 0; \ - UINT _Count = 0; \ - \ - for (_NdisBuffer = (Packet)->Private.Head; \ - _NdisBuffer != (PNDIS_BUFFER)NULL; \ - _NdisBuffer = _NdisBuffer->Next) \ - { \ - _PhysicalBufferCount += NDIS_BUFFER_TO_SPAN_PAGES(_NdisBuffer); \ - NdisQueryBufferOffset(_NdisBuffer, &_Offset, &_PacketLength); \ - _TotalPacketLength += _PacketLength; \ - _Count++; \ - } \ - (Packet)->Private.PhysicalCount = _PhysicalBufferCount; \ - (Packet)->Private.TotalLength = _TotalPacketLength; \ - (Packet)->Private.Count = _Count; \ - (Packet)->Private.ValidCounts = TRUE; \ - } \ - \ - if (PhysicalBufferCount) \ - *((PUINT)PhysicalBufferCount) = (Packet)->Private.PhysicalCount; \ - \ - if (BufferCount) \ - *((PUINT)BufferCount) = (Packet)->Private.Count; \ - \ - if (TotalPacketLength) \ - *((PUINT)TotalPacketLength) = (Packet)->Private.TotalLength; \ - } \ +static __inline +VOID +NdisQueryPacket( + IN PNDIS_PACKET Packet, + OUT PUINT PhysicalBufferCount OPTIONAL, + OUT PUINT BufferCount OPTIONAL, + OUT PNDIS_BUFFER *FirstBuffer OPTIONAL, + OUT PUINT TotalPacketLength OPTIONAL) +{ + if (FirstBuffer) + *FirstBuffer = Packet->Private.Head; + if (TotalPacketLength || BufferCount || PhysicalBufferCount) + { + if (!Packet->Private.ValidCounts) + { + UINT Offset; + UINT PacketLength; + PNDIS_BUFFER NdisBuffer; + UINT PhysicalBufferCount = 0; + UINT TotalPacketLength = 0; + UINT Count = 0; + + for (NdisBuffer = Packet->Private.Head; + NdisBuffer != (PNDIS_BUFFER)NULL; + NdisBuffer = NdisBuffer->Next) + { + PhysicalBufferCount += NDIS_BUFFER_TO_SPAN_PAGES(NdisBuffer); + NdisQueryBufferOffset(NdisBuffer, &Offset, &PacketLength); + TotalPacketLength += PacketLength; + Count++; + } + Packet->Private.PhysicalCount = PhysicalBufferCount; + Packet->Private.TotalLength = TotalPacketLength; + Packet->Private.Count = Count; + Packet->Private.ValidCounts = TRUE; + } + + if (PhysicalBufferCount) + *PhysicalBufferCount = Packet->Private.PhysicalCount; + + if (BufferCount) + *BufferCount = Packet->Private.Count; + + if (TotalPacketLength) + *TotalPacketLength = Packet->Private.TotalLength; + } } /* @@ -2281,7 +2285,7 @@ #endif -#if defined(_M_IX86) || defined(_M_AMD64) +#if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_PPC) /* * VOID @@ -2305,17 +2309,17 @@ #else #define NdisMoveMappedMemory(Destination, Source, Length) \ -{ \ - PUCHAR _Dest = Destination, _Src = Source, _End = _Dest + Length; \ - while (_Dest < _End) \ - *_Dest++ = _Src++; \ +{ + PUCHAR _Dest = Destination, _Src = Source, _End = _Dest + Length; + while (_Dest < _End) + *_Dest++ = _Src++; } #define NdisZeroMappedMemory(Destination, Length) \ -{ \ - PUCHAR _Dest = Destination, _End = _Dest + Length; \ - while (_Dest < _End) \ - *_Dest++ = 0; \ +{ + PUCHAR _Dest = Destination, _End = _Dest + Length; + while (_Dest < _End) + *_Dest++ = 0; } #endif /* _M_IX86 or _M_AMD64 */ @@ -4126,6 +4130,7 @@ KEVENT DpcsCompletedEvent; } NDIS_INTERRUPT, *PNDIS_INTERRUPT; + typedef enum _NDIS_WORK_ITEM_TYPE { NdisWorkItemRequest, NdisWorkItemSend, @@ -4255,19 +4260,19 @@ IN PUCHAR Packet, IN ULONG PacketSize); -typedef VOID DDKFASTAPI +typedef VOID FASTCALL (*NDIS_M_DEQUEUE_WORK_ITEM)( IN PNDIS_MINIPORT_BLOCK Miniport, IN NDIS_WORK_ITEM_TYPE WorkItemType, OUT PVOID *WorkItemContext); -typedef NDIS_STATUS DDKFASTAPI +typedef NDIS_STATUS FASTCALL (*NDIS_M_QUEUE_NEW_WORK_ITEM)( IN PNDIS_MINIPORT_BLOCK Miniport, IN NDIS_WORK_ITEM_TYPE WorkItemType, IN PVOID WorkItemContext); -typedef NDIS_STATUS DDKFASTAPI +typedef NDIS_STATUS FASTCALL (*NDIS_M_QUEUE_WORK_ITEM)( IN PNDIS_MINIPORT_BLOCK Miniport, IN NDIS_WORK_ITEM_TYPE WorkItemType, @@ -4294,7 +4299,7 @@ (*NDIS_M_SEND_RESOURCES_HANDLER)( IN NDIS_HANDLE MiniportAdapterHandle); -typedef BOOLEAN DDKFASTAPI +typedef BOOLEAN FASTCALL (*NDIS_M_START_SENDS)( IN PNDIS_MINIPORT_BLOCK Miniport); Modified: branches/powerpc/reactos/include/reactos/bugcodes.h URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/include/reactos…
============================================================================== --- branches/powerpc/reactos/include/reactos/bugcodes.h (original) +++ branches/powerpc/reactos/include/reactos/bugcodes.h Mon Jun 18 01:18:25 2007 @@ -1,10 +1,10 @@ /* This file is generated with wmc version 0.3.0. Do not edit! */ /* Source : ntoskrnl/ntoskrnl.mc */ /* Cmdline: wmc -i -H include/reactos/bugcodes.h -o ntoskrnl/bugcodes.rc ntoskrnl/ntoskrnl.mc */ -/* Date : Sun Apr 1 07:41:30 2007 */ - -#ifndef __WMCGENERATED_460f622a_H -#define __WMCGENERATED_460f622a_H +/* Date : Wed Jun 13 06:44:39 2007 */ + +#ifndef __WMCGENERATED_466f9257_H +#define __WMCGENERATED_466f9257_H /* Severity codes */ #define STATUS_SEVERITY_ERROR 0x3 @@ -550,6 +550,22 @@ /* Approx. msg: The BIOS in this system is not fully ACPI compliant. Please contact your */ #define ACPI_BIOS_ERROR ((ULONG)0x000000a5L) +/* MessageId : 0x400000a8 */ +/* Approx. msg: The system is booting in safemode - Minimal Services */ +#define BOOTING_IN_SAFEMODE_MINIMAL ((ULONG)0x400000a8L) + +/* MessageId : 0x400000a9 */ +/* Approx. msg: The system is booting in safemode - Minimal Services with Network */ +#define BOOTING_IN_SAFEMODE_NETWORK ((ULONG)0x400000a9L) + +/* MessageId : 0x400000aa */ +/* Approx. msg: The system is booting in safemode - Directory Services Repair */ +#define BOOTING_IN_SAFEMODE_DSREPAIR ((ULONG)0x400000aaL) + +/* MessageId : 0x400000b7 */ +/* Approx. msg: Boot Logging Enabled */ +#define BOOTLOG_ENABLED ((ULONG)0x400000b7L) + /* MessageId : 0x000000be */ /* Approx. msg: ATTEMPTED_WRITE_TO_READONLY_MEMORY */ #define ATTEMPTED_WRITE_TO_READONLY_MEMORY ((ULONG)0x000000beL) @@ -635,7 +651,7 @@ #define WINDOWS_NT_INFO_STRING ((ULONG)0x40000088L) /* MessageId : 0x40000089 */ -/* Approx. msg: MulitProcessor Kernel */ +/* Approx. msg: MultiProcessor Kernel */ #define WINDOWS_NT_MP_STRING ((ULONG)0x40000089L) /* MessageId : 0x4000009d */ Modified: branches/powerpc/reactos/include/reactos/buildno.h URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/include/reactos…
============================================================================== --- branches/powerpc/reactos/include/reactos/buildno.h (original) +++ branches/powerpc/reactos/include/reactos/buildno.h Mon Jun 18 01:18:25 2007 @@ -1,9 +1,9 @@ /* Do not edit - Machine generated */ #ifndef _INC_REACTOS_BUILDNO #define _INC_REACTOS_BUILDNO -#define KERNEL_VERSION_BUILD 20070523 -#define KERNEL_VERSION_BUILD_STR "20070523-rUNKNOWN" -#define KERNEL_VERSION_BUILD_RC "20070523-rUNKNOWN\0" +#define KERNEL_VERSION_BUILD 20070613 +#define KERNEL_VERSION_BUILD_STR "20070613-rUNKNOWN" +#define KERNEL_VERSION_BUILD_RC "20070613-rUNKNOWN\0" #define KERNEL_RELEASE_RC "0.4-SVN\0" #define KERNEL_RELEASE_STR "0.4-SVN" #define KERNEL_VERSION_RC "0.4-SVN\0" Modified: branches/powerpc/reactos/include/reactos/errcodes.h URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/include/reactos…
============================================================================== --- branches/powerpc/reactos/include/reactos/errcodes.h (original) +++ branches/powerpc/reactos/include/reactos/errcodes.h Mon Jun 18 01:18:25 2007 @@ -1,10 +1,10 @@ /* This file is generated with wmc version 0.3.0. Do not edit! */ /* Source : dll/win32/kernel32/kernel32.mc */ /* Cmdline: wmc -i -U -H include/reactos/errcodes.h -o dll/win32/kernel32/errcodes.rc dll/win32/kernel32/kernel32.mc */ -/* Date : Wed May 23 04:08:35 2007 */ - -#ifndef __WMCGENERATED_4653be43_H -#define __WMCGENERATED_4653be43_H +/* Date : Wed Jun 13 06:13:07 2007 */ + +#ifndef __WMCGENERATED_466f8af3_H +#define __WMCGENERATED_466f8af3_H /* Severity codes */ #define STATUS_SEVERITY_ERROR 0x3 Modified: branches/powerpc/reactos/include/reactos/ppcmmu/mmu.h URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/include/reactos…
============================================================================== --- branches/powerpc/reactos/include/reactos/ppcmmu/mmu.h (original) +++ branches/powerpc/reactos/include/reactos/ppcmmu/mmu.h Mon Jun 18 01:18:25 2007 @@ -96,15 +96,14 @@ int (*mmumain)(int action, void *arg1, void *arg2, void *arg3) = (void *)MMUCODE; __asm__("bl 1f\n\t" "\n1:\n\t" - "mflr 0\n\t" - "stw 0,0(%0)" : : "r" (&pc)); + "mflr %0\n\t" : "=r" (pc)); for(i = 0, gotbat = 0; i < 4 && gotbat < 2; i++) { GetBat(i, 1, &batu, &batl); - if(batu & 0x3fc) + if(batu & 0xffc) { - mask = ~(0x1ffff | ((batu & 0x3fc)>>2)<<17); + mask = ~(0x1ffff | ((batu & 0xffc)>>2)<<17); if(!(batu & 2) || ((batu & mask) != (pc & mask))) usebat[gotbat++] = i; } else { Modified: branches/powerpc/reactos/ntoskrnl/bugcodes.rc URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/ntoskrnl/bugcod…
============================================================================== --- branches/powerpc/reactos/ntoskrnl/bugcodes.rc (original) +++ branches/powerpc/reactos/ntoskrnl/bugcodes.rc Mon Jun 18 01:18:25 2007 @@ -1,40 +1,46 @@ /* This file is generated with wmc version 0.3.0. Do not edit! */ /* Source : ntoskrnl/ntoskrnl.mc */ /* Cmdline: wmc -i -H include/reactos/bugcodes.h -o ntoskrnl/bugcodes.rc ntoskrnl/ntoskrnl.mc */ -/* Date : Wed May 23 04:08:35 2007 */ +/* Date : Wed Jun 13 06:44:39 2007 */ 1 MESSAGETABLE LANGUAGE 0x9, 0x1 { - /* NBlocks */ 0x0000001bL, - /* Lo,Hi,Offs */ 0x00000000L, 0x00000039L, 0x00000148L, - /* Lo,Hi,Offs */ 0x0000003eL, 0x00000042L, 0x00000c74L, - /* Lo,Hi,Offs */ 0x00000044L, 0x00000045L, 0x00000e04L, - /* Lo,Hi,Offs */ 0x00000048L, 0x00000059L, 0x00000e4cL, - /* Lo,Hi,Offs */ 0x0000005cL, 0x0000007bL, 0x00001060L, - /* Lo,Hi,Offs */ 0x0000007dL, 0x00000080L, 0x00001588L, - /* Lo,Hi,Offs */ 0x0000008eL, 0x0000008eL, 0x000017acL, - /* Lo,Hi,Offs */ 0x00000094L, 0x00000094L, 0x000017c8L, - /* Lo,Hi,Offs */ 0x00000096L, 0x00000096L, 0x000017ecL, - /* Lo,Hi,Offs */ 0x000000a5L, 0x000000a5L, 0x0000180cL, - /* Lo,Hi,Offs */ 0x000000beL, 0x000000beL, 0x00001880L, - /* Lo,Hi,Offs */ 0x000000c3L, 0x000000c3L, 0x00001918L, - /* Lo,Hi,Offs */ 0x000000c5L, 0x000000c5L, 0x00001a84L, - /* Lo,Hi,Offs */ 0x000000c8L, 0x000000c8L, 0x00001d04L, - /* Lo,Hi,Offs */ 0x000000cbL, 0x000000cbL, 0x00001df4L, - /* Lo,Hi,Offs */ 0x000000ceL, 0x000000ceL, 0x00001e20L, - /* Lo,Hi,Offs */ 0x000000d0L, 0x000000d1L, 0x00001e5cL, - /* Lo,Hi,Offs */ 0x000000d3L, 0x000000d4L, 0x00001ea0L, - /* Lo,Hi,Offs */ 0x000000d8L, 0x000000d8L, 0x00001f08L, - /* Lo,Hi,Offs */ 0x000000e0L, 0x000000e5L, 0x00001f28L, - /* Lo,Hi,Offs */ 0x000000e9L, 0x000000eaL, 0x0000217cL, - /* Lo,Hi,Offs */ 0x000000efL, 0x000000efL, 0x0000229cL, - /* Lo,Hi,Offs */ 0x000000f4L, 0x000000f4L, 0x000022b8L, - /* Lo,Hi,Offs */ 0x000000faL, 0x000000faL, 0x000022dcL, - /* Lo,Hi,Offs */ 0x000000fcL, 0x000000fcL, 0x00002300L, - /* Lo,Hi,Offs */ 0x4000009aL, 0x4000009fL, 0x0000232cL, - /* Lo,Hi,Offs */ 0x8000007fL, 0x80000083L, 0x000024b8L, + /* NBlocks */ 0x00000021L, + /* Lo,Hi,Offs */ 0x00000000L, 0x00000039L, 0x00000190L, + /* Lo,Hi,Offs */ 0x0000003eL, 0x00000042L, 0x00000cbcL, + /* Lo,Hi,Offs */ 0x00000044L, 0x00000045L, 0x00000e4cL, + /* Lo,Hi,Offs */ 0x00000048L, 0x00000059L, 0x00000e94L, + /* Lo,Hi,Offs */ 0x0000005cL, 0x0000007bL, 0x000010a8L, + /* Lo,Hi,Offs */ 0x0000007dL, 0x00000080L, 0x000015d0L, + /* Lo,Hi,Offs */ 0x0000008eL, 0x00000090L, 0x000017f4L, + /* Lo,Hi,Offs */ 0x00000094L, 0x00000094L, 0x00001850L, + /* Lo,Hi,Offs */ 0x00000096L, 0x00000096L, 0x00001874L, + /* Lo,Hi,Offs */ 0x000000a0L, 0x000000a0L, 0x00001894L, + /* Lo,Hi,Offs */ 0x000000a5L, 0x000000a5L, 0x000018b0L, + /* Lo,Hi,Offs */ 0x000000beL, 0x000000beL, 0x00001924L, + /* Lo,Hi,Offs */ 0x000000c3L, 0x000000c3L, 0x000019bcL, + /* Lo,Hi,Offs */ 0x000000c5L, 0x000000c5L, 0x00001b28L, + /* Lo,Hi,Offs */ 0x000000c8L, 0x000000c8L, 0x00001da8L, + /* Lo,Hi,Offs */ 0x000000cbL, 0x000000cbL, 0x00001e98L, + /* Lo,Hi,Offs */ 0x000000ceL, 0x000000ceL, 0x00001ec4L, + /* Lo,Hi,Offs */ 0x000000d0L, 0x000000d1L, 0x00001f00L, + /* Lo,Hi,Offs */ 0x000000d3L, 0x000000d4L, 0x00001f44L, + /* Lo,Hi,Offs */ 0x000000d8L, 0x000000d8L, 0x00001facL, + /* Lo,Hi,Offs */ 0x000000e0L, 0x000000e5L, 0x00001fccL, + /* Lo,Hi,Offs */ 0x000000e9L, 0x000000eaL, 0x00002220L, + /* Lo,Hi,Offs */ 0x000000efL, 0x000000efL, 0x00002340L, + /* Lo,Hi,Offs */ 0x000000f4L, 0x000000f4L, 0x0000235cL, + /* Lo,Hi,Offs */ 0x000000faL, 0x000000faL, 0x00002380L, + /* Lo,Hi,Offs */ 0x000000fcL, 0x000000fcL, 0x000023a4L, + /* Lo,Hi,Offs */ 0x4000007eL, 0x4000007eL, 0x000023d0L, + /* Lo,Hi,Offs */ 0x40000087L, 0x40000089L, 0x000023fcL, + /* Lo,Hi,Offs */ 0x4000009dL, 0x4000009dL, 0x00002458L, + /* Lo,Hi,Offs */ 0x4000009fL, 0x4000009fL, 0x00002484L, + /* Lo,Hi,Offs */ 0x400000a8L, 0x400000aaL, 0x00002564L, + /* Lo,Hi,Offs */ 0x400000b7L, 0x400000b7L, 0x0000262cL, + /* Lo,Hi,Offs */ 0x8000007fL, 0x80000083L, 0x00002648L, /* Msg 0x00000000 */ 0x0048, 0x0000, "The bug code is undefined. Please use an existing code instead.\n\x00\x00\x00\x00", @@ -424,11 +430,20 @@ /* Msg 0x0000008e */ 0x001c, 0x0000, "SPIN_LOCK_INIT_FAILURE\n\x00", + /* Msg 0x0000008f */ 0x0020, 0x0000, + "PP0_INITIALIZATION_FAILED\n\x00\x00", + + /* Msg 0x00000090 */ 0x0020, 0x0000, + "PP1_INITIALIZATION_FAILED\n\x00\x00", + /* Msg 0x00000094 */ 0x0024, 0x0000, "KERNEL_STACK_LOCKED_AT_EXIT\n\x00\x00\x00\x00", /* Msg 0x00000096 */ 0x0020, 0x0000, "INVALID_WORK_QUEUE_ITEM\n\x00\x00\x00\x00", + + /* Msg 0x000000a0 */ 0x001c, 0x0000, + "INTERNAL_POWER_ERROR\n\x00\x00\x00", /* Msg 0x000000a5 */ 0x0074, 0x0000, "The BIOS in this system is not fully ACPI compliant. Please contact you", @@ -530,19 +545,19 @@ /* Msg 0x000000fc */ 0x002c, 0x0000, "ATTEMPTED_EXECUTE_OF_NOEXECUTE_MEMORY\n\x00\x00", - /* Msg 0x4000009a */ 0x0024, 0x0000, - "ReactOS Version %s (Build %s)\n\x00\x00", - - /* Msg 0x4000009b */ 0x0014, 0x0000, + /* Msg 0x4000007e */ 0x002c, 0x0000, + "ReactOS (R) Version %hs (Build %u%hs)\n\x00\x00", + + /* Msg 0x40000087 */ 0x0014, 0x0000, "Service Pack\n\x00\x00\x00", - /* Msg 0x4000009c */ 0x002c, 0x0000, + /* Msg 0x40000088 */ 0x002c, 0x0000, "%u System Processor [%u MB Memory] %Z\n\x00\x00", - /* Msg 0x4000009d */ 0x001c, 0x0000, - "MulitProcessor Kernel\n\x00\x00", - - /* Msg 0x4000009e */ 0x002c, 0x0000, + /* Msg 0x40000089 */ 0x001c, 0x0000, + "MultiProcessor Kernel\n\x00\x00", + + /* Msg 0x4000009d */ 0x002c, 0x0000, "%u System Processors [%u MB Memory] %Z\n\x00", /* Msg 0x4000009f */ 0x00e0, 0x0000, @@ -550,6 +565,18 @@ "e,\n and you\\n are welcome to change it and/or distribute copies of it ", "under\n certain\\n conditions. There is absolutely no warranty for React", "OS.\\n\n\x00\x00\x00\x00", + + /* Msg 0x400000a8 */ 0x003c, 0x0000, + "The system is booting in safemode - Minimal Services\n\x00\x00\x00", + + /* Msg 0x400000a9 */ 0x0048, 0x0000, + "The system is booting in safemode - Minimal Services with Network\n\x00\x00", + + /* Msg 0x400000aa */ 0x0044, 0x0000, + "The system is booting in safemode - Directory Services Repair\n\x00\x00", + + /* Msg 0x400000b7 */ 0x001c, 0x0000, + "Boot Logging Enabled\n\x00\x00\x00", /* Msg 0x8000007f */ 0x0064, 0x0000, "A problem has been detected and ReactOS has been shut down to prevent da", Modified: branches/powerpc/reactos/ntoskrnl/include/internal/ntoskrnl.h URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/ntoskrnl/includ…
============================================================================== --- branches/powerpc/reactos/ntoskrnl/include/internal/ntoskrnl.h (original) +++ branches/powerpc/reactos/ntoskrnl/include/internal/ntoskrnl.h Mon Jun 18 01:18:25 2007 @@ -17,6 +17,7 @@ #ifdef _NTOSKRNL_ +#define NUM_BOOT_DRIVERS 32 #define KeGetCurrentThread _KeGetCurrentThread #define KeGetPreviousMode _KeGetPreviousMode #undef PsGetCurrentProcess @@ -353,4 +354,12 @@ C_ASSERT(FIELD_OFFSET(KTSS, IoMapBase) == KTSS_IOMAPBASE); #endif +#ifdef _PPC_ +#define SWAPD(x) ((((x)&0xff)<<24)|(((x)&0xff00)<<8)|(((x)>>8)&0xff00)|(((x)>>24)&0xff)) +#define SWAPW(x) ((((x)&0xff)<<8)|(((x)>>8)&0xff)) +#else +#define SWAPD(x) x +#define SWAPW(x) x +#endif + #endif /* INCLUDE_INTERNAL_NTOSKRNL_H */ Modified: branches/powerpc/reactos/ntoskrnl/ke/freeldr.c URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/ntoskrnl/ke/fre…
============================================================================== --- branches/powerpc/reactos/ntoskrnl/ke/freeldr.c (original) +++ branches/powerpc/reactos/ntoskrnl/ke/freeldr.c Mon Jun 18 01:18:25 2007 @@ -17,8 +17,9 @@ /* FreeLDR Module Data */ LOADER_MODULE KeLoaderModules[64]; +LDR_DATA_TABLE_ENTRY ModuleObject[NUM_BOOT_DRIVERS]; ULONG KeLoaderModuleCount; -static CHAR KeLoaderModuleStrings[64][256]; +CHAR KeLoaderModuleStrings[64][256]; /* FreeLDR Memory Data */ ADDRESS_RANGE KeMemoryMap[64]; @@ -32,9 +33,6 @@ ROS_LOADER_PARAMETER_BLOCK KeRosLoaderBlock; static CHAR KeLoaderCommandLine[256]; BOOLEAN AcpiTableDetected; - -/* FreeLDR PE Hack Data */ -extern LDR_DATA_TABLE_ENTRY HalModuleObject; /* NT Loader Data */ LOADER_PARAMETER_BLOCK BldrLoaderBlock; @@ -221,7 +219,7 @@ else if (!(_stricmp(DriverName, "hal.dll"))) { /* The HAL actually gets loaded somewhere else */ - ModStart = HalModuleObject.DllBase; + ModStart = ModuleObject[1].DllBase; /* Create an MD for the HAL */ MdEntry = &BldrMemoryDescriptors[i]; @@ -296,10 +294,6 @@ #endif } -VOID -INIT_FUNCTION -NTAPI -LdrpSettleHal(PVOID NewHalBase); VOID NTAPI KiSetupSyscallHandler(); @@ -314,7 +308,6 @@ ULONG StartKernelBase; ULONG HalBase; ULONG DriverBase; - ULONG DriverSize; PLOADER_PARAMETER_BLOCK NtLoaderBlock; CHAR* s; #ifdef _M_IX86 @@ -406,6 +399,11 @@ strcpy(KeLoaderModuleStrings[i], (PCHAR)KeLoaderModules[i].String); } + DPRINT1("Module %08x-%08x: %s\n", + KeLoaderModules[i].ModStart, + KeLoaderModules[i].ModEnd, + KeLoaderModuleStrings[i]); + #ifdef _M_PPC KeLoaderModules[i].ModStart += KSEG0_BASE - StartKernelBase; KeLoaderModules[i].ModEnd += KSEG0_BASE - StartKernelBase; @@ -429,9 +427,8 @@ /* Choose last module address as the final kernel address */ MmFreeLdrLastKernelAddress = - ROUND_UP(KeLoaderModules[KeRosLoaderBlock.ModsCount - 1].ModEnd, 0x10000); - - /* Select the HAL Base */ + KeLoaderModules[KeRosLoaderBlock.ModsCount - 1].ModEnd; + HalBase = KeLoaderModules[1].ModStart; /* Choose Driver Base */ @@ -442,48 +439,21 @@ LdrHalBase = (ULONG_PTR)DriverBase; #endif + /* Convert the loader block */ + KiRosFrldrLpbToNtLpb(&KeRosLoaderBlock, &NtLoaderBlock); + /* Initialize Module Management */ - LdrInitModuleManagement((PVOID)KeLoaderModules[0].ModStart); - -#ifdef _M_PPC - LdrpSettleHal((PVOID)DriverBase); -#endif - - /* Load HAL.DLL with the PE Loader */ - LdrSafePEProcessModule((PVOID)HalBase, - (PVOID)DriverBase, - (PVOID)KeLoaderModules[0].ModStart, - &DriverSize); - - /* Increase the last kernel address with the size of HAL */ - MmFreeLdrLastKernelAddress += PAGE_ROUND_UP(DriverSize); - -#ifdef _M_IX86 - /* Now select the final beginning and ending Kernel Addresses */ - MmFreeLdrFirstKrnlPhysAddr = KeLoaderModules[0].ModStart - - KSEG0_BASE + 0x200000; - MmFreeLdrLastKrnlPhysAddr = MmFreeLdrLastKernelAddress - - KSEG0_BASE + 0x200000; -#endif + /* LdrInitModuleManagement((PVOID)KeLoaderModules[0].ModStart); */ /* Setup the IDT */ KeInitExceptions(); // ONCE HACK BELOW IS GONE, MOVE TO KISYSTEMSTARTUP! KeInitInterrupts(); // ROS HACK DEPRECATED SOON BY NEW HAL - /* Load the Kernel with the PE Loader */ - LdrSafePEProcessModule((PVOID)KeLoaderModules[0].ModStart, - (PVOID)KeLoaderModules[0].ModStart, - (PVOID)DriverBase, - &DriverSize); - /* Sets up the VDM Data */ #ifdef _M_IX86 NtEarlyInitVdm(); #endif - /* Convert the loader block */ - KiRosFrldrLpbToNtLpb(&KeRosLoaderBlock, &NtLoaderBlock); - /* Do general System Startup */ KiSystemStartup(NtLoaderBlock); } Modified: branches/powerpc/reactos/ntoskrnl/ke/powerpc/ppc_irq.c URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/ntoskrnl/ke/pow…
============================================================================== --- branches/powerpc/reactos/ntoskrnl/ke/powerpc/ppc_irq.c (original) +++ branches/powerpc/reactos/ntoskrnl/ke/powerpc/ppc_irq.c Mon Jun 18 01:18:25 2007 @@ -822,14 +822,13 @@ NTAPI KiSystemService(ppc_trap_frame_t *trap_frame) { - SetPhysByte(0x800003f8, 'S'); - SetPhysByte(0x800003f8, 'C'); - SetPhysByte(0x800003f8, '!'); - SetPhysByte(0x800003f8, '\r'); - SetPhysByte(0x800003f8, '\n'); + int i; switch(trap_frame->gpr[8]) { case 0x10000: /* DebugService */ + for( i = 0; i < trap_frame->gpr[5]; i++ ) + SetPhysByte(0x800003f8, ((PCHAR)trap_frame->gpr[4])[i]); + trap_frame->gpr[3] = KdpServiceDispatcher (trap_frame->gpr[3], (PCHAR)trap_frame->gpr[4], Modified: branches/powerpc/reactos/ntoskrnl/ntoskrnl.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/ntoskrnl/ntoskr…
============================================================================== --- branches/powerpc/reactos/ntoskrnl/ntoskrnl.rbuild (original) +++ branches/powerpc/reactos/ntoskrnl/ntoskrnl.rbuild Mon Jun 18 01:18:25 2007 @@ -251,10 +251,6 @@ <file>kdinit.c</file> <file>kdio.c</file> <file>kdmain.c</file> - </directory> - <directory name="ldr"> - <file>loader.c</file> - <file>rtl.c</file> </directory> <directory name="lpc"> <file>close.c</file>
17 years, 6 months
1
0
0
0
[greatlrd] 27216: GetCaps are complete, not tested in all case but almost all
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun Jun 17 19:19:59 2007 New Revision: 27216 URL:
http://svn.reactos.org/svn/reactos?rev=27216&view=rev
Log: GetCaps are complete, not tested in all case but almost all Added: trunk/reactos/dll/directx/ddraw/Ddraw/GetCaps.c (with props) Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c trunk/reactos/dll/directx/ddraw/ddraw.rbuild Added: trunk/reactos/dll/directx/ddraw/Ddraw/GetCaps.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/Ge…
============================================================================== --- trunk/reactos/dll/directx/ddraw/Ddraw/GetCaps.c (added) +++ trunk/reactos/dll/directx/ddraw/Ddraw/GetCaps.c Sun Jun 17 19:19:59 2007 @@ -1,0 +1,269 @@ +/* $Id$ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS DirectX + * FILE: ddraw/ddraw/ddraw_main.c + * PURPOSE: IDirectDraw7 Implementation + * PROGRAMMER: Magnus Olsen + * + */ + +/* TODO + * lpddNLVHELCaps and lpddNLVCaps + * Thouse two can be null or inviald in lpGBL + * we need add code in startup to detect if we have lpddNLVCaps set + * ms HEL does not support lpddNLVHELCaps shall we do that ? + * ms HEL does not support dwVidMemTotal and dwVidMemFree shall we implement a emulate of them ? + */ + +#include "rosdraw.h" + +#include <string.h> + +/* PSEH for SEH Support */ +#include <pseh/pseh.h> + + +HRESULT WINAPI +Main_DirectDraw_GetCaps( LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps, + LPDDCAPS pHELCaps) +{ + HRESULT retVal = DDERR_INVALIDPARAMS; + LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface; + + DX_WINDBG_trace(); + + _SEH_TRY + { + if ((!pDriverCaps) && (!pHELCaps)) + { + retVal = DDERR_INVALIDPARAMS; + _SEH_LEAVE; + } + + if (pDriverCaps) + { + /* Setup hardware caps */ + DDSCAPS2 ddscaps = { 0 }; + LPDDCORECAPS CoreCaps = (LPDDCORECAPS)&This->lpLcl->lpGbl->ddCaps; + + DWORD dwTotal = 0; + DWORD dwFree = 0; + + Main_DirectDraw_GetAvailableVidMem4(iface, &ddscaps, &dwTotal, &dwFree); + + switch (pDriverCaps->dwSize) + { + case sizeof(DDCAPS_DX1): + { + LPDDCAPS_DX1 myCaps = (LPDDCAPS_DX1) pDriverCaps; + + if (CoreCaps->dwSize == sizeof(DDCORECAPS)) + { + memcpy(myCaps, CoreCaps, sizeof(DDCAPS_DX1)); + } + + myCaps->dwVidMemFree = dwFree; + myCaps->dwVidMemTotal = dwTotal; + myCaps->dwSize = sizeof(DDCAPS_DX1); + + retVal = DD_OK; + } + break; + + case sizeof(DDCAPS_DX3): + { + LPDDCAPS_DX3 myCaps = (LPDDCAPS_DX3) pDriverCaps; + + if (CoreCaps->dwSize == sizeof(DDCORECAPS)) + { + memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCAPS_DX3)); + } + + myCaps->dwVidMemFree = dwFree; + myCaps->dwVidMemTotal = dwTotal; + myCaps->dwSize = sizeof(DDCAPS_DX3); + + retVal = DD_OK; + } + break; + + case sizeof(DDCAPS_DX5): + { + LPDDCAPS_DX5 myCaps = (LPDDCAPS_DX5) pDriverCaps; + + /* FIXME This->lpLcl->lpGbl->lpddNLVCaps are not set in startup.c + if (This->lpLcl->lpGbl->lpddNLVCaps->dwSize == sizeof(DDNONLOCALVIDMEMCAPS)) + { + memcpy(&myCaps->dwNLVBCaps, This->lpLcl->lpGbl->lpddNLVCaps, sizeof(DDNONLOCALVIDMEMCAPS)); + } + */ + memset(myCaps->dwNLVBCaps,0,sizeof(DDNONLOCALVIDMEMCAPS)); + + if (CoreCaps->dwSize == sizeof(DDCORECAPS)) + { + memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCORECAPS)); + } + + myCaps->dwVidMemFree = dwFree; + myCaps->dwVidMemTotal = dwTotal; + myCaps->dwSize = sizeof(DDCAPS_DX5); + + retVal = DD_OK; + } + break; + + /* DDCAPS_DX6 is same as DDCAPS_DX7 */ + case sizeof(DDCAPS_DX7): + { + LPDDCAPS_DX7 myCaps = (LPDDCAPS_DX7) pDriverCaps; + + /* FIXME This->lpLcl->lpGbl->lpddNLVCaps are not set in startup.c + if (This->lpLcl->lpGbl->lpddNLVCaps->dwSize == sizeof(DDNONLOCALVIDMEMCAPS)) + { + memcpy(&myCaps->dwNLVBCaps, This->lpLcl->lpGbl->lpddNLVCaps, sizeof(DDNONLOCALVIDMEMCAPS)); + } + */ + memset(myCaps->dwNLVBCaps,0,sizeof(DDNONLOCALVIDMEMCAPS)); + + if (CoreCaps->dwSize == sizeof(DDCORECAPS)) + { + memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCORECAPS)); + } + + myCaps->dwVidMemFree = dwFree; + myCaps->dwVidMemTotal = dwTotal; + + myCaps->ddsCaps.dwCaps = myCaps->ddsOldCaps.dwCaps; + myCaps->ddsCaps.dwCaps2 = 0; + myCaps->ddsCaps.dwCaps3 = 0; + myCaps->ddsCaps.dwCaps4 = 0; + myCaps->dwSize = sizeof(DDCAPS_DX7); + + } + break; + + default: + retVal = DDERR_INVALIDPARAMS; + break; + } + } + + if (pHELCaps) + { + /* Setup software caps */ + DDSCAPS2 ddscaps = { 0 }; + LPDDCORECAPS CoreCaps = (LPDDCORECAPS)&This->lpLcl->lpGbl->ddHELCaps; + + DWORD dwTotal = 0; + DWORD dwFree = 0; + + Main_DirectDraw_GetAvailableVidMem4(iface, &ddscaps, &dwTotal, &dwFree); + + switch (pHELCaps->dwSize) + { + case sizeof(DDCAPS_DX1): + { + LPDDCAPS_DX1 myCaps = (LPDDCAPS_DX1) pHELCaps; + + if (CoreCaps->dwSize == sizeof(DDCORECAPS)) + { + memcpy(myCaps, CoreCaps, sizeof(DDCAPS_DX1)); + } + + myCaps->dwVidMemFree = dwFree; + myCaps->dwVidMemTotal = dwTotal; + myCaps->dwSize = sizeof(DDCAPS_DX1); + + retVal = DD_OK; + } + break; + + case sizeof(DDCAPS_DX3): + { + LPDDCAPS_DX3 myCaps = (LPDDCAPS_DX3) pHELCaps; + + if (CoreCaps->dwSize == sizeof(DDCORECAPS)) + { + memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCAPS_DX3)); + } + + myCaps->dwVidMemFree = dwFree; + myCaps->dwVidMemTotal = dwTotal; + myCaps->dwSize = sizeof(DDCAPS_DX3); + + retVal = DD_OK; + } + break; + + case sizeof(DDCAPS_DX5): + { + LPDDCAPS_DX5 myCaps = (LPDDCAPS_DX5) pHELCaps; + + /* FIXME This->lpLcl->lpGbl->lpddNLVHELCaps are not set in startup.c + if (This->lpLcl->lpGbl->lpddNLVHELCaps->dwSize == sizeof(DDNONLOCALVIDMEMCAPS)) + { + memcpy(&myCaps->dwNLVBCaps, This->lpLcl->lpGbl->lpddNLVHELCaps, sizeof(DDNONLOCALVIDMEMCAPS)); + } + */ + memset(myCaps->dwNLVBCaps,0,sizeof(DDNONLOCALVIDMEMCAPS)); + + if (CoreCaps->dwSize == sizeof(DDCORECAPS)) + { + memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCORECAPS)); + } + + myCaps->dwVidMemFree = dwFree; + myCaps->dwVidMemTotal = dwTotal; + myCaps->dwSize = sizeof(DDCAPS_DX5); + + retVal = DD_OK; + } + break; + + /* DDCAPS_DX6 is same as DDCAPS_DX7 */ + case sizeof(DDCAPS_DX7): + { + LPDDCAPS_DX7 myCaps = (LPDDCAPS_DX7) pHELCaps; + + /* FIXME This->lpLcl->lpGbl->lpddNLVHELCaps are not set in startup.c + if (This->lpLcl->lpGbl->lpddNLVHELCaps->dwSize == sizeof(DDNONLOCALVIDMEMCAPS)) + { + memcpy(&myCaps->dwNLVBCaps, This->lpLcl->lpGbl->lpddNLVHELCaps, sizeof(DDNONLOCALVIDMEMCAPS)); + } + */ + memset(myCaps->dwNLVBCaps,0,sizeof(DDNONLOCALVIDMEMCAPS)); + + if (CoreCaps->dwSize == sizeof(DDCORECAPS)) + { + memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCORECAPS)); + } + + myCaps->dwVidMemFree = dwFree; + myCaps->dwVidMemTotal = dwTotal; + + myCaps->ddsCaps.dwCaps = myCaps->ddsOldCaps.dwCaps; + myCaps->ddsCaps.dwCaps2 = 0; + myCaps->ddsCaps.dwCaps3 = 0; + myCaps->ddsCaps.dwCaps4 = 0; + myCaps->dwSize = sizeof(DDCAPS_DX7); + + } + break; + + default: + retVal = DDERR_INVALIDPARAMS; + break; + } + } + + + } + _SEH_HANDLE + { + retVal = DD_FALSE; + } + _SEH_END; + + return retVal; +} Propchange: trunk/reactos/dll/directx/ddraw/Ddraw/GetCaps.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/dll/directx/ddraw/Ddraw/GetCaps.c ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
============================================================================== --- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c (original) +++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Sun Jun 17 19:19:59 2007 @@ -450,168 +450,6 @@ //LeaveCriticalSection(&ddcs); return retVal; } - -HRESULT WINAPI -Main_DirectDraw_GetCaps( LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps, - LPDDCAPS pHELCaps) -{ - HRESULT retVal = DDERR_INVALIDPARAMS; - LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface; - - DX_WINDBG_trace(); - - _SEH_TRY - { - if ((!pDriverCaps) && (!pHELCaps)) - { - retVal = DDERR_INVALIDPARAMS; - _SEH_LEAVE; - } - - if (pDriverCaps) - { - /* Setup hardware caps */ - DDSCAPS2 ddscaps = { 0 }; - LPDDCORECAPS CoreCaps = (LPDDCORECAPS)&This->lpLcl->lpGbl->ddCaps; - - DWORD dwTotal = 0; - DWORD dwFree = 0; - - Main_DirectDraw_GetAvailableVidMem4(iface, &ddscaps, &dwTotal, &dwFree); - - switch (pDriverCaps->dwSize) - { - case sizeof(DDCAPS_DX1): - { - LPDDCAPS_DX1 myCaps = (LPDDCAPS_DX1) pDriverCaps; - - if (CoreCaps->dwSize == sizeof(DDCORECAPS)) - { - memcpy(myCaps, CoreCaps, sizeof(DDCAPS_DX1)); - } - - myCaps->dwVidMemFree = dwFree; - myCaps->dwVidMemTotal = dwTotal; - myCaps->dwSize = sizeof(DDCAPS_DX1); - - retVal = DD_OK; - } - break; - - case sizeof(DDCAPS_DX3): - { - LPDDCAPS_DX3 myCaps = (LPDDCAPS_DX3) pDriverCaps; - - if (CoreCaps->dwSize == sizeof(DDCORECAPS)) - { - memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCAPS_DX3)); - } - - myCaps->dwVidMemFree = dwFree; - myCaps->dwVidMemTotal = dwTotal; - myCaps->dwSize = sizeof(DDCAPS_DX3); - - retVal = DD_OK; - } - break; - - case sizeof(DDCAPS_DX5): - { - LPDDCAPS_DX5 myCaps = (LPDDCAPS_DX5) pDriverCaps; - - /* FIXME This->lpLcl->lpGbl->lpddNLVCaps are not set in startup.c - if (This->lpLcl->lpGbl->lpddNLVCaps->dwSize == sizeof(DDNONLOCALVIDMEMCAPS)) - { - memcpy(&myCaps->dwNLVBCaps, This->lpLcl->lpGbl->lpddNLVCaps, sizeof(DDNONLOCALVIDMEMCAPS)); - } - */ - memset(myCaps->dwNLVBCaps,0,sizeof(DDNONLOCALVIDMEMCAPS)); - - if (CoreCaps->dwSize == sizeof(DDCORECAPS)) - { - memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCORECAPS)); - } - - myCaps->dwVidMemFree = dwFree; - myCaps->dwVidMemTotal = dwTotal; - myCaps->dwSize = sizeof(DDCAPS_DX5); - - retVal = DD_OK; - } - break; - - /* DDCAPS_DX6 is same as DDCAPS_DX7 */ - case sizeof(DDCAPS_DX7): - { - LPDDCAPS_DX7 myCaps = (LPDDCAPS_DX7) pDriverCaps; - - /* FIXME This->lpLcl->lpGbl->lpddNLVCaps are not set in startup.c - if (This->lpLcl->lpGbl->lpddNLVCaps->dwSize == sizeof(DDNONLOCALVIDMEMCAPS)) - { - memcpy(&myCaps->dwNLVBCaps, This->lpLcl->lpGbl->lpddNLVCaps, sizeof(DDNONLOCALVIDMEMCAPS)); - } - */ - memset(myCaps->dwNLVBCaps,0,sizeof(DDNONLOCALVIDMEMCAPS)); - - if (CoreCaps->dwSize == sizeof(DDCORECAPS)) - { - memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCORECAPS)); - } - - myCaps->dwVidMemFree = dwFree; - myCaps->dwVidMemTotal = dwTotal; - - myCaps->ddsCaps.dwCaps = myCaps->ddsOldCaps.dwCaps; - myCaps->ddsCaps.dwCaps2 = 0; - myCaps->ddsCaps.dwCaps3 = 0; - myCaps->ddsCaps.dwCaps4 = 0; - myCaps->dwSize = sizeof(DDCAPS_DX7); - - } - break; - - default: - retVal = DDERR_INVALIDPARAMS; - break; - } - } - - if (pHELCaps) - { - /* Setup software caps */ - switch (pHELCaps->dwSize) - { - case sizeof(DDCAPS_DX1): - retVal = DDERR_INVALIDPARAMS; - break; - case sizeof(DDCAPS_DX3): - retVal = DDERR_INVALIDPARAMS; - break; - case sizeof(DDCAPS_DX5): - retVal = DDERR_INVALIDPARAMS; - break; - - /* DDCAPS_DX6 is same as DDCAPS_DX7 */ - case sizeof(DDCAPS_DX7): - retVal = DDERR_INVALIDPARAMS; - break; - default: - retVal = DDERR_INVALIDPARAMS; - break; - } - } - } - _SEH_HANDLE - { - retVal = DD_FALSE; - } - _SEH_END; - - return retVal; -} - - - /* @@ -699,7 +537,7 @@ Main_DirectDraw_EnumDisplayModes, /* (EnumDisplayModes testing / devloping) */ Main_DirectDraw_EnumSurfaces, Main_DirectDraw_FlipToGDISurface, - Main_DirectDraw_GetCaps, /* (GetCaps testing / devloping) */ + Main_DirectDraw_GetCaps, /* (GetCaps done) */ Main_DirectDraw_GetDisplayMode, /* (GetDisplayMode testing / devloping) */ Main_DirectDraw_GetFourCCCodes, /* (GetFourCCCodes done) */ Main_DirectDraw_GetGDISurface, Modified: trunk/reactos/dll/directx/ddraw/ddraw.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/ddraw.rb…
============================================================================== --- trunk/reactos/dll/directx/ddraw/ddraw.rbuild (original) +++ trunk/reactos/dll/directx/ddraw/ddraw.rbuild Sun Jun 17 19:19:59 2007 @@ -27,6 +27,7 @@ <file>ddraw_main.c</file> <file>ddraw_displaymode.c</file> <file>ddraw_setcooperativelevel.c</file> + <file>GetCaps.c</file> <file>GetDeviceIdentifier.c</file> <file>ddraw_stubs.c</file> <file>callbacks_dd_hel.c</file>
17 years, 6 months
1
0
0
0
[dgorbachev] 27215: Activate debug message about misbehaving "userinit.exe"
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Sun Jun 17 19:18:06 2007 New Revision: 27215 URL:
http://svn.reactos.org/svn/reactos?rev=27215&view=rev
Log: Activate debug message about misbehaving "userinit.exe" Modified: trunk/reactos/ntoskrnl/ob/obref.c Modified: trunk/reactos/ntoskrnl/ob/obref.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obref.c?rev=27…
============================================================================== --- trunk/reactos/ntoskrnl/ob/obref.c (original) +++ trunk/reactos/ntoskrnl/ob/obref.c Sun Jun 17 19:18:06 2007 @@ -290,7 +290,7 @@ if (Header->PointerCount < Header->HandleCount) { - DPRINT("Misbehaving object: %wZ\n", &Header->Type->Name); + DPRINT1("Misbehaving object: %wZ\n", &Header->Type->Name); return Header->PointerCount; } @@ -301,7 +301,7 @@ /* Sanity check */ if (Header->HandleCount) { - DPRINT("Misbehaving object: %wZ\n", &Header->Type->Name); + DPRINT1("Misbehaving object: %wZ\n", &Header->Type->Name); return Header->PointerCount; }
17 years, 6 months
1
0
0
0
[greatlrd] 27214: DD->GetCaps for hal are so complete we can do with current startup process we are missing setting This->lpLcl->lpGbl->lpddNLVCaps fixed a smaller bugs in caps data
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun Jun 17 18:46:04 2007 New Revision: 27214 URL:
http://svn.reactos.org/svn/reactos?rev=27214&view=rev
Log: DD->GetCaps for hal are so complete we can do with current startup process we are missing setting This->lpLcl->lpGbl->lpddNLVCaps fixed a smaller bugs in caps data Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
============================================================================== --- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c (original) +++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Sun Jun 17 18:46:04 2007 @@ -519,19 +519,19 @@ { LPDDCAPS_DX5 myCaps = (LPDDCAPS_DX5) pDriverCaps; + /* FIXME This->lpLcl->lpGbl->lpddNLVCaps are not set in startup.c + if (This->lpLcl->lpGbl->lpddNLVCaps->dwSize == sizeof(DDNONLOCALVIDMEMCAPS)) + { + memcpy(&myCaps->dwNLVBCaps, This->lpLcl->lpGbl->lpddNLVCaps, sizeof(DDNONLOCALVIDMEMCAPS)); + } + */ + memset(myCaps->dwNLVBCaps,0,sizeof(DDNONLOCALVIDMEMCAPS)); + if (CoreCaps->dwSize == sizeof(DDCORECAPS)) { memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCORECAPS)); } - /* FIXME - DWORD dwNLVBCaps; - DWORD dwNLVBCaps2; - DWORD dwNLVBCKeyCaps; - DWORD dwNLVBFXCaps; - DWORD dwNLVBRops[DD_ROP_SPACE]; - */ - myCaps->dwVidMemFree = dwFree; myCaps->dwVidMemTotal = dwTotal; myCaps->dwSize = sizeof(DDCAPS_DX5); @@ -544,6 +544,14 @@ case sizeof(DDCAPS_DX7): { LPDDCAPS_DX7 myCaps = (LPDDCAPS_DX7) pDriverCaps; + + /* FIXME This->lpLcl->lpGbl->lpddNLVCaps are not set in startup.c + if (This->lpLcl->lpGbl->lpddNLVCaps->dwSize == sizeof(DDNONLOCALVIDMEMCAPS)) + { + memcpy(&myCaps->dwNLVBCaps, This->lpLcl->lpGbl->lpddNLVCaps, sizeof(DDNONLOCALVIDMEMCAPS)); + } + */ + memset(myCaps->dwNLVBCaps,0,sizeof(DDNONLOCALVIDMEMCAPS)); if (CoreCaps->dwSize == sizeof(DDCORECAPS)) { @@ -553,18 +561,10 @@ myCaps->dwVidMemFree = dwFree; myCaps->dwVidMemTotal = dwTotal; - /* FIXME - DWORD dwNLVBCaps; - DWORD dwNLVBCaps2; - DWORD dwNLVBCKeyCaps; - DWORD dwNLVBFXCaps; - DWORD dwNLVBRops[DD_ROP_SPACE]; - */ - - myCaps->ddsCaps.dwCaps = ddscaps.dwCaps; - myCaps->ddsCaps.dwCaps2 = ddscaps.dwCaps2; - myCaps->ddsCaps.dwCaps3 = ddscaps.dwCaps3; - myCaps->ddsCaps.dwCaps4 = ddscaps.dwCaps4; + myCaps->ddsCaps.dwCaps = myCaps->ddsOldCaps.dwCaps; + myCaps->ddsCaps.dwCaps2 = 0; + myCaps->ddsCaps.dwCaps3 = 0; + myCaps->ddsCaps.dwCaps4 = 0; myCaps->dwSize = sizeof(DDCAPS_DX7); } @@ -699,7 +699,7 @@ Main_DirectDraw_EnumDisplayModes, /* (EnumDisplayModes testing / devloping) */ Main_DirectDraw_EnumSurfaces, Main_DirectDraw_FlipToGDISurface, - Main_DirectDraw_GetCaps, + Main_DirectDraw_GetCaps, /* (GetCaps testing / devloping) */ Main_DirectDraw_GetDisplayMode, /* (GetDisplayMode testing / devloping) */ Main_DirectDraw_GetFourCCCodes, /* (GetFourCCCodes done) */ Main_DirectDraw_GetGDISurface,
17 years, 6 months
1
0
0
0
[greatlrd] 27213: 50% are implmene in DD->GetCaps now
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun Jun 17 18:14:42 2007 New Revision: 27213 URL:
http://svn.reactos.org/svn/reactos?rev=27213&view=rev
Log: 50% are implmene in DD->GetCaps now Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
============================================================================== --- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c (original) +++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Sun Jun 17 18:14:42 2007 @@ -455,96 +455,157 @@ Main_DirectDraw_GetCaps( LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps, LPDDCAPS pHELCaps) { - HRESULT retVal = DD_OK; + HRESULT retVal = DDERR_INVALIDPARAMS; + LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface; DX_WINDBG_trace(); - if (!(IsBadWritePtr(pDriverCaps,sizeof(LPDDCAPS)))) - { - if (!(IsBadWritePtr(pHELCaps,sizeof(LPDDCAPS)))) - { - return DDERR_INVALIDPARAMS; - } - } - - if ((IsBadWritePtr(pDriverCaps,sizeof(LPDDCAPS)))) - { - DDSCAPS2 ddscaps = { 0 }; - DWORD dwTotal = 0; - DWORD dwFree = 0; - /* Setup hardware caps */ - - Main_DirectDraw_GetAvailableVidMem4(iface, &ddscaps, &dwTotal, &dwFree); - - - switch (pDriverCaps->dwSize) - { - case sizeof(DDCAPS_DX1): + + _SEH_TRY + { + if ((!pDriverCaps) && (!pHELCaps)) + { + retVal = DDERR_INVALIDPARAMS; + _SEH_LEAVE; + } + + if (pDriverCaps) + { + /* Setup hardware caps */ + DDSCAPS2 ddscaps = { 0 }; + LPDDCORECAPS CoreCaps = (LPDDCORECAPS)&This->lpLcl->lpGbl->ddCaps; + + DWORD dwTotal = 0; + DWORD dwFree = 0; + + Main_DirectDraw_GetAvailableVidMem4(iface, &ddscaps, &dwTotal, &dwFree); + + switch (pDriverCaps->dwSize) + { + case sizeof(DDCAPS_DX1): { LPDDCAPS_DX1 myCaps = (LPDDCAPS_DX1) pDriverCaps; + + if (CoreCaps->dwSize == sizeof(DDCORECAPS)) + { + memcpy(myCaps, CoreCaps, sizeof(DDCAPS_DX1)); + } myCaps->dwVidMemFree = dwFree; myCaps->dwVidMemTotal = dwTotal; + myCaps->dwSize = sizeof(DDCAPS_DX1); + + retVal = DD_OK; } break; - case sizeof(DDCAPS_DX3): + case sizeof(DDCAPS_DX3): { LPDDCAPS_DX3 myCaps = (LPDDCAPS_DX3) pDriverCaps; + + if (CoreCaps->dwSize == sizeof(DDCORECAPS)) + { + memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCAPS_DX3)); + } myCaps->dwVidMemFree = dwFree; myCaps->dwVidMemTotal = dwTotal; + myCaps->dwSize = sizeof(DDCAPS_DX3); + + retVal = DD_OK; } break; - case sizeof(DDCAPS_DX5): + case sizeof(DDCAPS_DX5): { LPDDCAPS_DX5 myCaps = (LPDDCAPS_DX5) pDriverCaps; + + if (CoreCaps->dwSize == sizeof(DDCORECAPS)) + { + memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCORECAPS)); + } + + /* FIXME + DWORD dwNLVBCaps; + DWORD dwNLVBCaps2; + DWORD dwNLVBCKeyCaps; + DWORD dwNLVBFXCaps; + DWORD dwNLVBRops[DD_ROP_SPACE]; + */ myCaps->dwVidMemFree = dwFree; myCaps->dwVidMemTotal = dwTotal; + myCaps->dwSize = sizeof(DDCAPS_DX5); + + retVal = DD_OK; } break; - /* DDCAPS_DX6 is same as DDCAPS_DX7 */ - case sizeof(DDCAPS_DX7): + /* DDCAPS_DX6 is same as DDCAPS_DX7 */ + case sizeof(DDCAPS_DX7): { LPDDCAPS_DX7 myCaps = (LPDDCAPS_DX7) pDriverCaps; + + if (CoreCaps->dwSize == sizeof(DDCORECAPS)) + { + memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCORECAPS)); + } myCaps->dwVidMemFree = dwFree; myCaps->dwVidMemTotal = dwTotal; + + /* FIXME + DWORD dwNLVBCaps; + DWORD dwNLVBCaps2; + DWORD dwNLVBCKeyCaps; + DWORD dwNLVBFXCaps; + DWORD dwNLVBRops[DD_ROP_SPACE]; + */ + + myCaps->ddsCaps.dwCaps = ddscaps.dwCaps; + myCaps->ddsCaps.dwCaps2 = ddscaps.dwCaps2; + myCaps->ddsCaps.dwCaps3 = ddscaps.dwCaps3; + myCaps->ddsCaps.dwCaps4 = ddscaps.dwCaps4; + myCaps->dwSize = sizeof(DDCAPS_DX7); + } break; - default: - retVal = DDERR_INVALIDPARAMS; - break; - } - } - - if ((IsBadWritePtr(pHELCaps,sizeof(LPDDCAPS)))) - { - /* Setup hardware caps */ - switch (pHELCaps->dwSize) - { - case sizeof(DDCAPS_DX1): - retVal = DDERR_INVALIDPARAMS; - break; - case sizeof(DDCAPS_DX3): - retVal = DDERR_INVALIDPARAMS; - break; - case sizeof(DDCAPS_DX5): - retVal = DDERR_INVALIDPARAMS; - break; - - /* DDCAPS_DX6 is same as DDCAPS_DX7 */ - case sizeof(DDCAPS_DX7): - retVal = DDERR_INVALIDPARAMS; - break; - default: - retVal = DDERR_INVALIDPARAMS; - break; - } - } + default: + retVal = DDERR_INVALIDPARAMS; + break; + } + } + + if (pHELCaps) + { + /* Setup software caps */ + switch (pHELCaps->dwSize) + { + case sizeof(DDCAPS_DX1): + retVal = DDERR_INVALIDPARAMS; + break; + case sizeof(DDCAPS_DX3): + retVal = DDERR_INVALIDPARAMS; + break; + case sizeof(DDCAPS_DX5): + retVal = DDERR_INVALIDPARAMS; + break; + + /* DDCAPS_DX6 is same as DDCAPS_DX7 */ + case sizeof(DDCAPS_DX7): + retVal = DDERR_INVALIDPARAMS; + break; + default: + retVal = DDERR_INVALIDPARAMS; + break; + } + } + } + _SEH_HANDLE + { + retVal = DD_FALSE; + } + _SEH_END; return retVal; }
17 years, 6 months
1
0
0
0
[greatlrd] 27212: GetCpas filling in how much memory we got now from HAL
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun Jun 17 16:30:58 2007 New Revision: 27212 URL:
http://svn.reactos.org/svn/reactos?rev=27212&view=rev
Log: GetCpas filling in how much memory we got now from HAL Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
============================================================================== --- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c (original) +++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Sun Jun 17 16:30:58 2007 @@ -468,23 +468,53 @@ if ((IsBadWritePtr(pDriverCaps,sizeof(LPDDCAPS)))) { + DDSCAPS2 ddscaps = { 0 }; + DWORD dwTotal = 0; + DWORD dwFree = 0; /* Setup hardware caps */ + + Main_DirectDraw_GetAvailableVidMem4(iface, &ddscaps, &dwTotal, &dwFree); + + switch (pDriverCaps->dwSize) { case sizeof(DDCAPS_DX1): - retVal = DDERR_INVALIDPARAMS; - break; + { + LPDDCAPS_DX1 myCaps = (LPDDCAPS_DX1) pDriverCaps; + + myCaps->dwVidMemFree = dwFree; + myCaps->dwVidMemTotal = dwTotal; + } + break; + case sizeof(DDCAPS_DX3): - retVal = DDERR_INVALIDPARAMS; - break; + { + LPDDCAPS_DX3 myCaps = (LPDDCAPS_DX3) pDriverCaps; + + myCaps->dwVidMemFree = dwFree; + myCaps->dwVidMemTotal = dwTotal; + } + break; + case sizeof(DDCAPS_DX5): - retVal = DDERR_INVALIDPARAMS; + { + LPDDCAPS_DX5 myCaps = (LPDDCAPS_DX5) pDriverCaps; + + myCaps->dwVidMemFree = dwFree; + myCaps->dwVidMemTotal = dwTotal; + } break; /* DDCAPS_DX6 is same as DDCAPS_DX7 */ case sizeof(DDCAPS_DX7): - retVal = DDERR_INVALIDPARAMS; - break; + { + LPDDCAPS_DX7 myCaps = (LPDDCAPS_DX7) pDriverCaps; + + myCaps->dwVidMemFree = dwFree; + myCaps->dwVidMemTotal = dwTotal; + } + break; + default: retVal = DDERR_INVALIDPARAMS; break; @@ -515,6 +545,8 @@ break; } } + + return retVal; }
17 years, 6 months
1
0
0
0
[greatlrd] 27211: start implement of DirectDraw_GetCaps
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun Jun 17 15:22:23 2007 New Revision: 27211 URL:
http://svn.reactos.org/svn/reactos?rev=27211&view=rev
Log: start implement of DirectDraw_GetCaps Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_stubs.c Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
============================================================================== --- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c (original) +++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Sun Jun 17 15:22:23 2007 @@ -131,7 +131,7 @@ } else { - /* DirectDraw4 Vtable */ + /* DirectDraw Vtable */ newThis->lpVtbl = &DirectDraw_Vtable; newThis->lpLcl = This->lpLcl; newThis->lpLink = This; @@ -450,6 +450,74 @@ //LeaveCriticalSection(&ddcs); return retVal; } + +HRESULT WINAPI +Main_DirectDraw_GetCaps( LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps, + LPDDCAPS pHELCaps) +{ + HRESULT retVal = DD_OK; + + DX_WINDBG_trace(); + if (!(IsBadWritePtr(pDriverCaps,sizeof(LPDDCAPS)))) + { + if (!(IsBadWritePtr(pHELCaps,sizeof(LPDDCAPS)))) + { + return DDERR_INVALIDPARAMS; + } + } + + if ((IsBadWritePtr(pDriverCaps,sizeof(LPDDCAPS)))) + { + /* Setup hardware caps */ + switch (pDriverCaps->dwSize) + { + case sizeof(DDCAPS_DX1): + retVal = DDERR_INVALIDPARAMS; + break; + case sizeof(DDCAPS_DX3): + retVal = DDERR_INVALIDPARAMS; + break; + case sizeof(DDCAPS_DX5): + retVal = DDERR_INVALIDPARAMS; + break; + + /* DDCAPS_DX6 is same as DDCAPS_DX7 */ + case sizeof(DDCAPS_DX7): + retVal = DDERR_INVALIDPARAMS; + break; + default: + retVal = DDERR_INVALIDPARAMS; + break; + } + } + + if ((IsBadWritePtr(pHELCaps,sizeof(LPDDCAPS)))) + { + /* Setup hardware caps */ + switch (pHELCaps->dwSize) + { + case sizeof(DDCAPS_DX1): + retVal = DDERR_INVALIDPARAMS; + break; + case sizeof(DDCAPS_DX3): + retVal = DDERR_INVALIDPARAMS; + break; + case sizeof(DDCAPS_DX5): + retVal = DDERR_INVALIDPARAMS; + break; + + /* DDCAPS_DX6 is same as DDCAPS_DX7 */ + case sizeof(DDCAPS_DX7): + retVal = DDERR_INVALIDPARAMS; + break; + default: + retVal = DDERR_INVALIDPARAMS; + break; + } + } +} + + Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
============================================================================== --- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_stubs.c (original) +++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_stubs.c Sun Jun 17 15:22:23 2007 @@ -57,13 +57,6 @@ DX_STUB; } -HRESULT WINAPI -Main_DirectDraw_GetCaps(LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps, - LPDDCAPS pHELCaps) -{ - DX_WINDBG_trace(); - DX_STUB; -} HRESULT WINAPI Main_DirectDraw_GetGDISurface(LPDIRECTDRAW7 iface,
17 years, 6 months
1
0
0
0
[greatlrd] 27210: fixing one more bugs in QueryInterface
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun Jun 17 02:05:16 2007 New Revision: 27210 URL:
http://svn.reactos.org/svn/reactos?rev=27210&view=rev
Log: fixing one more bugs in QueryInterface Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
============================================================================== --- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c (original) +++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Sun Jun 17 02:05:16 2007 @@ -39,78 +39,110 @@ */ if (IsEqualGUID(&IID_IDirectDraw7, id)) { - LPDDRAWI_DIRECTDRAW_INT newThis; - DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT)); - - if (newThis == NULL) - { - retVal = DDERR_OUTOFMEMORY; + if (This->lpVtbl != &DirectDraw7_Vtable) + { + LPDDRAWI_DIRECTDRAW_INT newThis; + DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT)); + + if (newThis == NULL) + { + retVal = DDERR_OUTOFMEMORY; + } + else + { + /* DirectDraw7 Vtable */ + newThis->lpVtbl = &DirectDraw7_Vtable; + newThis->lpLcl = This->lpLcl; + newThis->lpLink = This; + *obj = &newThis->lpVtbl; + Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis); + } } else { - /* DirectDraw7 Vtable */ - newThis->lpVtbl = &DirectDraw7_Vtable; - newThis->lpLcl = This->lpLcl; - newThis->lpLink = This; - *obj = &newThis->lpVtbl; - Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis); + *obj = This; + Main_DirectDraw_AddRef((LPDIRECTDRAW7)This); } } else if (IsEqualGUID(&IID_IDirectDraw4, id)) { - LPDDRAWI_DIRECTDRAW_INT newThis; - DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT)); - - if (newThis == NULL) - { - retVal = DDERR_OUTOFMEMORY; + if (This->lpVtbl != &DirectDraw4_Vtable) + { + LPDDRAWI_DIRECTDRAW_INT newThis; + DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT)); + + if (newThis == NULL) + { + retVal = DDERR_OUTOFMEMORY; + } + else + { + /* DirectDraw4 Vtable */ + newThis->lpVtbl = &DirectDraw4_Vtable; + newThis->lpLcl = This->lpLcl; + newThis->lpLink = This; + *obj = &newThis->lpVtbl; + Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis); + } } else { - /* DirectDraw4 Vtable */ - newThis->lpVtbl = &DirectDraw4_Vtable; - newThis->lpLcl = This->lpLcl; - newThis->lpLink = This; - *obj = &newThis->lpVtbl; - Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis); + *obj = This; + Main_DirectDraw_AddRef((LPDIRECTDRAW7)This); } } else if (IsEqualGUID(&IID_IDirectDraw2, id)) { - LPDDRAWI_DIRECTDRAW_INT newThis; - DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT)); - - if (newThis == NULL) - { - retVal = DDERR_OUTOFMEMORY; + if (This->lpVtbl != &DirectDraw2_Vtable) + { + LPDDRAWI_DIRECTDRAW_INT newThis; + DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT)); + + if (newThis == NULL) + { + retVal = DDERR_OUTOFMEMORY; + } + else + { + /* DirectDraw4 Vtable */ + newThis->lpVtbl = &DirectDraw2_Vtable; + newThis->lpLcl = This->lpLcl; + newThis->lpLink = This; + *obj = &newThis->lpVtbl; + Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis); + } } else { - /* DirectDraw4 Vtable */ - newThis->lpVtbl = &DirectDraw2_Vtable; - newThis->lpLcl = This->lpLcl; - newThis->lpLink = This; - *obj = &newThis->lpVtbl; - Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis); + *obj = This; + Main_DirectDraw_AddRef((LPDIRECTDRAW7)This); } } else if (IsEqualGUID(&IID_IDirectDraw, id)) { - LPDDRAWI_DIRECTDRAW_INT newThis; - DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT)); - - if (newThis == NULL) - { - retVal = DDERR_OUTOFMEMORY; + if (This->lpVtbl != &DirectDraw_Vtable) + { + LPDDRAWI_DIRECTDRAW_INT newThis; + DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT)); + + if (newThis == NULL) + { + retVal = DDERR_OUTOFMEMORY; + } + else + { + /* DirectDraw4 Vtable */ + newThis->lpVtbl = &DirectDraw_Vtable; + newThis->lpLcl = This->lpLcl; + newThis->lpLink = This; + *obj = &newThis->lpVtbl; + Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis); + } } else { - /* DirectDraw4 Vtable */ - newThis->lpVtbl = &DirectDraw_Vtable; - newThis->lpLcl = This->lpLcl; - newThis->lpLink = This; - *obj = &newThis->lpVtbl; - Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis); + *obj = This; + Main_DirectDraw_AddRef((LPDIRECTDRAW7)This); } } else
17 years, 6 months
1
0
0
0
[greatlrd] 27209: forget using addref in DirectDraw_QueryInterface, more werid bugs in ref
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun Jun 17 00:04:01 2007 New Revision: 27209 URL:
http://svn.reactos.org/svn/reactos?rev=27209&view=rev
Log: forget using addref in DirectDraw_QueryInterface, more werid bugs in ref Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
============================================================================== --- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c (original) +++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Sun Jun 17 00:04:01 2007 @@ -51,9 +51,9 @@ /* DirectDraw7 Vtable */ newThis->lpVtbl = &DirectDraw7_Vtable; newThis->lpLcl = This->lpLcl; - newThis->dwIntRefCnt = 1; newThis->lpLink = This; *obj = &newThis->lpVtbl; + Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis); } } else if (IsEqualGUID(&IID_IDirectDraw4, id)) @@ -70,9 +70,9 @@ /* DirectDraw4 Vtable */ newThis->lpVtbl = &DirectDraw4_Vtable; newThis->lpLcl = This->lpLcl; - newThis->dwIntRefCnt = 1; newThis->lpLink = This; *obj = &newThis->lpVtbl; + Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis); } } else if (IsEqualGUID(&IID_IDirectDraw2, id)) @@ -89,9 +89,9 @@ /* DirectDraw4 Vtable */ newThis->lpVtbl = &DirectDraw2_Vtable; newThis->lpLcl = This->lpLcl; - newThis->dwIntRefCnt = 1; newThis->lpLink = This; *obj = &newThis->lpVtbl; + Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis); } } else if (IsEqualGUID(&IID_IDirectDraw, id)) @@ -108,9 +108,9 @@ /* DirectDraw4 Vtable */ newThis->lpVtbl = &DirectDraw_Vtable; newThis->lpLcl = This->lpLcl; - newThis->dwIntRefCnt = 1; newThis->lpLink = This; *obj = &newThis->lpVtbl; + Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis); } } else
17 years, 6 months
1
0
0
0
[greatlrd] 27208: fixing couple of bugs in Main_DirectDraw_QueryInterface 1. adding create linking when u req a new directdraw interface from old one. This Type of linking is exacly same lcl pointer as the linked interface, it mean we shall not create new lcl but use the current we got. waring still bugs in DirectDraw_QueryInterface
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sat Jun 16 23:38:20 2007 New Revision: 27208 URL:
http://svn.reactos.org/svn/reactos?rev=27208&view=rev
Log: fixing couple of bugs in Main_DirectDraw_QueryInterface 1. adding create linking when u req a new directdraw interface from old one. This Type of linking is exacly same lcl pointer as the linked interface, it mean we shall not create new lcl but use the current we got. waring still bugs in DirectDraw_QueryInterface Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
============================================================================== --- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c (original) +++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Sat Jun 16 23:38:20 2007 @@ -39,44 +39,79 @@ */ if (IsEqualGUID(&IID_IDirectDraw7, id)) { - /* FIXME linking */ - - /* DirectDraw7 Vtable */ - This->lpVtbl = &DirectDraw7_Vtable; - This->lpLcl->dwLocalFlags = This->lpLcl->dwLocalFlags + DDRAWILCL_DIRECTDRAW7; - *obj = &This->lpVtbl; - Main_DirectDraw_AddRef(iface); + LPDDRAWI_DIRECTDRAW_INT newThis; + DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT)); + + if (newThis == NULL) + { + retVal = DDERR_OUTOFMEMORY; + } + else + { + /* DirectDraw7 Vtable */ + newThis->lpVtbl = &DirectDraw7_Vtable; + newThis->lpLcl = This->lpLcl; + newThis->dwIntRefCnt = 1; + newThis->lpLink = This; + *obj = &newThis->lpVtbl; + } } else if (IsEqualGUID(&IID_IDirectDraw4, id)) { - /* FIXME linking */ - - /* DirectDraw4 Vtable */ - This->lpVtbl = &DirectDraw4_Vtable; - This->lpLcl->dwLocalFlags = This->lpLcl->dwLocalFlags; - *obj = &This->lpVtbl; - Main_DirectDraw_AddRef(iface); + LPDDRAWI_DIRECTDRAW_INT newThis; + DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT)); + + if (newThis == NULL) + { + retVal = DDERR_OUTOFMEMORY; + } + else + { + /* DirectDraw4 Vtable */ + newThis->lpVtbl = &DirectDraw4_Vtable; + newThis->lpLcl = This->lpLcl; + newThis->dwIntRefCnt = 1; + newThis->lpLink = This; + *obj = &newThis->lpVtbl; + } } else if (IsEqualGUID(&IID_IDirectDraw2, id)) { - /* FIXME linking */ - - - /* DirectDraw4 Vtable */ - This->lpVtbl = &DirectDraw2_Vtable; - This->lpLcl->dwLocalFlags = This->lpLcl->dwLocalFlags; - *obj = &This->lpVtbl; - Main_DirectDraw_AddRef(iface); + LPDDRAWI_DIRECTDRAW_INT newThis; + DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT)); + + if (newThis == NULL) + { + retVal = DDERR_OUTOFMEMORY; + } + else + { + /* DirectDraw4 Vtable */ + newThis->lpVtbl = &DirectDraw2_Vtable; + newThis->lpLcl = This->lpLcl; + newThis->dwIntRefCnt = 1; + newThis->lpLink = This; + *obj = &newThis->lpVtbl; + } } else if (IsEqualGUID(&IID_IDirectDraw, id)) { - /* FIXME linking */ - - /* DirectDraw4 Vtable */ - This->lpVtbl = &DirectDraw_Vtable; - This->lpLcl->dwLocalFlags = This->lpLcl->dwLocalFlags; - *obj = &This->lpVtbl; - Main_DirectDraw_AddRef(iface); + LPDDRAWI_DIRECTDRAW_INT newThis; + DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT)); + + if (newThis == NULL) + { + retVal = DDERR_OUTOFMEMORY; + } + else + { + /* DirectDraw4 Vtable */ + newThis->lpVtbl = &DirectDraw_Vtable; + newThis->lpLcl = This->lpLcl; + newThis->dwIntRefCnt = 1; + newThis->lpLink = This; + *obj = &newThis->lpVtbl; + } } else {
17 years, 6 months
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
42
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Results per page:
10
25
50
100
200