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
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
April 2006
----- 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
14 participants
324 discussions
Start a n
N
ew thread
[greatlrd] 21576: This commit is redesign off ddraw primare surface, we need reach primare surface from every where. We have now a expriment code that show how to create overlay with this new design but we do not set it up right yet.
by greatlrd@svn.reactos.org
Author: greatlrd Date: Thu Apr 13 13:14:32 2006 New Revision: 21576 URL:
http://svn.reactos.ru/svn/reactos?rev=21576&view=rev
Log: This commit is redesign off ddraw primare surface, we need reach primare surface from every where. We have now a expriment code that show how to create overlay with this new design but we do not set it up right yet. Modified: trunk/reactos/dll/directx/ddraw/hal/surface_hal.c trunk/reactos/dll/directx/ddraw/main/ddraw_main.c trunk/reactos/dll/directx/ddraw/main/surface_main.c trunk/reactos/dll/directx/ddraw/rosdraw.h Modified: trunk/reactos/dll/directx/ddraw/hal/surface_hal.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/surfa…
============================================================================== --- trunk/reactos/dll/directx/ddraw/hal/surface_hal.c (original) +++ trunk/reactos/dll/directx/ddraw/hal/surface_hal.c Thu Apr 13 13:14:32 2006 @@ -30,14 +30,14 @@ return DD_FALSE; } - if (!(This->owner->mDDrawGlobal.lpDDCBtmp->HALDDSurface.dwFlags & DDHAL_SURFCB32_BLT)) + if (!(This->Owner->mDDrawGlobal.lpDDCBtmp->HALDDSurface.dwFlags & DDHAL_SURFCB32_BLT)) { return DDERR_NODRIVERSUPPORT; } - mDdBlt.lpDDDestSurface = This->Surf->mpPrimaryLocals[0]; - - if (!DdResetVisrgn(This->Surf->mpPrimaryLocals[0], NULL)) + mDdBlt.lpDDDestSurface = This->Owner->mpPrimaryLocals[0]; + + if (!DdResetVisrgn(This->Owner->mpPrimaryLocals[0], NULL)) { return DDERR_NOGDI; } @@ -62,12 +62,12 @@ if (src != NULL) { - mDdBlt.lpDDSrcSurface = That->Surf->mpPrimaryLocals[0]; - } - - mDdBlt.lpDD = &This->owner->mDDrawGlobal; - mDdBlt.Blt = This->owner->mCallbacks.HALDDSurface.Blt; - mDdBlt.lpDDDestSurface = This->Surf->mpPrimaryLocals[0]; + mDdBlt.lpDDSrcSurface = That->Surf->mpSurfLocals[0]; + } + + mDdBlt.lpDD = &This->Owner->mDDrawGlobal; + mDdBlt.Blt = This->Owner->mCallbacks.HALDDSurface.Blt; + mDdBlt.lpDDDestSurface = This->Owner->mpPrimaryLocals[0]; mDdBlt.dwFlags = dwFlags; @@ -107,13 +107,13 @@ } Lock.ddRVal = DDERR_NOTPALETTIZED; - Lock.Lock = This->owner->mCallbacks.HALDDSurface.Lock; + Lock.Lock = This->Owner->mCallbacks.HALDDSurface.Lock; Lock.dwFlags = flags; - Lock.lpDDSurface = &This->Surf->mPrimaryLocal; - Lock.lpDD = &This->owner->mDDrawGlobal; + Lock.lpDDSurface = &This->Owner->mPrimaryLocal; + Lock.lpDD = &This->Owner->mDDrawGlobal; Lock.lpSurfData = NULL; - if (!DdResetVisrgn(&This->Surf->mPrimaryLocal, NULL)) + if (!DdResetVisrgn(&This->Owner->mPrimaryLocal, NULL)) { OutputDebugStringA("Here DdResetVisrgn lock"); return DDERR_UNSUPPORTED; @@ -138,13 +138,13 @@ { RtlZeroMemory(pDDSD,sizeof(DDSURFACEDESC2)); // FIXME the interanl mddsdPrimary shall be DDSURFACEDESC2 - memcpy(pDDSD,&This->Surf->mddsdPrimary,sizeof(DDSURFACEDESC)); + memcpy(pDDSD,&This->Owner->mddsdPrimary,sizeof(DDSURFACEDESC)); pDDSD->dwSize = sizeof(DDSURFACEDESC2); } if (pDDSD->dwSize == sizeof(DDSURFACEDESC)) { RtlZeroMemory(pDDSD,sizeof(DDSURFACEDESC)); - memcpy(pDDSD,&This->Surf->mddsdPrimary,sizeof(DDSURFACEDESC)); + memcpy(pDDSD,&This->Owner->mddsdPrimary,sizeof(DDSURFACEDESC)); pDDSD->dwSize = sizeof(DDSURFACEDESC); } @@ -159,9 +159,9 @@ DDHAL_UNLOCKDATA unLock; unLock.ddRVal = DDERR_NOTPALETTIZED; - unLock.lpDD = &This->owner->mDDrawGlobal; - unLock.lpDDSurface = &This->Surf->mPrimaryLocal; - unLock.Unlock = This->owner->mCallbacks.HALDDSurface.Unlock; + unLock.lpDD = &This->Owner->mDDrawGlobal; + unLock.lpDDSurface = &This->Owner->mPrimaryLocal; + unLock.Unlock = This->Owner->mCallbacks.HALDDSurface.Unlock; Modified: trunk/reactos/dll/directx/ddraw/main/ddraw_main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/ddra…
============================================================================== --- trunk/reactos/dll/directx/ddraw/main/ddraw_main.c (original) +++ trunk/reactos/dll/directx/ddraw/main/ddraw_main.c Thu Apr 13 13:14:32 2006 @@ -357,6 +357,11 @@ DdReenableDirectDrawObject(&This->mDDrawGlobal, &dummy); /* FIXME fill the This->DirectDrawGlobal.vmiData right */ } + + //This->mDDrawGlobal.lpExclusiveOwner->hDC = (ULONG_PTR)GetDC( (HWND)This->mDDrawGlobal.lpExclusiveOwner->hWnd); + + + return ret; } @@ -446,11 +451,11 @@ // FIXME free This->mDDrawGlobal.dsList on release This->mDDrawGlobal.dsList = (LPDDRAWI_DDRAWSURFACE_INT)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DDRAWI_DDRAWSURFACE_INT)); - That->owner = (IDirectDrawImpl *)This; - That->owner->mDDrawGlobal.dsList->dwIntRefCnt =1; + That->Owner = (IDirectDrawImpl *)This; + That->Owner->mDDrawGlobal.dsList->dwIntRefCnt =1; /* we alwasy set to use the DirectDrawSurface7_Vtable as internel */ - That->owner->mDDrawGlobal.dsList->lpVtbl = (PVOID) &DirectDrawSurface7_Vtable; + That->Owner->mDDrawGlobal.dsList->lpVtbl = (PVOID) &DirectDrawSurface7_Vtable; That->Surf = surf; @@ -465,11 +470,11 @@ if (pDDSD->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) { - - memcpy(&That->Surf->mddsdPrimary,pDDSD,sizeof(DDSURFACEDESC)); - That->Surf->mddsdPrimary.dwSize = sizeof(DDSURFACEDESC); + OutputDebugStringA("Create DDSCAPS_PRIMARYSURFACE\n"); + memcpy(&That->Owner->mddsdPrimary,pDDSD,sizeof(DDSURFACEDESC)); + That->Owner->mddsdPrimary.dwSize = sizeof(DDSURFACEDESC); This->mDdCanCreateSurface.bIsDifferentPixelFormat = FALSE; - This->mDdCanCreateSurface.lpDDSurfaceDesc = &That->Surf->mddsdPrimary; + This->mDdCanCreateSurface.lpDDSurfaceDesc = &That->Owner->mddsdPrimary; if (This->mDdCanCreateSurface.CanCreateSurface(&This->mDdCanCreateSurface)== DDHAL_DRIVER_NOTHANDLED) { @@ -481,34 +486,34 @@ return DDERR_NOTINITIALIZED; } - memset(&That->Surf->mPrimaryGlobal, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL)); - That->Surf->mPrimaryGlobal.dwGlobalFlags = DDRAWISURFGBL_ISGDISURFACE; - That->Surf->mPrimaryGlobal.lpDD = &This->mDDrawGlobal; - That->Surf->mPrimaryGlobal.lpDDHandle = &This->mDDrawGlobal; - That->Surf->mPrimaryGlobal.wWidth = (WORD)This->mpModeInfos[0].dwWidth; - That->Surf->mPrimaryGlobal.wHeight = (WORD)This->mpModeInfos[0].dwHeight; - That->Surf->mPrimaryGlobal.lPitch = This->mpModeInfos[0].lPitch; - - memset(&That->Surf->mPrimaryMore, 0, sizeof(DDRAWI_DDRAWSURFACE_MORE)); - That->Surf->mPrimaryMore.dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE); - - memset(&That->Surf->mPrimaryLocal, 0, sizeof(DDRAWI_DDRAWSURFACE_LCL)); - That->Surf->mPrimaryLocal.lpGbl = &That->Surf->mPrimaryGlobal; - That->Surf->mPrimaryLocal.lpSurfMore = &That->Surf->mPrimaryMore; - That->Surf->mPrimaryLocal.dwProcessId = GetCurrentProcessId(); + memset(&That->Owner->mPrimaryGlobal, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL)); + That->Owner->mPrimaryGlobal.dwGlobalFlags = DDRAWISURFGBL_ISGDISURFACE; + That->Owner->mPrimaryGlobal.lpDD = &This->mDDrawGlobal; + That->Owner->mPrimaryGlobal.lpDDHandle = &This->mDDrawGlobal; + That->Owner->mPrimaryGlobal.wWidth = (WORD)This->mpModeInfos[0].dwWidth; + That->Owner->mPrimaryGlobal.wHeight = (WORD)This->mpModeInfos[0].dwHeight; + That->Owner->mPrimaryGlobal.lPitch = This->mpModeInfos[0].lPitch; + + memset(&That->Owner->mPrimaryMore, 0, sizeof(DDRAWI_DDRAWSURFACE_MORE)); + That->Owner->mPrimaryMore.dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE); + + memset(&That->Owner->mPrimaryLocal, 0, sizeof(DDRAWI_DDRAWSURFACE_LCL)); + That->Owner->mPrimaryLocal.lpGbl = &That->Owner->mPrimaryGlobal; + That->Owner->mPrimaryLocal.lpSurfMore = &That->Owner->mPrimaryMore; + That->Owner->mPrimaryLocal.dwProcessId = GetCurrentProcessId(); /* FIXME Check the flags if we shall create a primaresurface for overlay or something else Examine windows which flags are being set for we assume this is right unsue I think */ //That->Surf->mPrimaryLocal.dwFlags = DDRAWISURF_PARTOFPRIMARYCHAIN|DDRAWISURF_HASOVERLAYDATA; - That->Surf->mPrimaryLocal.ddsCaps.dwCaps = That->Surf->mddsdPrimary.ddsCaps.dwCaps; - That->Surf->mpPrimaryLocals[0] = &That->Surf->mPrimaryLocal; + That->Owner->mPrimaryLocal.ddsCaps.dwCaps = That->Owner->mddsdPrimary.ddsCaps.dwCaps; + That->Owner->mpPrimaryLocals[0] = &That->Owner->mPrimaryLocal; - This->mDdCreateSurface.lpDDSurfaceDesc = &That->Surf->mddsdPrimary; - This->mDdCreateSurface.lplpSList = That->Surf->mpPrimaryLocals; + This->mDdCreateSurface.lpDDSurfaceDesc = &That->Owner->mddsdPrimary; + This->mDdCreateSurface.lplpSList = That->Owner->mpPrimaryLocals; This->mDdCreateSurface.dwSCnt = This->mDDrawGlobal.dsList->dwIntRefCnt ; @@ -535,41 +540,41 @@ DDSD_ZBUFFERBITDEPTH */ - That->Surf->mddsdPrimary.dwFlags = DDSD_CAPS + DDSD_PIXELFORMAT; - RtlCopyMemory(&That->Surf->mddsdPrimary.ddpfPixelFormat,&This->mDDrawGlobal.vmiData.ddpfDisplay,sizeof(DDPIXELFORMAT)); - RtlCopyMemory(&That->Surf->mddsdPrimary.ddsCaps,&This->mDDrawGlobal.ddCaps,sizeof(DDCORECAPS)); + That->Owner->mddsdPrimary.dwFlags = DDSD_CAPS + DDSD_PIXELFORMAT; + RtlCopyMemory(&That->Owner->mddsdPrimary.ddpfPixelFormat,&This->mDDrawGlobal.vmiData.ddpfDisplay,sizeof(DDPIXELFORMAT)); + //RtlCopyMemory(&That->Surf->mddsdPrimary.ddsCaps,&This->mDDrawGlobal.ddCaps,sizeof(DDCORECAPS)); //RtlCopyMemory(&pDDSD->ddckCKDestOverlay,&This->mDDrawGlobal.ddckCKDestOverlay,sizeof(DDCOLORKEY)); //RtlCopyMemory(&pDDSD->ddckCKSrcOverlay,&This->mDDrawGlobal.ddckCKSrcOverlay,sizeof(DDCOLORKEY)); if (This->mDDrawGlobal.vmiData.dwDisplayHeight != 0) { - That->Surf->mddsdPrimary.dwFlags += DDSD_HEIGHT ; - That->Surf->mddsdPrimary.dwHeight = This->mDDrawGlobal.vmiData.dwDisplayHeight; + That->Owner->mddsdPrimary.dwFlags += DDSD_HEIGHT ; + That->Owner->mddsdPrimary.dwHeight = This->mDDrawGlobal.vmiData.dwDisplayHeight; } if (This->mDDrawGlobal.vmiData.dwDisplayWidth != 0) { - That->Surf->mddsdPrimary.dwFlags += DDSD_WIDTH ; - That->Surf->mddsdPrimary.dwWidth = This->mDDrawGlobal.vmiData.dwDisplayWidth; + That->Owner->mddsdPrimary.dwFlags += DDSD_WIDTH ; + That->Owner->mddsdPrimary.dwWidth = This->mDDrawGlobal.vmiData.dwDisplayWidth; } if (This->mDDrawGlobal.vmiData.lDisplayPitch != 0) { - That->Surf->mddsdPrimary.dwFlags += DDSD_PITCH ; - That->Surf->mddsdPrimary.lPitch = This->mDDrawGlobal.vmiData.lDisplayPitch; + That->Owner->mddsdPrimary.dwFlags += DDSD_PITCH ; + That->Owner->mddsdPrimary.lPitch = This->mDDrawGlobal.vmiData.lDisplayPitch; } if ( This->mDDrawGlobal.dwMonitorFrequency != 0) { - That->Surf->mddsdPrimary.dwFlags += DDSD_REFRESHRATE ; - That->Surf->mddsdPrimary.dwRefreshRate = This->mDDrawGlobal.dwMonitorFrequency; + That->Owner->mddsdPrimary.dwFlags += DDSD_REFRESHRATE ; + That->Owner->mddsdPrimary.dwRefreshRate = This->mDDrawGlobal.dwMonitorFrequency; } if (This->mDDrawGlobal.vmiData.ddpfDisplay.dwAlphaBitDepth != 0) { - That->Surf->mddsdPrimary.dwFlags += DDSD_ALPHABITDEPTH ; - That->Surf->mddsdPrimary.dwAlphaBitDepth = This->mDDrawGlobal.vmiData.ddpfDisplay.dwAlphaBitDepth; + That->Owner->mddsdPrimary.dwFlags += DDSD_ALPHABITDEPTH ; + That->Owner->mddsdPrimary.dwAlphaBitDepth = This->mDDrawGlobal.vmiData.ddpfDisplay.dwAlphaBitDepth; } return DD_OK; @@ -578,123 +583,136 @@ else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_OVERLAY) { // DX_STUB_str( "Can not create overlay surface"); - // memset(&That->Surf->mddsdOverlay, 0, sizeof(DDSURFACEDESC)); - // memcpy(&That->Surf->mddsdOverlay,pDDSD,sizeof(DDSURFACEDESC)); - // That->Surf->mddsdOverlay.dwSize = sizeof(DDSURFACEDESC); - //That->Surf->mddsdOverlay.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_BACKBUFFERCOUNT | DDSD_WIDTH | DDSD_HEIGHT; - - //That->Surf->mddsdOverlay.ddsCaps.dwCaps = DDSCAPS_OVERLAY | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM | DDSCAPS_COMPLEX | DDSCAPS_FLIP; - - //That->Surf->mddsdOverlay.dwWidth = 100; //pels; - //That->Surf->mddsdOverlay.dwHeight = 100; // lines; - //That->Surf->mddsdOverlay.dwBackBufferCount = 1; //cBuffers; - - //That->Surf->mddsdOverlay.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT); - //That->Surf->mddsdOverlay.ddpfPixelFormat.dwFlags = DDPF_RGB; - //That->Surf->mddsdOverlay.ddpfPixelFormat.dwRGBBitCount = 32; - - //mDdCanCreateSurface.lpDD = &This->mDDrawGlobal; - //mDdCanCreateSurface.CanCreateSurface = This->mCallbacks.HALDD.CanCreateSurface; - //mDdCanCreateSurface.bIsDifferentPixelFormat = TRUE; //isDifferentPixelFormat; - //mDdCanCreateSurface.lpDDSurfaceDesc = &That->Surf->mddsdOverlay; // pDDSD; - - - //if (This->mHALInfo.lpDDCallbacks->CanCreateSurface(&mDdCanCreateSurface)== DDHAL_DRIVER_NOTHANDLED) - //{ - // return DDERR_NOTINITIALIZED; - //} - - //if (mDdCanCreateSurface.ddRVal != DD_OK) - //{ - // return DDERR_NOTINITIALIZED; - //} - - //memset(&That->Surf->mOverlayGlobal, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL)); - //That->Surf->mOverlayGlobal.dwGlobalFlags = 0; - //That->Surf->mOverlayGlobal.lpDD = &This->mDDrawGlobal; - //That->Surf->mOverlayGlobal.lpDDHandle = &This->mDDrawGlobal; - //That->Surf->mOverlayGlobal.wWidth = (WORD)That->Surf->mddsdOverlay.dwWidth; - //That->Surf->mOverlayGlobal.wHeight = (WORD)That->Surf->mddsdOverlay.dwHeight; - //That->Surf->mOverlayGlobal.lPitch = -1; - //That->Surf->mOverlayGlobal.ddpfSurface = That->Surf->mddsdOverlay.ddpfPixelFormat; - - //// setup front- and backbuffer surfaces - //UINT cSurfaces = That->Surf->mddsdOverlay.dwBackBufferCount + 1; - //for (i = 0; i < cSurfaces; i++) - //{ - // memset(&That->Surf->mOverlayMore[i], 0, sizeof(DDRAWI_DDRAWSURFACE_MORE)); - // That->Surf->mOverlayMore[i].dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE); - - // memset(&That->Surf->mOverlayLocal[i], 0, sizeof(DDRAWI_DDRAWSURFACE_LCL)); - // That->Surf->mOverlayLocal[i].lpGbl = &That->Surf->mOverlayGlobal; - // That->Surf->mOverlayLocal[i].lpSurfMore = &That->Surf->mOverlayMore[i]; - // That->Surf->mOverlayLocal[i].dwProcessId = GetCurrentProcessId(); - // That->Surf->mOverlayLocal[i].dwFlags = (i == 0) ? - // (DDRAWISURF_IMPLICITROOT|DDRAWISURF_FRONTBUFFER): - // (DDRAWISURF_IMPLICITCREATE|DDRAWISURF_BACKBUFFER); - - // That->Surf->mOverlayLocal[i].dwFlags |= DDRAWISURF_ATTACHED|DDRAWISURF_ATTACHED_FROM| DDRAWISURF_HASPIXELFORMAT| DDRAWISURF_HASOVERLAYDATA; - - // That->Surf->mOverlayLocal[i].ddsCaps.dwCaps = That->Surf->mddsdOverlay.ddsCaps.dwCaps; - // That->Surf->mpOverlayLocals[i] = &That->Surf->mOverlayLocal[i]; - //} - - //for (i = 0; i < cSurfaces; i++) - //{ - // UINT j = (i + 1) % cSurfaces; - // if (!DdAttachSurface(That->Surf->mpOverlayLocals[i], That->Surf->mpOverlayLocals[j])) - // { - // // derr(L"DirectDrawImpl[%08x]::__setupDevice DdAttachSurface(%d, %d) failed", this, i, j); - // return DD_FALSE; - // } - //} + OutputDebugStringA("Create DDSCAPS_OVERLAY\n"); + + memset(&That->Surf->mddsdOverlay, 0, sizeof(DDSURFACEDESC)); + That->Surf->mddsdOverlay.dwSize = sizeof(DDSURFACEDESC); + That->Surf->mddsdOverlay.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_BACKBUFFERCOUNT | DDSD_WIDTH | DDSD_HEIGHT; + That->Surf->mddsdOverlay.ddsCaps.dwCaps = DDSCAPS_OVERLAY | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM | DDSCAPS_COMPLEX | DDSCAPS_FLIP; +// + That->Surf->mddsdOverlay.dwWidth = 100; //pels; + That->Surf->mddsdOverlay.dwHeight = 100; // lines; + That->Surf->mddsdOverlay.dwBackBufferCount = 1; //cBuffers; + + That->Surf->mddsdOverlay.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT); + That->Surf->mddsdOverlay.ddpfPixelFormat.dwFlags = DDPF_RGB; + That->Surf->mddsdOverlay.ddpfPixelFormat.dwRGBBitCount = 32; +// +// + DDHAL_CANCREATESURFACEDATA mDdCanCreateSurface; + mDdCanCreateSurface.lpDD = &This->mDDrawGlobal; + mDdCanCreateSurface.CanCreateSurface = This->mCallbacks.HALDD.CanCreateSurface; + mDdCanCreateSurface.bIsDifferentPixelFormat = TRUE; //isDifferentPixelFormat; + mDdCanCreateSurface.lpDDSurfaceDesc = &That->Surf->mddsdOverlay; // pDDSD; + + if (This->mHALInfo.lpDDCallbacks->CanCreateSurface(&mDdCanCreateSurface)== DDHAL_DRIVER_NOTHANDLED) + { + // derr(L"DirectDrawImpl[%08x]::__createPrimary Cannot create primary [%08x]", this, rv); + return DDERR_NOTINITIALIZED; + } + + if (mDdCanCreateSurface.ddRVal != DD_OK) + { + return DDERR_NOTINITIALIZED; + } + + + memset(&That->Surf->mOverlayGlobal, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL)); + That->Surf->mOverlayGlobal.dwGlobalFlags = 0; + That->Surf->mOverlayGlobal.lpDD = &This->mDDrawGlobal; + That->Surf->mOverlayGlobal.lpDDHandle = &This->mDDrawGlobal; + That->Surf->mOverlayGlobal.wWidth = (WORD)That->Surf->mddsdOverlay.dwWidth; + That->Surf->mOverlayGlobal.wHeight = (WORD)That->Surf->mddsdOverlay.dwHeight; + That->Surf->mOverlayGlobal.lPitch = -1; + That->Surf->mOverlayGlobal.ddpfSurface = That->Surf->mddsdOverlay.ddpfPixelFormat; +// +// // setup front- and backbuffer surfaces + UINT cSurfaces = That->Surf->mddsdOverlay.dwBackBufferCount + 1; + UINT i; + for ( i = 0; i < cSurfaces; i++) + { + memset(&That->Surf->mOverlayMore[i], 0, sizeof(DDRAWI_DDRAWSURFACE_MORE)); + That->Surf->mOverlayMore[i].dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE); + + memset(&That->Surf->mOverlayLocal[i], 0, sizeof(DDRAWI_DDRAWSURFACE_LCL)); + That->Surf->mOverlayLocal[i].lpGbl = &That->Surf->mOverlayGlobal; + That->Surf->mOverlayLocal[i].lpSurfMore = &That->Surf->mOverlayMore[i]; + That->Surf-> mOverlayLocal[i].dwProcessId = GetCurrentProcessId(); + That->Surf->mOverlayLocal[i].dwFlags = (i == 0) ? + (DDRAWISURF_IMPLICITROOT|DDRAWISURF_FRONTBUFFER): + (DDRAWISURF_IMPLICITCREATE|DDRAWISURF_BACKBUFFER); + + That->Surf->mOverlayLocal[i].dwFlags |= + DDRAWISURF_ATTACHED|DDRAWISURF_ATTACHED_FROM| + DDRAWISURF_HASPIXELFORMAT| + DDRAWISURF_HASOVERLAYDATA; + + That->Surf->mOverlayLocal[i].ddsCaps.dwCaps = That->Surf->mddsdOverlay.ddsCaps.dwCaps; + That->Surf->mpOverlayLocals[i] = &That->Surf->mOverlayLocal[i]; + } + + for ( i = 0; i < cSurfaces; i++) + { + UINT j = (i + 1) % cSurfaces; + + + + + if (!DdAttachSurface(That->Surf->mpOverlayLocals[i], That->Surf->mpOverlayLocals[j])) + { + return DD_FALSE; + } + + } + + + DDHAL_CREATESURFACEDATA mDdCreateSurface; + mDdCreateSurface.lpDD = &This->mDDrawGlobal; + mDdCreateSurface.CreateSurface = This->mCallbacks.HALDD.CreateSurface; + mDdCreateSurface.lpDDSurfaceDesc = &That->Surf->mddsdOverlay;//pDDSD; + mDdCreateSurface.lplpSList = That->Surf->mpOverlayLocals; //cSurfaces; + mDdCreateSurface.dwSCnt = 1 ; //ppSurfaces; + + if (This->mHALInfo.lpDDCallbacks->CreateSurface(&mDdCreateSurface) == DDHAL_DRIVER_NOTHANDLED) + { + return DDERR_NOTINITIALIZED; + } - //mDdCreateSurface.lpDD = &This->mDDrawGlobal; - //mDdCreateSurface.CreateSurface = This->mCallbacks.HALDD.CreateSurface; - //mDdCreateSurface.lpDDSurfaceDesc = &That->Surf->mddsdOverlay;//pDDSD; - //mDdCreateSurface.lplpSList = That->Surf->mpOverlayLocals; //cSurfaces; - //mDdCreateSurface.dwSCnt = 1 ; //ppSurfaces; - - //if (This->mHALInfo.lpDDCallbacks->CreateSurface(&mDdCreateSurface) == DDHAL_DRIVER_NOTHANDLED) - //{ - // return DDERR_NOTINITIALIZED; - //} + + if (mDdCreateSurface.ddRVal != DD_OK) + { + return mDdCreateSurface.ddRVal; + } + + DDHAL_UPDATEOVERLAYDATA mDdUpdateOverlay; + mDdUpdateOverlay.lpDD = &This->mDDrawGlobal; + mDdUpdateOverlay.UpdateOverlay = This->mCallbacks.HALDDSurface.UpdateOverlay; + mDdUpdateOverlay.lpDDDestSurface = This->mpPrimaryLocals[0]; + mDdUpdateOverlay.lpDDSrcSurface = That->Surf->mpOverlayLocals[0];//pDDSurface; + mDdUpdateOverlay.dwFlags = DDOVER_SHOW; + - //if (mDdCreateSurface.ddRVal != DD_OK) - //{ - // return mDdCreateSurface.ddRVal; - //} + mDdUpdateOverlay.rDest.top = 0; + mDdUpdateOverlay.rDest.left = 0; + mDdUpdateOverlay.rDest.right = 50; + mDdUpdateOverlay.rDest.bottom = 50; + + mDdUpdateOverlay.rSrc.top = 0; + mDdUpdateOverlay.rSrc.left = 0; + mDdUpdateOverlay.rSrc.right = 50; + mDdUpdateOverlay.rSrc.bottom = 50; + + if ( mDdUpdateOverlay.UpdateOverlay(&mDdUpdateOverlay) == DDHAL_DRIVER_NOTHANDLED) + { + return DDERR_NOTINITIALIZED; + } - //DDHAL_UPDATEOVERLAYDATA mDdUpdateOverlay; - //mDdUpdateOverlay.lpDD = &This->mDDrawGlobal; - //mDdUpdateOverlay.UpdateOverlay = This->mCallbacks.HALDDSurface.UpdateOverlay; - //mDdUpdateOverlay.lpDDDestSurface = That->Surf->mpPrimaryLocals[0]; - //mDdUpdateOverlay.lpDDSrcSurface = That->Surf->mpOverlayLocals[0];//pDDSurface; - //mDdUpdateOverlay.dwFlags = DDOVER_SHOW; - - //mDdUpdateOverlay.rDest.top = 0; - //mDdUpdateOverlay.rDest.left = 0; - //mDdUpdateOverlay.rDest.right = 50; - //mDdUpdateOverlay.rDest.bottom = 50; - - //mDdUpdateOverlay.rSrc.top = 0; - //mDdUpdateOverlay.rSrc.left = 0; - //mDdUpdateOverlay.rSrc.right = 50; - //mDdUpdateOverlay.rSrc.bottom = 50; - - //if (mDdUpdateOverlay.UpdateOverlay(&mDdUpdateOverlay) == DDHAL_DRIVER_NOTHANDLED) - //{ - // return DDERR_NOTINITIALIZED; - //} - - //if (mDdUpdateOverlay.ddRVal != DD_OK) - //{ - // return mDdUpdateOverlay.ddRVal; - //} - - return DD_OK; - return DDERR_INVALIDSURFACETYPE; - + if (mDdUpdateOverlay.ddRVal != DD_OK) + { + return mDdUpdateOverlay.ddRVal; + } + + return DD_OK; } else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_BACKBUFFER) { Modified: trunk/reactos/dll/directx/ddraw/main/surface_main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/surf…
============================================================================== --- trunk/reactos/dll/directx/ddraw/main/surface_main.c (original) +++ trunk/reactos/dll/directx/ddraw/main/surface_main.c Thu Apr 13 13:14:32 2006 @@ -32,14 +32,14 @@ DX_WINDBG_trace(); - return InterlockedIncrement((PLONG)&This->owner->mDDrawGlobal.dsList->dwIntRefCnt); + return InterlockedIncrement((PLONG)&This->Owner->mDDrawGlobal.dsList->dwIntRefCnt); } ULONG WINAPI Main_DDrawSurface_Release(LPDIRECTDRAWSURFACE7 iface) { IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - ULONG ref = InterlockedDecrement((PLONG)&This->owner->mDDrawGlobal.dsList->dwIntRefCnt); + ULONG ref = InterlockedDecrement((PLONG)&This->Owner->mDDrawGlobal.dsList->dwIntRefCnt); if (ref == 0) HeapFree(GetProcessHeap(), 0, This); @@ -66,7 +66,7 @@ IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - if (This->owner->mCallbacks.HALDDSurface.dwFlags & DDHAL_SURFCB32_BLT) + if (This->Owner->mCallbacks.HALDDSurface.dwFlags & DDHAL_SURFCB32_BLT) { return Hal_DDrawSurface_Blt( iface, rdst, src, rsrc, dwFlags, lpbltfx); } @@ -87,7 +87,7 @@ return DDERR_INVALIDPARAMS; } - if (This->owner->mCallbacks.HALDDSurface.dwFlags & DDHAL_SURFCB32_LOCK) + if (This->Owner->mCallbacks.HALDDSurface.dwFlags & DDHAL_SURFCB32_LOCK) { return Hal_DDrawSurface_Lock( iface, prect, pDDSD, flags, event); } @@ -101,7 +101,7 @@ IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - if (This->owner->mCallbacks.HALDDSurface.dwFlags & DDHAL_SURFCB32_LOCK) + if (This->Owner->mCallbacks.HALDDSurface.dwFlags & DDHAL_SURFCB32_LOCK) { return Hal_DDrawSurface_Unlock( iface, pRect); } @@ -125,7 +125,7 @@ That = (IDirectDrawSurfaceImpl*)pAttach; //FIXME Have I put This and That in right order ?? DdAttachSurface(from, to) - return DdAttachSurface( That->Surf->mpPrimaryLocals[0],This->Surf->mpPrimaryLocals[0]); + return DdAttachSurface( That->Owner->mpPrimaryLocals[0],This->Owner->mpPrimaryLocals[0]); } /* MSDN: "not currently implemented." */ @@ -213,7 +213,7 @@ IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - if (This->owner->mCallbacks.HALDDSurface.dwFlags & DDHAL_SURFCB32_FLIP) + if (This->Owner->mCallbacks.HALDDSurface.dwFlags & DDHAL_SURFCB32_FLIP) { return Hal_DDrawSurface_Flip(iface, override, dwFlags); } @@ -246,7 +246,7 @@ IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - if (This->owner->mCallbacks.HALDDSurface.dwFlags & DDHAL_SURFCB32_FLIP) + if (This->Owner->mCallbacks.HALDDSurface.dwFlags & DDHAL_SURFCB32_FLIP) { return Hal_DDrawSurface_GetBltStatus( iface, dwFlags); } @@ -274,7 +274,7 @@ This = (IDirectDrawSurfaceImpl*)iface; RtlZeroMemory(pCaps,sizeof(DDSCAPS2)); - pCaps->dwCaps = This->Surf->mddsdPrimary.ddsCaps.dwCaps; + pCaps->dwCaps = This->Owner->mddsdPrimary.ddsCaps.dwCaps; return DD_OK; } @@ -321,14 +321,14 @@ for now we aussme the surface exits and create the hDC for it */ - if ((HDC)This->Surf->mPrimaryLocal.hDC == NULL) - { - This->Surf->mPrimaryLocal.hDC = (ULONG_PTR)GetDC((HWND)This->owner->mDDrawGlobal.lpExclusiveOwner->hWnd); - *phDC = (HDC)This->Surf->mPrimaryLocal.hDC; + if ((HDC)This->Owner->mPrimaryLocal.hDC == NULL) + { + This->Owner->mPrimaryLocal.hDC = (ULONG_PTR)GetDC((HWND)This->Owner->mDDrawGlobal.lpExclusiveOwner->hWnd); + *phDC = (HDC)This->Owner->mPrimaryLocal.hDC; } else { - *phDC = (HDC)This->Surf->mpPrimaryLocals[0]->hDC; + *phDC = (HDC)This->Owner->mpPrimaryLocals[0]->hDC; } return DD_OK; @@ -420,7 +420,7 @@ } RtlZeroMemory(pDDSD,dwSize); - memcpy(pDDSD, &This->Surf->mddsdPrimary, sizeof(DDSURFACEDESC)); + memcpy(pDDSD, &This->Owner->mddsdPrimary, sizeof(DDSURFACEDESC)); pDDSD->dwSize = dwSize; return DD_OK; @@ -480,12 +480,12 @@ /* FIXME check if surface exits or not */ - if ((HDC)This->Surf->mPrimaryLocal.hDC == NULL) + if ((HDC)This->Owner->mPrimaryLocal.hDC == NULL) { return DDERR_GENERIC; } - ReleaseDC((HWND)This->owner->mDDrawGlobal.lpExclusiveOwner->hWnd,hDC); + ReleaseDC((HWND)This->Owner->mDDrawGlobal.lpExclusiveOwner->hWnd,hDC); return DD_OK; } @@ -507,7 +507,7 @@ IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - if (This->owner->mCallbacks.HALDDSurface.dwFlags & DDHAL_SURFCB32_SETCOLORKEY) + if (This->Owner->mCallbacks.HALDDSurface.dwFlags & DDHAL_SURFCB32_SETCOLORKEY) { return Hal_DDrawSurface_SetColorKey (iface, dwFlags, pCKey); } @@ -575,7 +575,7 @@ IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - if (This->owner->mCallbacks.HALDDSurface.dwFlags & DDHAL_SURFCB32_UPDATEOVERLAY) + if (This->Owner->mCallbacks.HALDDSurface.dwFlags & DDHAL_SURFCB32_UPDATEOVERLAY) { return Hal_DDrawSurface_UpdateOverlayDisplay ( iface, dwFlags); } Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/rosdraw.h…
============================================================================== --- trunk/reactos/dll/directx/ddraw/rosdraw.h (original) +++ trunk/reactos/dll/directx/ddraw/rosdraw.h Thu Apr 13 13:14:32 2006 @@ -82,20 +82,28 @@ DDHAL_CREATESURFACEDATA mDdCreateSurface; DDHAL_CANCREATESURFACEDATA mDdCanCreateSurface; -} IDirectDrawImpl; - -/******** Surface Object ********/ -typedef struct -{ + /* Primarey surface we must reach it from every where */ DDRAWI_DDRAWSURFACE_GBL mPrimaryGlobal; DDRAWI_DDRAWSURFACE_MORE mPrimaryMore; DDRAWI_DDRAWSURFACE_LCL mPrimaryLocal; DDRAWI_DDRAWSURFACE_LCL *mpPrimaryLocals[1]; - DDRAWI_DDRAWCLIPPER_LCL mPrimaryClipperLocal; DDRAWI_DDRAWCLIPPER_GBL mPrimaryClipperGlobal; DDSURFACEDESC mddsdPrimary; + +} IDirectDrawImpl; + +/******** Surface Object ********/ +typedef struct +{ + + DDRAWI_DDRAWSURFACE_GBL mSurfGlobal; + DDRAWI_DDRAWSURFACE_MORE mSurfMore; + DDRAWI_DDRAWSURFACE_LCL mSurfLocal; + DDRAWI_DDRAWSURFACE_LCL *mpSurfLocals[1]; + DDRAWI_DDRAWCLIPPER_LCL mSurfClipperLocal; + DDRAWI_DDRAWCLIPPER_GBL mSurfClipperGlobal; DDRAWI_DDRAWSURFACE_GBL mOverlayGlobal; DDRAWI_DDRAWSURFACE_LCL mOverlayLocal[6]; @@ -111,7 +119,7 @@ IDirectDrawSurface7Vtbl* lpVtbl; IDirectDrawSurface3Vtbl* lpVtbl_v3; - IDirectDrawImpl* owner; + IDirectDrawImpl* Owner; DDRAWI_DDRAWSURFACE_GBL Global; DDRAWI_DDRAWSURFACE_MORE More; @@ -233,9 +241,9 @@ firstcall = FALSE; \ } -#define DX_WINDBG_trace() - -/* +//#define DX_WINDBG_trace() + + #define DX_WINDBG_trace() \ static BOOL firstcallx = TRUE; \ if (firstcallx) \ @@ -245,7 +253,7 @@ OutputDebugStringA(buffer); \ firstcallx = TRUE; \ } -*/ + #define DX_WINDBG_trace_res(width,height,bpp) \ static BOOL firstcallxx = TRUE; \
18 years, 6 months
1
0
0
0
[hpoussin] 21575: Conform better to Wine standards
by hpoussin@svn.reactos.org
Author: hpoussin Date: Thu Apr 13 12:06:45 2006 New Revision: 21575 URL:
http://svn.reactos.ru/svn/reactos?rev=21575&view=rev
Log: Conform better to Wine standards Modified: trunk/reactos/dll/win32/setupapi/devinst.c trunk/reactos/dll/win32/setupapi/parser.c trunk/reactos/dll/win32/setupapi/setupapi.rbuild trunk/reactos/dll/win32/setupapi/setupapi_private.h Modified: trunk/reactos/dll/win32/setupapi/devinst.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/setupapi/devinst.…
============================================================================== --- trunk/reactos/dll/win32/setupapi/devinst.c (original) +++ trunk/reactos/dll/win32/setupapi/devinst.c Thu Apr 13 12:06:45 2006 @@ -19,27 +19,36 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#define INITGUID #include "setupapi_private.h" WINE_DEFAULT_DEBUG_CHANNEL(setupapi); /* Unicode constants */ +static const WCHAR AddInterface[] = {'A','d','d','I','n','t','e','r','f','a','c','e',0}; static const WCHAR ClassGUID[] = {'C','l','a','s','s','G','U','I','D',0}; static const WCHAR Class[] = {'C','l','a','s','s',0}; static const WCHAR ClassInstall32[] = {'C','l','a','s','s','I','n','s','t','a','l','l','3','2',0}; static const WCHAR Control[] = {'C','o','n','t','r','o','l',0}; static const WCHAR DeviceInstance[] = {'D','e','v','i','c','e','I','n','s','t','a','n','c','e',0}; static const WCHAR DotCoInstallers[] = {'.','C','o','I','n','s','t','a','l','l','e','r','s',0}; +static const WCHAR DotHW[] = {'.','H','W',0}; +static const WCHAR DotInterfaces[] = {'.','I','n','t','e','r','f','a','c','e','s',0}; static const WCHAR DotServices[] = {'.','S','e','r','v','i','c','e','s',0}; static const WCHAR InterfaceInstall32[] = {'I','n','t','e','r','f','a','c','e','I','n','s','t','a','l','l','3','2',0}; static const WCHAR Linked[] = {'L','i','n','k','e','d',0}; static const WCHAR SymbolicLink[] = {'S','y','m','b','o','l','i','c','L','i','n','k',0}; static const WCHAR Version[] = {'V','e','r','s','i','o','n',0}; -/* FIXME: header mess */ -DEFINE_GUID(GUID_NULL, - 0x00000000L, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); +static const WCHAR REGSTR_DRIVER_DATE[] = {'D','r','i','v','e','r','D','a','t','e',0}; +static const WCHAR REGSTR_DRIVER_DATE_DATA[] = {'D','r','i','v','e','r','D','a','t','e','D','a','t','a',0}; +static const WCHAR REGSTR_DRIVER_VERSION[] = {'D','r','i','v','e','r','V','e','r','s','i','o','n',0}; +static const WCHAR REGSTR_SECURITY[] = {'S','e','c','u','r','i','t','y',0}; +static const WCHAR REGSTR_UI_NUMBER_DESC_FORMAT[] = {'U','I','N','u','m','b','e','r','D','e','s','c','F','o','r','m','a','t',0}; + +static const WCHAR INF_MANUFACTURER[] = {'M','a','n','u','f','a','c','t','u','r','e','r',0}; +static const WCHAR INF_PROVIDER[] = {'P','r','o','v','i','d','e','r',0}; +static const WCHAR INF_DRIVER_VER[] = {'D','r','i','v','e','r','V','e','r',0}; + typedef DWORD (CALLBACK* CLASS_INSTALL_PROC) ( IN DI_FUNCTION InstallFunction, @@ -699,7 +708,7 @@ size = FIELD_OFFSET(struct DeviceInfoSet, szData); if (MachineName) - size += (wcslen(MachineName) + 3) * sizeof(WCHAR); + size += (strlenW(MachineName) + 3) * sizeof(WCHAR); list = HeapAlloc(GetProcessHeap(), 0, size); if (!list) { @@ -1027,46 +1036,54 @@ break; } +static const WCHAR FormatPlatformArchitectureMajorMinor[] = {'%','s','%','s','%','s','.','%','l','u','.','%','l','u',0}; +static const WCHAR FormatPlatformMajorMinor[] = {'%','s','%','s','.','%','l','u','.','%','l','u',0}; +static const WCHAR FormatPlatformArchitectureMajor[] = {'%','s','%','s','%','s','.','%','l','u',0}; +static const WCHAR FormatPlatformMajor[] = {'%','s','%','s','.','%','l','u',0}; +static const WCHAR FormatPlatformArchitecture[] = {'%','s','%','s','%','s',0}; +static const WCHAR FormatPlatform[] = {'%','s','%','s',0}; +static const WCHAR FormatNone[] = {'%','s',0}; + SectionName[LINE_LEN] = UNICODE_NULL; /* Test with platform.architecture.major.minor extension */ - snprintfW(SectionName, LINE_LEN, L"%s%s%s.%lu.%lu", InfSectionName, + snprintfW(SectionName, LINE_LEN, FormatPlatformArchitectureMajorMinor, InfSectionName, pExtensionPlatform, pExtensionArchitecture, pPlatformInfo->MajorVersion, pPlatformInfo->MinorVersion); lLineCount = SetupGetLineCountW(InfHandle, SectionName); if (lLineCount != -1) goto sectionfound; /* Test with platform.major.minor extension */ - snprintfW(SectionName, LINE_LEN, L"%s%s.%lu.%lu", InfSectionName, + snprintfW(SectionName, LINE_LEN, FormatPlatformMajorMinor, InfSectionName, pExtensionPlatform, pPlatformInfo->MajorVersion, pPlatformInfo->MinorVersion); lLineCount = SetupGetLineCountW(InfHandle, SectionName); if (lLineCount != -1) goto sectionfound; /* Test with platform.architecture.major extension */ - snprintfW(SectionName, LINE_LEN, L"%s%s%s.%lu", InfSectionName, + snprintfW(SectionName, LINE_LEN, FormatPlatformArchitectureMajor, InfSectionName, pExtensionPlatform, pExtensionArchitecture, pPlatformInfo->MajorVersion); lLineCount = SetupGetLineCountW(InfHandle, SectionName); if (lLineCount != -1) goto sectionfound; /* Test with platform.major extension */ - snprintfW(SectionName, LINE_LEN, L"%s%s.%lu", InfSectionName, + snprintfW(SectionName, LINE_LEN, FormatPlatformMajor, InfSectionName, pExtensionPlatform, pPlatformInfo->MajorVersion); lLineCount = SetupGetLineCountW(InfHandle, SectionName); if (lLineCount != -1) goto sectionfound; /* Test with platform.architecture extension */ - snprintfW(SectionName, LINE_LEN, L"%s%s%s", InfSectionName, + snprintfW(SectionName, LINE_LEN, FormatPlatformArchitecture, InfSectionName, pExtensionPlatform, pExtensionArchitecture); lLineCount = SetupGetLineCountW(InfHandle, SectionName); if (lLineCount != -1) goto sectionfound; /* Test with platform extension */ - snprintfW(SectionName, LINE_LEN, L"%s%s", InfSectionName, + snprintfW(SectionName, LINE_LEN, FormatPlatform, InfSectionName, pExtensionPlatform); lLineCount = SetupGetLineCountW(InfHandle, SectionName); if (lLineCount != -1) goto sectionfound; /* Test without extension */ - snprintfW(SectionName, LINE_LEN, L"%s", InfSectionName); + snprintfW(SectionName, LINE_LEN, FormatNone, InfSectionName); lLineCount = SetupGetLineCountW(InfHandle, SectionName); if (lLineCount != -1) goto sectionfound; @@ -1336,7 +1353,7 @@ *pDeviceInfo = NULL; - size = FIELD_OFFSET(struct DeviceInfoElement, Data) + (wcslen(InstancePath) + 1) * sizeof(WCHAR); + size = FIELD_OFFSET(struct DeviceInfoElement, Data) + (strlenW(InstancePath) + 1) * sizeof(WCHAR); deviceInfo = HeapAlloc(GetProcessHeap(), 0, size); if (!deviceInfo) { @@ -1353,9 +1370,9 @@ } deviceInfo->InstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS_W); - wcscpy(deviceInfo->Data, InstancePath); + strcpyW(deviceInfo->Data, InstancePath); deviceInfo->DeviceName = deviceInfo->Data; - deviceInfo->UniqueId = wcsrchr(deviceInfo->Data, '\\'); + deviceInfo->UniqueId = strrchrW(deviceInfo->Data, '\\'); deviceInfo->DeviceDescription = NULL; memcpy(&deviceInfo->ClassGuid, pClassGuid, sizeof(GUID)); deviceInfo->CreationFlags = 0; @@ -1378,14 +1395,14 @@ *pDeviceInterface = NULL; deviceInterface = HeapAlloc(GetProcessHeap(), 0, - FIELD_OFFSET(struct DeviceInterface, SymbolicLink) + (wcslen(SymbolicLink) + 1) * sizeof(WCHAR)); + FIELD_OFFSET(struct DeviceInterface, SymbolicLink) + (strlenW(SymbolicLink) + 1) * sizeof(WCHAR)); if (!deviceInterface) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; } deviceInterface->DeviceInfo = deviceInfo; - wcscpy(deviceInterface->SymbolicLink, SymbolicLink); + strcpyW(deviceInterface->SymbolicLink, SymbolicLink); deviceInterface->Flags = 0; /* FIXME */ memcpy(&deviceInterface->InterfaceClassGuid, pInterfaceGuid, sizeof(GUID)); @@ -1423,11 +1440,11 @@ rc = RegOpenKeyExW(hEnumeratorKey, KeyBuffer, 0, KEY_ENUMERATE_SUB_KEYS, &hDeviceIdKey); if (rc != ERROR_SUCCESS) return rc; - wcscpy(InstancePath, Enumerator); - wcscat(InstancePath, L"\\"); - wcscat(InstancePath, KeyBuffer); - wcscat(InstancePath, L"\\"); - pEndOfInstancePath = &InstancePath[wcslen(InstancePath)]; + strcpyW(InstancePath, Enumerator); + strcatW(InstancePath, L"\\"); + strcatW(InstancePath, KeyBuffer); + strcatW(InstancePath, L"\\"); + pEndOfInstancePath = &InstancePath[strlenW(InstancePath)]; /* Enumerate instance IDs (subkeys of hDeviceIdKey) */ j = 0; @@ -1454,7 +1471,7 @@ return rc; } *pEndOfInstancePath = '\0'; - wcscat(InstancePath, KeyBuffer); + strcatW(InstancePath, KeyBuffer); /* Read ClassGUID value */ dwLength = sizeof(KeyBuffer) - sizeof(WCHAR); @@ -1498,7 +1515,7 @@ RegCloseKey(hDeviceIdKey); return GetLastError(); } - TRACE("Adding '%S' to device info set %p\n", InstancePath, list); + TRACE("Adding '%s' to device info set %p\n", debugstr_w(InstancePath), list); InsertTailList(&list->ListHead, &deviceInfo->ListEntry); } RegCloseKey(hDeviceIdKey); @@ -1684,7 +1701,7 @@ if (DeviceInstanceW) { /* Check if device enumerator is not the right one */ - if (wcscmp(DeviceInstanceW, InstancePath) != 0) + if (strcmpW(DeviceInstanceW, InstancePath) != 0) { HeapFree(GetProcessHeap(), 0, InstancePath); RegCloseKey(hDeviceInstanceKey); @@ -2117,7 +2134,7 @@ size = FIELD_OFFSET(struct ClassImageList, szData); if (MachineName) - size += (wcslen(MachineName) + 3) * sizeof(WCHAR); + size += (strlenW(MachineName) + 3) * sizeof(WCHAR); list = HeapAlloc(GetProcessHeap(), 0, size); if (!list) { @@ -2547,7 +2564,7 @@ } else { - wcscpy(DeviceInterfaceDetailData->DevicePath, devName); + strcpyW(DeviceInterfaceDetailData->DevicePath, devName); TRACE("DevicePath is %s\n", debugstr_w(DeviceInterfaceDetailData->DevicePath)); if (DeviceInfoData) { @@ -2728,13 +2745,13 @@ case SPDRP_MFG: RegistryPropertyName = REGSTR_VAL_MFG; break; case SPDRP_SECURITY: - RegistryPropertyName = L"Security"; break; + RegistryPropertyName = REGSTR_SECURITY; break; case SPDRP_SERVICE: RegistryPropertyName = REGSTR_VAL_SERVICE; break; case SPDRP_UI_NUMBER: RegistryPropertyName = REGSTR_VAL_UI_NUMBER; break; case SPDRP_UI_NUMBER_DESC_FORMAT: - RegistryPropertyName = L"UINumberDescFormat"; break; + RegistryPropertyName = REGSTR_UI_NUMBER_DESC_FORMAT; break; case SPDRP_UPPERFILTERS: RegistryPropertyName = REGSTR_VAL_UPPERFILTERS; break; default: @@ -2796,7 +2813,7 @@ case SPDRP_PHYSICAL_DEVICE_OBJECT_NAME: { - DWORD required = (wcslen(DevInfo->Data) + 1) * sizeof(WCHAR); + DWORD required = (strlenW(DevInfo->Data) + 1) * sizeof(WCHAR); if (PropertyRegDataType) *PropertyRegDataType = REG_SZ; @@ -2804,7 +2821,7 @@ *RequiredSize = required; if (PropertyBufferSize >= required) { - wcscpy((LPWSTR)PropertyBuffer, DevInfo->Data); + strcpyW((LPWSTR)PropertyBuffer, DevInfo->Data); ret = TRUE; } else @@ -2928,7 +2945,7 @@ RegistryDataType = REG_MULTI_SZ; break; case SPDRP_SECURITY: - RegistryPropertyName = L"Security"; + RegistryPropertyName = REGSTR_SECURITY; RegistryDataType = REG_BINARY; break; case SPDRP_SERVICE: @@ -2936,7 +2953,7 @@ RegistryDataType = REG_SZ; break; case SPDRP_UI_NUMBER_DESC_FORMAT: - RegistryPropertyName = L"UINumberDescFormat"; + RegistryPropertyName = REGSTR_UI_NUMBER_DESC_FORMAT; RegistryDataType = REG_SZ; break; case SPDRP_UPPERFILTERS: @@ -3138,9 +3155,9 @@ FIXME("Case not implemented: InfFileName NULL\n"); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); } - else if (Flags & ~(DI_NOVCP | DI_NOBROWSE | DI_FORCECOPY | DI_QUIETINSTALL)) - { - TRACE("Unknown flags: 0x%08lx\n", Flags & ~(DI_NOVCP | DI_NOBROWSE | DI_FORCECOPY | DI_QUIETINSTALL)); + else if (Flags & ~(DI_NOVCP | DI_NOBROWSE | DI_FORCECOPY)) + { + TRACE("Unknown flags: 0x%08lx\n", Flags & ~(DI_NOVCP | DI_NOBROWSE | DI_FORCECOPY)); SetLastError(ERROR_INVALID_FLAGS); } else if ((Flags & DI_NOVCP) && FileQueue == NULL) @@ -3219,7 +3236,7 @@ hInf, ClassInstall32, SectionName, - MAX_PATH - wcslen(DotServices), + MAX_PATH - strlenW(DotServices), NULL, NULL); if (!ret) @@ -4361,13 +4378,13 @@ struct DeviceInfoElement *DevInfo = (struct DeviceInfoElement *)DeviceInfoData->Reserved; DWORD required; - required = (wcslen(DevInfo->DeviceName) + 1) * sizeof(WCHAR); + required = (strlenW(DevInfo->DeviceName) + 1) * sizeof(WCHAR); if (RequiredSize) *RequiredSize = required; if (required <= DeviceInstanceIdSize) { - wcscpy(DeviceInstanceId, DevInfo->DeviceName); + strcpyW(DeviceInstanceId, DevInfo->DeviceName); ret = TRUE; } else @@ -4762,16 +4779,16 @@ if (UuidToStringW((UUID*)&DeviceInfoData->ClassGuid, &lpGuidString) != RPC_S_OK) goto cleanup; /* The driver key is in \System\CurrentControlSet\Control\Class\{GUID}\Index */ - DriverKey = HeapAlloc(GetProcessHeap(), 0, (wcslen(lpGuidString) + 7) * sizeof(WCHAR) + sizeof(UNICODE_STRING)); + DriverKey = HeapAlloc(GetProcessHeap(), 0, (strlenW(lpGuidString) + 7) * sizeof(WCHAR) + sizeof(UNICODE_STRING)); if (!DriverKey) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); goto cleanup; } - wcscpy(DriverKey, L"{"); - wcscat(DriverKey, lpGuidString); - wcscat(DriverKey, L"}\\"); - pDeviceInstance = &DriverKey[wcslen(DriverKey)]; + strcpyW(DriverKey, L"{"); + strcatW(DriverKey, lpGuidString); + strcatW(DriverKey, L"}\\"); + pDeviceInstance = &DriverKey[strlenW(DriverKey)]; rc = RegOpenKeyExW(RootKey, REGSTR_PATH_CLASS_NT, 0, @@ -4824,7 +4841,7 @@ hDeviceKey = SetupDiOpenDevRegKey(DeviceInfoSet, DeviceInfoData, Scope, HwProfile, DIREG_DEV, KEY_SET_VALUE); if (hDeviceKey == INVALID_HANDLE_VALUE) goto cleanup; - rc = RegSetValueEx(hDeviceKey, REGSTR_VAL_DRIVER, 0, REG_SZ, (const BYTE *)DriverKey, (wcslen(DriverKey) + 1) * sizeof(WCHAR)); + rc = RegSetValueEx(hDeviceKey, REGSTR_VAL_DRIVER, 0, REG_SZ, (const BYTE *)DriverKey, (strlenW(DriverKey) + 1) * sizeof(WCHAR)); if (rc != ERROR_SUCCESS) { SetLastError(rc); @@ -5064,8 +5081,8 @@ struct DeviceInfoSet *list; BOOL ret = FALSE; - TRACE("%p %S %s %S %p %lx %p\n", DeviceInfoSet, DeviceName, - debugstr_guid(ClassGuid), DeviceDescription, + TRACE("%p %s %s %s %p %lx %p\n", DeviceInfoSet, debugstr_w(DeviceName), + debugstr_guid(ClassGuid), debugstr_w(DeviceDescription), hwndParent, CreationFlags, DeviceInfoData); if (!DeviceInfoSet) @@ -5182,7 +5199,7 @@ driverInfo->Details.Reserved = (ULONG_PTR)driverInfo; /* Copy InfFileName field */ - wcsncpy(driverInfo->Details.InfFileName, InfFile, MAX_PATH - 1); + strncpyW(driverInfo->Details.InfFileName, InfFile, MAX_PATH - 1); driverInfo->Details.InfFileName[MAX_PATH - 1] = '\0'; /* Fill InfDate field */ @@ -5214,13 +5231,13 @@ /* Copy MatchingId information */ if (MatchingId) { - driverInfo->MatchingId = HeapAlloc(GetProcessHeap(), 0, (wcslen(MatchingId) + 1) * sizeof(WCHAR)); + driverInfo->MatchingId = HeapAlloc(GetProcessHeap(), 0, (strlenW(MatchingId) + 1) * sizeof(WCHAR)); if (!driverInfo->MatchingId) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); goto cleanup; } - RtlCopyMemory(driverInfo->MatchingId, MatchingId, (wcslen(MatchingId) + 1) * sizeof(WCHAR)); + RtlCopyMemory(driverInfo->MatchingId, MatchingId, (strlenW(MatchingId) + 1) * sizeof(WCHAR)); } else driverInfo->MatchingId = NULL; @@ -5244,21 +5261,22 @@ if (!Result) goto cleanup; - TRACE("Adding driver '%S' [%S/%S] (Rank 0x%lx)\n", - driverInfo->Details.DrvDescription, InfFile, InfInstallSection, Rank); + TRACE("Adding driver '%s' [%s/%s] (Rank 0x%lx)\n", + debugstr_w(driverInfo->Details.DrvDescription), debugstr_w(InfFile), + debugstr_w(InfInstallSection), Rank); driverInfo->DriverRank = Rank; memcpy(&driverInfo->DriverDate, &DriverDate, sizeof(FILETIME)); memcpy(&driverInfo->ClassGuid, ClassGuid, sizeof(GUID)); driverInfo->Info.DriverType = DriverType; driverInfo->Info.Reserved = (ULONG_PTR)driverInfo; - wcsncpy(driverInfo->Info.Description, driverInfo->Details.DrvDescription, LINE_LEN - 1); + strncpyW(driverInfo->Info.Description, driverInfo->Details.DrvDescription, LINE_LEN - 1); driverInfo->Info.Description[LINE_LEN - 1] = '\0'; - wcsncpy(driverInfo->Info.MfgName, ManufacturerName, LINE_LEN - 1); + strncpyW(driverInfo->Info.MfgName, ManufacturerName, LINE_LEN - 1); driverInfo->Info.MfgName[LINE_LEN - 1] = '\0'; if (ProviderName) { - wcsncpy(driverInfo->Info.ProviderName, ProviderName, LINE_LEN - 1); + strncpyW(driverInfo->Info.ProviderName, ProviderName, LINE_LEN - 1); driverInfo->Info.ProviderName[LINE_LEN - 1] = '\0'; } else @@ -5327,7 +5345,7 @@ if (!SetupGetLineTextW( NULL, /* Context */ hInf, - L"Version", L"ClassGUID", + Version, ClassGUID, guidW, sizeof(guidW), NULL /* Required size */)) { @@ -5343,7 +5361,7 @@ /* Get provider name */ Result = SetupGetLineTextW( NULL, /* Context */ - hInf, L"Version", L"Provider", + hInf, Version, INF_PROVIDER, NULL, 0, &RequiredSize); if (Result) @@ -5357,7 +5375,7 @@ } Result = SetupGetLineTextW( NULL, /* Context */ - hInf, L"Version", L"Provider", + hInf, Version, INF_PROVIDER, ProviderName, RequiredSize, &RequiredSize); } @@ -5368,7 +5386,7 @@ /* Read the "DriverVer" value */ Result = SetupGetLineTextW( NULL, /* Context */ - hInf, L"Version", L"DriverVer", + hInf, Version, INF_DRIVER_VER, NULL, 0, &RequiredSize); if (Result) @@ -5382,7 +5400,7 @@ } Result = SetupGetLineTextW( NULL, /* Context */ - hInf, L"Version", L"DriverVer", + hInf, Version, INF_DRIVER_VER, DriverVer, RequiredSize, &RequiredSize); } @@ -5390,7 +5408,7 @@ goto cleanup; /* Get driver date and driver version, by analyzing the "DriverVer" value */ - pComma = wcschr(DriverVer, ','); + pComma = strchrW(DriverVer, ','); if (pComma != NULL) { *pComma = UNICODE_NULL; @@ -5398,7 +5416,7 @@ } /* Get driver date version. Invalid date = 00/00/00 */ memset(DriverDate, 0, sizeof(FILETIME)); - if (wcslen(DriverVer) == 10 + if (strlenW(DriverVer) == 10 && (DriverVer[2] == '-' || DriverVer[2] == '/') && (DriverVer[5] == '-' || DriverVer[5] == '/')) { @@ -5571,14 +5589,14 @@ if (InstallParams.Flags & DI_ENUMSINGLEINF) { /* InstallParams.DriverPath contains the name of a .inf file */ - RequiredSize = wcslen(InstallParams.DriverPath) + 2; + RequiredSize = strlenW(InstallParams.DriverPath) + 2; Buffer = HeapAlloc(GetProcessHeap(), 0, RequiredSize * sizeof(WCHAR)); if (!Buffer) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); goto done; } - wcscpy(Buffer, InstallParams.DriverPath); + strcpyW(Buffer, InstallParams.DriverPath); ((LPWSTR)Buffer)[RequiredSize - 1] = 0; Result = TRUE; } @@ -5637,9 +5655,9 @@ len = GetFullPathNameW(InstallParams.DriverPath, len, FullInfFileName, NULL); if (len == 0) goto done; - if (*FullInfFileName && FullInfFileName[wcslen(FullInfFileName) - 1] != '\\') - wcscat(FullInfFileName, L"\\"); - pFullFilename = &FullInfFileName[wcslen(FullInfFileName)]; + if (*FullInfFileName && FullInfFileName[strlenW(FullInfFileName) - 1] != '\\') + strcatW(FullInfFileName, L"\\"); + pFullFilename = &FullInfFileName[strlenW(FullInfFileName)]; } else { @@ -5649,22 +5667,22 @@ pFullFilename = &FullInfFileName[0]; } - for (filename = (LPCWSTR)Buffer; *filename; filename += wcslen(filename) + 1) + for (filename = (LPCWSTR)Buffer; *filename; filename += strlenW(filename) + 1) { INFCONTEXT ContextManufacturer, ContextDevice; GUID ClassGuid; - wcscpy(pFullFilename, filename); - TRACE("Opening file %S\n", FullInfFileName); + strcpyW(pFullFilename, filename); + TRACE("Opening file %s\n", debugstr_w(FullInfFileName)); currentInfFileDetails = HeapAlloc( GetProcessHeap(), 0, - FIELD_OFFSET(struct InfFileDetails, FullInfFileName) + wcslen(FullInfFileName) * sizeof(WCHAR) + sizeof(UNICODE_NULL)); + FIELD_OFFSET(struct InfFileDetails, FullInfFileName) + strlenW(FullInfFileName) * sizeof(WCHAR) + sizeof(UNICODE_NULL)); if (!currentInfFileDetails) continue; memset(currentInfFileDetails, 0, sizeof(struct InfFileDetails)); - wcscpy(currentInfFileDetails->FullInfFileName, FullInfFileName); + strcpyW(currentInfFileDetails->FullInfFileName, FullInfFileName); currentInfFileDetails->hInf = SetupOpenInfFileW(FullInfFileName, NULL, INF_STYLE_WIN4, NULL); ReferenceInfFile(currentInfFileDetails); @@ -5706,7 +5724,7 @@ FIXME("ExcludeFromSelect list ignored\n"); /* Get the manufacturers list */ - Result = SetupFindFirstLineW(currentInfFileDetails->hInf, L"Manufacturer", NULL, &ContextManufacturer); + Result = SetupFindFirstLineW(currentInfFileDetails->hInf, INF_MANUFACTURER, NULL, &ContextManufacturer); while (Result) { Result = SetupGetStringFieldW( @@ -5743,7 +5761,7 @@ currentInfFileDetails->hInf, ManufacturerSection, ManufacturerSection, LINE_LEN, NULL, NULL); if (Result) { - TRACE("Enumerating devices in manufacturer %S\n", ManufacturerSection); + TRACE("Enumerating devices in manufacturer %s\n", debugstr_w(ManufacturerSection)); Result = SetupFindFirstLineW(currentInfFileDetails->hInf, ManufacturerSection, NULL, &ContextDevice); } } @@ -5805,7 +5823,7 @@ } /* FIXME: Check ExcludeFromSelect list */ DriverAlreadyAdded = FALSE; - for (DriverRank = 0, currentId = (LPCWSTR)HardwareIDs; !DriverAlreadyAdded && *currentId; currentId += wcslen(currentId) + 1, DriverRank++) + for (DriverRank = 0, currentId = (LPCWSTR)HardwareIDs; !DriverAlreadyAdded && *currentId; currentId += strlenW(currentId) + 1, DriverRank++) { if (wcsicmp(DeviceId, currentId) == 0) { @@ -5826,7 +5844,7 @@ } if (CompatibleIDs) { - for (DriverRank = 0, currentId = (LPCWSTR)CompatibleIDs; !DriverAlreadyAdded && *currentId; currentId += wcslen(currentId) + 1, DriverRank++) + for (DriverRank = 0, currentId = (LPCWSTR)CompatibleIDs; !DriverAlreadyAdded && *currentId; currentId += strlenW(currentId) + 1, DriverRank++) { if (wcsicmp(DeviceId, currentId) == 0) { @@ -6045,7 +6063,9 @@ DWORD rc; BOOL ret = FALSE; - TRACE("%p %S %p %lx %p\n", DeviceInfoSet, DeviceInstanceId, hwndParent, OpenFlags, DeviceInfoData); + TRACE("%p %s %p %lx %p\n", + DeviceInfoSet, debugstr_w(DeviceInstanceId), + hwndParent, OpenFlags, DeviceInfoData); if (OpenFlags & DIOD_CANCEL_REMOVE) FIXME("DIOD_CANCEL_REMOVE flag not implemented\n"); @@ -6575,8 +6595,8 @@ /* The caller wants to compare only DriverType, Description and ProviderName fields */ struct DriverInfoElement *driverInfo = CONTAINING_RECORD(ItemList, struct DriverInfoElement, ListEntry); if (driverInfo->Info.DriverType == DriverInfoData->DriverType - && wcscmp(driverInfo->Info.Description, DriverInfoData->Description) == 0 - && wcscmp(driverInfo->Info.ProviderName, DriverInfoData->ProviderName) == 0) + && strcmpW(driverInfo->Info.Description, DriverInfoData->Description) == 0 + && strcmpW(driverInfo->Info.ProviderName, DriverInfoData->ProviderName) == 0) { break; } @@ -6913,6 +6933,7 @@ IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData) { +#ifndef __WINESRC__ PLUGPLAY_CONTROL_RESET_DEVICE_DATA ResetDeviceData; struct DeviceInfoElement *deviceInfo = (struct DeviceInfoElement *)DeviceInfoData->Reserved; NTSTATUS Status; @@ -6928,13 +6949,17 @@ Status = NtPlugPlayControl(PlugPlayControlResetDevice, &ResetDeviceData, sizeof(PLUGPLAY_CONTROL_RESET_DEVICE_DATA)); SetLastError(RtlNtStatusToDosError(Status)); return NT_SUCCESS(Status); +#else + FIXME("Stub: ResetDevice(%p %p)\n", DeviceInfoSet, DeviceInfoData); + return TRUE; +#endif } static BOOL StopDevice( IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData) { - FIXME("Stub %p %p\n", DeviceInfoSet, DeviceInfoData); + FIXME("Stub: StopDevice(%p %p)\n", DeviceInfoSet, DeviceInfoData); return TRUE; } @@ -7293,7 +7318,7 @@ return FALSE; } - FIXME("Need to AddInterface(%s %s %s %u)\n", debugstr_guid(InterfaceGuid), + FIXME("Need to InstallOneInterface(%s %s %s %u)\n", debugstr_guid(InterfaceGuid), debugstr_w(ReferenceString), debugstr_w(InterfaceSection), InterfaceFlags); return TRUE; } @@ -7353,15 +7378,15 @@ SelectedDriver->InfFileDetails->hInf, SelectedDriver->Details.SectionName, SectionName, MAX_PATH, &SectionNameLength, NULL); - if (!Result || SectionNameLength > MAX_PATH - wcslen(L".Interfaces") - 1) + if (!Result || SectionNameLength > MAX_PATH - strlenW(DotInterfaces) - 1) goto cleanup; - wcscat(SectionName, L".Interfaces"); + strcatW(SectionName, DotInterfaces); ret = TRUE; Result = SetupFindFirstLineW( SelectedDriver->InfFileDetails->hInf, SectionName, - L"AddInterface", + AddInterface, &ContextInterface); while (ret && Result) { @@ -7416,7 +7441,7 @@ MyFree(ReferenceString); MyFree(InterfaceSection); InterfaceGuidString = ReferenceString = InterfaceSection = NULL; - Result = SetupFindNextMatchLineW(&ContextInterface, L"AddInterface", &ContextInterface); + Result = SetupFindNextMatchLineW(&ContextInterface, AddInterface, &ContextInterface); } } @@ -7451,7 +7476,7 @@ if (strncmpW(FullName, Windir, last - FullName) == 0) { - /* The path is %SYSTEMROOT%\Inf */ + /* The path is %WINDIR%\Inf */ *IsOEMLocation = FALSE; } else @@ -7564,9 +7589,9 @@ SelectedDriver->InfFileDetails->hInf, SelectedDriver->Details.SectionName, SectionName, MAX_PATH, &SectionNameLength, NULL); - if (!Result || SectionNameLength > MAX_PATH - wcslen(DotServices)) + if (!Result || SectionNameLength > MAX_PATH - strlenW(DotServices)) goto cleanup; - pSectionName = &SectionName[wcslen(SectionName)]; + pSectionName = &SectionName[strlenW(SectionName)]; /* Get information from [Version] section */ if (!SetupDiGetINFClassW(SelectedDriver->Details.InfFileName, &ClassGuid, ClassName, MAX_CLASS_NAME_LEN, &RequiredSize)) @@ -7624,34 +7649,34 @@ memcpy(&fullVersion, &SelectedDriver->Info.DriverVersion, sizeof(LARGE_INTEGER)); TRACE("Write information to driver key\n"); TRACE("DriverDate : '%u-%u-%u'\n", DriverDate.wMonth, DriverDate.wDay, DriverDate.wYear); - TRACE("DriverDesc : '%S'\n", SelectedDriver->Info.Description); + TRACE("DriverDesc : '%s'\n", debugstr_w(SelectedDriver->Info.Description)); TRACE("DriverVersion : '%u.%u.%u.%u'\n", fullVersion.HighPart >> 16, fullVersion.HighPart & 0xffff, fullVersion.LowPart >> 16, fullVersion.LowPart & 0xffff); - TRACE("InfPath : '%S'\n", SelectedDriver->Details.InfFileName); - TRACE("InfSection : '%S'\n", SelectedDriver->Details.SectionName); - TRACE("InfSectionExt : '%S'\n", &SectionName[wcslen(SelectedDriver->Details.SectionName)]); - TRACE("MatchingDeviceId: '%S'\n", SelectedDriver->MatchingId); - TRACE("ProviderName : '%S'\n", SelectedDriver->Info.ProviderName); + TRACE("InfPath : '%s'\n", debugstr_w(SelectedDriver->Details.InfFileName)); + TRACE("InfSection : '%s'\n", debugstr_w(SelectedDriver->Details.SectionName)); + TRACE("InfSectionExt : '%s'\n", debugstr_w(&SectionName[strlenW(SelectedDriver->Details.SectionName)])); + TRACE("MatchingDeviceId: '%s'\n", debugstr_w(SelectedDriver->MatchingId)); + TRACE("ProviderName : '%s'\n", debugstr_w(SelectedDriver->Info.ProviderName)); swprintf(Buffer, L"%u-%u-%u", DriverDate.wMonth, DriverDate.wDay, DriverDate.wYear); - rc = RegSetValueEx(hKey, L"DriverDate", 0, REG_SZ, (const BYTE *)Buffer, (wcslen(Buffer) + 1) * sizeof(WCHAR)); + rc = RegSetValueEx(hKey, REGSTR_DRIVER_DATE, 0, REG_SZ, (const BYTE *)Buffer, (strlenW(Buffer) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) - rc = RegSetValueEx(hKey, L"DriverDateData", 0, REG_BINARY, (const BYTE *)&SelectedDriver->Info.DriverDate, sizeof(FILETIME)); + rc = RegSetValueEx(hKey, REGSTR_DRIVER_DATE_DATA, 0, REG_BINARY, (const BYTE *)&SelectedDriver->Info.DriverDate, sizeof(FILETIME)); if (rc == ERROR_SUCCESS) - rc = RegSetValueEx(hKey, REGSTR_VAL_DRVDESC, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.Description, (wcslen(SelectedDriver->Info.Description) + 1) * sizeof(WCHAR)); + rc = RegSetValueEx(hKey, REGSTR_VAL_DRVDESC, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.Description, (strlenW(SelectedDriver->Info.Description) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) { swprintf(Buffer, L"%u.%u.%u.%u", fullVersion.HighPart >> 16, fullVersion.HighPart & 0xffff, fullVersion.LowPart >> 16, fullVersion.LowPart & 0xffff); - rc = RegSetValueEx(hKey, L"DriverVersion", 0, REG_SZ, (const BYTE *)Buffer, (wcslen(Buffer) + 1) * sizeof(WCHAR)); + rc = RegSetValueEx(hKey, REGSTR_DRIVER_VERSION, 0, REG_SZ, (const BYTE *)Buffer, (strlenW(Buffer) + 1) * sizeof(WCHAR)); } if (rc == ERROR_SUCCESS) - rc = RegSetValueEx(hKey, REGSTR_VAL_INFPATH, 0, REG_SZ, (const BYTE *)SelectedDriver->Details.InfFileName, (wcslen(SelectedDriver->Details.InfFileName) + 1) * sizeof(WCHAR)); + rc = RegSetValueEx(hKey, REGSTR_VAL_INFPATH, 0, REG_SZ, (const BYTE *)SelectedDriver->Details.InfFileName, (strlenW(SelectedDriver->Details.InfFileName) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) - rc = RegSetValueEx(hKey, REGSTR_VAL_INFSECTION, 0, REG_SZ, (const BYTE *)SelectedDriver->Details.SectionName, (wcslen(SelectedDriver->Details.SectionName) + 1) * sizeof(WCHAR)); + rc = RegSetValueEx(hKey, REGSTR_VAL_INFSECTION, 0, REG_SZ, (const BYTE *)SelectedDriver->Details.SectionName, (strlenW(SelectedDriver->Details.SectionName) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) - rc = RegSetValueEx(hKey, REGSTR_VAL_INFSECTIONEXT, 0, REG_SZ, (const BYTE *)&SectionName[wcslen(SelectedDriver->Details.SectionName)], (wcslen(SectionName) - wcslen(SelectedDriver->Details.SectionName) + 1) * sizeof(WCHAR)); + rc = RegSetValueEx(hKey, REGSTR_VAL_INFSECTIONEXT, 0, REG_SZ, (const BYTE *)&SectionName[strlenW(SelectedDriver->Details.SectionName)], (strlenW(SectionName) - strlenW(SelectedDriver->Details.SectionName) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) - rc = RegSetValueEx(hKey, REGSTR_VAL_MATCHINGDEVID, 0, REG_SZ, (const BYTE *)SelectedDriver->MatchingId, (wcslen(SelectedDriver->MatchingId) + 1) * sizeof(WCHAR)); + rc = RegSetValueEx(hKey, REGSTR_VAL_MATCHINGDEVID, 0, REG_SZ, (const BYTE *)SelectedDriver->MatchingId, (strlenW(SelectedDriver->MatchingId) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) - rc = RegSetValueEx(hKey, REGSTR_VAL_PROVIDER_NAME, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.ProviderName, (wcslen(SelectedDriver->Info.ProviderName) + 1) * sizeof(WCHAR)); + rc = RegSetValueEx(hKey, REGSTR_VAL_PROVIDER_NAME, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.ProviderName, (strlenW(SelectedDriver->Info.ProviderName) + 1) * sizeof(WCHAR)); if (rc != ERROR_SUCCESS) { SetLastError(rc); @@ -7663,7 +7688,7 @@ /* FIXME: Process .LogConfigOverride section */ /* Install .Services section */ - wcscpy(pSectionName, DotServices); + strcpyW(pSectionName, DotServices); Result = SetupInstallServicesFromInfSectionExW( SelectedDriver->InfFileDetails->hInf, SectionName, @@ -7706,7 +7731,7 @@ DoAction = 0; if (!(InstallParams.FlagsEx & DI_FLAGSEX_NO_DRVREG_MODIFY)) DoAction |= SPINST_REGISTRY; - wcscpy(pSectionName, L".HW"); + strcpyW(pSectionName, DotHW); Result = SetupInstallFromInfSectionW(InstallParams.hwndParent, SelectedDriver->InfFileDetails->hInf, SectionName, DoAction, hKey, NULL, 0, @@ -7717,17 +7742,17 @@ /* Write information to enum key */ TRACE("Write information to enum key\n"); - TRACE("Class : '%S'\n", ClassName); - TRACE("ClassGUID : '%S'\n", lpFullGuidString); - TRACE("DeviceDesc : '%S'\n", SelectedDriver->Info.Description); - TRACE("Mfg : '%S'\n", SelectedDriver->Info.MfgName); - rc = RegSetValueEx(hKey, REGSTR_VAL_CLASS, 0, REG_SZ, (const BYTE *)ClassName, (wcslen(ClassName) + 1) * sizeof(WCHAR)); + TRACE("Class : '%s'\n", debugstr_w(ClassName)); + TRACE("ClassGUID : '%s'\n", debugstr_w(lpFullGuidString)); + TRACE("DeviceDesc : '%s'\n", debugstr_w(SelectedDriver->Info.Description)); + TRACE("Mfg : '%s'\n", debugstr_w(SelectedDriver->Info.MfgName)); + rc = RegSetValueEx(hKey, REGSTR_VAL_CLASS, 0, REG_SZ, (const BYTE *)ClassName, (strlenW(ClassName) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) - rc = RegSetValueEx(hKey, REGSTR_VAL_CLASSGUID, 0, REG_SZ, (const BYTE *)lpFullGuidString, (wcslen(lpFullGuidString) + 1) * sizeof(WCHAR)); + rc = RegSetValueEx(hKey, REGSTR_VAL_CLASSGUID, 0, REG_SZ, (const BYTE *)lpFullGuidString, (strlenW(lpFullGuidString) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) - rc = RegSetValueEx(hKey, REGSTR_VAL_DEVDESC, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.Description, (wcslen(SelectedDriver->Info.Description) + 1) * sizeof(WCHAR)); + rc = RegSetValueEx(hKey, REGSTR_VAL_DEVDESC, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.Description, (strlenW(SelectedDriver->Info.Description) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) - rc = RegSetValueEx(hKey, REGSTR_VAL_MFG, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.MfgName, (wcslen(SelectedDriver->Info.MfgName) + 1) * sizeof(WCHAR)); + rc = RegSetValueEx(hKey, REGSTR_VAL_MFG, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.MfgName, (strlenW(SelectedDriver->Info.MfgName) + 1) * sizeof(WCHAR)); if (rc != ERROR_SUCCESS) { SetLastError(rc); Modified: trunk/reactos/dll/win32/setupapi/parser.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/setupapi/parser.c…
============================================================================== --- trunk/reactos/dll/win32/setupapi/parser.c (original) +++ trunk/reactos/dll/win32/setupapi/parser.c Thu Apr 13 12:06:45 2006 @@ -1116,7 +1116,7 @@ WCHAR *path, *p; UINT len; - TRACE("%S %S %lx %p\n", name, class, style, error); + TRACE("%s %s %lx %p\n", debugstr_w(name), debugstr_w(class), style, error); if (strchrW( name, '\\' ) || strchrW( name, '/' )) { @@ -2007,7 +2007,7 @@ DWORD requiredSize = 0; BOOL ret = FALSE; - TRACE("%S %lx %p %ld %p\n", DirectoryPath, InfStyle, + TRACE("%s %lx %p %ld %p\n", debugstr_w(DirectoryPath), InfStyle, ReturnBuffer, ReturnBufferSize, RequiredSize); if (InfStyle & ~(INF_STYLE_OLDNT | INF_STYLE_WIN4)) @@ -2085,7 +2085,7 @@ /* InfStyle was not correct. Skip this file */ continue; } - TRACE("Invalid .inf file %S\n", pFileSpecification); + TRACE("Invalid .inf file %s\n", debugstr_w(pFileSpecification)); continue; } @@ -2208,7 +2208,7 @@ HINF hInf = INVALID_HANDLE_VALUE; BOOL ret = FALSE; - TRACE("%S %p %p %ld %p\n", InfName, ClassGuid, + TRACE("%s %p %p %ld %p\n", debugstr_w(InfName), ClassGuid, ClassName, ClassNameSize, RequiredSize); /* Open .inf file */ Modified: trunk/reactos/dll/win32/setupapi/setupapi.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/setupapi/setupapi…
============================================================================== --- trunk/reactos/dll/win32/setupapi/setupapi.rbuild (original) +++ trunk/reactos/dll/win32/setupapi/setupapi.rbuild Thu Apr 13 12:06:45 2006 @@ -14,6 +14,7 @@ <define name="_SETUPAPI_" /> <define name="_SETUPAPI_VER">0x501</define> <library>pnp_client</library> + <library>uuid</library> <library>wine</library> <library>ntdll</library> <library>kernel32</library> Modified: trunk/reactos/dll/win32/setupapi/setupapi_private.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/setupapi/setupapi…
============================================================================== --- trunk/reactos/dll/win32/setupapi/setupapi_private.h (original) +++ trunk/reactos/dll/win32/setupapi/setupapi_private.h Thu Apr 13 12:06:45 2006 @@ -53,7 +53,7 @@ /* SPINT_ACTIVE : the interface is active/enabled - * SPINT_DEFAULT: the interface is the default interface for the device class FIXME??? + * SPINT_DEFAULT: the interface is the default interface for the device class * SPINT_REMOVED: the interface is removed */ DWORD Flags;
18 years, 6 months
1
0
0
0
[greatlrd] 21574: Bugfix : hal lock surface so it does not crash any longer
by greatlrd@svn.reactos.org
Author: greatlrd Date: Thu Apr 13 10:38:52 2006 New Revision: 21574 URL:
http://svn.reactos.ru/svn/reactos?rev=21574&view=rev
Log: Bugfix : hal lock surface so it does not crash any longer Modified: trunk/reactos/dll/directx/ddraw/hal/surface_hal.c Modified: trunk/reactos/dll/directx/ddraw/hal/surface_hal.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/surfa…
============================================================================== --- trunk/reactos/dll/directx/ddraw/hal/surface_hal.c (original) +++ trunk/reactos/dll/directx/ddraw/hal/surface_hal.c Thu Apr 13 10:38:52 2006 @@ -130,13 +130,26 @@ OutputDebugStringA("Here ddRVal lock"); return Lock.ddRVal; } - + // FIXME ??? is this right ?? - RtlZeroMemory(pDDSD,sizeof(DDSURFACEDESC2)); - memcpy(pDDSD,&This->Surf->mddsdPrimary,sizeof(DDSURFACEDESC)); - pDDSD->dwSize = sizeof(DDSURFACEDESC2); - - pDDSD->lpSurface = (LPVOID) Lock.lpSurfData; + if (pDDSD != NULL) + { + if (pDDSD->dwSize == sizeof(DDSURFACEDESC2)) + { + RtlZeroMemory(pDDSD,sizeof(DDSURFACEDESC2)); + // FIXME the interanl mddsdPrimary shall be DDSURFACEDESC2 + memcpy(pDDSD,&This->Surf->mddsdPrimary,sizeof(DDSURFACEDESC)); + pDDSD->dwSize = sizeof(DDSURFACEDESC2); + } + if (pDDSD->dwSize == sizeof(DDSURFACEDESC)) + { + RtlZeroMemory(pDDSD,sizeof(DDSURFACEDESC)); + memcpy(pDDSD,&This->Surf->mddsdPrimary,sizeof(DDSURFACEDESC)); + pDDSD->dwSize = sizeof(DDSURFACEDESC); + } + + pDDSD->lpSurface = (LPVOID) Lock.lpSurfData; + } return DD_OK; }
18 years, 6 months
1
0
0
0
[greatlrd] 21573: Implement surface unlock
by greatlrd@svn.reactos.org
Author: greatlrd Date: Thu Apr 13 10:29:01 2006 New Revision: 21573 URL:
http://svn.reactos.ru/svn/reactos?rev=21573&view=rev
Log: Implement surface unlock Modified: trunk/reactos/dll/directx/ddraw/hal/surface_hal.c Modified: trunk/reactos/dll/directx/ddraw/hal/surface_hal.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/surfa…
============================================================================== --- trunk/reactos/dll/directx/ddraw/hal/surface_hal.c (original) +++ trunk/reactos/dll/directx/ddraw/hal/surface_hal.c Thu Apr 13 10:29:01 2006 @@ -93,7 +93,7 @@ { IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - + DDHAL_LOCKDATA Lock; if (prect!=NULL) @@ -115,16 +115,19 @@ if (!DdResetVisrgn(&This->Surf->mPrimaryLocal, NULL)) { - // derr(L"DirectDrawImpl[%08x]::_clear DdResetVisrgn failed", this); + OutputDebugStringA("Here DdResetVisrgn lock"); + return DDERR_UNSUPPORTED; } if (Lock.Lock(&Lock)!= DDHAL_DRIVER_HANDLED) { - return DDERR_LOCKEDSURFACES; + OutputDebugStringA("Here DDHAL_DRIVER_HANDLED lock"); + return DDERR_UNSUPPORTED; } if (Lock.ddRVal!= DD_OK) { + OutputDebugStringA("Here ddRVal lock"); return Lock.ddRVal; } @@ -138,8 +141,33 @@ return DD_OK; } HRESULT Hal_DDrawSurface_Unlock(LPDIRECTDRAWSURFACE7 iface, LPRECT pRect) -{ - DX_STUB; +{ + IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; + + DDHAL_UNLOCKDATA unLock; + unLock.ddRVal = DDERR_NOTPALETTIZED; + unLock.lpDD = &This->owner->mDDrawGlobal; + unLock.lpDDSurface = &This->Surf->mPrimaryLocal; + unLock.Unlock = This->owner->mCallbacks.HALDDSurface.Unlock; + + + + if (!DdResetVisrgn( unLock.lpDDSurface, NULL)) + { + return DDERR_UNSUPPORTED; + } + + if (unLock.Unlock(&unLock)!= DDHAL_DRIVER_HANDLED) + { + return DDERR_UNSUPPORTED; + } + + if (unLock.ddRVal!= DD_OK) + { + return unLock.ddRVal; + } + + return DD_OK; } HRESULT Hal_DDrawSurface_Flip(LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAWSURFACE7 override, DWORD dwFlags)
18 years, 6 months
1
0
0
0
[gvg] 21572: Keep track of last trunk rev merged to branch
by gvg@svn.reactos.org
Author: gvg Date: Thu Apr 13 09:48:23 2006 New Revision: 21572 URL:
http://svn.reactos.ru/svn/reactos?rev=21572&view=rev
Log: Keep track of last trunk rev merged to branch Modified: branches/ntoskrnl-audit/reactos/ (props changed) Propchange: branches/ntoskrnl-audit/reactos/ ------------------------------------------------------------------------------ lastmerge = 21570
18 years, 6 months
1
0
0
0
[gvg] 21571: Create kernel audit playground
by gvg@svn.reactos.org
Author: gvg Date: Thu Apr 13 09:41:16 2006 New Revision: 21571 URL:
http://svn.reactos.ru/svn/reactos?rev=21571&view=rev
Log: Create kernel audit playground Added: branches/ntoskrnl-audit/ - copied from r21570, trunk/
18 years, 6 months
1
0
0
0
[greatlrd] 21570: make ddraw not crashing in ros. close my debug marco for windows.
by greatlrd@svn.reactos.org
Author: greatlrd Date: Thu Apr 13 00:10:20 2006 New Revision: 21570 URL:
http://svn.reactos.ru/svn/reactos?rev=21570&view=rev
Log: make ddraw not crashing in ros. close my debug marco for windows. Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/rosdraw.h…
============================================================================== --- trunk/reactos/dll/directx/ddraw/rosdraw.h (original) +++ trunk/reactos/dll/directx/ddraw/rosdraw.h Thu Apr 13 00:10:20 2006 @@ -233,6 +233,9 @@ firstcall = FALSE; \ } +#define DX_WINDBG_trace() + +/* #define DX_WINDBG_trace() \ static BOOL firstcallx = TRUE; \ if (firstcallx) \ @@ -242,6 +245,7 @@ OutputDebugStringA(buffer); \ firstcallx = TRUE; \ } +*/ #define DX_WINDBG_trace_res(width,height,bpp) \ static BOOL firstcallxx = TRUE; \
18 years, 6 months
1
0
0
0
[greatlrd] 21569: Implement DX HAL Lock it works now. we getting back user mode pointer of kernel mode memode pointer. it is mapen now. it did make next test apps working with our ddraw.dll in windows. lest 4 dx draw apps I got is working.
by greatlrd@svn.reactos.org
Author: greatlrd Date: Thu Apr 13 00:09:09 2006 New Revision: 21569 URL:
http://svn.reactos.ru/svn/reactos?rev=21569&view=rev
Log: Implement DX HAL Lock it works now. we getting back user mode pointer of kernel mode memode pointer. it is mapen now. it did make next test apps working with our ddraw.dll in windows. lest 4 dx draw apps I got is working. Modified: trunk/reactos/dll/directx/ddraw/hal/surface_hal.c Modified: trunk/reactos/dll/directx/ddraw/hal/surface_hal.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/surfa…
============================================================================== --- trunk/reactos/dll/directx/ddraw/hal/surface_hal.c (original) +++ trunk/reactos/dll/directx/ddraw/hal/surface_hal.c Thu Apr 13 00:09:09 2006 @@ -65,25 +65,20 @@ mDdBlt.lpDDSrcSurface = That->Surf->mpPrimaryLocals[0]; } - //mDdBlt.lpDDSrcSurface = NULL; //src-> - mDdBlt.lpDD = &This->owner->mDDrawGlobal; mDdBlt.Blt = This->owner->mCallbacks.HALDDSurface.Blt; mDdBlt.lpDDDestSurface = This->Surf->mpPrimaryLocals[0]; mDdBlt.dwFlags = dwFlags; - - // This->Surf->mpPrimaryLocals[0]->hDC = This->owner->mDDrawGlobal.lpExclusiveOwner->hDC; + // FIXME dectect if it clipped or not - DX_STUB_str( "Can not create offscreenplain surface"); mDdBlt.IsClipped = FALSE; if (mDdBlt.Blt(&mDdBlt) != DDHAL_DRIVER_HANDLED) { return DDHAL_DRIVER_HANDLED; } - if (mDdBlt.ddRVal!=DD_OK) { @@ -97,10 +92,9 @@ pDDSD, DWORD flags, HANDLE event) { - IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - - - DDHAL_LOCKDATA Lock; + IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; + + DDHAL_LOCKDATA Lock; if (prect!=NULL) { @@ -115,26 +109,32 @@ Lock.ddRVal = DDERR_NOTPALETTIZED; Lock.Lock = This->owner->mCallbacks.HALDDSurface.Lock; Lock.dwFlags = flags; - Lock.lpDDSurface = This->Surf->mpPrimaryLocals[0]; + Lock.lpDDSurface = &This->Surf->mPrimaryLocal; Lock.lpDD = &This->owner->mDDrawGlobal; Lock.lpSurfData = NULL; - - // FIXME some how lock goes wrong; - return DD_FALSE; - if (This->owner->mCallbacks.HALDDSurface.Lock(&Lock)!= DDHAL_DRIVER_HANDLED) + + if (!DdResetVisrgn(&This->Surf->mPrimaryLocal, NULL)) { + // derr(L"DirectDrawImpl[%08x]::_clear DdResetVisrgn failed", this); + } + + if (Lock.Lock(&Lock)!= DDHAL_DRIVER_HANDLED) + { + return DDERR_LOCKEDSURFACES; + } + + if (Lock.ddRVal!= DD_OK) + { return Lock.ddRVal; } + // FIXME ??? is this right ?? RtlZeroMemory(pDDSD,sizeof(DDSURFACEDESC2)); memcpy(pDDSD,&This->Surf->mddsdPrimary,sizeof(DDSURFACEDESC)); pDDSD->dwSize = sizeof(DDSURFACEDESC2); - - pDDSD->lpSurface = Lock.lpSurfData; - - - // FIXME some things is wrong it does not show the data on screen ?? - + + pDDSD->lpSurface = (LPVOID) Lock.lpSurfData; + return DD_OK; } HRESULT Hal_DDrawSurface_Unlock(LPDIRECTDRAWSURFACE7 iface, LPRECT pRect)
18 years, 6 months
1
0
0
0
[tretiakov] 21568: Oops, forget to add these.
by tretiakov@svn.reactos.org
Author: tretiakov Date: Wed Apr 12 23:18:22 2006 New Revision: 21568 URL:
http://svn.reactos.ru/svn/reactos?rev=21568&view=rev
Log: Oops, forget to add these. Added: trunk/reactos/dll/win32/rpcrt4/ndr_contexth.c trunk/reactos/dll/win32/rpcrt4/ndr_contexth.h Added: trunk/reactos/dll/win32/rpcrt4/ndr_contexth.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_contex…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_contexth.c (added) +++ trunk/reactos/dll/win32/rpcrt4/ndr_contexth.c Wed Apr 12 23:18:22 2006 @@ -1,0 +1,206 @@ +/* + * Context Handle Functions + * + * Copyright 2006 Saveliy Tretiakov + * + * 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 + */ + +#include "rpc.h" +#include "rpcndr.h" +#include "wine/debug.h" + +#include "rpc_binding.h" +#include "ndr_contexth.h" + + +/*********************************************************************** + * NDRCContextBinding + */ +RPC_BINDING_HANDLE WINAPI NDRCContextBinding(NDR_CCONTEXT CContext) +{ + if(!CContext) + RpcRaiseException(ERROR_INVALID_HANDLE); + + return (RPC_BINDING_HANDLE)((CContextHandle*)CContext)->Binding; +} + +/*********************************************************************** + * NDRCContextMarshall + */ +void WINAPI NDRCContextMarshall(NDR_CCONTEXT CContext, void *pBuff ) +{ + CContextHandle *ctx = (CContextHandle*)CContext; + memcpy(pBuff, &ctx->Ndr, sizeof(ContextHandleNdr)); +} + +/*********************************************************************** + * NdrClientContextMarshall + */ +void WINAPI NdrClientContextMarshall(PMIDL_STUB_MESSAGE pStubMsg, + NDR_CCONTEXT ContextHandle, + int fCheck) +{ + + if(!ContextHandle) + RpcRaiseException(ERROR_INVALID_HANDLE); + + NDRCContextMarshall(ContextHandle, pStubMsg->Buffer); + + pStubMsg->Buffer += sizeof(ContextHandleNdr); + +} + +/*********************************************************************** + * NDRCContextUnmarshall + */ +void WINAPI NDRCContextUnmarshall(NDR_CCONTEXT *pCContext, + RPC_BINDING_HANDLE hBinding, + void *pBuff, + unsigned long DataRepresentation ) +{ + CContextHandle *ctx = (CContextHandle*)*pCContext; + ContextHandleNdr *ndr = (ContextHandleNdr*)pBuff; + RPC_STATUS status; + + if(UuidIsNil(&ndr->uuid, &status)) + { + if(ctx) + { + RPCRT4_DestroyBinding(ctx->Binding); + HeapFree(GetProcessHeap(), 0, ctx); + } + *pCContext = NULL; + } + else + { + ctx = HeapAlloc(GetProcessHeap(), 0, sizeof(CContextHandle)); + if(!ctx) RpcRaiseException(ERROR_OUTOFMEMORY); + + status = RpcBindingCopy(hBinding, (RPC_BINDING_HANDLE*) &ctx->Binding); + if(status != RPC_S_OK) RpcRaiseException(status); + + memcpy(&ctx->Ndr, ndr, sizeof(ContextHandleNdr)); + *pCContext = (NDR_CCONTEXT)ctx; + } +} + +/*********************************************************************** + * NdrClientContextUnmarshall + */ +void WINAPI NdrClientContextUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, + NDR_CCONTEXT * pContextHandle, + RPC_BINDING_HANDLE BindHandle) +{ + if(!pContextHandle) + RpcRaiseException(ERROR_INVALID_HANDLE); + + NDRCContextUnmarshall(pContextHandle, + ((CContextHandle*)pContextHandle)->Binding, + pStubMsg->Buffer, + pStubMsg->RpcMsg->DataRepresentation); + + pStubMsg->Buffer += sizeof(ContextHandleNdr); +} + +/*********************************************************************** + * RpcSmDestroyClientContext + */ +RPC_STATUS WINAPI RpcSmDestroyClientContext(void** ContextHandle) +{ + CContextHandle *ctx = (CContextHandle*)ContextHandle; + + if(!ctx) + return RPC_X_SS_CONTEXT_MISMATCH; + + RPCRT4_DestroyBinding(ctx->Binding); + HeapFree(GetProcessHeap(), 0, ctx); + *ContextHandle = NULL; + + return RPC_S_OK; +} + +/*********************************************************************** + * RpcSsDestroyClientContext + */ +void WINAPI RpcSsDestroyClientContext(void** ContextHandle) +{ + RPC_STATUS status; + + status = RpcSmDestroyClientContext(ContextHandle); + + if(status != RPC_S_OK) + RpcRaiseException(status); +} + +/*********************************************************************** + * NdrServerContextMarshall + */ +void WINAPI NdrServerContextMarshall(PMIDL_STUB_MESSAGE pStubMsg, + NDR_SCONTEXT ContextHandle, + NDR_RUNDOWN RundownRoutine ) +{ + FIXME("(%p, %p, %p): stub\n", pStubMsg, ContextHandle, RundownRoutine); +} + +/*********************************************************************** + * NdrServerContextUnmarshall + */ +NDR_SCONTEXT WINAPI NdrServerContextUnmarshall(PMIDL_STUB_MESSAGE pStubMsg) +{ + FIXME("(%p): stub\n", pStubMsg); + return NULL; +} + +/*********************************************************************** + * NdrContextHandleSize + */ +void WINAPI NdrContextHandleSize(PMIDL_STUB_MESSAGE pStubMsg, + unsigned char* pMemory, + PFORMAT_STRING pFormat) +{ + FIXME("(%p, %p, %p): stub\n", pStubMsg, pMemory, pFormat); +} + +/*********************************************************************** + * NdrContextHandleInitialize + */ +NDR_SCONTEXT WINAPI NdrContextHandleInitialize(PMIDL_STUB_MESSAGE pStubMsg, + PFORMAT_STRING pFormat) +{ + FIXME("(%p, %p): stub\n", pStubMsg, pFormat); + return NULL; +} + +/*********************************************************************** + * NdrServerContextNewMarshall + */ +void WINAPI NdrServerContextNewMarshall(PMIDL_STUB_MESSAGE pStubMsg, + NDR_SCONTEXT ContextHandle, + NDR_RUNDOWN RundownRoutine, + PFORMAT_STRING pFormat) +{ + FIXME("(%p, %p, %p, %p): stub\n", pStubMsg, ContextHandle, RundownRoutine, pFormat); +} + +/*********************************************************************** + * NdrServerContextNewUnmarshall + */ +NDR_SCONTEXT WINAPI NdrServerContextNewUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, + PFORMAT_STRING pFormat) +{ + FIXME("(%p, %p): stub\n", pStubMsg, pFormat); + return NULL; +} Added: trunk/reactos/dll/win32/rpcrt4/ndr_contexth.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_contex…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_contexth.h (added) +++ trunk/reactos/dll/win32/rpcrt4/ndr_contexth.h Wed Apr 12 23:18:22 2006 @@ -1,0 +1,39 @@ +/* + * Context Handle Functions + * + * Copyright 2006 Saveliy Tretiakov + * + * 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 + */ + + +#ifndef __WINE_NDR_CONTEXTH_H +#define __WINE_NDR_CONTEXTH_H + +#include "wine/rpcss_shared.h" + +typedef struct _ContextHandleNdr +{ + UINT attributes; + UUID uuid; +} ContextHandleNdr; + +typedef struct _CContextHandle +{ + RpcBinding *Binding; + ContextHandleNdr Ndr; +} CContextHandle; + +#endif //__WINE_NDR_CONTEXTH_H
18 years, 6 months
1
0
0
0
[tretiakov] 21567: Move all context handle stuff to ndr_contexth.c
by tretiakov@svn.reactos.org
Author: tretiakov Date: Wed Apr 12 23:17:30 2006 New Revision: 21567 URL:
http://svn.reactos.ru/svn/reactos?rev=21567&view=rev
Log: Move all context handle stuff to ndr_contexth.c Modified: trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c trunk/reactos/dll/win32/rpcrt4/rpc_binding.h trunk/reactos/dll/win32/rpcrt4/rpcrt4.rbuild Modified: trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_marsha…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c Wed Apr 12 23:17:30 2006 @@ -3229,167 +3229,3 @@ /* nothing to do */ } - -/*********************************************************************** - * NDRCContextMarshall - */ -void WINAPI NDRCContextMarshall(NDR_CCONTEXT CContext, void *pBuff ) -{ - CContextHandle *ctx = (CContextHandle*)CContext; - memcpy(pBuff, &ctx->Ndr, sizeof(ContextHandleNdr)); -} - -/*********************************************************************** - * NdrClientContextMarshall - */ -void WINAPI NdrClientContextMarshall(PMIDL_STUB_MESSAGE pStubMsg, - NDR_CCONTEXT ContextHandle, - int fCheck) -{ - - if(!ContextHandle) - RpcRaiseException(ERROR_INVALID_HANDLE); - - NDRCContextMarshall(ContextHandle, pStubMsg->Buffer); - - pStubMsg->Buffer += sizeof(ContextHandleNdr); - -} - - -/*********************************************************************** - * NDRCContextUnmarshall - */ -void WINAPI NDRCContextUnmarshall(NDR_CCONTEXT *pCContext, - RPC_BINDING_HANDLE hBinding, - void *pBuff, - unsigned long DataRepresentation ) -{ - CContextHandle *ctx = (CContextHandle*)*pCContext; - ContextHandleNdr *ndr = (ContextHandleNdr*)pBuff; - RPC_STATUS status; - - if(UuidIsNil(&ndr->uuid, &status)) - { - if(ctx) - { - RPCRT4_DestroyBinding(ctx->Binding); - HeapFree(GetProcessHeap(), 0, ctx); - } - *pCContext = NULL; - } - else - { - ctx = HeapAlloc(GetProcessHeap(), 0, sizeof(CContextHandle)); - if(!ctx) RpcRaiseException(ERROR_OUTOFMEMORY); - - status = RpcBindingCopy(hBinding, (RPC_BINDING_HANDLE*) &ctx->Binding); - if(status != RPC_S_OK) RpcRaiseException(status); - - memcpy(&ctx->Ndr, ndr, sizeof(ContextHandleNdr)); - *pCContext = (NDR_CCONTEXT)ctx; - } -} - -/*********************************************************************** - * NdrClientContextUnmarshall - */ -void WINAPI NdrClientContextUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, - NDR_CCONTEXT * pContextHandle, - RPC_BINDING_HANDLE BindHandle) -{ - if(!pContextHandle) - RpcRaiseException(ERROR_INVALID_HANDLE); - - NDRCContextUnmarshall(pContextHandle, - ((CContextHandle*)pContextHandle)->Binding, - pStubMsg->Buffer, - pStubMsg->RpcMsg->DataRepresentation); - - pStubMsg->Buffer += sizeof(ContextHandleNdr); -} - -void WINAPI NdrServerContextMarshall(PMIDL_STUB_MESSAGE pStubMsg, - NDR_SCONTEXT ContextHandle, - NDR_RUNDOWN RundownRoutine ) -{ - FIXME("(%p, %p, %p): stub\n", pStubMsg, ContextHandle, RundownRoutine); -} - -NDR_SCONTEXT WINAPI NdrServerContextUnmarshall(PMIDL_STUB_MESSAGE pStubMsg) -{ - FIXME("(%p): stub\n", pStubMsg); - return NULL; -} - -void WINAPI NdrContextHandleSize(PMIDL_STUB_MESSAGE pStubMsg, - unsigned char* pMemory, - PFORMAT_STRING pFormat) -{ - FIXME("(%p, %p, %p): stub\n", pStubMsg, pMemory, pFormat); -} - -NDR_SCONTEXT WINAPI NdrContextHandleInitialize(PMIDL_STUB_MESSAGE pStubMsg, - PFORMAT_STRING pFormat) -{ - FIXME("(%p, %p): stub\n", pStubMsg, pFormat); - return NULL; -} - -void WINAPI NdrServerContextNewMarshall(PMIDL_STUB_MESSAGE pStubMsg, - NDR_SCONTEXT ContextHandle, - NDR_RUNDOWN RundownRoutine, - PFORMAT_STRING pFormat) -{ - FIXME("(%p, %p, %p, %p): stub\n", pStubMsg, ContextHandle, RundownRoutine, pFormat); -} - -NDR_SCONTEXT WINAPI NdrServerContextNewUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, - PFORMAT_STRING pFormat) -{ - FIXME("(%p, %p): stub\n", pStubMsg, pFormat); - return NULL; -} - -/*********************************************************************** - * NDRCContextBinding - */ -RPC_BINDING_HANDLE WINAPI NDRCContextBinding(NDR_CCONTEXT CContext) -{ - if(!CContext) - RpcRaiseException(ERROR_INVALID_HANDLE); - - return (RPC_BINDING_HANDLE)((CContextHandle*)CContext)->Binding; -} - -/*********************************************************************** - * RpcSmDestroyClientContext - */ -RPC_STATUS WINAPI RpcSmDestroyClientContext(void** ContextHandle) -{ - CContextHandle *ctx = (CContextHandle*)ContextHandle; - - if(!ctx) - return RPC_X_SS_CONTEXT_MISMATCH; - - RPCRT4_DestroyBinding(ctx->Binding); - HeapFree(GetProcessHeap(), 0, ctx); - *ContextHandle = NULL; - - return RPC_S_OK; -} - -/*********************************************************************** - * RpcSsDestroyClientContext - */ -void WINAPI RpcSsDestroyClientContext(void** ContextHandle) -{ - RPC_STATUS status; - - status = RpcSmDestroyClientContext(ContextHandle); - - if(status != RPC_S_OK) - RpcRaiseException(status); -} - - Modified: trunk/reactos/dll/win32/rpcrt4/rpc_binding.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_bindin…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_binding.h (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_binding.h Wed Apr 12 23:17:30 2006 @@ -53,18 +53,6 @@ RpcConnection* FromConn; } RpcBinding; -typedef struct _ContextHandleNdr -{ - UINT attributes; - UUID uuid; -} ContextHandleNdr; - -typedef struct _CContextHandle -{ - RpcBinding *Binding; - ContextHandleNdr Ndr; -} CContextHandle; - LPSTR RPCRT4_strndupA(LPCSTR src, INT len); LPWSTR RPCRT4_strndupW(LPWSTR src, INT len); LPSTR RPCRT4_strdupWtoA(LPWSTR src); Modified: trunk/reactos/dll/win32/rpcrt4/rpcrt4.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpcrt4.rbu…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpcrt4.rbuild (original) +++ trunk/reactos/dll/win32/rpcrt4/rpcrt4.rbuild Wed Apr 12 23:17:30 2006 @@ -29,6 +29,7 @@ <file>rpc_epmap.c</file> <file>rpc_message.c</file> <file>rpc_server.c</file> + <file>ndr_contexth.c</file> <file>rpcrt4_main.c</file> <file>rpcss_np_client.c</file> <file>rpcrt4.rc</file>
18 years, 6 months
1
0
0
0
← Newer
1
...
16
17
18
19
20
21
22
...
33
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
Results per page:
10
25
50
100
200