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
October 2005
----- 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
26 participants
737 discussions
Start a n
N
ew thread
[hbirr] 18749: Fixed the stub for AddAccessDeniedObjectAce.
by hbirr@svn.reactos.com
Fixed the stub for AddAccessDeniedObjectAce. Modified: trunk/reactos/lib/advapi32/sec/ac.c _____ Modified: trunk/reactos/lib/advapi32/sec/ac.c --- trunk/reactos/lib/advapi32/sec/ac.c 2005-10-24 17:39:57 UTC (rev 18748) +++ trunk/reactos/lib/advapi32/sec/ac.c 2005-10-24 17:41:16 UTC (rev 18749) @@ -247,7 +247,10 @@ AddAccessDeniedObjectAce( PACL pAcl, DWORD dwAceRevision, + DWORD AceFlags, DWORD AccessMask, + GUID* ObjectTypeGuid, + GUID* InheritedObjectTypeGuid, PSID pSid) { DPRINT1("%s() not implemented!\n", __FUNCTION__);
19 years, 2 months
1
0
0
0
[hbirr] 18748: Disable some unimplemented functions.
by hbirr@svn.reactos.com
Disable some unimplemented functions. Modified: trunk/reactos/lib/advapi32/advapi32.def _____ Modified: trunk/reactos/lib/advapi32/advapi32.def --- trunk/reactos/lib/advapi32/advapi32.def 2005-10-24 17:32:47 UTC (rev 18747) +++ trunk/reactos/lib/advapi32/advapi32.def 2005-10-24 17:39:57 UTC (rev 18748) @@ -85,7 +85,7 @@ ;ConvertSecurityDescriptorToAccessNamedW=ConvertSecurityDescriptorToAcce ssW@28 ;ConvertSecurityDescriptorToAccessW@28 ;ConvertSecurityDescriptorToStringSecurityDescriptorA@20 -ConvertSecurityDescriptorToStringSecurityDescriptorW@20 +;ConvertSecurityDescriptorToStringSecurityDescriptorW@20 ConvertSidToStringSidA@8 ConvertSidToStringSidW@8 ;ConvertStringSDToSDDomainA@24 @@ -95,7 +95,7 @@ ConvertStringSecurityDescriptorToSecurityDescriptorA@16 ConvertStringSecurityDescriptorToSecurityDescriptorW@16 ;ConvertStringSidToSidA@8 -ConvertStringSidToSidW@8 +;ConvertStringSidToSidW@8 ConvertToAutoInheritPrivateObjectSecurity@24 CopySid@12 ;CreateCodeAuthzLevel@20 @@ -106,7 +106,7 @@ ;CreateProcessAsUserSecure CreateProcessAsUserW@44 ;CreateProcessWithLogonW -CreateRestrictedToken@36 +;CreateRestrictedToken@36 CreateServiceA@52 CreateServiceW@52 ;CreateTraceInstanceId@8 @@ -211,7 +211,7 @@ EncryptFileA@4 EncryptFileW@4 ;EncryptedFileKeyInfo -EncryptionDisable@8 +;EncryptionDisable@8 EnumDependentServicesA@24 EnumDependentServicesW@24 EnumServiceGroupW@36
19 years, 2 months
1
0
0
0
[greatlrd] 18747: prepare some directdraw syscall using cache info, that will make our ddraw.dll work evently in reactos.
by greatlrd@svn.reactos.com
prepare some directdraw syscall using cache info, that will make our ddraw.dll work evently in reactos. Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c _____ Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c --- trunk/reactos/subsys/win32k/ntddraw/ddraw.c 2005-10-24 17:27:41 UTC (rev 18746) +++ trunk/reactos/subsys/win32k/ntddraw/ddraw.c 2005-10-24 17:32:47 UTC (rev 18747) @@ -208,12 +208,19 @@ ) { DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED; - + PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; + /* backup the orignal PDev and info */ + lgpl = puCreateSurfaceData->lpDD; + + /* use our cache version instead */ + puCreateSurfaceData->lpDD = &pDirectDraw->Global; + + /* make the call */ if (!(pDirectDraw->DD.dwFlags & DDHAL_CB32_CANCREATESURFACE)) ddRVal = DDHAL_DRIVER_NOTHANDLED; else @@ -221,6 +228,9 @@ ddRVal = pDirectDraw->DD.CreateSurface(puCreateSurfaceData); } + /* But back the orignal PDev */ + puCreateSurfaceData->lpDD = lgpl; + GDIOBJ_UnlockObjByPtr(pDirectDraw); return ddRVal; } @@ -231,15 +241,27 @@ ) { DWORD ddRVal; + PDD_DIRECTDRAW_GLOBAL lgpl; + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; + /* backup the orignal PDev and info */ + lgpl = puWaitForVerticalBlankData->lpDD; + + /* use our cache version instead */ + puWaitForVerticalBlankData->lpDD = &pDirectDraw->Global; + + /* make the call */ if (!(pDirectDraw->DD.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK)) ddRVal = DDHAL_DRIVER_NOTHANDLED; else ddRVal = pDirectDraw->DD.WaitForVerticalBlank(puWaitForVerticalBlankData); + /* But back the orignal PDev */ + puWaitForVerticalBlankData->lpDD = lgpl; + GDIOBJ_UnlockObjByPtr(pDirectDraw); return ddRVal; } @@ -250,16 +272,27 @@ ) { DWORD ddRVal; + PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; + /* backup the orignal PDev and info */ + lgpl = puCanCreateSurfaceData->lpDD; + + /* use our cache version instead */ + puCanCreateSurfaceData->lpDD = &pDirectDraw->Global; + + /* make the call */ if (!(pDirectDraw->DD.dwFlags & DDHAL_CB32_CANCREATESURFACE)) ddRVal = DDHAL_DRIVER_NOTHANDLED; else ddRVal = pDirectDraw->DD.CanCreateSurface(puCanCreateSurfaceData); + /* But back the orignal PDev */ + puCanCreateSurfaceData->lpDD = lgpl; + GDIOBJ_UnlockObjByPtr(pDirectDraw); return ddRVal; } @@ -270,16 +303,27 @@ ) { DWORD ddRVal; + PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; + /* backup the orignal PDev and info */ + lgpl = puGetScanLineData->lpDD; + + /* use our cache version instead */ + puGetScanLineData->lpDD = &pDirectDraw->Global; + + /* make the call */ if (!(pDirectDraw->DD.dwFlags & DDHAL_CB32_GETSCANLINE)) ddRVal = DDHAL_DRIVER_NOTHANDLED; else ddRVal = pDirectDraw->DD.GetScanLine(puGetScanLineData); + /* But back the orignal PDev */ + puGetScanLineData->lpDD = lgpl; + GDIOBJ_UnlockObjByPtr(pDirectDraw); return ddRVal; } @@ -321,6 +365,7 @@ ddRVal = pDirectDraw->Surf.DestroySurface(&DestroySurf); } + GDIOBJ_UnlockObjByPtr(pDirectDraw); return ddRVal; } @@ -334,16 +379,27 @@ ) { DWORD ddRVal; + PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceTarget, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; + /* backup the orignal PDev and info */ + lgpl = puFlipData->lpDD; + + /* use our cache version instead */ + puFlipData->lpDD = &pDirectDraw->Global; + + /* make the call */ if (!(pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_FLIP)) ddRVal = DDHAL_DRIVER_NOTHANDLED; else ddRVal = pDirectDraw->Surf.Flip(puFlipData); + /* But back the orignal PDev */ + puFlipData->lpDD = lgpl; + GDIOBJ_UnlockObjByPtr(pDirectDraw); return ddRVal; } @@ -355,16 +411,27 @@ ) { DWORD ddRVal; + PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; + /* backup the orignal PDev and info */ + lgpl = puLockData->lpDD; + + /* use our cache version instead */ + puLockData->lpDD = &pDirectDraw->Global; + + /* make the call */ if (!(pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_LOCK)) ddRVal = DDHAL_DRIVER_NOTHANDLED; else ddRVal = pDirectDraw->Surf.Lock(puLockData); + /* But back the orignal PDev */ + puLockData->lpDD = lgpl; + GDIOBJ_UnlockObjByPtr(pDirectDraw); return ddRVal; }
19 years, 2 months
1
0
0
0
[hbirr] 18746: - Translate STATUS_DEVICE_NOT_CONNECTED to the correct error.
by hbirr@svn.reactos.com
- Translate STATUS_DEVICE_NOT_CONNECTED to the correct error. Modified: trunk/reactos/lib/rtl/error.c _____ Modified: trunk/reactos/lib/rtl/error.c --- trunk/reactos/lib/rtl/error.c 2005-10-24 17:25:23 UTC (rev 18745) +++ trunk/reactos/lib/rtl/error.c 2005-10-24 17:27:41 UTC (rev 18746) @@ -300,7 +300,7 @@ ERROR_NO_SYSTEM_RESOURCES, /* c000009a (STATUS_INSUFFICIENT_RESOURCES) */ ERROR_PATH_NOT_FOUND, /* c000009b (STATUS_DFS_EXIT_PATH_FOUND) */ ERROR_CRC, /* c000009c (STATUS_DEVICE_DATA_ERROR) */ - ERROR_NOT_READY, /* c000009d (STATUS_DEVICE_NOT_CONNECTED) */ + ERROR_DEVICE_NOT_CONNECTED, /* c000009d (STATUS_DEVICE_NOT_CONNECTED) */ ERROR_NOT_READY, /* c000009e (STATUS_DEVICE_POWER_FAILURE) */ ERROR_INVALID_ADDRESS, /* c000009f (STATUS_FREE_VM_NOT_AT_BASE) */ ERROR_INVALID_ADDRESS, /* c00000a0 (STATUS_MEMORY_NOT_ALLOCATED) */ @@ -907,7 +907,7 @@ if (HIWORD(Status) == 0x8007) return LOWORD(Status); - DbgPrint("RTL: RtlNtStatusToDosErrorNoTeb(0x%lx): no valid W32 error mapping\n", Status); + DPRINT1("RTL: RtlNtStatusToDosErrorNoTeb(0x%lx): no valid W32 error mapping\n", Status); return ERROR_MR_MID_NOT_FOUND; }
19 years, 2 months
1
0
0
0
[hbirr] 18745: - Initialize the csr request inside the loop, if CsrClientCallServer is called inside a loop.
by hbirr@svn.reactos.com
- Initialize the csr request inside the loop, if CsrClientCallServer is called inside a loop. Modified: trunk/reactos/lib/kernel32/misc/console.c _____ Modified: trunk/reactos/lib/kernel32/misc/console.c --- trunk/reactos/lib/kernel32/misc/console.c 2005-10-24 17:23:42 UTC (rev 18744) +++ trunk/reactos/lib/kernel32/misc/console.c 2005-10-24 17:25:23 UTC (rev 18745) @@ -1116,11 +1116,12 @@ } CsrRequest = MAKE_CSR_API(WRITE_CONSOLE, CSR_CONSOLE); - Request->Data.WriteConsoleRequest.ConsoleHandle = hConsoleOutput; - Request->Data.WriteConsoleRequest.Unicode = bUnicode; while(nNumberOfCharsToWrite > 0) { + Request->Data.WriteConsoleRequest.ConsoleHandle = hConsoleOutput; + Request->Data.WriteConsoleRequest.Unicode = bUnicode; + nChars = min(nNumberOfCharsToWrite, CSRSS_MAX_WRITE_CONSOLE / CharSize); Request->Data.WriteConsoleRequest.NrCharactersToWrite = nChars; @@ -1224,6 +1225,7 @@ } Request->Status = STATUS_SUCCESS; + CsrRequest = MAKE_CSR_API(READ_CONSOLE, CSR_CONSOLE); do { @@ -1237,7 +1239,6 @@ } } - CsrRequest = MAKE_CSR_API(READ_CONSOLE, CSR_CONSOLE); Request->Data.ReadConsoleRequest.ConsoleHandle = hConsoleInput; Request->Data.ReadConsoleRequest.Unicode = bUnicode; Request->Data.ReadConsoleRequest.NrCharactersToRead = min(nNumberOfCharsToRead, CSRSS_MAX_READ_CONSOLE / CharSize); @@ -1659,12 +1660,11 @@ NTSTATUS Status; CsrRequest = MAKE_CSR_API(READ_INPUT, CSR_CONSOLE); - Request.Data.ReadInputRequest.ConsoleHandle = hConsoleInput; - Request.Data.ReadInputRequest.Unicode = bUnicode; - Read = 0; while(nLength > 0) { + Request.Data.ReadInputRequest.ConsoleHandle = hConsoleInput; + Request.Data.ReadInputRequest.Unicode = bUnicode; Status = CsrClientCallServer(&Request, NULL, CsrRequest, sizeof(CSR_API_MESSAGE)); @@ -2114,14 +2114,14 @@ } CsrRequest = MAKE_CSR_API(READ_CONSOLE_OUTPUT_CHAR, CSR_CONSOLE); - Request->Data.ReadConsoleOutputCharRequest.ConsoleHandle = hConsoleOutput; - Request->Data.ReadConsoleOutputCharRequest.Unicode = bUnicode; Request->Data.ReadConsoleOutputCharRequest.ReadCoord = dwReadCoord; while(nLength > 0) { DWORD BytesRead; + Request->Data.ReadConsoleOutputCharRequest.ConsoleHandle = hConsoleOutput; + Request->Data.ReadConsoleOutputCharRequest.Unicode = bUnicode; Request->Data.ReadConsoleOutputCharRequest.NumCharsToRead = min(nLength, nChars); SizeBytes = Request->Data.ReadConsoleOutputCharRequest.NumCharsToRead * CharSize; @@ -2238,11 +2238,12 @@ } CsrRequest = MAKE_CSR_API(READ_CONSOLE_OUTPUT_ATTRIB, CSR_CONSOLE); - Request->Data.ReadConsoleOutputAttribRequest.ConsoleHandle = hConsoleOutput; - Request->Data.ReadConsoleOutputAttribRequest.ReadCoord = dwReadCoord; while (nLength != 0) { + Request->Data.ReadConsoleOutputAttribRequest.ConsoleHandle = hConsoleOutput; + Request->Data.ReadConsoleOutputAttribRequest.ReadCoord = dwReadCoord; + if (nLength > CSRSS_MAX_READ_CONSOLE_OUTPUT_ATTRIB / sizeof(WORD)) Size = CSRSS_MAX_READ_CONSOLE_OUTPUT_ATTRIB / sizeof(WCHAR); else @@ -2303,14 +2304,14 @@ } CsrRequest = MAKE_CSR_API(WRITE_CONSOLE_OUTPUT_CHAR, CSR_CONSOLE); - Request->Data.WriteConsoleOutputCharRequest.ConsoleHandle = hConsoleOutput; - Request->Data.WriteConsoleOutputCharRequest.Unicode = bUnicode; Request->Data.WriteConsoleOutputCharRequest.Coord = dwWriteCoord; while(nLength > 0) { DWORD BytesWrite; + Request->Data.WriteConsoleOutputCharRequest.ConsoleHandle = hConsoleOutput; + Request->Data.WriteConsoleOutputCharRequest.Unicode = bUnicode; Request->Data.WriteConsoleOutputCharRequest.Length = min(nLength, nChars); BytesWrite = Request->Data.WriteConsoleOutputCharRequest.Length * CharSize; @@ -2419,13 +2420,14 @@ } CsrRequest = MAKE_CSR_API(WRITE_CONSOLE_OUTPUT_ATTRIB, CSR_CONSOLE); - Request->Data.WriteConsoleOutputAttribRequest.ConsoleHandle = hConsoleOutput; Request->Data.WriteConsoleOutputAttribRequest.Coord = dwWriteCoord; + if( lpNumberOfAttrsWritten ) *lpNumberOfAttrsWritten = nLength; while( nLength ) { Size = min(nLength, CSRSS_MAX_WRITE_CONSOLE_OUTPUT_ATTRIB / sizeof(WORD)); + Request->Data.WriteConsoleOutputAttribRequest.ConsoleHandle = hConsoleOutput; Request->Data.WriteConsoleOutputAttribRequest.Length = Size; memcpy(Request->Data.WriteConsoleOutputAttribRequest.Attribute, lpAttribute, Size * sizeof(WORD));
19 years, 2 months
1
0
0
0
[hbirr] 18744: - Change the protection in WriteProcessMemory if it is necessary.
by hbirr@svn.reactos.com
- Change the protection in WriteProcessMemory if it is necessary. Modified: trunk/reactos/lib/kernel32/mem/procmem.c _____ Modified: trunk/reactos/lib/kernel32/mem/procmem.c --- trunk/reactos/lib/kernel32/mem/procmem.c 2005-10-24 17:21:23 UTC (rev 18743) +++ trunk/reactos/lib/kernel32/mem/procmem.c 2005-10-24 17:23:42 UTC (rev 18744) @@ -58,17 +58,99 @@ SIZE_T *lpNumberOfBytesWritten ) { - NTSTATUS Status; + NTSTATUS Status, ProtectStatus; + MEMORY_BASIC_INFORMATION MemInfo; + ULONG Length; + BOOLEAN UnProtect; - Status = NtWriteVirtualMemory( hProcess, lpBaseAddress, (LPVOID)lpBuffer, nSize, - (PULONG)lpNumberOfBytesWritten - ); + if (lpNumberOfBytesWritten) + { + *lpNumberOfBytesWritten = 0; + } - if (!NT_SUCCESS(Status)) - { + while (nSize) + { + Status = NtQueryVirtualMemory(hProcess, + lpBaseAddress, + MemoryBasicInformation, + &MemInfo, + sizeof(MEMORY_BASIC_INFORMATION), + NULL); + + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + Length = MemInfo.RegionSize - ((ULONG_PTR)lpBaseAddress - (ULONG_PTR)MemInfo.BaseAddress); + if (Length > nSize) + { + Length = nSize; + } + UnProtect = MemInfo.Protect & (PAGE_READWRITE|PAGE_WRITECOPY|PAGE_EXECUTE_READWRITE|PAGE_EXECUTE_WRITE COPY) ? FALSE : TRUE; + if (UnProtect) + { + MemInfo.BaseAddress = lpBaseAddress; + MemInfo.RegionSize = Length; + if (MemInfo.Protect & (PAGE_EXECUTE|PAGE_EXECUTE_READ)) + { + MemInfo.Protect &= ~(PAGE_EXECUTE|PAGE_EXECUTE_READ); + MemInfo.Protect |= PAGE_EXECUTE_READWRITE; + } + else + { + MemInfo.Protect &= ~(PAGE_READONLY|PAGE_NOACCESS); + MemInfo.Protect |= PAGE_READWRITE; + } + + ProtectStatus = NtProtectVirtualMemory(hProcess, + &MemInfo.BaseAddress, + &MemInfo.RegionSize, + MemInfo.Protect, + &MemInfo.Protect); + if (!NT_SUCCESS(ProtectStatus)) + { + SetLastErrorByStatus(ProtectStatus); + return FALSE; + } + Length = MemInfo.RegionSize - ((ULONG_PTR)lpBaseAddress - (ULONG_PTR)MemInfo.BaseAddress); + if (Length > nSize) + { + Length = nSize; + } + } + + Status = NtWriteVirtualMemory(hProcess, + lpBaseAddress, + (LPVOID)lpBuffer, + Length, + &Length); + if (UnProtect) + { + ProtectStatus = NtProtectVirtualMemory(hProcess, + &MemInfo.BaseAddress, + &MemInfo.RegionSize, + MemInfo.Protect, + &MemInfo.Protect); + } + if (!NT_SUCCESS(Status)) + { SetLastErrorByStatus (Status); return FALSE; - } + } + if (UnProtect && !NT_SUCCESS(ProtectStatus)) + { + SetLastErrorByStatus (ProtectStatus); + return FALSE; + } + lpBaseAddress = (LPVOID)((ULONG_PTR)lpBaseAddress + Length); + lpBuffer = (LPCVOID)((ULONG_PTR)lpBuffer + Length); + nSize -= Length; + if (lpNumberOfBytesWritten) + { + *lpNumberOfBytesWritten += Length; + } + } return TRUE; }
19 years, 2 months
1
0
0
0
[hbirr] 18743: - Set the correct type and state in MiQueryVirtualMemory.
by hbirr@svn.reactos.com
- Set the correct type and state in MiQueryVirtualMemory. - Return an error in MiProtectVirtualMemory if we trying to access a region other than a section view or virtual memory. - Don't allow to read or write kernel memory in NtRead/WriteVirtualMemory. - Don't unprotect the memory in NtWriteVirtualMemory. - Don't allow to change the memory protection of kernel address space. - If it is possible, access the memory aligned by pages (in ProbeForWrite). Modified: trunk/reactos/ntoskrnl/mm/virtual.c _____ Modified: trunk/reactos/ntoskrnl/mm/virtual.c --- trunk/reactos/ntoskrnl/mm/virtual.c 2005-10-24 17:13:08 UTC (rev 18742) +++ trunk/reactos/ntoskrnl/mm/virtual.c 2005-10-24 17:21:23 UTC (rev 18743) @@ -184,8 +184,8 @@ ResultLength); break; case MEMORY_AREA_NO_ACCESS: - Info->Type = 0; - Info->State = MEM_FREE; + Info->Type = MEM_PRIVATE; + Info->State = MEM_RESERVE; Info->Protect = MemoryArea->Attributes; Info->AllocationProtect = MemoryArea->Attributes; Info->BaseAddress = MemoryArea->StartingAddress; @@ -196,7 +196,7 @@ *ResultLength = sizeof(MEMORY_BASIC_INFORMATION); break; case MEMORY_AREA_SHARED_DATA: - Info->Type = 0; + Info->Type = MEM_PRIVATE; Info->State = MEM_COMMIT; Info->Protect = MemoryArea->Attributes; Info->AllocationProtect = MemoryArea->Attributes; @@ -422,7 +422,7 @@ else { /* FIXME: Should we return failure or success in this case? */ - Status = STATUS_SUCCESS; + Status = STATUS_CONFLICTING_ADDRESSES; } MmUnlockAddressSpace(AddressSpace); @@ -480,6 +480,13 @@ NumberOfBytesToProtect = *UnsafeNumberOfBytesToProtect; } + if ((ULONG_PTR)BaseAddress + NumberOfBytesToProtect - 1 < (ULONG_PTR)BaseAddress || + (ULONG_PTR)BaseAddress + NumberOfBytesToProtect - 1 >= MmUserProbeAddress) + { + /* Don't allow to change the protection of a kernel mode address */ + return STATUS_INVALID_PARAMETER_2; + } + /* (tMk 2004.II.5) in Microsoft SDK I read: * 'if this parameter is NULL or does not point to a valid variable, the function fails' */ @@ -554,15 +561,46 @@ PAGED_CODE(); + DPRINT("NtReadVirtualMemory(ProcessHandle %x, BaseAddress %x, " + "Buffer %x, NumberOfBytesToRead %d)\n",ProcessHandle,BaseAddress, + Buffer,NumberOfBytesToRead); + + if ((ULONG_PTR)BaseAddress + NumberOfBytesToRead - 1 < (ULONG_PTR)BaseAddress || + (ULONG_PTR)BaseAddress + NumberOfBytesToRead - 1 >= MmUserProbeAddress) + { + /* Don't allow to read from kernel space */ + return STATUS_ACCESS_VIOLATION; + } + PreviousMode = ExGetPreviousMode(); + if (PreviousMode != KernelMode) + { + if ((ULONG_PTR)Buffer + NumberOfBytesToRead - 1 < (ULONG_PTR)Buffer || + (ULONG_PTR)Buffer + NumberOfBytesToRead - 1 >= MmUserProbeAddress) + { + /* Don't allow to write into kernel space */ + return STATUS_ACCESS_VIOLATION; + } + } + + Status = ObReferenceObjectByHandle(ProcessHandle, + PROCESS_VM_READ, + NULL, + PreviousMode, + (PVOID*)(&Process), + NULL); + if (!NT_SUCCESS(Status)) + { + return(Status); + } + + CurrentProcess = PsGetCurrentProcess(); + if(PreviousMode != KernelMode) { _SEH_TRY { - ProbeForWrite(Buffer, - NumberOfBytesToRead, - 1); if(NumberOfBytesRead != NULL) { ProbeForWriteUlong(NumberOfBytesRead); @@ -580,23 +618,7 @@ } } - DPRINT("NtReadVirtualMemory(ProcessHandle %x, BaseAddress %x, " - "Buffer %x, NumberOfBytesToRead %d)\n",ProcessHandle,BaseAddress, - Buffer,NumberOfBytesToRead); - Status = ObReferenceObjectByHandle(ProcessHandle, - PROCESS_VM_READ, - NULL, - PreviousMode, - (PVOID*)(&Process), - NULL); - if (!NT_SUCCESS(Status)) - { - return(Status); - } - - CurrentProcess = PsGetCurrentProcess(); - if (Process == CurrentProcess) { _SEH_TRY @@ -639,7 +661,6 @@ Status = STATUS_SUCCESS; _SEH_TRY { - ProbeForRead(BaseAddress, NumberOfBytesToRead, 1); Status = STATUS_PARTIAL_COPY; RtlCopyMemory(SystemAddress, BaseAddress, NumberOfBytesToRead); Status = STATUS_SUCCESS; @@ -750,9 +771,6 @@ PMDL Mdl; PVOID SystemAddress; PEPROCESS Process; - ULONG OldProtection = 0; - PVOID ProtectBaseAddress; - ULONG ProtectNumberOfBytes; KPROCESSOR_MODE PreviousMode; NTSTATUS CopyStatus, Status = STATUS_SUCCESS; @@ -760,24 +778,40 @@ "Buffer %x, NumberOfBytesToWrite %d)\n",ProcessHandle,BaseAddress, Buffer,NumberOfBytesToWrite); + if ((ULONG_PTR)BaseAddress + NumberOfBytesToWrite - 1 < (ULONG_PTR)BaseAddress || + (ULONG_PTR)BaseAddress + NumberOfBytesToWrite - 1 >= MmUserProbeAddress) + { + /* Don't allow to write into kernel space */ + return STATUS_ACCESS_VIOLATION; + } + PreviousMode = ExGetPreviousMode(); - if (PreviousMode != KernelMode && NumberOfBytesWritten != NULL) + if (PreviousMode != KernelMode) { - _SEH_TRY + if ((ULONG_PTR)Buffer + NumberOfBytesToWrite - 1 < (ULONG_PTR)Buffer || + (ULONG_PTR)Buffer + NumberOfBytesToWrite - 1 >= MmUserProbeAddress) { - ProbeForWriteUlong(NumberOfBytesWritten); + /* Don't allow to read from kernel space */ + return STATUS_ACCESS_VIOLATION; } - _SEH_HANDLE + if (NumberOfBytesWritten != NULL) { - Status = _SEH_GetExceptionCode(); - } - _SEH_END; + _SEH_TRY + { + ProbeForWriteUlong(NumberOfBytesWritten); + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; - if (!NT_SUCCESS(Status)) - { - return Status; - } + if (!NT_SUCCESS(Status)) + { + return Status; + } + } } Status = ObReferenceObjectByHandle(ProcessHandle, @@ -791,35 +825,14 @@ return(Status); } - /* We have to make sure the target memory is writable. - * - * I am not sure if it is correct to do this in any case, but it has to be - * done at least in some cases because you can use WriteProcessMemory to - * write into the .text section of a module where memcpy() would crash. - * -blight (2005/01/09) - */ - ProtectBaseAddress = BaseAddress; - ProtectNumberOfBytes = NumberOfBytesToWrite; - CopyStatus = STATUS_SUCCESS; /* Write memory */ if (Process == PsGetCurrentProcess()) { - Status = MiProtectVirtualMemory(Process, - &ProtectBaseAddress, - &ProtectNumberOfBytes, - PAGE_READWRITE, - &OldProtection); - if (!NT_SUCCESS(Status)) - { - ObDereferenceObject(Process); - return Status; - } - if (PreviousMode != KernelMode) { - _SEH_TRY + _SEH_TRY { memcpy(BaseAddress, Buffer, NumberOfBytesToWrite); } @@ -841,51 +854,48 @@ Buffer, NumberOfBytesToWrite); if(Mdl == NULL) - { - ObDereferenceObject(Process); - return(STATUS_NO_MEMORY); - } + { + ObDereferenceObject(Process); + return(STATUS_NO_MEMORY); + } + _SEH_TRY + { + /* Map the MDL. */ + MmProbeAndLockPages(Mdl, + UserMode, + IoReadAccess); + } + _SEH_HANDLE + { + CopyStatus = _SEH_GetExceptionCode(); + } + _SEH_END; - /* Make the target area writable. */ - Status = MiProtectVirtualMemory(Process, - &ProtectBaseAddress, - &ProtectNumberOfBytes, - PAGE_READWRITE, - &OldProtection); - if (!NT_SUCCESS(Status)) - { - ObDereferenceObject(Process); - ExFreePool(Mdl); - return Status; - } - - /* Map the MDL. */ - MmProbeAndLockPages(Mdl, - UserMode, - IoReadAccess); - - /* Copy memory from the mapped MDL into the target buffer. */ - KeAttachProcess(&Process->Pcb); - - SystemAddress = MmGetSystemAddressForMdl(Mdl); - if (PreviousMode != KernelMode) + if (NT_SUCCESS(CopyStatus)) { - _SEH_TRY + /* Copy memory from the mapped MDL into the target buffer. */ + KeAttachProcess(&Process->Pcb); + + SystemAddress = MmGetSystemAddressForMdl(Mdl); + if (PreviousMode != KernelMode) { - memcpy(BaseAddress, SystemAddress, NumberOfBytesToWrite); + _SEH_TRY + { + memcpy(BaseAddress, SystemAddress, NumberOfBytesToWrite); + } + _SEH_HANDLE + { + CopyStatus = _SEH_GetExceptionCode(); + } + _SEH_END; } - _SEH_HANDLE + else { - CopyStatus = _SEH_GetExceptionCode(); + memcpy(BaseAddress, SystemAddress, NumberOfBytesToWrite); } - _SEH_END; - } - else - { - memcpy(BaseAddress, SystemAddress, NumberOfBytesToWrite); - } - KeDetachProcess(); + KeDetachProcess(); + } /* Free the MDL. */ if (Mdl->MappedSystemVa != NULL) @@ -895,22 +905,9 @@ MmUnlockPages(Mdl); ExFreePool(Mdl); } - - /* Reset the protection of the target memory. */ - Status = MiProtectVirtualMemory(Process, - &ProtectBaseAddress, - &ProtectNumberOfBytes, - OldProtection, - &OldProtection); - if (!NT_SUCCESS(Status)) - { - DPRINT1("Failed to reset protection of the target memory! (Status 0x%x)\n", Status); - /* FIXME: Should we bugcheck here? */ - } - ObDereferenceObject(Process); - if (NumberOfBytesWritten != NULL) + if (NT_SUCCESS(CopyStatus) && NumberOfBytesWritten != NULL) { if (PreviousMode != KernelMode) { @@ -1030,7 +1027,7 @@ ExRaiseStatus (STATUS_DATATYPE_MISALIGNMENT); } - Last = (PCHAR)((ULONG_PTR)Address + Length - 1); + Last = (CHAR*)((ULONG_PTR)Address + Length - 1); if ((ULONG_PTR)Last < (ULONG_PTR)Address || (ULONG_PTR)Last >= (ULONG_PTR)MmUserProbeAddress) { @@ -1039,11 +1036,13 @@ /* Check for accessible pages */ Current = (CHAR*)Address; - do + *Current = *Current; + Current = (PCHAR)((ULONG_PTR)PAGE_ROUND_DOWN(Current) + PAGE_SIZE); + while (Current <= Last) { *Current = *Current; Current = (CHAR*)((ULONG_PTR)Current + PAGE_SIZE); - } while (Current <= Last); + } } /* EOF */
19 years, 2 months
1
0
0
0
[ekohl] 18742: Fixed definition of ScmrChangeServiceConfigW:
by ekohl@svn.reactos.com
Fixed definition of ScmrChangeServiceConfigW: - lpBinaryPathName must be a [unique] pointer. Modified: trunk/reactos/include/idl/svcctl.idl _____ Modified: trunk/reactos/include/idl/svcctl.idl --- trunk/reactos/include/idl/svcctl.idl 2005-10-24 16:44:37 UTC (rev 18741) +++ trunk/reactos/include/idl/svcctl.idl 2005-10-24 17:13:08 UTC (rev 18742) @@ -74,14 +74,16 @@ /* Function 9 */ DWORD ScmrNotifyBootConfigStatus([in] handle_t BindingHandle, [in] BOOL BootAcceptable); + + /* Function 11 */ - DWORD ScmrChangeServiceConfigW([in] handle_t BiningHandle, + DWORD ScmrChangeServiceConfigW([in] handle_t BindingHandle, [in] SC_HANDLE hSCManager, [in] DWORD dwServiceType, [in] DWORD dwStartType, - [in] DWORD dwErrorControl, - [in, string, ref] LPCWSTR lpBinaryPathName, - [in, string, unique] LPCWSTR lpLoadOrderGroup, + [in] DWORD dwErrorControl, + [in, string, unique] LPCWSTR lpBinaryPathName, + [in, string, unique] LPCWSTR lpLoadOrderGroup, [in, out, unique] LPDWORD lpdwTagId, [in, size_is(dwDependenciesLength), unique] LPCWSTR lpDependencies, [in] DWORD dwDependenciesLength,
19 years, 2 months
1
0
0
0
[greatlrd] 18741: filling in bit more info to DDRAW_GLOBAL struct in halinistate.
by greatlrd@svn.reactos.com
filling in bit more info to DDRAW_GLOBAL struct in halinistate. Modified: trunk/reactos/lib/ddraw/main/ddraw.c _____ Modified: trunk/reactos/lib/ddraw/main/ddraw.c --- trunk/reactos/lib/ddraw/main/ddraw.c 2005-10-24 16:29:36 UTC (rev 18740) +++ trunk/reactos/lib/ddraw/main/ddraw.c 2005-10-24 16:44:37 UTC (rev 18741) @@ -71,12 +71,14 @@ This->hdc = GetDC(hwnd); This->cooperative_level = cooplevel; - if((ret = Hel_DirectDraw_SetCooperativeLevel (iface)) != DD_OK) - return ret; + if((ret = Hal_DirectDraw_SetCooperativeLevel (iface)) != DD_OK) return ret; + if((ret = Hel_DirectDraw_SetCooperativeLevel (iface)) != DD_OK) + return ret; + return DD_OK; } @@ -371,7 +373,7 @@ HRESULT WINAPI Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps, LPDWORD total, LPDWORD free) { - + DX_STUB; }
19 years, 2 months
1
0
0
0
[mbosma] 18740: Implemented thunks for IDirectDrawSurface and IDirectDraw. This isn't good code, because it is a mixture of wine and our code. But it works as far as I can see. I will fix it someday.
by mbosma@svn.reactos.com
Implemented thunks for IDirectDrawSurface and IDirectDraw. This isn't good code, because it is a mixture of wine and our code. But it works as far as I can see. I will fix it someday. Modified: trunk/reactos/lib/ddraw/ddraw.xml Modified: trunk/reactos/lib/ddraw/main/clipper.c Modified: trunk/reactos/lib/ddraw/main/color.c Modified: trunk/reactos/lib/ddraw/main/ddraw.c Modified: trunk/reactos/lib/ddraw/main/gamma.c Modified: trunk/reactos/lib/ddraw/main/palette.c Modified: trunk/reactos/lib/ddraw/main/surface.c Modified: trunk/reactos/lib/ddraw/main.c Modified: trunk/reactos/lib/ddraw/rosdraw.h Added: trunk/reactos/lib/ddraw/thunks/ddraw.c Added: trunk/reactos/lib/ddraw/thunks/surface.c Added: trunk/reactos/lib/ddraw/winedraw.h _____ Modified: trunk/reactos/lib/ddraw/ddraw.xml --- trunk/reactos/lib/ddraw/ddraw.xml 2005-10-24 15:56:03 UTC (rev 18739) +++ trunk/reactos/lib/ddraw/ddraw.xml 2005-10-24 16:29:36 UTC (rev 18740) @@ -1,4 +1,4 @@ -<module name="ddraw" type="win32dll" installbase="system32" installname="ddraw.dll" allowwarnings="true"> +<module name="ddraw" type="win32dll" installbase="system32" installname="ddraw.dll"> <importlibrary definition="ddraw.def" /> <include base="ddraw">.</include> <define name="UNICODE" /> @@ -35,4 +35,9 @@ <file>ddraw.c</file> <file>surface.c</file> </directory> + + <directory name="thunks"> + <file>ddraw.c</file> + <file>surface.c</file> + </directory> </module> _____ Modified: trunk/reactos/lib/ddraw/main/clipper.c --- trunk/reactos/lib/ddraw/main/clipper.c 2005-10-24 15:56:03 UTC (rev 18739) +++ trunk/reactos/lib/ddraw/main/clipper.c 2005-10-24 16:29:36 UTC (rev 18740) @@ -3,7 +3,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS * FILE: lib/ddraw/main/clipper.c - * PURPOSE: DirectDraw Implementation + * PURPOSE: IDirectDrawClipper Implementation * PROGRAMMER: Maarten Bosma * */ _____ Modified: trunk/reactos/lib/ddraw/main/color.c --- trunk/reactos/lib/ddraw/main/color.c 2005-10-24 15:56:03 UTC (rev 18739) +++ trunk/reactos/lib/ddraw/main/color.c 2005-10-24 16:29:36 UTC (rev 18740) @@ -3,7 +3,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS * FILE: lib/ddraw/main/color.c - * PURPOSE: DirectDraw Implementation + * PURPOSE: IDirectDrawColorControl Implementation * PROGRAMMER: Maarten Bosma * */ _____ Modified: trunk/reactos/lib/ddraw/main/ddraw.c --- trunk/reactos/lib/ddraw/main/ddraw.c 2005-10-24 15:56:03 UTC (rev 18739) +++ trunk/reactos/lib/ddraw/main/ddraw.c 2005-10-24 16:29:36 UTC (rev 18740) @@ -3,7 +3,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS * FILE: lib/ddraw/main/ddraw.c - * PURPOSE: DirectDraw Implementation + * PURPOSE: IDirectDraw7 Implementation * PROGRAMMER: Magnus Olsen, Maarten Bosma * */ @@ -140,7 +140,9 @@ if (That == NULL) return E_OUTOFMEMORY; - That->lpVtbl = &DirectDrawSurface_Vtable; + That->lpVtbl = &DirectDrawSurface7_Vtable; + That->lpVtbl_v3 = &DDRAW_IDDS3_Thunk_VTable; + That->ref = 1; *ppSurf = (LPDIRECTDRAWSURFACE7)That; @@ -173,13 +175,39 @@ return ref; } -/**** Stubs ****/ +HRESULT WINAPI Main_DirectDraw_QueryInterface ( + LPDIRECTDRAW7 iface, REFIID id, LPVOID *obj ) +{ + IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + + if (IsEqualGUID(&IID_IDirectDraw7, id)) + { + *obj = &This->lpVtbl; + } + else if (IsEqualGUID(&IID_IDirectDraw, id)) + { + *obj = &This->lpVtbl_v1; + } + else if (IsEqualGUID(&IID_IDirectDraw2, id)) + { + *obj = &This->lpVtbl_v2; + } + else if (IsEqualGUID(&IID_IDirectDraw4, id)) + { + *obj = &This->lpVtbl_v4; + } + else + { + *obj = NULL; + return E_NOINTERFACE; + } -HRESULT WINAPI Main_DirectDraw_QueryInterface (LPDIRECTDRAW7 iface,REFIID refiid,LPVOID *obj) -{ - DX_STUB; + Main_DirectDraw_AddRef(iface); + return S_OK; } +/**** Stubs ****/ + HRESULT WINAPI Main_DirectDraw_Compact(LPDIRECTDRAW7 iface) { DX_STUB; @@ -380,7 +408,7 @@ DX_STUB; } -IDirectDraw7Vtbl DirectDraw_Vtable = +IDirectDraw7Vtbl DirectDraw7_Vtable = { Main_DirectDraw_QueryInterface, Main_DirectDraw_AddRef, _____ Modified: trunk/reactos/lib/ddraw/main/gamma.c --- trunk/reactos/lib/ddraw/main/gamma.c 2005-10-24 15:56:03 UTC (rev 18739) +++ trunk/reactos/lib/ddraw/main/gamma.c 2005-10-24 16:29:36 UTC (rev 18740) @@ -3,7 +3,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS * FILE: lib/ddraw/main/gamma.c - * PURPOSE: DirectDraw Implementation + * PURPOSE: IDirectDrawGamma Implementation * PROGRAMMER: Maarten Bosma * */ _____ Modified: trunk/reactos/lib/ddraw/main/palette.c --- trunk/reactos/lib/ddraw/main/palette.c 2005-10-24 15:56:03 UTC (rev 18739) +++ trunk/reactos/lib/ddraw/main/palette.c 2005-10-24 16:29:36 UTC (rev 18740) @@ -3,7 +3,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS * FILE: lib/ddraw/main/palette.c - * PURPOSE: DirectDraw Implementation + * PURPOSE: IDirectDrawPalette Implementation * PROGRAMMER: Maarten Bosma * */ _____ Modified: trunk/reactos/lib/ddraw/main/surface.c --- trunk/reactos/lib/ddraw/main/surface.c 2005-10-24 15:56:03 UTC (rev 18739) +++ trunk/reactos/lib/ddraw/main/surface.c 2005-10-24 16:29:36 UTC (rev 18740) @@ -3,7 +3,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS * FILE: lib/ddraw/main/surface.c - * PURPOSE: DirectDraw Implementation + * PURPOSE: IDirectDrawSurface7 Implementation * PROGRAMMER: Magnus Olsen, Maarten Bosma * */ @@ -113,6 +113,13 @@ /**** Stubs ****/ +HRESULT WINAPI +Main_DDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE7 iface, REFIID riid, + LPVOID* ppObj) +{ + DX_STUB; +} + HRESULT WINAPI Main_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst, LPDIRECTDRAWSURFACE7 src, LPRECT rsrc, DWORD dwFlags, LPDDBLTFX lpbltfx) { @@ -131,13 +138,6 @@ } HRESULT WINAPI -Main_DDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE7 iface, REFIID riid, - LPVOID* ppObj) -{ - DX_STUB; -} - -HRESULT WINAPI Main_DDrawSurface_AddAttachedSurface(LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAWSURFACE7 pAttach) { @@ -421,7 +421,7 @@ DX_STUB; } -IDirectDrawSurface7Vtbl DirectDrawSurface_Vtable = +IDirectDrawSurface7Vtbl DirectDrawSurface7_Vtable = { Main_DDrawSurface_QueryInterface, Main_DDrawSurface_AddRef, _____ Modified: trunk/reactos/lib/ddraw/main.c --- trunk/reactos/lib/ddraw/main.c 2005-10-24 15:56:03 UTC (rev 18739) +++ trunk/reactos/lib/ddraw/main.c 2005-10-24 16:29:36 UTC (rev 18740) @@ -13,8 +13,7 @@ #include "rosdraw.h" -HRESULT WINAPI Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface, - IUnknown* pUnkOuter, BOOL ex) +HRESULT WINAPI Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface, REFIID id, BOOL ex) { IDirectDrawImpl* This = (IDirectDrawImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawImpl)); @@ -23,10 +22,17 @@ ZeroMemory(This,sizeof(IDirectDrawImpl)); - This->lpVtbl = &DirectDraw_Vtable; + This->lpVtbl = &DirectDraw7_Vtable; + This->lpVtbl_v1 = &DDRAW_IDirectDraw_VTable; + This->lpVtbl_v2 = &DDRAW_IDirectDraw2_VTable; + This->lpVtbl_v4 = &DDRAW_IDirectDraw4_VTable; + This->DirectDrawGlobal.dwRefCnt = 1; *pIface = (LPDIRECTDRAW)This; + if(This->lpVtbl->QueryInterface ((LPDIRECTDRAW7)This, id, (void**)&pIface) != S_OK) + return DDERR_INVALIDPARAMS; + return This->lpVtbl->Initialize ((LPDIRECTDRAW7)This, pGUID); } @@ -39,10 +45,10 @@ return DDERR_INVALIDPARAMS; } - return Create_DirectDraw (lpGUID, lplpDD, pUnkOuter, FALSE); + return Create_DirectDraw (lpGUID, lplpDD, &IID_IDirectDraw, FALSE); } -HRESULT WINAPI DirectDrawCreateEx(LPGUID lpGUID, LPVOID* lplpDD, REFIID iid, LPUNKNOWN pUnkOuter) +HRESULT WINAPI DirectDrawCreateEx(LPGUID lpGUID, LPVOID* lplpDD, REFIID id, LPUNKNOWN pUnkOuter) { /* check see if pUnkOuter is null or not */ if (pUnkOuter) @@ -52,12 +58,12 @@ } /* Is it a DirectDraw 7 Request or not */ - if (!IsEqualGUID(iid, &IID_IDirectDraw7)) + if (!IsEqualGUID(id, &IID_IDirectDraw7)) { return DDERR_INVALIDPARAMS; } - return Create_DirectDraw (lpGUID, (LPDIRECTDRAW*)lplpDD, pUnkOuter, TRUE); + return Create_DirectDraw (lpGUID, (LPDIRECTDRAW*)lplpDD, id, TRUE); } HRESULT WINAPI DirectDrawEnumerateA( @@ -65,7 +71,7 @@ LPVOID lpContext ) { - return DD_OK; + DX_STUB; } @@ -74,7 +80,7 @@ LPVOID lpContext ) { - return DD_OK; + DX_STUB; } HRESULT WINAPI DirectDrawEnumerateExA( @@ -83,7 +89,7 @@ DWORD dwFlags ) { - return DD_OK; + DX_STUB; } HRESULT WINAPI DirectDrawEnumerateExW( @@ -92,7 +98,7 @@ DWORD dwFlags ) { - return DD_OK; + DX_STUB; } HRESULT WINAPI DirectDrawCreateClipper( @@ -101,6 +107,5 @@ LPUNKNOWN pUnkOuter ) { - return DD_OK; + DX_STUB; } - _____ Modified: trunk/reactos/lib/ddraw/rosdraw.h --- trunk/reactos/lib/ddraw/rosdraw.h 2005-10-24 15:56:03 UTC (rev 18739) +++ trunk/reactos/lib/ddraw/rosdraw.h 2005-10-24 16:29:36 UTC (rev 18740) @@ -3,7 +3,6 @@ /********* Includes *********/ - #include <windows.h> #include <stdio.h> #include <ddraw.h> @@ -16,6 +15,10 @@ typedef struct { IDirectDraw7Vtbl* lpVtbl; + IDirectDraw4Vtbl* lpVtbl_v4; + IDirectDraw2Vtbl* lpVtbl_v2; + IDirectDrawVtbl* lpVtbl_v1; + DDRAWI_DIRECTDRAW_GBL DirectDrawGlobal; DDHALINFO HalInfo; @@ -33,6 +36,8 @@ typedef struct { IDirectDrawSurface7Vtbl* lpVtbl; + IDirectDrawSurface3Vtbl* lpVtbl_v3; + LONG ref; IDirectDrawImpl* owner; @@ -63,8 +68,14 @@ /*********** VTables ************/ -extern IDirectDraw7Vtbl DirectDraw_Vtable; -extern IDirectDrawSurface7Vtbl DirectDrawSurface_Vtable; +extern IDirectDraw7Vtbl DirectDraw7_Vtable; +extern IDirectDrawVtbl DDRAW_IDirectDraw_VTable; +extern IDirectDraw2Vtbl DDRAW_IDirectDraw2_VTable; +extern IDirectDraw4Vtbl DDRAW_IDirectDraw4_VTable; + +extern IDirectDrawSurface7Vtbl DirectDrawSurface7_Vtable; +extern IDirectDrawSurface3Vtbl DDRAW_IDDS3_Thunk_VTable; + extern IDirectDrawPaletteVtbl DirectDrawPalette_Vtable; extern IDirectDrawClipperVtbl DirectDrawClipper_Vtable; extern IDirectDrawColorControlVtbl DirectDrawColorControl_Vtable; _____ Added: trunk/reactos/lib/ddraw/thunks/ddraw.c --- trunk/reactos/lib/ddraw/thunks/ddraw.c 2005-10-24 15:56:03 UTC (rev 18739) +++ trunk/reactos/lib/ddraw/thunks/ddraw.c 2005-10-24 16:29:36 UTC (rev 18740) @@ -0,0 +1,1049 @@ +/* Direct Draw Thunks and old vtables + * Copyright 2000 TransGaming Technologies Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * Taken form wine (wine/dlls/ddraw/ddraw_thunks.c rev 1.2) + * with some little changes + * + */ + +#include "winedraw.h" + + +static HRESULT WINAPI +IDirectDrawImpl_QueryInterface(LPDIRECTDRAW This, REFIID iid, LPVOID *ppObj) +{ + return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw, + IDirectDraw7, This), + iid, ppObj); +} + +static HRESULT WINAPI +IDirectDraw2Impl_QueryInterface(LPDIRECTDRAW2 This, REFIID iid, LPVOID *ppObj) +{ + return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw2, + IDirectDraw7, This), + iid, ppObj); +} + + +static HRESULT WINAPI +IDirectDraw4Impl_QueryInterface(LPDIRECTDRAW4 This, REFIID iid, LPVOID *ppObj) +{ + return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw4, + IDirectDraw7, This), + iid, ppObj); +} + +static ULONG WINAPI +IDirectDrawImpl_AddRef(LPDIRECTDRAW This) +{ + return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw, IDirectDraw7, + This)); +} + +static ULONG WINAPI +IDirectDraw2Impl_AddRef(LPDIRECTDRAW2 This) +{ + return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw2, IDirectDraw7, + This)); +} + +static ULONG WINAPI +IDirectDraw4Impl_AddRef(LPDIRECTDRAW4 This) +{ + return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw4, IDirectDraw7, + This)); +} + +static ULONG WINAPI +IDirectDrawImpl_Release(LPDIRECTDRAW This) +{ + return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw, IDirectDraw7, + This)); +} + +static ULONG WINAPI +IDirectDraw2Impl_Release(LPDIRECTDRAW2 This) +{ + return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw2, IDirectDraw7, + This)); +} + +static ULONG WINAPI +IDirectDraw4Impl_Release(LPDIRECTDRAW4 This) +{ + return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw4, IDirectDraw7, + This)); +} + +static HRESULT WINAPI +IDirectDrawImpl_Compact(LPDIRECTDRAW This) +{ + return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw, IDirectDraw7, + This)); +} + +static HRESULT WINAPI +IDirectDraw2Impl_Compact(LPDIRECTDRAW2 This) +{ + return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw2, IDirectDraw7, + This)); +} + +static HRESULT WINAPI +IDirectDraw4Impl_Compact(LPDIRECTDRAW4 This) +{ + return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw4, IDirectDraw7, + This)); +} + +static HRESULT WINAPI +IDirectDrawImpl_CreateClipper(LPDIRECTDRAW This, DWORD dwFlags, + LPDIRECTDRAWCLIPPER *ppClipper, + IUnknown *pUnkOuter) +{ + return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw, + IDirectDraw7, + This), + dwFlags, ppClipper, pUnkOuter); +} + +static HRESULT WINAPI +IDirectDraw2Impl_CreateClipper(LPDIRECTDRAW2 This, DWORD dwFlags, + LPDIRECTDRAWCLIPPER *ppClipper, + IUnknown *pUnkOuter) +{ + return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw2, + IDirectDraw7, + This), + dwFlags, ppClipper, pUnkOuter); +} + +static HRESULT WINAPI +IDirectDraw4Impl_CreateClipper(LPDIRECTDRAW4 This, DWORD dwFlags, + LPDIRECTDRAWCLIPPER *ppClipper, + IUnknown *pUnkOuter) +{ + return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw4, + IDirectDraw7, + This), + dwFlags, ppClipper, pUnkOuter); +} + +static HRESULT WINAPI +IDirectDrawImpl_CreatePalette(LPDIRECTDRAW This, DWORD dwFlags, + LPPALETTEENTRY pEntries, + LPDIRECTDRAWPALETTE *ppPalette, + IUnknown *pUnkOuter) +{ + return IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw, + IDirectDraw7, + This), + dwFlags, pEntries, ppPalette, pUnkOuter); +} + +static HRESULT WINAPI +IDirectDraw2Impl_CreatePalette(LPDIRECTDRAW2 This, DWORD dwFlags, + LPPALETTEENTRY pEntries, + LPDIRECTDRAWPALETTE *ppPalette, + IUnknown *pUnkOuter) +{ + return IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw2, + IDirectDraw7, + This), + dwFlags, pEntries, ppPalette, pUnkOuter); +} + +static HRESULT WINAPI +IDirectDraw4Impl_CreatePalette(LPDIRECTDRAW4 This, DWORD dwFlags, + LPPALETTEENTRY pEntries, + LPDIRECTDRAWPALETTE *ppPalette, + IUnknown *pUnkOuter) +{ + return IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw4, + IDirectDraw7, + This), + dwFlags, pEntries, ppPalette, pUnkOuter); +} + +static HRESULT WINAPI +IDirectDrawImpl_CreateSurface(LPDIRECTDRAW This, LPDDSURFACEDESC pSDesc, + LPDIRECTDRAWSURFACE *ppSurface, + IUnknown *pUnkOuter) +{ + LPDIRECTDRAWSURFACE7 pSurface7; + HRESULT hr; + + /* the LPDDSURFACEDESC -> LPDDSURFACEDESC2 conversion should be ok, + * since the data layout is the same */ + hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw, + IDirectDraw7, + This), + (LPDDSURFACEDESC2)pSDesc, &pSurface7, pUnkOuter); + + /* This coercion is safe, since the IDirectDrawSurface3 vtable has the + * IDirectDrawSurface vtable layout at the beginning */ + *ppSurface = (LPDIRECTDRAWSURFACE) COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, + IDirectDrawSurface7, IDirectDrawSurface3, + pSurface7); + + return hr; +} + +static HRESULT WINAPI +IDirectDraw2Impl_CreateSurface(LPDIRECTDRAW2 This, LPDDSURFACEDESC pSDesc, + LPDIRECTDRAWSURFACE *ppSurface, + IUnknown *pUnkOuter) +{ + LPDIRECTDRAWSURFACE7 pSurface7; + HRESULT hr; + + hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw2, + IDirectDraw7, + This), + (LPDDSURFACEDESC2)pSDesc, &pSurface7, pUnkOuter); + + /* This coercion is safe, since the IDirectDrawSurface3 vtable has the + * IDirectDrawSurface vtable layout at the beginning */ + *ppSurface = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, + IDirectDrawSurface7, IDirectDrawSurface3, + pSurface7); + + return hr; +} + +static HRESULT WINAPI +IDirectDraw4Impl_CreateSurface(LPDIRECTDRAW4 This, LPDDSURFACEDESC2 pSDesc, + LPDIRECTDRAWSURFACE4 *ppSurface, + IUnknown *pUnkOuter) +{ + return IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw4, + IDirectDraw7, + This), + pSDesc, + (LPDIRECTDRAWSURFACE7 *)ppSurface, + pUnkOuter); +} + +static HRESULT WINAPI +IDirectDrawImpl_DuplicateSurface(LPDIRECTDRAW This, LPDIRECTDRAWSURFACE pSrc, + LPDIRECTDRAWSURFACE *ppDst) +{ + LPDIRECTDRAWSURFACE7 pDst7; + HRESULT hr; + + hr = IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw, + IDirectDraw7, This), + COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, + IDirectDrawSurface3, + IDirectDrawSurface7, + pSrc), + &pDst7); + + /* This coercion is safe, since the IDirectDrawSurface3 vtable has the + * IDirectDrawSurface vtable layout at the beginning */ + *ppDst = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7, + IDirectDrawSurface3, pDst7); + + return hr; +} + +static HRESULT WINAPI +IDirectDraw2Impl_DuplicateSurface(LPDIRECTDRAW2 This, LPDIRECTDRAWSURFACE pSrc, + LPDIRECTDRAWSURFACE *ppDst) +{ + LPDIRECTDRAWSURFACE7 pDst7; + HRESULT hr; + + hr = IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw2, + IDirectDraw7, This), + COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, + IDirectDrawSurface3, + IDirectDrawSurface7, + pSrc), + &pDst7); + + /* This coercion is safe, since the IDirectDrawSurface3 vtable has the + * IDirectDrawSurface vtable layout at the beginning */ + *ppDst = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7, + IDirectDrawSurface3, pDst7); + + return hr; +} + +static HRESULT WINAPI +IDirectDraw4Impl_DuplicateSurface(LPDIRECTDRAW4 This, + LPDIRECTDRAWSURFACE4 pSrc, + LPDIRECTDRAWSURFACE4 *ppDst) +{ + return IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw4, + IDirectDraw7, + This), + (LPDIRECTDRAWSURFACE7)pSrc, + (LPDIRECTDRAWSURFACE7 *)ppDst); +} + +struct displaymodescallback_context +{ + LPDDENUMMODESCALLBACK func; + LPVOID context; +}; + +static HRESULT CALLBACK +EnumDisplayModesCallbackThunk(LPDDSURFACEDESC2 pDDSD2, LPVOID context) +{ + DDSURFACEDESC DDSD; + struct displaymodescallback_context *cbcontext = context; + + memcpy(&DDSD,pDDSD2,sizeof(DDSD)); + DDSD.dwSize = sizeof(DDSD); + + return cbcontext->func(&DDSD, cbcontext->context); +} + +static HRESULT WINAPI +IDirectDrawImpl_EnumDisplayModes(LPDIRECTDRAW This, DWORD dwFlags, + LPDDSURFACEDESC pDDSD, LPVOID context, + LPDDENUMMODESCALLBACK cb) +{ + struct displaymodescallback_context cbcontext; + + cbcontext.func = cb; + cbcontext.context = context; + + return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw, + IDirectDraw7, + This), + dwFlags, (LPDDSURFACEDESC2)pDDSD, &cbcontext, + EnumDisplayModesCallbackThunk); +} + +static HRESULT WINAPI +IDirectDraw2Impl_EnumDisplayModes(LPDIRECTDRAW2 This, DWORD dwFlags, + LPDDSURFACEDESC pDDSD, LPVOID context, + LPDDENUMMODESCALLBACK cb) +{ + struct displaymodescallback_context cbcontext; + + cbcontext.func = cb; + cbcontext.context = context; + + return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw2, + IDirectDraw7, + This), + dwFlags, (LPDDSURFACEDESC2)pDDSD, &cbcontext, + EnumDisplayModesCallbackThunk); +} + +static HRESULT WINAPI +IDirectDraw4Impl_EnumDisplayModes(LPDIRECTDRAW4 This, DWORD dwFlags, + LPDDSURFACEDESC2 pDDSD, LPVOID context, + LPDDENUMMODESCALLBACK2 cb) +{ + return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw4, + IDirectDraw7, + This), + dwFlags, pDDSD, context, cb); +} + +struct surfacescallback_context +{ + LPDDENUMSURFACESCALLBACK func; + LPVOID context; +}; + +static HRESULT CALLBACK +EnumSurfacesCallbackThunk(LPDIRECTDRAWSURFACE7 pSurf, LPDDSURFACEDESC2 pDDSD, + LPVOID context) +{ + struct surfacescallback_context *cbcontext = context; + + /* This coercion is safe, since the IDirectDrawSurface3 vtable has the + * IDirectDrawSurface vtable layout at the beginning */ + return cbcontext->func((LPDIRECTDRAWSURFACE) + COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, + IDirectDrawSurface7, + IDirectDrawSurface3, pSurf), + (LPDDSURFACEDESC)pDDSD, cbcontext->context); +} + +static HRESULT WINAPI +IDirectDrawImpl_EnumSurfaces(LPDIRECTDRAW This, DWORD dwFlags, + LPDDSURFACEDESC pDDSD, LPVOID context, + LPDDENUMSURFACESCALLBACK cb) +{ + struct surfacescallback_context cbcontext; + + cbcontext.func = cb; + cbcontext.context = context; + + return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw, + IDirectDraw7, This), + dwFlags, (LPDDSURFACEDESC2)pDDSD, + &cbcontext, EnumSurfacesCallbackThunk); +} + +static HRESULT WINAPI +IDirectDraw2Impl_EnumSurfaces(LPDIRECTDRAW2 This, DWORD dwFlags, + LPDDSURFACEDESC pDDSD, LPVOID context, + LPDDENUMSURFACESCALLBACK cb) +{ + struct surfacescallback_context cbcontext; + + cbcontext.func = cb; + cbcontext.context = context; + + return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw2, + IDirectDraw7, This), + dwFlags, (LPDDSURFACEDESC2)pDDSD, + &cbcontext, EnumSurfacesCallbackThunk); +} + +static HRESULT WINAPI +IDirectDraw4Impl_EnumSurfaces(LPDIRECTDRAW4 This, DWORD dwFlags, + LPDDSURFACEDESC2 pDDSD, LPVOID context, + LPDDENUMSURFACESCALLBACK2 cb) +{ + return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw4, + IDirectDraw7, This), + dwFlags, pDDSD, context, + (LPDDENUMSURFACESCALLBACK7)cb); +} + +static HRESULT WINAPI +IDirectDrawImpl_FlipToGDISurface(LPDIRECTDRAW This) +{ + return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw, + IDirectDraw7, + This)); +} + +static HRESULT WINAPI +IDirectDraw2Impl_FlipToGDISurface(LPDIRECTDRAW2 This) +{ + return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw2, + IDirectDraw7, + This)); +} + +static HRESULT WINAPI +IDirectDraw4Impl_FlipToGDISurface(LPDIRECTDRAW4 This) +{ + return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw4, + IDirectDraw7, + This)); +} + +static HRESULT WINAPI +IDirectDrawImpl_GetCaps(LPDIRECTDRAW This, LPDDCAPS pDDC1, LPDDCAPS pDDC2) +{ + return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw, IDirectDraw7, + This), pDDC1, pDDC2); +} + +static HRESULT WINAPI +IDirectDraw2Impl_GetCaps(LPDIRECTDRAW2 This, LPDDCAPS pDDC1, LPDDCAPS pDDC2) +{ + return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw2, IDirectDraw7, + This), pDDC1, pDDC2); +} + +static HRESULT WINAPI +IDirectDraw4Impl_GetCaps(LPDIRECTDRAW4 This, LPDDCAPS pDDC1, LPDDCAPS pDDC2) +{ + return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw4, IDirectDraw7, + This), pDDC1, pDDC2); +} + +static HRESULT WINAPI +IDirectDrawImpl_GetDisplayMode(LPDIRECTDRAW This, LPDDSURFACEDESC pDDSD) +{ + return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw, + IDirectDraw7, This), + (LPDDSURFACEDESC2)pDDSD); +} + +static HRESULT WINAPI +IDirectDraw2Impl_GetDisplayMode(LPDIRECTDRAW2 This, LPDDSURFACEDESC pDDSD) +{ + return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw2, + IDirectDraw7, This), + (LPDDSURFACEDESC2)pDDSD); +} + +static HRESULT WINAPI +IDirectDraw4Impl_GetDisplayMode(LPDIRECTDRAW4 This, LPDDSURFACEDESC2 pDDSD) +{ + return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw4, + IDirectDraw7, This), + pDDSD); +} + +static HRESULT WINAPI +IDirectDrawImpl_GetFourCCCodes(LPDIRECTDRAW This, LPDWORD lpNumCodes, + LPDWORD lpCodes) +{ + return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw, + IDirectDraw7, + This), + lpNumCodes, lpCodes); +} + +static HRESULT WINAPI +IDirectDraw2Impl_GetFourCCCodes(LPDIRECTDRAW2 This, LPDWORD lpNumCodes, + LPDWORD lpCodes) +{ + return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw2, + IDirectDraw7, + This), + lpNumCodes, lpCodes); +} + +static HRESULT WINAPI +IDirectDraw4Impl_GetFourCCCodes(LPDIRECTDRAW4 This, LPDWORD lpNumCodes, + LPDWORD lpCodes) +{ + return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw4, + IDirectDraw7, + This), + lpNumCodes, lpCodes); +} + +static HRESULT WINAPI +IDirectDrawImpl_GetGDISurface(LPDIRECTDRAW This, LPDIRECTDRAWSURFACE *ppSurf) +{ + LPDIRECTDRAWSURFACE7 pSurf7; + HRESULT hr; + + hr = IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw, + IDirectDraw7, + This), &pSurf7); + + /* This coercion is safe, since the IDirectDrawSurface3 vtable has the + * IDirectDrawSurface vtable layout at the beginning */ + *ppSurf = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7, + IDirectDrawSurface3, pSurf7); + + return hr; +} + +static HRESULT WINAPI +IDirectDraw2Impl_GetGDISurface(LPDIRECTDRAW2 This, LPDIRECTDRAWSURFACE *ppSurf) +{ + LPDIRECTDRAWSURFACE7 pSurf7; + HRESULT hr; + + hr = IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw2, + IDirectDraw7, + This), &pSurf7); + + /* This coercion is safe, since the IDirectDrawSurface3 vtable has the + * IDirectDrawSurface vtable layout at the beginning */ + *ppSurf = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7, + IDirectDrawSurface3, pSurf7); + + return hr; +} + +static HRESULT WINAPI +IDirectDraw4Impl_GetGDISurface(LPDIRECTDRAW4 This, + LPDIRECTDRAWSURFACE4 *ppSurf) +{ + return IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw4, + IDirectDraw7, + This), + (LPDIRECTDRAWSURFACE7 *)ppSurf); +} + +static HRESULT WINAPI +IDirectDrawImpl_GetMonitorFrequency(LPDIRECTDRAW This, LPDWORD pdwFreq) +{ + return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw, + IDirectDraw7, + This), + pdwFreq); +} + +static HRESULT WINAPI +IDirectDraw2Impl_GetMonitorFrequency(LPDIRECTDRAW2 This, LPDWORD pdwFreq) +{ + return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl, + IDirectDraw2, + IDirectDraw7, + This), + pdwFreq); +} + +static HRESULT WINAPI +IDirectDraw4Impl_GetMonitorFrequency(LPDIRECTDRAW4 This, LPDWORD pdwFreq) +{ + return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl, [truncated at 1000 lines; 966 more skipped]
19 years, 2 months
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
74
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Results per page:
10
25
50
100
200