ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
April 2006
----- 2025 -----
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
14 participants
324 discussions
Start a n
N
ew thread
[greatlrd] 21435: This files is emty and do not contain any real code on a dummy interface to prepare the implement of d3d8.dll
by aleksey@studiocerebral.com
Author: greatlrd Date: Sat Apr 1 23:21:01 2006 New Revision: 21435 URL:
http://svn.reactos.ru/svn/reactos?rev=21435&view=rev
Log: This files is emty and do not contain any real code on a dummy interface to prepare the implement of d3d8.dll Modified: trunk/reactos/dll/directx/d3d8/d3d8.c (props changed) trunk/reactos/dll/directx/d3d8/d3d8.def (props changed) trunk/reactos/dll/directx/d3d8/d3d8.h (props changed) trunk/reactos/dll/directx/d3d8/d3d8.rc (props changed) Propchange: trunk/reactos/dll/directx/d3d8/d3d8.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/directx/d3d8/d3d8.def ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/directx/d3d8/d3d8.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/directx/d3d8/d3d8.rc ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
19 years
1
0
0
0
[greatlrd] 21434: Unlock all file no of these file have been revers. Correct The HAL startup process thanks to Steffen Schulze to solv it He is working with close software He have wrote complete MoComp to us but am waiting with to commit that interface. Rember all code he have done is being use in close source apps and thuse apps will stay close source. In his source code overlay surface is working fine. This is frist step to correct HAL. Now we need fix the CreateSurface process.
by aleksey@studiocerebral.com
Author: greatlrd Date: Sat Apr 1 23:12:56 2006 New Revision: 21434 URL:
http://svn.reactos.ru/svn/reactos?rev=21434&view=rev
Log: Unlock all file no of these file have been revers. Correct The HAL startup process thanks to Steffen Schulze to solv it He is working with close software He have wrote complete MoComp to us but am waiting with to commit that interface. Rember all code he have done is being use in close source apps and thuse apps will stay close source. In his source code overlay surface is working fine. This is frist step to correct HAL. Now we need fix the CreateSurface process. Modified: trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c (contents, props changed) trunk/reactos/dll/directx/ddraw/hal/surface_hal.c (contents, props changed) trunk/reactos/dll/directx/ddraw/main.c trunk/reactos/dll/directx/ddraw/main/clipper_main.c (contents, props changed) trunk/reactos/dll/directx/ddraw/main/color_main.c (contents, props changed) trunk/reactos/dll/directx/ddraw/main/ddraw_main.c (contents, props changed) trunk/reactos/dll/directx/ddraw/main/gamma_main.c (contents, props changed) trunk/reactos/dll/directx/ddraw/main/kernel_main.c (props changed) trunk/reactos/dll/directx/ddraw/main/palette_main.c (contents, props changed) trunk/reactos/dll/directx/ddraw/main/surface_main.c (contents, props changed) trunk/reactos/dll/directx/ddraw/main/videoport_main.c (props changed) trunk/reactos/dll/directx/ddraw/rosdraw.h trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c (contents, props changed) trunk/reactos/dll/directx/ddraw/soft/surface_hel.c (props changed) trunk/reactos/dll/directx/ddraw/thunks/ddraw_thunk.c (props changed) trunk/reactos/dll/directx/ddraw/thunks/surface_thunk.c (props changed) Modified: trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/ddraw…
============================================================================== --- trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c (original) +++ trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c Sat Apr 1 23:12:56 2006 @@ -14,295 +14,311 @@ HRESULT Hal_DirectDraw_Initialize (LPDIRECTDRAW7 iface) { IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - - /* point to it self */ - This->DirectDrawGlobal.lp16DD = &This->DirectDrawGlobal; - - /* get the object */ - if(!DdCreateDirectDrawObject (&This->DirectDrawGlobal, (HDC)This->DirectDrawGlobal.lpExclusiveOwner->hDC )) - return DDERR_INVALIDPARAMS; + + /* HAL Startup process */ + DEVMODE devmode; + HBITMAP hbmp; + const UINT bmiSize = sizeof(BITMAPINFOHEADER) + 0x10; + UCHAR *pbmiData; + BITMAPINFO *pbmi; + DWORD *pMasks; + BOOL newmode = FALSE; + + /* + Get Display mode res and caps + We need fill the mDDrawGlobal + vmidata struct right + + this code is from Steffen Schulze + 1. Add the mpModeInfos to inisate + */ + This->mcModeInfos = 1; + This->mpModeInfos = (DDHALMODEINFO*) DxHeapMemAlloc(This->mcModeInfos * sizeof(DDHALMODEINFO)); + + if (This->mpModeInfos == NULL) + { + return DD_FALSE; + } + + EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devmode); + + This->mpModeInfos[0].dwWidth = devmode.dmPelsWidth; + This->mpModeInfos[0].dwHeight = devmode.dmPelsHeight; + This->mpModeInfos[0].dwBPP = devmode.dmBitsPerPel; + This->mpModeInfos[0].lPitch = (devmode.dmPelsWidth*devmode.dmBitsPerPel)/8; + This->mpModeInfos[0].wRefreshRate = (WORD)devmode.dmDisplayFrequency; + + /* + Create HDC + we need it for doing the Call to GdiEntry1 + */ + This->hdc = CreateDCW(L"DISPLAY",L"DISPLAY",NULL,NULL); + + if (This->hdc == NULL) + { + return DD_FALSE; + } + + /* Do not release HDC it is mapen in kernel mode + we can only release it at exit of ddraw.dll + */ + + /* + Dectect RGB bit mask + this code is from Steffen Schulze + why it need I do not know yet but it + will allown us to create any type of + surface later + */ + + hbmp = CreateCompatibleBitmap(This->hdc, 1, 1); + if (hbmp==NULL) + { + DxHeapMemFree(This->mpModeInfos); + DeleteDC(This->hdc); + return DD_FALSE; + } + + pbmiData = (UCHAR *) DxHeapMemAlloc(bmiSize); + pbmi = (BITMAPINFO*)pbmiData; + + if (pbmiData==NULL) + { + DxHeapMemFree(This->mpModeInfos); + DeleteDC(This->hdc); + DeleteObject(hbmp); + return DDERR_UNSUPPORTED; + } + + pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbmi->bmiHeader.biBitCount = (WORD)devmode.dmBitsPerPel; + pbmi->bmiHeader.biCompression = BI_BITFIELDS; + pbmi->bmiHeader.biWidth = 1; + pbmi->bmiHeader.biHeight = 1; + + GetDIBits(This->hdc, hbmp, 0, 0, NULL, pbmi, 0); + DeleteObject(hbmp); + + pMasks = (DWORD*)(pbmiData + sizeof(BITMAPINFOHEADER)); + This->mpModeInfos[0].dwRBitMask = pMasks[0]; + This->mpModeInfos[0].dwGBitMask = pMasks[1]; + This->mpModeInfos[0].dwBBitMask = pMasks[2]; + This->mpModeInfos[0].dwAlphaBitMask = pMasks[3]; + + DxHeapMemFree(pbmiData); + + /* + prepare start up the DX Draw HAL interface now + */ + + memset(&This->mDDrawGlobal, 0, sizeof(DDRAWI_DIRECTDRAW_GBL)); + memset(&This->mHALInfo, 0, sizeof(DDHALINFO)); + memset(&This->mCallbacks, 0, sizeof(DDHAL_CALLBACKS)); + + /* + Startup DX HAL step one of three + */ + if (!DdCreateDirectDrawObject(&This->mDDrawGlobal, This->hdc)) + { + DxHeapMemFree(This->mpModeInfos); + DeleteDC(This->hdc); + DeleteObject(hbmp); + return DD_FALSE; + } - /* alloc all the space */ - This->DirectDrawGlobal.lpDDCBtmp = (LPDDHAL_CALLBACKS)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(DDHAL_CALLBACKS)); - - This->DirectDrawGlobal.lpD3DHALCallbacks = (ULONG_PTR)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY, - sizeof(D3DHAL_CALLBACKS)); - - This->DirectDrawGlobal.lpD3DGlobalDriverData = (ULONG_PTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(D3DHAL_GLOBALDRIVERDATA)); - - /* Fill in some info */ - This->HalInfo.lpD3DGlobalDriverData = This->DirectDrawGlobal.lpD3DGlobalDriverData; - This->HalInfo.lpD3DHALCallbacks = This->DirectDrawGlobal.lpD3DHALCallbacks; - This->HalInfo.lpDDCallbacks = &This->DirectDrawGlobal.lpDDCBtmp->HALDD; - This->HalInfo.lpDDExeBufCallbacks = &This->DirectDrawGlobal.lpDDCBtmp->HALDDExeBuf; - This->HalInfo.lpDDPaletteCallbacks = &This->DirectDrawGlobal.lpDDCBtmp->HALDDPalette; - This->HalInfo.lpDDSurfaceCallbacks = &This->DirectDrawGlobal.lpDDCBtmp->HALDDSurface; - - /* query all kinds of infos from the driver */ - if(!DdQueryDirectDrawObject ( - &This->DirectDrawGlobal, - &This->HalInfo, - This->HalInfo.lpDDCallbacks, - This->HalInfo.lpDDSurfaceCallbacks, - This->HalInfo.lpDDPaletteCallbacks, - (LPD3DHAL_CALLBACKS)This->DirectDrawGlobal.lpD3DHALCallbacks, - (LPD3DHAL_GLOBALDRIVERDATA)This->DirectDrawGlobal.lpD3DGlobalDriverData, - This->HalInfo.lpDDExeBufCallbacks, - NULL, - NULL, - NULL )) - { - return DD_FALSE; - } - - This->HalInfo.vmiData.pvmList = (LPVIDMEM) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(VIDMEM) * This->HalInfo.vmiData.dwNumHeaps); - - This->DirectDrawGlobal.lpdwFourCC = (DWORD *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(DWORD) * This->HalInfo.ddCaps.dwNumFourCCCodes); - ((LPD3DHAL_GLOBALDRIVERDATA)This->DirectDrawGlobal.lpD3DGlobalDriverData)->lpTextureFormats = - (LPDDSURFACEDESC) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DDSURFACEDESC) * - ((LPD3DHAL_GLOBALDRIVERDATA)This->DirectDrawGlobal.lpD3DGlobalDriverData)->dwNumTextureFormats); - - if(!DdQueryDirectDrawObject ( - &This->DirectDrawGlobal, - &This->HalInfo, - This->HalInfo.lpDDCallbacks, - This->HalInfo.lpDDSurfaceCallbacks, - This->HalInfo.lpDDPaletteCallbacks, - (LPD3DHAL_CALLBACKS)This->DirectDrawGlobal.lpD3DHALCallbacks, - (LPD3DHAL_GLOBALDRIVERDATA)This->DirectDrawGlobal.lpD3DGlobalDriverData, - This->HalInfo.lpDDExeBufCallbacks, - ((LPD3DHAL_GLOBALDRIVERDATA)This->DirectDrawGlobal.lpD3DGlobalDriverData)->lpTextureFormats, - This->DirectDrawGlobal.lpdwFourCC, - This->HalInfo.vmiData.pvmList - )) - { - return DD_FALSE; - } + // Do not relase HDC it have been map in kernel mode + // DeleteDC(hdc); + + if (!DdReenableDirectDrawObject(&This->mDDrawGlobal, &newmode)) + { + DxHeapMemFree(This->mpModeInfos); + DeleteDC(This->hdc); + DeleteObject(hbmp); + return DD_FALSE; + } + + /* + Setup the DirectDraw Local + */ + + This->mDDrawLocal.lpDDCB = &This->mCallbacks; + This->mDDrawLocal.lpGbl = &This->mDDrawGlobal; + This->mDDrawLocal.dwProcessId = GetCurrentProcessId(); + + This->mDDrawGlobal.lpDDCBtmp = &This->mCallbacks; + This->mDDrawGlobal.lpExclusiveOwner = &This->mDDrawLocal; + + /* + Startup DX HAL step two of three + */ + + if (!DdQueryDirectDrawObject(&This->mDDrawGlobal, + &This->mHALInfo, + &This->mCallbacks.HALDD, + &This->mCallbacks.HALDDSurface, + &This->mCallbacks.HALDDPalette, + &This->mD3dCallbacks, + &This->mD3dDriverData, + &This->mD3dBufferCallbacks, + NULL, + NULL, + NULL)) + { + DxHeapMemFree(This->mpModeInfos); + DeleteDC(This->hdc); + DeleteObject(hbmp); + // FIXME Close DX fristcall and second call + return DD_FALSE; + } + + This->mcvmList = This->mHALInfo.vmiData.dwNumHeaps; + This->mpvmList = (VIDMEM*) DxHeapMemAlloc(sizeof(VIDMEM) * This->mcvmList); + if (This->mpvmList == NULL) + { + DxHeapMemFree(This->mpModeInfos); + DeleteDC(This->hdc); + DeleteObject(hbmp); + // FIXME Close DX fristcall and second call + return DD_FALSE; + } + + This->mcFourCC = This->mHALInfo.ddCaps.dwNumFourCCCodes; + This->mpFourCC = (DWORD *) DxHeapMemAlloc(sizeof(DWORD) * This->mcFourCC); + if (This->mpFourCC == NULL) + { + DxHeapMemFree(This->mpvmList); + DxHeapMemFree(This->mpModeInfos); + DeleteDC(This->hdc); + DeleteObject(hbmp); + // FIXME Close DX fristcall and second call + return DD_FALSE; + } + + This->mcTextures = This->mD3dDriverData.dwNumTextureFormats; + This->mpTextures = (DDSURFACEDESC*) DxHeapMemAlloc(sizeof(DDSURFACEDESC) * This->mcTextures); + if (This->mpTextures == NULL) + { + DxHeapMemFree( This->mpFourCC); + DxHeapMemFree( This->mpvmList); + DxHeapMemFree( This->mpModeInfos); + DeleteDC(This->hdc); + DeleteObject(hbmp); + // FIXME Close DX fristcall and second call + return DD_FALSE; + } + + This->mHALInfo.vmiData.pvmList = This->mpvmList; + This->mHALInfo.lpdwFourCC = This->mpFourCC; + This->mD3dDriverData.lpTextureFormats = This->mpTextures; + + if (!DdQueryDirectDrawObject( + &This->mDDrawGlobal, + &This->mHALInfo, + &This->mCallbacks.HALDD, + &This->mCallbacks.HALDDSurface, + &This->mCallbacks.HALDDPalette, + &This->mD3dCallbacks, + &This->mD3dDriverData, + &This->mCallbacks.HALDDExeBuf, + This->mpTextures, + This->mpFourCC, + This->mpvmList)) + + { + DxHeapMemFree(This->mpTextures); + DxHeapMemFree(This->mpFourCC); + DxHeapMemFree(This->mpvmList); + DxHeapMemFree(This->mpModeInfos); + DeleteDC(This->hdc); + DeleteObject(hbmp); + // FIXME Close DX fristcall and second call + return DD_FALSE; + } + + /* + Copy over from HalInfo to DirectDrawGlobal + */ + + // this is wrong, cDriverName need be in ASC code not UNICODE + //memcpy(mDDrawGlobal.cDriverName, mDisplayAdapter, sizeof(wchar)*MAX_DRIVER_NAME); + + memcpy(&This->mDDrawGlobal.vmiData, &This->mHALInfo.vmiData,sizeof(VIDMEMINFO)); + memcpy(&This->mDDrawGlobal.ddCaps, &This->mHALInfo.ddCaps,sizeof(DDCORECAPS)); + + This->mHALInfo.dwNumModes = This->mcModeInfos; + This->mHALInfo.lpModeInfo = This->mpModeInfos; + This->mHALInfo.dwMonitorFrequency = This->mpModeInfos[0].wRefreshRate; + + This->mDDrawGlobal.dwMonitorFrequency = This->mHALInfo.dwMonitorFrequency; + This->mDDrawGlobal.dwModeIndex = This->mHALInfo.dwModeIndex; + This->mDDrawGlobal.dwNumModes = This->mHALInfo.dwNumModes; + This->mDDrawGlobal.lpModeInfo = This->mHALInfo.lpModeInfo; + This->mDDrawGlobal.hInstance = This->mHALInfo.hInstance; + + This->mDDrawGlobal.lp16DD = &This->mDDrawGlobal; + + DeleteObject(hbmp); + //DeleteDC(This->hdc); + + return DD_OK; +} + +VOID +Hal_DirectDraw_Release (LPDIRECTDRAW7 iface) +{ + IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + + if (This->mDDrawGlobal.hDD != 0) + { + DdDeleteDirectDrawObject (&This->mDDrawGlobal); + } + + if (This->mpTextures != NULL) + { + DxHeapMemFree(This->mpTextures); + } + + if (This->mpFourCC != NULL) + { + DxHeapMemFree(This->mpFourCC); + } + + if (This->mpvmList != NULL) + { + DxHeapMemFree(This->mpvmList); + } + + if (This->mpModeInfos != NULL) + { + DxHeapMemFree(This->mpModeInfos); + } + + if (This->hdc != NULL) + { + DeleteDC(This->hdc); + } - /* Copy HalInfo to DirectDrawGlobal (Not complete)*/ - RtlCopyMemory(&This->DirectDrawGlobal.vmiData,&This->HalInfo.vmiData,sizeof(VIDMEMINFO)); - RtlCopyMemory(&This->DirectDrawGlobal.ddCaps,&This->HalInfo.ddCaps,sizeof(DDCORECAPS)); - This->DirectDrawGlobal.dwMonitorFrequency = This->HalInfo.dwMonitorFrequency; - - This->DirectDrawGlobal.dwModeIndex = This->HalInfo.dwModeIndex; - This->DirectDrawGlobal.dwNumModes = This->HalInfo.dwNumModes; - This->DirectDrawGlobal.lpModeInfo = This->HalInfo.lpModeInfo; - - /* Unsure which of these two for lpPDevice - This->DirectDrawGlobal.dwPDevice = This->HalInfo.lpPDevice; - This->lpDriverHandle = This->HalInfo.lpPDevice; - */ - This->DirectDrawGlobal.hInstance = This->HalInfo.hInstance; - RtlCopyMemory(&This->DirectDrawGlobal.lpDDCBtmp->HALDDExeBuf, - &This->HalInfo.lpDDExeBufCallbacks,sizeof(DDHAL_DDEXEBUFCALLBACKS)); - - /************************************************************************/ - /* Set up the rest of the callbacks all callbacks we get back from */ - /* gdi32.dll is user mode */ - /************************************************************************/ - - /* Todo add a check see if HalInfo.GetDriverInfo is supported or not */ - /* Do not trust msdn what it say about dwContext it is not in use for - windows nt, it is in use for all os, and it always pont to - DirectDrawGlobal.hDD */ - - /* FIXME add all callback that have been commect out to gpl */ - /* FIXME free the memmor that being alloc when ddraw.dll exists */ - /* FIXME add check for DriverInfo if the handle or not */ - - DDHAL_GETDRIVERINFODATA DriverInfo; - memset(&DriverInfo,0, sizeof(DDHAL_GETDRIVERINFODATA)); - DriverInfo.dwSize = sizeof(DDHAL_GETDRIVERINFODATA); - DriverInfo.dwContext = This->DirectDrawGlobal.hDD; - - /* Get ColorControlCallbacks */ - DriverInfo.guidInfo = GUID_ColorControlCallbacks; - DriverInfo.lpvData = &This->DirectDrawGlobal.lpDDCBtmp->HALDDColorControl; - DriverInfo.dwExpectedSize = sizeof(DDHAL_DDCOLORCONTROLCALLBACKS); - This->HalInfo.GetDriverInfo(&DriverInfo); - - /* Get the GUID_D3DCallbacks callback */ - /* Problem with include files - DDHAL_DDMISCELLANEOUSCALLBACKS misc; - DriverInfo.guidInfo = GUID_D3DCallbacks; - DriverInfo.lpvData = &misc; - DriverInfo.dwExpectedSize = sizeof(); - This->HalInfo.GetDriverInfo( &DriverInfo);*/ - - /* Get the D3DCallbacks2 */ - This->DirectDrawGlobal.lpD3DHALCallbacks2 = (ULONG_PTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(D3DHAL_CALLBACKS2)); - DriverInfo.guidInfo = GUID_D3DCallbacks2; - DriverInfo.lpvData = (PVOID)This->DirectDrawGlobal.lpD3DHALCallbacks2; - DriverInfo.dwExpectedSize = sizeof(D3DHAL_CALLBACKS2); - This->HalInfo.GetDriverInfo(&DriverInfo); - - - /* Get the D3DCallbacks3 */ - This->DirectDrawGlobal.lpD3DHALCallbacks = (ULONG_PTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(D3DHAL_CALLBACKS3)); - DriverInfo.guidInfo = GUID_D3DCallbacks3; - DriverInfo.lpvData = (PVOID)This->DirectDrawGlobal.lpD3DHALCallbacks; - DriverInfo.dwExpectedSize = sizeof(D3DHAL_CALLBACKS3); - This->HalInfo.GetDriverInfo(&DriverInfo); - - /* Get the misc callback */ - /* Problem with include files - DriverInfo.guidInfo = GUID_D3DCaps; - DriverInfo.lpvData = &misc; - DriverInfo.dwExpectedSize = sizeof(); - This->HalInfo.GetDriverInfo( &DriverInfo); - */ - - /* Get the D3DExtendedCaps */ - - This->DirectDrawGlobal.lpD3DExtendedCaps = (ULONG_PTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(D3DHAL_D3DEXTENDEDCAPS)); - DriverInfo.guidInfo = GUID_D3DExtendedCaps; - DriverInfo.lpvData = (PVOID) This->DirectDrawGlobal.lpD3DExtendedCaps; - DriverInfo.dwExpectedSize = sizeof(D3DHAL_D3DEXTENDEDCAPS); - This->HalInfo.GetDriverInfo(&DriverInfo); - - /* Get the D3DParseUnknownCommandCallback */ - /* D3dDrawPrimitives2 callback where should it be fill in - DriverInfo.guidInfo = GUID_D3DParseUnknownCommandCallback; - DriverInfo.lpvData = &misc; - DriverInfo.dwExpectedSize = sizeof(); - This->HalInfo.GetDriverInfo( &DriverInfo); - */ - - /* Get the GetHeapAlignment */ - /* where should it be fill in - DriverInfo.guidInfo = GUID_GetHeapAlignment; - DriverInfo.lpvData = &misc; - DriverInfo.dwExpectedSize = sizeof(); - This->HalInfo.GetDriverInfo( &DriverInfo); - */ - - /* Get the KernelCallbacks */ - DriverInfo.guidInfo = GUID_KernelCallbacks; - DriverInfo.lpvData = &This->DirectDrawGlobal.lpDDCBtmp->HALDDKernel; - DriverInfo.dwExpectedSize = sizeof(DDHAL_DDKERNELCALLBACKS); - This->HalInfo.GetDriverInfo(&DriverInfo); - - /* Get the KernelCaps */ - This->DirectDrawGlobal.lpDDKernelCaps = (LPDDKERNELCAPS)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(DDHAL_DDKERNELCALLBACKS)); - DriverInfo.guidInfo = GUID_KernelCaps; - DriverInfo.lpvData = (PVOID) This->DirectDrawGlobal.lpDDKernelCaps; - DriverInfo.dwExpectedSize = sizeof(DDHAL_DDKERNELCALLBACKS); - This->HalInfo.GetDriverInfo(&DriverInfo); - - /* Get the MiscellaneousCallbacks */ - DriverInfo.guidInfo = GUID_MiscellaneousCallbacks; - DriverInfo.lpvData = &This->DirectDrawGlobal.lpDDCBtmp->HALDDMiscellaneous; - DriverInfo.dwExpectedSize = sizeof(DDHAL_DDMISCELLANEOUSCALLBACKS); - This->HalInfo.GetDriverInfo(&DriverInfo); - - /* Get the Miscellaneous2Callbacks */ - /* Not in the DDRAWI_DIRECTDRAW_GBL we map it up as private - Contain CreatesurfaceEx and other nice callbacks */ - DriverInfo.guidInfo = GUID_Miscellaneous2Callbacks; - DriverInfo.lpvData = &This->Misc2Callback; - DriverInfo.dwExpectedSize = sizeof(DDHAL_DDMISCELLANEOUSCALLBACKS); - This->HalInfo.GetDriverInfo(&DriverInfo); - - /* Get the MotionCompCallbacks */ - DriverInfo.guidInfo = GUID_MotionCompCallbacks; - DriverInfo.lpvData = &This->DirectDrawGlobal.lpDDCBtmp->HALDDMotionComp; - DriverInfo.dwExpectedSize = sizeof(DDHAL_DDMOTIONCOMPCALLBACKS); - This->HalInfo.GetDriverInfo(&DriverInfo); - - /* Get the NonLocalVidMemCaps */ - This->DirectDrawGlobal.lpddNLVCaps = (LPDDNONLOCALVIDMEMCAPS)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(DDNONLOCALVIDMEMCAPS)); - DriverInfo.guidInfo = GUID_NonLocalVidMemCaps; - DriverInfo.lpvData = (PVOID)This->DirectDrawGlobal.lpddNLVCaps; - DriverInfo.dwExpectedSize = sizeof(DDNONLOCALVIDMEMCAPS); - This->HalInfo.GetDriverInfo(&DriverInfo); - - /* Get the NTCallbacks */ - /* Fill in wher - DriverInfo.guidInfo = GUID_NTCallbacks; - DriverInfo.lpvData = &misc; - DriverInfo.dwExpectedSize = sizeof(); - This->HalInfo.GetDriverInfo( &DriverInfo); - */ - - /* Get the NTPrivateDriverCaps */ - /* Fill in wher - DriverInfo.guidInfo = GUID_NTPrivateDriverCaps; - DriverInfo.lpvData = &misc; - DriverInfo.dwExpectedSize = sizeof(); - This->HalInfo.GetDriverInfo( &DriverInfo); - */ - - /* Get the UpdateNonLocalHeap */ - /* Fill in where - DriverInfo.guidInfo = GUID_UpdateNonLocalHeap; - DriverInfo.lpvData = &misc; - DriverInfo.dwExpectedSize = sizeof(); - This->HalInfo.GetDriverInfo( &DriverInfo); - */ - - /* Get the VideoPortCallbacks */ - DriverInfo.guidInfo = GUID_VideoPortCallbacks; - DriverInfo.lpvData = &This->DirectDrawGlobal.lpDDCBtmp->HALDDVideoPort; - DriverInfo.dwExpectedSize = sizeof(DDHAL_DDVIDEOPORTCALLBACKS); - This->HalInfo.GetDriverInfo(&DriverInfo); - - /* Get the VideoPortCaps */ - This->DirectDrawGlobal.lpDDVideoPortCaps = (LPDDVIDEOPORTCAPS)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(DDVIDEOPORTCAPS)); - DriverInfo.guidInfo = GUID_VideoPortCaps; - DriverInfo.lpvData = (PVOID)This->DirectDrawGlobal.lpDDVideoPortCaps; - DriverInfo.dwExpectedSize = sizeof(DDVIDEOPORTCAPS); - This->HalInfo.GetDriverInfo(&DriverInfo); - - /* Get the ZPixelFormats */ - /* take off this it until we figout how lpexluisev should be fild in - This->DirectDrawGlobal.lpZPixelFormats = (LPDDPIXELFORMAT) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(DDPIXELFORMAT) * This->DirectDrawGlobal.dwNumZPixelFormats); - DriverInfo.guidInfo = GUID_ZPixelFormats; - DriverInfo.lpvData = (PVOID)This->DirectDrawGlobal.lpZPixelFormats; - DriverInfo.dwExpectedSize = sizeof(DDPIXELFORMAT); - This->HalInfo.GetDriverInfo(&DriverInfo); - */ - - /* Setup some info from the callbacks we got */ - DDHAL_GETAVAILDRIVERMEMORYDATA mem; - mem.lpDD = &This->DirectDrawGlobal; - This->DirectDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.GetAvailDriverMemory(&mem); - This->DirectDrawGlobal.ddCaps.dwVidMemFree = mem.dwFree; - This->DirectDrawGlobal.ddCaps.dwVidMemTotal = mem.dwTotal; - - BOOL dummy = TRUE; - DdReenableDirectDrawObject(&This->DirectDrawGlobal, &dummy); - - /* Now all setup for HAL is done */ - return DD_OK; -} - -HRESULT Hal_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface) +} + + + +HRESULT +Hal_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface) { IDirectDrawImpl* This = (IDirectDrawImpl*)iface; DDHAL_SETEXCLUSIVEMODEDATA SetExclusiveMode; - if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE)) - { - return DDERR_NODRIVERSUPPORT; - } - - SetExclusiveMode.lpDD = &This->DirectDrawGlobal; + if (!(This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE)) + { + return DDERR_NODRIVERSUPPORT; + } + + SetExclusiveMode.lpDD = &This->mDDrawGlobal; SetExclusiveMode.ddRVal = DDERR_NOTPALETTIZED; SetExclusiveMode.dwEnterExcl = This->cooperative_level; - if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.SetExclusiveMode(&SetExclusiveMode) != DDHAL_DRIVER_HANDLED) + if (This->mDDrawGlobal.lpDDCBtmp->HALDD.SetExclusiveMode(&SetExclusiveMode) != DDHAL_DRIVER_HANDLED) { return DDERR_NODRIVERSUPPORT; } @@ -311,62 +327,24 @@ } -VOID Hal_DirectDraw_Release (LPDIRECTDRAW7 iface) -{ - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - - DdDeleteDirectDrawObject (&This->DirectDrawGlobal); - - /* - if(This->DirectDrawGlobal.lpDDKernelCaps) - HeapFree(GetProcessHeap(), 0, This->DirectDrawGlobal.lpDDKernelCaps); - - if(This->DirectDrawGlobal.lpddNLVCaps) - HeapFree(GetProcessHeap(), 0, This->DirectDrawGlobal.lpddNLVCaps); - - if(This->DirectDrawGlobal.lpDDVideoPortCaps) - HeapFree(GetProcessHeap(), 0, This->DirectDrawGlobal.lpDDVideoPortCaps); - - if(This->DirectDrawGlobal.lpdwFourCC) - HeapFree(GetProcessHeap(), 0, This->DirectDrawGlobal.lpdwFourCC); - - if(This->DirectDrawGlobal.lpZPixelFormats) - HeapFree(GetProcessHeap(), 0, This->DirectDrawGlobal.lpZPixelFormats); - - if(This->HalInfo.vmiData.pvmList) - HeapFree(GetProcessHeap(), 0, This->HalInfo.vmiData.pvmList); - - if(((LPD3DHAL_GLOBALDRIVERDATA)This->DirectDrawGlobal.lpD3DGlobalDriverData)->lpTextureFormats) - HeapFree(GetProcessHeap(), 0, ((LPD3DHAL_GLOBALDRIVERDATA)This->DirectDrawGlobal.lpD3DGlobalDriverData)->lpTextureFormats); - - if(This->DirectDrawGlobal.lpDDCBtmp) - HeapFree(GetProcessHeap(), 0, This->DirectDrawGlobal.lpDDCBtmp); - - if(This->DirectDrawGlobal.lpD3DHALCallbacks) - HeapFree(GetProcessHeap(), 0, (PVOID)This->DirectDrawGlobal.lpD3DHALCallbacks); - - if(This->DirectDrawGlobal.lpD3DGlobalDriverData) - HeapFree(GetProcessHeap(), 0, (PVOID)This->DirectDrawGlobal.lpD3DGlobalDriverData); - */ -} - - -HRESULT Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps, + +HRESULT +Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps, LPDWORD total, LPDWORD free) { IDirectDrawImpl* This = (IDirectDrawImpl*)iface; DDHAL_GETAVAILDRIVERMEMORYDATA mem; - if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.dwFlags & DDHAL_MISCCB32_GETAVAILDRIVERMEMORY)) - { - return DDERR_NODRIVERSUPPORT; - } - - mem.lpDD = &This->DirectDrawGlobal; + if (!(This->mDDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.dwFlags & DDHAL_MISCCB32_GETAVAILDRIVERMEMORY)) + { + return DDERR_NODRIVERSUPPORT; + } + + mem.lpDD = &This->mDDrawGlobal; mem.ddRVal = DDERR_NOTPALETTIZED; - if (This->DirectDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.GetAvailDriverMemory(&mem) != DDHAL_DRIVER_HANDLED) + if (This->mDDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.GetAvailDriverMemory(&mem) != DDHAL_DRIVER_HANDLED) { return DDERR_NODRIVERSUPPORT; } @@ -387,17 +365,17 @@ DDHAL_WAITFORVERTICALBLANKDATA WaitVectorData; - if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK)) + if (!(This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK)) { return DDERR_NODRIVERSUPPORT; } - WaitVectorData.lpDD = &This->DirectDrawGlobal; + WaitVectorData.lpDD = &This->mDDrawGlobal; WaitVectorData.dwFlags = dwFlags; WaitVectorData.hEvent = (DWORD)h; WaitVectorData.ddRVal = DDERR_NOTPALETTIZED; - if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.WaitForVerticalBlank(&WaitVectorData) != DDHAL_DRIVER_HANDLED) + if (This->mDDrawGlobal.lpDDCBtmp->HALDD.WaitForVerticalBlank(&WaitVectorData) != DDHAL_DRIVER_HANDLED) { return DDERR_NODRIVERSUPPORT; } @@ -411,15 +389,15 @@ DDHAL_GETSCANLINEDATA GetScan; - if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_GETSCANLINE)) - { - return DDERR_NODRIVERSUPPORT; - } - - GetScan.lpDD = &This->DirectDrawGlobal; + if (!(This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_GETSCANLINE)) + { + return DDERR_NODRIVERSUPPORT; + } + + GetScan.lpDD = &This->mDDrawGlobal; GetScan.ddRVal = DDERR_NOTPALETTIZED; - if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.GetScanLine(&GetScan) != DDHAL_DRIVER_HANDLED) + if (This->mDDrawGlobal.lpDDCBtmp->HALDD.GetScanLine(&GetScan) != DDHAL_DRIVER_HANDLED) { return DDERR_NODRIVERSUPPORT; } @@ -434,15 +412,15 @@ DDHAL_FLIPTOGDISURFACEDATA FlipGdi; - if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_FLIPTOGDISURFACE)) - { - return DDERR_NODRIVERSUPPORT; - } - - FlipGdi.lpDD = &This->DirectDrawGlobal; + if (!(This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_FLIPTOGDISURFACE)) + { + return DDERR_NODRIVERSUPPORT; + } + + FlipGdi.lpDD = &This->mDDrawGlobal; FlipGdi.ddRVal = DDERR_NOTPALETTIZED; - if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.FlipToGDISurface(&FlipGdi) != DDHAL_DRIVER_HANDLED) + if (This->mDDrawGlobal.lpDDCBtmp->HALDD.FlipToGDISurface(&FlipGdi) != DDHAL_DRIVER_HANDLED) { return DDERR_NODRIVERSUPPORT; } @@ -459,19 +437,21 @@ IDirectDrawImpl* This = (IDirectDrawImpl*)iface; DDHAL_SETMODEDATA mode; - if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETMODE)) + if (!(This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETMODE)) { return DDERR_NODRIVERSUPPORT; } - mode.lpDD = &This->DirectDrawGlobal; + mode.lpDD = &This->mDDrawGlobal; mode.ddRVal = DDERR_NODRIVERSUPPORT; + + // FIXME : add search for which mode.ModeIndex we should use // FIXME : fill the mode.inexcl; // FIXME : fill the mode.useRefreshRate; - if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.SetMode(&mode) != DDHAL_DRIVER_HANDLED) + if (This->mDDrawGlobal.lpDDCBtmp->HALDD.SetMode(&mode) != DDHAL_DRIVER_HANDLED) { return DDERR_NODRIVERSUPPORT; } Propchange: trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* 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 Sat Apr 1 23:12:56 2006 @@ -45,15 +45,15 @@ /************ Test see if we can Create Surface ***********************/ - if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_CANCREATESURFACE) + if (This->owner->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_CANCREATESURFACE) { /* can the driver create the surface */ DDHAL_CANCREATESURFACEDATA CanCreateData; memset(&CanCreateData, 0, sizeof(DDHAL_CANCREATESURFACEDATA)); - CanCreateData.lpDD = &This->owner->DirectDrawGlobal; + CanCreateData.lpDD = &This->owner->mDDrawGlobal; CanCreateData.lpDDSurfaceDesc = (LPDDSURFACEDESC)&This->ddsd; - if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.CanCreateSurface(&CanCreateData) == DDHAL_DRIVER_NOTHANDLED) + if (This->owner->mDDrawGlobal.lpDDCBtmp->HALDD.CanCreateSurface(&CanCreateData) == DDHAL_DRIVER_NOTHANDLED) return DDERR_INVALIDPARAMS; if(CanCreateData.ddRVal != DD_OK) @@ -64,10 +64,10 @@ /* surface global struct */ memset(&This->Global, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL)); - This->Global.lpDD = &This->owner->DirectDrawGlobal; - This->Global.wHeight = This->owner->DirectDrawGlobal.vmiData.dwDisplayHeight; - This->Global.wWidth = This->owner->DirectDrawGlobal.vmiData.dwDisplayWidth; - This->Global.dwLinearSize = This->owner->DirectDrawGlobal.vmiData.lDisplayPitch; + This->Global.lpDD = &This->owner->mDDrawGlobal; + This->Global.wHeight = This->owner->mDDrawGlobal.vmiData.dwDisplayHeight; + This->Global.wWidth = This->owner->mDDrawGlobal.vmiData.dwDisplayWidth; + This->Global.dwLinearSize = This->owner->mDDrawGlobal.vmiData.lDisplayPitch; if(pDDSD2->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) This->Global.dwGlobalFlags = DDRAWISURFGBL_ISGDISURFACE; @@ -76,8 +76,10 @@ This->More.dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE); This->More.dmiDDrawReserved7.wWidth = This->Global.wWidth; This->More.dmiDDrawReserved7.wHeight = This->Global.wHeight; - This->More.dmiDDrawReserved7.wBPP = This->owner->Bpp; - This->More.dmiDDrawReserved7.wRefreshRate = This->owner->DirectDrawGlobal.dwMonitorFrequency; + //This->More.dmiDDrawReserved7.wBPP = This->owner->Bpp; + This->More.dmiDDrawReserved7.wBPP = This->Global.dwLinearSize; + + This->More.dmiDDrawReserved7.wRefreshRate = This->owner->mDDrawGlobal.dwMonitorFrequency; //This->More.dmiDDrawReserved7.wMonitorsAttachedToDesktop = 2; /* ToDo: fill ddsCapsEx */ @@ -95,7 +97,7 @@ /* the parameter struct */ DDHAL_CREATESURFACEDATA CreateData; memset(&CreateData, 0, sizeof(DDHAL_CREATESURFACEDATA)); - CreateData.lpDD = &This->owner->DirectDrawGlobal; + CreateData.lpDD = &This->owner->mDDrawGlobal; CreateData.lpDDSurfaceDesc = (LPDDSURFACEDESC)&This->ddsd; CreateData.dwSCnt = 1; CreateData.lplpSList = This->pLocal; @@ -103,7 +105,7 @@ CreateData.ddRVal = 1; /* this is the call we were waiting for */ - if(This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.CreateSurface(&CreateData) == DDHAL_DRIVER_NOTHANDLED) + if(This->owner->mDDrawGlobal.lpDDCBtmp->HALDD.CreateSurface(&CreateData) == DDHAL_DRIVER_NOTHANDLED) return DDERR_INVALIDPARAMS; asm("int3"); @@ -126,13 +128,13 @@ IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; IDirectDrawSurfaceImpl* That = (IDirectDrawSurfaceImpl*)src; - if (!(This->owner->DirectDrawGlobal.lpDDCBtmp->HALDDSurface.dwFlags & DDHAL_SURFCB32_BLT)) + if (!(This->owner->mDDrawGlobal.lpDDCBtmp->HALDDSurface.dwFlags & DDHAL_SURFCB32_BLT)) { return DDERR_NODRIVERSUPPORT; } DDHAL_BLTDATA BltData; - BltData.lpDD = &This->owner->DirectDrawGlobal; + BltData.lpDD = &This->owner->mDDrawGlobal; BltData.dwFlags = dwFlags; BltData.lpDDDestSurface = &This->Local; if(rDest) BltData.rDest = *(RECTL*)rDest; @@ -140,7 +142,7 @@ if(That) BltData.lpDDSrcSurface = &That->Local; if(lpbltfx) BltData.bltFX = *lpbltfx; - if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDDSurface.Blt(&BltData) != DDHAL_DRIVER_HANDLED) + if (This->owner->mDDrawGlobal.lpDDCBtmp->HALDDSurface.Blt(&BltData) != DDHAL_DRIVER_HANDLED) { return DDERR_NODRIVERSUPPORT; } Propchange: trunk/reactos/dll/directx/ddraw/hal/surface_hal.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Modified: trunk/reactos/dll/directx/ddraw/main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main.c?re…
============================================================================== --- trunk/reactos/dll/directx/ddraw/main.c (original) +++ trunk/reactos/dll/directx/ddraw/main.c Sat Apr 1 23:12:56 2006 @@ -15,9 +15,17 @@ -HRESULT -WINAPI -Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface, REFIID id, BOOL ex) +/* + * IMPLEMENT + * Status this api is finish and is 100% correct + */ + +HRESULT +WINAPI +Create_DirectDraw (LPGUID pGUID, + LPDIRECTDRAW* pIface, + REFIID id, + BOOL ex) { IDirectDrawImpl* This = (IDirectDrawImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawImpl)); @@ -30,8 +38,7 @@ 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) @@ -40,9 +47,16 @@ return This->lpVtbl->Initialize ((LPDIRECTDRAW7)This, pGUID); } -HRESULT -WINAPI -DirectDrawCreate (LPGUID lpGUID, LPDIRECTDRAW* lplpDD, LPUNKNOWN pUnkOuter) +/* + * IMPLEMENT + * Status this api is finish and is 100% correct + */ + +HRESULT +WINAPI +DirectDrawCreate (LPGUID lpGUID, + LPDIRECTDRAW* lplpDD, + LPUNKNOWN pUnkOuter) { /* check see if pUnkOuter is null or not */ if (pUnkOuter) @@ -53,10 +67,18 @@ return Create_DirectDraw (lpGUID, lplpDD, &IID_IDirectDraw, FALSE); } - -HRESULT -WINAPI -DirectDrawCreateEx(LPGUID lpGUID, LPVOID* lplpDD, REFIID id, LPUNKNOWN pUnkOuter) + +/* + * IMPLEMENT + * Status this api is finish and is 100% correct + */ + +HRESULT +WINAPI +DirectDrawCreateEx(LPGUID lpGUID, + LPVOID* lplpDD, + REFIID id, + LPUNKNOWN pUnkOuter) { /* check see if pUnkOuter is null or not */ if (pUnkOuter) @@ -74,38 +96,52 @@ return Create_DirectDraw (lpGUID, (LPDIRECTDRAW*)lplpDD, id, TRUE); } -HRESULT -WINAPI DirectDrawEnumerateA( - LPDDENUMCALLBACKA lpCallback, - LPVOID lpContext -) +/* + * UNIMPLEMENT + */ + +HRESULT +WINAPI +DirectDrawEnumerateA( + LPDDENUMCALLBACKA lpCallback, + LPVOID lpContext) { DX_STUB; } -HRESULT WINAPI DirectDrawEnumerateW( - LPDDENUMCALLBACKW lpCallback, - LPVOID lpContext -) +/* + * UNIMPLEMENT + */ + +HRESULT WINAPI DirectDrawEnumerateW(LPDDENUMCALLBACKW lpCallback, + LPVOID lpContext) { DX_STUB; } -HRESULT WINAPI DirectDrawEnumerateExA( - LPDDENUMCALLBACKEXA lpCallback, - LPVOID lpContext, - DWORD dwFlags -) +/* + * UNIMPLEMENT + */ + +HRESULT +WINAPI +DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA lpCallback, + LPVOID lpContext, + DWORD dwFlags) { DX_STUB; } -HRESULT WINAPI DirectDrawEnumerateExW( - LPDDENUMCALLBACKEXW lpCallback, - LPVOID lpContext, - DWORD dwFlags -) +/* + * UNIMPLEMENT + */ + +HRESULT +WINAPI +DirectDrawEnumerateExW(LPDDENUMCALLBACKEXW lpCallback, + LPVOID lpContext, + DWORD dwFlags) { DX_STUB; } @@ -118,7 +154,13 @@ */ -HRESULT WINAPI +/* + * UNIMPLEMENT + * Status FIXME need be implement and this code is realy need be tested + */ + +HRESULT +WINAPI D3DParseUnknownCommand( LPVOID lpvCommands, LPVOID *lplpvReturnedCommand) { Modified: trunk/reactos/dll/directx/ddraw/main/clipper_main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/clip…
============================================================================== --- trunk/reactos/dll/directx/ddraw/main/clipper_main.c (original) +++ trunk/reactos/dll/directx/ddraw/main/clipper_main.c Sat Apr 1 23:12:56 2006 @@ -12,22 +12,13 @@ ULONG WINAPI Main_DirectDrawClipper_Release(LPDIRECTDRAWCLIPPER iface) -{ - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - ULONG ref = InterlockedDecrement((PLONG)&This->DirectDrawGlobal.dwRefCnt); - - if (ref == 0) - HeapFree(GetProcessHeap(), 0, This); - - return ref; +{ + return 0; } ULONG WINAPI Main_DirectDrawClipper_AddRef (LPDIRECTDRAWCLIPPER iface) -{ - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - ULONG ref = InterlockedIncrement((PLONG)&This->DirectDrawGlobal.dwRefCnt); - - return ref; +{ + return 1; } HRESULT WINAPI Main_DirectDrawClipper_Initialize( Propchange: trunk/reactos/dll/directx/ddraw/main/clipper_main.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Modified: trunk/reactos/dll/directx/ddraw/main/color_main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/colo…
============================================================================== --- trunk/reactos/dll/directx/ddraw/main/color_main.c (original) +++ trunk/reactos/dll/directx/ddraw/main/color_main.c Sat Apr 1 23:12:56 2006 @@ -12,23 +12,14 @@ ULONG WINAPI Main_DirectDrawColorControl_AddRef(LPDIRECTDRAWCOLORCONTROL iface) -{ - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - ULONG ref = InterlockedIncrement((PLONG)&This->DirectDrawGlobal.dwRefCnt); - - return ref; +{ + return 1; } ULONG WINAPI Main_DirectDrawColorControl_Release(LPDIRECTDRAWCOLORCONTROL iface) { - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - ULONG ref = InterlockedDecrement((PLONG)&This->DirectDrawGlobal.dwRefCnt); - - if (ref == 0) - HeapFree(GetProcessHeap(), 0, This); - - return ref; + return 0; } HRESULT WINAPI Propchange: trunk/reactos/dll/directx/ddraw/main/color_main.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* 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 Sat Apr 1 23:12:56 2006 @@ -10,43 +10,47 @@ #include "rosdraw.h" - -HRESULT WINAPI Main_DirectDraw_Initialize (LPDIRECTDRAW7 iface, LPGUID lpGUID) +/* + * IMPLEMENT + * Status this api is finish and is 100% correct + */ +HRESULT +WINAPI +Main_DirectDraw_Initialize (LPDIRECTDRAW7 iface, LPGUID lpGUID) { IDirectDrawImpl* This = (IDirectDrawImpl*)iface; HRESULT ret; + + if (iface==NULL) + { + return DDERR_NOTINITIALIZED; + } + if (This->InitializeDraw == TRUE) + { return DDERR_ALREADYINITIALIZED; - - This->InitializeDraw = TRUE; - - RtlZeroMemory(&This->DirectDrawGlobal, sizeof(DDRAWI_DIRECTDRAW_GBL)); + } + else + { + This->InitializeDraw = TRUE; + } + + RtlZeroMemory(&This->mDDrawGlobal, sizeof(DDRAWI_DIRECTDRAW_GBL)); - /* cObsolete is undoc in msdn it being use in CreateDCA */ - RtlCopyMemory(&This->DirectDrawGlobal.cObsolete,&"DISPLAY",7); - RtlCopyMemory(&This->DirectDrawGlobal.cDriverName,&"DISPLAY",7); + RtlCopyMemory(&This->mDDrawGlobal.cObsolete,&"DISPLAY",7); + RtlCopyMemory(&This->mDDrawGlobal.cDriverName,&"DISPLAY",7); /* Setup the lpExclusiveOwner struct in msdn this struct member is undoc I am using there name to figout which info it should be fild with My hardware drv does not support call to SetExusive so I can not debug it see how it should be fild + this part have been move to HAL */ - - This->DirectDrawGlobal.lpExclusiveOwner = &This->ExclusiveOwner; - memset(&This->ExclusiveOwner, 0, sizeof(DDRAWI_DIRECTDRAW_LCL)); - - This->DirectDrawGlobal.lpExclusiveOwner->dwProcessId = GetCurrentProcessId(); - This->DirectDrawGlobal.lpExclusiveOwner->hDC = ((ULONG_PTR)GetWindowDC(GetDesktopWindow())); - This->DirectDrawGlobal.lpExclusiveOwner->hWnd = ((ULONG_PTR)GetDesktopWindow()); - This->DirectDrawGlobal.lpExclusiveOwner->lpGbl = &This->DirectDrawGlobal; - - This->Height = GetDeviceCaps((HDC)This->DirectDrawGlobal.lpExclusiveOwner->hDC , VERTRES); - This->Width = GetDeviceCaps((HDC)This->DirectDrawGlobal.lpExclusiveOwner->hDC , HORZRES); - This->Bpp = GetDeviceCaps((HDC)This->DirectDrawGlobal.lpExclusiveOwner->hDC , BITSPIXEL); - + + // call software first if((ret = Hal_DirectDraw_Initialize (iface)) != DD_OK) return ret; @@ -54,13 +58,68 @@ // ... then overwrite with hal if((ret = Hel_DirectDraw_Initialize (iface)) != DD_OK) return ret; - - /* Hack to set right freq */ - - This->DirectDrawGlobal.dwMonitorFrequency = GetDeviceCaps((HDC)This->DirectDrawGlobal.lpExclusiveOwner->hDC , VREFRESH); - + return DD_OK; } + +/* + * IMPLEMENT + * Status this api is finish and is 100% correct + */ +ULONG +WINAPI +Main_DirectDraw_AddRef (LPDIRECTDRAW7 iface) +{ + IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + ULONG ref=0; + + if (iface!=NULL) + { + ref = InterlockedIncrement((PLONG)&This->mDDrawGlobal.dwRefCnt); + } + return ref; +} + +/* + * IMPLEMENT + * Status + * not finish yet but is working fine + * it prevent memmory leaks at exit + */ +ULONG +WINAPI +Main_DirectDraw_Release (LPDIRECTDRAW7 iface) +{ + IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + ULONG ref=0; + + if (iface!=NULL) + { + ref = InterlockedDecrement((PLONG)&This->mDDrawGlobal.dwRefCnt); + + if (ref == 0) + { + // set resoltion back to the one in registry + if(This->cooperative_level & DDSCL_EXCLUSIVE) + { + ChangeDisplaySettings(NULL, 0); + } + + Hal_DirectDraw_Release(iface); + //Hel_DirectDraw_Release(iface); + RtlZeroMemory(&This->mDDrawGlobal, sizeof(DDRAWI_DIRECTDRAW_GBL)); + RtlZeroMemory(This, sizeof(IDirectDrawImpl)); + + HeapFree(GetProcessHeap(), 0, This); + } + } + return ref; +} + + + + + HRESULT WINAPI Main_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface, HWND hwnd, DWORD cooplevel) { @@ -72,7 +131,7 @@ IDirectDrawImpl* This = (IDirectDrawImpl*)iface; // check the parameters - if ((This->cooperative_level == cooplevel) && ((HWND)This->DirectDrawGlobal.lpExclusiveOwner->hWnd == hwnd)) + if ((This->cooperative_level == cooplevel) && ((HWND)This->mDDrawGlobal.lpExclusiveOwner->hWnd == hwnd)) return DD_OK; if (This->cooperative_level) @@ -85,11 +144,15 @@ return DDERR_INVALIDPARAMS; // set the data - This->DirectDrawGlobal.lpExclusiveOwner->hWnd = (ULONG_PTR) hwnd; - This->DirectDrawGlobal.lpExclusiveOwner->hDC = (ULONG_PTR)GetDC(hwnd); + This->mDDrawGlobal.lpExclusiveOwner->hWnd = (ULONG_PTR) hwnd; + This->mDDrawGlobal.lpExclusiveOwner->hDC = (ULONG_PTR)GetDC(hwnd); + + /* FIXME : fill the mDDrawGlobal.lpExclusiveOwner->dwLocalFlags right */ + //mDDrawGlobal.lpExclusiveOwner->dwLocalFlags + This->cooperative_level = cooplevel; - if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE) + if (This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE) { return Hal_DirectDraw_SetCooperativeLevel (iface); } @@ -106,16 +169,16 @@ DWORD ret; /* FIXME check the refresrate if it same if it not same do the mode switch */ - if ((This->DirectDrawGlobal.vmiData.dwDisplayHeight == dwHeight) && - (This->DirectDrawGlobal.vmiData.dwDisplayWidth == dwWidth) && - (This->DirectDrawGlobal.vmiData.ddpfDisplay.dwRGBBitCount == dwBPP)) + if ((This->mDDrawGlobal.vmiData.dwDisplayHeight == dwHeight) && + (This->mDDrawGlobal.vmiData.dwDisplayWidth == dwWidth) && + (This->mDDrawGlobal.vmiData.ddpfDisplay.dwRGBBitCount == dwBPP)) { return DD_OK; } /* Check use the Hal or Hel for SetMode */ - if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETMODE) + if (This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETMODE) { ret = Hal_DirectDraw_SetDisplayMode(iface, dwWidth, dwHeight, dwBPP, dwRefreshRate, dwFlags); } @@ -126,40 +189,25 @@ if (ret == DD_OK) { - DdReenableDirectDrawObject(&This->DirectDrawGlobal, &dummy); + DdReenableDirectDrawObject(&This->mDDrawGlobal, &dummy); /* FIXME fill the This->DirectDrawGlobal.vmiData right */ } return ret; } -ULONG WINAPI Main_DirectDraw_AddRef (LPDIRECTDRAW7 iface) -{ - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - ULONG ref = InterlockedIncrement((PLONG)&This->DirectDrawGlobal.dwRefCnt); - - return ref; -} - -ULONG WINAPI Main_DirectDraw_Release (LPDIRECTDRAW7 iface) -{ - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - ULONG ref = InterlockedDecrement((PLONG)&This->DirectDrawGlobal.dwRefCnt); - - if (ref == 0) - { - // set resoltion back to the one in registry - if(This->cooperative_level & DDSCL_EXCLUSIVE) - ChangeDisplaySettings(NULL, 0); - - HeapFree(GetProcessHeap(), 0, This); - } - - return ref; -} - -HRESULT WINAPI Main_DirectDraw_QueryInterface ( - LPDIRECTDRAW7 iface, REFIID id, LPVOID *obj ) + + + +/* + * IMPLEMENT + * Status this api is finish and is 100% correct + */ +HRESULT +WINAPI +Main_DirectDraw_QueryInterface (LPDIRECTDRAW7 iface, + REFIID id, + LPVOID *obj) { IDirectDrawImpl* This = (IDirectDrawImpl*)iface; @@ -213,13 +261,13 @@ That->lpVtbl = &DirectDrawSurface7_Vtable; That->lpVtbl_v3 = &DDRAW_IDDS3_Thunk_VTable; - This->DirectDrawGlobal.dsList = (LPDDRAWI_DDRAWSURFACE_INT)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + This->mDDrawGlobal.dsList = (LPDDRAWI_DDRAWSURFACE_INT)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DDRAWI_DDRAWSURFACE_INT)); That->owner = (IDirectDrawImpl *)This; - That->owner->DirectDrawGlobal.dsList->dwIntRefCnt =1; + That->owner->mDDrawGlobal.dsList->dwIntRefCnt =1; /* we alwasy set to use the DirectDrawSurface7_Vtable as internel */ - That->owner->DirectDrawGlobal.dsList->lpVtbl = (PVOID) &DirectDrawSurface7_Vtable; + That->owner->mDDrawGlobal.dsList->lpVtbl = (PVOID) &DirectDrawSurface7_Vtable; *ppSurf = (LPDIRECTDRAWSURFACE7)That; @@ -280,7 +328,7 @@ { IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_FLIPTOGDISURFACE) + if (This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_FLIPTOGDISURFACE) { return Hal_DirectDraw_FlipToGDISurface( iface); } @@ -296,13 +344,13 @@ if (pDriverCaps != NULL) { - RtlCopyMemory(pDriverCaps,&This->DirectDrawGlobal.ddCaps,sizeof(DDCORECAPS)); + RtlCopyMemory(pDriverCaps,&This->mDDrawGlobal.ddCaps,sizeof(DDCORECAPS)); status = DD_OK; } if (pHELCaps != NULL) { - RtlCopyMemory(pDriverCaps,&This->DirectDrawGlobal.ddHELCaps,sizeof(DDCORECAPS)); + RtlCopyMemory(pDriverCaps,&This->mDDrawGlobal.ddHELCaps,sizeof(DDCORECAPS)); status = DD_OK; } @@ -322,13 +370,13 @@ } pDDSD->dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_PITCH | DDSD_PIXELFORMAT | DDSD_REFRESHRATE | DDSD_WIDTH; - pDDSD->dwHeight = This->DirectDrawGlobal.vmiData.dwDisplayHeight; - pDDSD->dwWidth = This->DirectDrawGlobal.vmiData.dwDisplayWidth; - pDDSD->lPitch = This->DirectDrawGlobal.vmiData.lDisplayPitch; - pDDSD->dwRefreshRate = This->DirectDrawGlobal.dwMonitorFrequency; - - RtlCopyMemory(&pDDSD->ddpfPixelFormat,&This->DirectDrawGlobal.vmiData.ddpfDisplay,sizeof(DDPIXELFORMAT)); - RtlCopyMemory(&pDDSD->ddsCaps,&This->DirectDrawGlobal.ddCaps,sizeof(DDCORECAPS)); + pDDSD->dwHeight = This->mDDrawGlobal.vmiData.dwDisplayHeight; + pDDSD->dwWidth = This->mDDrawGlobal.vmiData.dwDisplayWidth; + pDDSD->lPitch = This->mDDrawGlobal.vmiData.lDisplayPitch; + pDDSD->dwRefreshRate = This->mDDrawGlobal.dwMonitorFrequency; + + RtlCopyMemory(&pDDSD->ddpfPixelFormat,&This->mDDrawGlobal.vmiData.ddpfDisplay,sizeof(DDPIXELFORMAT)); + RtlCopyMemory(&pDDSD->ddsCaps,&This->mDDrawGlobal.ddCaps,sizeof(DDCORECAPS)); /* have not check where I should get hold of this info yet DWORD dwBackBufferCount; @@ -354,7 +402,7 @@ { IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK) + if (This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK) { return Hal_DirectDraw_WaitForVerticalBlank( iface, dwFlags, h); } @@ -367,7 +415,7 @@ { IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - if (This->DirectDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.dwFlags & DDHAL_MISCCB32_GETAVAILDRIVERMEMORY) + if (This->mDDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.dwFlags & DDHAL_MISCCB32_GETAVAILDRIVERMEMORY) { return Hal_DirectDraw_GetAvailableVidMem (iface,ddscaps,total,free); } @@ -384,7 +432,7 @@ return DD_FALSE; } - *freq = This->DirectDrawGlobal.dwMonitorFrequency; + *freq = This->mDDrawGlobal.dwMonitorFrequency; return DD_OK; } @@ -392,7 +440,7 @@ { IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_GETSCANLINE) + if (This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_GETSCANLINE) { return Hal_DirectDraw_GetScanLine( iface, lpdwScanLine); } Propchange: trunk/reactos/dll/directx/ddraw/main/ddraw_main.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Modified: trunk/reactos/dll/directx/ddraw/main/gamma_main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/gamm…
============================================================================== --- trunk/reactos/dll/directx/ddraw/main/gamma_main.c (original) +++ trunk/reactos/dll/directx/ddraw/main/gamma_main.c Sat Apr 1 23:12:56 2006 @@ -13,22 +13,13 @@ ULONG WINAPI Main_DirectDrawGammaControl_AddRef(LPDIRECTDRAWGAMMACONTROL iface) { - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - ULONG ref = InterlockedIncrement((PLONG)&This->DirectDrawGlobal.dwRefCnt); - - return ref; + return 1; } ULONG WINAPI Main_DirectDrawGammaControl_Release(LPDIRECTDRAWGAMMACONTROL iface) { - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - ULONG ref = InterlockedDecrement((PLONG)&This->DirectDrawGlobal.dwRefCnt); - - if (ref == 0) - HeapFree(GetProcessHeap(), 0, This); - - return ref; + return 0; } HRESULT WINAPI Propchange: trunk/reactos/dll/directx/ddraw/main/gamma_main.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/directx/ddraw/main/kernel_main.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Modified: trunk/reactos/dll/directx/ddraw/main/palette_main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/pale…
============================================================================== --- trunk/reactos/dll/directx/ddraw/main/palette_main.c (original) +++ trunk/reactos/dll/directx/ddraw/main/palette_main.c Sat Apr 1 23:12:56 2006 @@ -13,21 +13,12 @@ ULONG WINAPI Main_DirectDrawPalette_Release(LPDIRECTDRAWPALETTE iface) { - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - ULONG ref = InterlockedIncrement((PLONG)&This->DirectDrawGlobal.dwRefCnt); - - return ref; + return 1; } ULONG WINAPI Main_DirectDrawPalette_AddRef(LPDIRECTDRAWPALETTE iface) { - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - ULONG ref = InterlockedDecrement((PLONG)&This->DirectDrawGlobal.dwRefCnt); - - if (ref == 0) - HeapFree(GetProcessHeap(), 0, This); - - return ref; + return 0; } HRESULT WINAPI Propchange: trunk/reactos/dll/directx/ddraw/main/palette_main.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* 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 Sat Apr 1 23:12:56 2006 @@ -16,7 +16,7 @@ IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; /* Call the Hal CreateSurface */ - if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_CREATESURFACE) + if (This->owner->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_CREATESURFACE) { return Hal_DDrawSurface_Initialize (iface, pDD, pDDSD2); } @@ -29,13 +29,13 @@ { IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - return InterlockedIncrement((PLONG)&This->owner->DirectDrawGlobal.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->DirectDrawGlobal.dsList->dwIntRefCnt); + ULONG ref = InterlockedDecrement((PLONG)&This->owner->mDDrawGlobal.dsList->dwIntRefCnt); if (ref == 0) HeapFree(GetProcessHeap(), 0, This); @@ -57,9 +57,8 @@ { IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - DX_STUB; - - if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_FLIPTOGDISURFACE) + + if (This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_FLIPTOGDISURFACE) { return Hal_DDrawSurface_Blt( iface, rdst, src, rsrc, dwFlags, lpbltfx); } Propchange: trunk/reactos/dll/directx/ddraw/main/surface_main.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/directx/ddraw/main/videoport_main.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* 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 Sat Apr 1 23:12:56 2006 @@ -10,6 +10,9 @@ #include <d3dhal.h> #include <ddrawgdi.h> +/* own macro to alloc memmory */ +#define DxHeapMemAlloc(m) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, m) +#define DxHeapMemFree(p) HeapFree(GetProcessHeap(), 0, p); /******** Main Object ********/ typedef struct @@ -20,21 +23,36 @@ IDirectDraw2Vtbl* lpVtbl_v2; IDirectDrawVtbl* lpVtbl_v1; - /* The main struct that contain all info from the HAL and HEL */ - DDRAWI_DIRECTDRAW_GBL DirectDrawGlobal; + /* The main struct that contain all info from the HAL and HEL */ + HDC hdc; + DDRAWI_DIRECTDRAW_GBL mDDrawGlobal; + DDRAWI_DIRECTDRAW_LCL mDDrawLocal; + DDHALINFO mHALInfo; + + DDHAL_CALLBACKS mCallbacks; + DDHAL_DDEXEBUFCALLBACKS mD3dBufferCallbacks; + D3DHAL_CALLBACKS mD3dCallbacks; + D3DHAL_GLOBALDRIVERDATA mD3dDriverData; + + UINT mcModeInfos; + DDHALMODEINFO *mpModeInfos; + + UINT mcvmList; + VIDMEM *mpvmList; + + UINT mcFourCC; + DWORD *mpFourCC; + + UINT mcTextures; + DDSURFACEDESC *mpTextures; + /* ExclusiveOwner */ - DDRAWI_DIRECTDRAW_LCL ExclusiveOwner; - - /* MISC info that will be remove in futuer */ - DDHAL_DDMISCELLANEOUSCALLBACKS Misc2Callback; - DDHALINFO HalInfo; + DDRAWI_DIRECTDRAW_LCL ExclusiveOwner; DWORD cooperative_level; - int Height, Width, Bpp; - BOOL InitializeDraw; - + BOOL InitializeDraw; } IDirectDrawImpl; Modified: trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/soft/ddra…
============================================================================== --- trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c (original) +++ trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c Sat Apr 1 23:12:56 2006 @@ -83,12 +83,12 @@ /* FIXME fill the DirectDrawGlobal right the modeindex old and new */ - if(dwWidth) - This->Height = dwWidth; - if(dwHeight) - This->Width = dwHeight; - if(dwBPP) - This->Bpp = dwBPP; + //if(dwWidth) + // This->Height = dwWidth; + //if(dwHeight) + // This->Width = dwHeight; + //if(dwBPP) + // This->Bpp = dwBPP; return DD_OK; } Propchange: trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/directx/ddraw/soft/surface_hel.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/directx/ddraw/thunks/ddraw_thunk.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/directx/ddraw/thunks/surface_thunk.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
19 years
1
0
0
0
[gedmurphy] 21433: - change the GDI code a bit so it's able to handle multiple tables (e.g. separate Dd table) - patch by Thomas Weidenmueller
by aleksey@studiocerebral.com
Author: gedmurphy Date: Sat Apr 1 19:25:40 2006 New Revision: 21433 URL:
http://svn.reactos.ru/svn/reactos?rev=21433&view=rev
Log: - change the GDI code a bit so it's able to handle multiple tables (e.g. separate Dd table) - patch by Thomas Weidenmueller Removed: trunk/reactos/subsystems/win32/win32k/ntuser/ssec.c Modified: trunk/reactos/subsystems/win32/win32k/eng/palette.c trunk/reactos/subsystems/win32/win32k/eng/surface.c trunk/reactos/subsystems/win32/win32k/include/bitmaps.h trunk/reactos/subsystems/win32/win32k/include/brush.h trunk/reactos/subsystems/win32/win32k/include/dc.h trunk/reactos/subsystems/win32/win32k/include/dce.h trunk/reactos/subsystems/win32/win32k/include/gdiobj.h trunk/reactos/subsystems/win32/win32k/include/object.h trunk/reactos/subsystems/win32/win32k/include/palette.h trunk/reactos/subsystems/win32/win32k/include/pen.h trunk/reactos/subsystems/win32/win32k/include/region.h trunk/reactos/subsystems/win32/win32k/include/ssec.h trunk/reactos/subsystems/win32/win32k/include/text.h trunk/reactos/subsystems/win32/win32k/include/win32k.h trunk/reactos/subsystems/win32/win32k/main/dllmain.c trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c trunk/reactos/subsystems/win32/win32k/ntuser/misc.c trunk/reactos/subsystems/win32/win32k/ntuser/painting.c trunk/reactos/subsystems/win32/win32k/ntuser/windc.c trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c trunk/reactos/subsystems/win32/win32k/objects/brush.c trunk/reactos/subsystems/win32/win32k/objects/cliprgn.c trunk/reactos/subsystems/win32/win32k/objects/color.c trunk/reactos/subsystems/win32/win32k/objects/dc.c trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c trunk/reactos/subsystems/win32/win32k/objects/palobj.c trunk/reactos/subsystems/win32/win32k/objects/region.c trunk/reactos/subsystems/win32/win32k/objects/stockobj.c trunk/reactos/subsystems/win32/win32k/win32k.rbuild Modified: trunk/reactos/subsystems/win32/win32k/eng/palette.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/eng…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/palette.c (original) +++ trunk/reactos/subsystems/win32/win32k/eng/palette.c Sat Apr 1 19:25:40 2006 @@ -44,7 +44,7 @@ Palette = PALETTE_AllocPalette(Mode, NumColors, Colors, Red, Green, Blue); if (Palette != NULL) { - GDIOBJ_SetOwnership(Palette, NULL); + GDIOBJ_SetOwnership(GdiHandleTable, Palette, NULL); } return Palette; @@ -56,7 +56,7 @@ BOOL STDCALL EngDeletePalette(IN HPALETTE Palette) { - GDIOBJ_SetOwnership(Palette, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(GdiHandleTable, Palette, PsGetCurrentProcess()); return PALETTE_FreePalette(Palette); } Modified: trunk/reactos/subsystems/win32/win32k/eng/surface.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/eng…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/surface.c (original) +++ trunk/reactos/subsystems/win32/win32k/eng/surface.c Sat Apr 1 19:25:40 2006 @@ -373,7 +373,7 @@ if ( !NewBitmap ) return 0; - GDIOBJ_SetOwnership(NewBitmap, NULL); + GDIOBJ_SetOwnership(GdiHandleTable, NewBitmap, NULL); return NewBitmap; } @@ -394,7 +394,7 @@ if (NewSurface == NULL) return 0; - GDIOBJ_SetOwnership(NewSurface, NULL); + GDIOBJ_SetOwnership(GdiHandleTable, NewSurface, NULL); BitmapObj = BITMAPOBJ_LockBitmap(NewSurface); if (! BITMAPOBJ_InitBitsLock(BitmapObj)) @@ -506,7 +506,7 @@ BOOL STDCALL EngDeleteSurface(IN HSURF Surface) { - GDIOBJ_SetOwnership(Surface, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(GdiHandleTable, Surface, PsGetCurrentProcess()); BITMAPOBJ_FreeBitmap(Surface); return TRUE; } @@ -533,7 +533,7 @@ SURFOBJ * STDCALL EngLockSurface(IN HSURF Surface) { - BITMAPOBJ *bmp = GDIOBJ_ShareLockObj(Surface, GDI_OBJECT_TYPE_BITMAP); + BITMAPOBJ *bmp = GDIOBJ_ShareLockObj(GdiHandleTable, Surface, GDI_OBJECT_TYPE_BITMAP); if (bmp != NULL) return &bmp->SurfObj; @@ -548,6 +548,6 @@ EngUnlockSurface(IN SURFOBJ *Surface) { if (Surface != NULL) - GDIOBJ_UnlockObjByPtr(Surface); + GDIOBJ_UnlockObjByPtr(GdiHandleTable, Surface); } /* EOF */ Modified: trunk/reactos/subsystems/win32/win32k/include/bitmaps.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/bitmaps.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/bitmaps.h Sat Apr 1 19:25:40 2006 @@ -25,9 +25,9 @@ /* Internal interface */ #define BITMAPOBJ_AllocBitmap() \ - ((HBITMAP) GDIOBJ_AllocObj (GDI_OBJECT_TYPE_BITMAP)) + ((HBITMAP) GDIOBJ_AllocObj (GdiHandleTable, GDI_OBJECT_TYPE_BITMAP)) #define BITMAPOBJ_FreeBitmap(hBMObj) \ - GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP) + GDIOBJ_FreeObj(GdiHandleTable, (HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP) /* NOTE: Use shared locks! */ #define BITMAPOBJ_LockBitmap(hBMObj) (PBITMAPOBJ)EngLockSurface((HSURF)hBMObj) #define BITMAPOBJ_UnlockBitmap(pBMObj) EngUnlockSurface(&pBMObj->SurfObj) Modified: trunk/reactos/subsystems/win32/win32k/include/brush.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/brush.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/brush.h Sat Apr 1 19:25:40 2006 @@ -68,10 +68,10 @@ #define GDIBRUSH_IS_MASKING 0x8000 /* Pattern bitmap is used as transparent mask (?) */ #define GDIBRUSH_CACHED_IS_SOLID 0x80000000 -#define BRUSHOBJ_AllocBrush() ((HBRUSH) GDIOBJ_AllocObj (GDI_OBJECT_TYPE_BRUSH)) -#define BRUSHOBJ_FreeBrush(hBrush) GDIOBJ_FreeObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH) -#define BRUSHOBJ_LockBrush(hBrush) ((PGDIBRUSHOBJ)GDIOBJ_LockObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH)) -#define BRUSHOBJ_UnlockBrush(pBrush) GDIOBJ_UnlockObjByPtr(pBrush) +#define BRUSHOBJ_AllocBrush() ((HBRUSH) GDIOBJ_AllocObj (GdiHandleTable, GDI_OBJECT_TYPE_BRUSH)) +#define BRUSHOBJ_FreeBrush(hBrush) GDIOBJ_FreeObj(GdiHandleTable, (HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH) +#define BRUSHOBJ_LockBrush(hBrush) ((PGDIBRUSHOBJ)GDIOBJ_LockObj(GdiHandleTable, (HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH)) +#define BRUSHOBJ_UnlockBrush(pBrush) GDIOBJ_UnlockObjByPtr(GdiHandleTable, pBrush) BOOL INTERNAL_CALL BRUSH_Cleanup(PVOID ObjectBody); #endif Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/dc.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/dc.h Sat Apr 1 19:25:40 2006 @@ -166,9 +166,9 @@ /* Internal functions */ #define DC_LockDc(hDC) \ - ((PDC) GDIOBJ_LockObj ((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC)) + ((PDC) GDIOBJ_LockObj (GdiHandleTable, (HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC)) #define DC_UnlockDc(pDC) \ - GDIOBJ_UnlockObjByPtr (pDC) + GDIOBJ_UnlockObjByPtr (GdiHandleTable, pDC) HDC FASTCALL RetrieveDisplayHDC(VOID); HDC FASTCALL DC_AllocDC(PUNICODE_STRING Driver); Modified: trunk/reactos/subsystems/win32/win32k/include/dce.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/dce.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/dce.h Sat Apr 1 19:25:40 2006 @@ -44,10 +44,10 @@ #define DCX_NOCLIPCHILDREN 0x00080000 #define DCEOBJ_AllocDCE() \ - ((HDCE) GDIOBJ_AllocObj (GDI_OBJECT_TYPE_DCE)) -#define DCEOBJ_FreeDCE(hDCE) GDIOBJ_FreeObj((HGDIOBJ)hDCE, GDI_OBJECT_TYPE_DCE) -#define DCEOBJ_LockDCE(hDCE) ((PDCE)GDIOBJ_LockObj((HGDIOBJ)hDCE, GDI_OBJECT_TYPE_DCE)) -#define DCEOBJ_UnlockDCE(pDCE) GDIOBJ_UnlockObjByPtr(pDCE) + ((HDCE) GDIOBJ_AllocObj (GdiHandleTable, GDI_OBJECT_TYPE_DCE)) +#define DCEOBJ_FreeDCE(hDCE) GDIOBJ_FreeObj(GdiHandleTable, (HGDIOBJ)hDCE, GDI_OBJECT_TYPE_DCE) +#define DCEOBJ_LockDCE(hDCE) ((PDCE)GDIOBJ_LockObj(GdiHandleTable, (HGDIOBJ)hDCE, GDI_OBJECT_TYPE_DCE)) +#define DCEOBJ_UnlockDCE(pDCE) GDIOBJ_UnlockObjByPtr(GdiHandleTable, pDCE) BOOL INTERNAL_CALL DCE_Cleanup(PVOID ObjectBody); PDCE FASTCALL DceAllocDCE(PWINDOW_OBJECT Window, DCE_TYPE Type); Modified: trunk/reactos/subsystems/win32/win32k/include/gdiobj.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/gdiobj.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/gdiobj.h Sat Apr 1 19:25:40 2006 @@ -8,6 +8,21 @@ /* Public GDI Object/Handle definitions */ #include <win32k/ntgdihdl.h> + +typedef struct _GDI_HANDLE_TABLE +{ + /* the table must be located at the beginning of this structure so it can be + properly mapped! */ + GDI_TABLE_ENTRY Entries[GDI_HANDLE_COUNT]; + + PPAGED_LOOKASIDE_LIST LookasideLists; + + SLIST_HEADER FreeEntriesHead; + SLIST_ENTRY FreeEntries[((GDI_HANDLE_COUNT * sizeof(GDI_TABLE_ENTRY)) << 3) / + (sizeof(SLIST_ENTRY) << 3)]; +} GDI_HANDLE_TABLE, *PGDI_HANDLE_TABLE; + +extern PGDI_HANDLE_TABLE GdiHandleTable; typedef PVOID PGDIOBJ; @@ -28,11 +43,11 @@ #endif } GDIOBJHDR, *PGDIOBJHDR; -BOOL INTERNAL_CALL GDIOBJ_OwnedByCurrentProcess(HGDIOBJ ObjectHandle); -void INTERNAL_CALL GDIOBJ_SetOwnership(HGDIOBJ ObjectHandle, PEPROCESS Owner); -void INTERNAL_CALL GDIOBJ_CopyOwnership(HGDIOBJ CopyFrom, HGDIOBJ CopyTo); -BOOL INTERNAL_CALL GDIOBJ_ConvertToStockObj(HGDIOBJ *hObj); -VOID INTERNAL_CALL GDIOBJ_UnlockObjByPtr(PGDIOBJ Object); +BOOL INTERNAL_CALL GDIOBJ_OwnedByCurrentProcess(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ ObjectHandle); +void INTERNAL_CALL GDIOBJ_SetOwnership(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ ObjectHandle, PEPROCESS Owner); +void INTERNAL_CALL GDIOBJ_CopyOwnership(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ CopyFrom, HGDIOBJ CopyTo); +BOOL INTERNAL_CALL GDIOBJ_ConvertToStockObj(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ *hObj); +VOID INTERNAL_CALL GDIOBJ_UnlockObjByPtr(PGDI_HANDLE_TABLE HandleTable, PGDIOBJ Object); #define GDIOBJ_GetObjectType(Handle) \ GDI_HANDLE_GET_TYPE(Handle) @@ -40,26 +55,26 @@ #ifdef GDI_DEBUG /* a couple macros for debugging GDIOBJ locking */ -#define GDIOBJ_AllocObj(ty) GDIOBJ_AllocObjDbg(__FILE__,__LINE__,ty) -#define GDIOBJ_FreeObj(obj,ty) GDIOBJ_FreeObjDbg(__FILE__,__LINE__,obj,ty) -#define GDIOBJ_LockObj(obj,ty) GDIOBJ_LockObjDbg(__FILE__,__LINE__,obj,ty) -#define GDIOBJ_ShareLockObj(obj,ty) GDIOBJ_ShareLockObjDbg(__FILE__,__LINE__,obj,ty) +#define GDIOBJ_AllocObj(ty) GDIOBJ_AllocObjDbg(GdiHandleTable,__FILE__,__LINE__,ty) +#define GDIOBJ_FreeObj(obj,ty) GDIOBJ_FreeObjDbg(GdiHandleTable,__FILE__,__LINE__,obj,ty) +#define GDIOBJ_LockObj(obj,ty) GDIOBJ_LockObjDbg(GdiHandleTable,__FILE__,__LINE__,obj,ty) +#define GDIOBJ_ShareLockObj(obj,ty) GDIOBJ_ShareLockObjDbg(GdiHandleTable,__FILE__,__LINE__,obj,ty) -HGDIOBJ INTERNAL_CALL GDIOBJ_AllocObjDbg(const char* file, int line, ULONG ObjectType); -BOOL INTERNAL_CALL GDIOBJ_FreeObjDbg (const char* file, int line, HGDIOBJ hObj, DWORD ObjectType); -PGDIOBJ INTERNAL_CALL GDIOBJ_LockObjDbg (const char* file, int line, HGDIOBJ hObj, DWORD ObjectType); -PGDIOBJ INTERNAL_CALL GDIOBJ_ShareLockObjDbg (const char* file, int line, HGDIOBJ hObj, DWORD ObjectType); +HGDIOBJ INTERNAL_CALL GDIOBJ_AllocObjDbg(PGDI_HANDLE_TABLE HandleTable, const char* file, int line, ULONG ObjectType); +BOOL INTERNAL_CALL GDIOBJ_FreeObjDbg (PGDI_HANDLE_TABLE HandleTable, const char* file, int line, HGDIOBJ hObj, DWORD ObjectType); +PGDIOBJ INTERNAL_CALL GDIOBJ_LockObjDbg (PGDI_HANDLE_TABLE HandleTable, const char* file, int line, HGDIOBJ hObj, DWORD ObjectType); +PGDIOBJ INTERNAL_CALL GDIOBJ_ShareLockObjDbg (PGDI_HANDLE_TABLE HandleTable, const char* file, int line, HGDIOBJ hObj, DWORD ObjectType); #else /* !GDI_DEBUG */ -HGDIOBJ INTERNAL_CALL GDIOBJ_AllocObj(ULONG ObjectType); -BOOL INTERNAL_CALL GDIOBJ_FreeObj (HGDIOBJ hObj, DWORD ObjectType); -PGDIOBJ INTERNAL_CALL GDIOBJ_LockObj (HGDIOBJ hObj, DWORD ObjectType); -PGDIOBJ INTERNAL_CALL GDIOBJ_ShareLockObj (HGDIOBJ hObj, DWORD ObjectType); +HGDIOBJ INTERNAL_CALL GDIOBJ_AllocObj(PGDI_HANDLE_TABLE HandleTable, ULONG ObjectType); +BOOL INTERNAL_CALL GDIOBJ_FreeObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ObjectType); +PGDIOBJ INTERNAL_CALL GDIOBJ_LockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ObjectType); +PGDIOBJ INTERNAL_CALL GDIOBJ_ShareLockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ObjectType); #endif /* GDI_DEBUG */ -PVOID INTERNAL_CALL GDI_MapHandleTable(PEPROCESS Process); +PVOID INTERNAL_CALL GDI_MapHandleTable(PSECTION_OBJECT SectionObject, PEPROCESS Process); #define GDIOBJFLAG_DEFAULT (0x0) #define GDIOBJFLAG_IGNOREPID (0x1) Modified: trunk/reactos/subsystems/win32/win32k/include/object.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/object.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/object.h Sat Apr 1 19:25:40 2006 @@ -125,8 +125,6 @@ \ } -VOID INTERNAL_CALL InitGdiObjectHandleTable (VOID); - VOID FASTCALL CreateStockObjects (VOID); VOID FASTCALL CreateSysColorObjects (VOID); Modified: trunk/reactos/subsystems/win32/win32k/include/palette.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/palette.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/palette.h Sat Apr 1 19:25:40 2006 @@ -35,9 +35,9 @@ ULONG Blue); HPALETTE FASTCALL PALETTE_AllocPaletteIndexedRGB(ULONG NumColors, CONST RGBQUAD *Colors); -#define PALETTE_FreePalette(hPalette) GDIOBJ_FreeObj((HGDIOBJ)hPalette, GDI_OBJECT_TYPE_PALETTE) -#define PALETTE_LockPalette(hPalette) ((PPALGDI)GDIOBJ_LockObj((HGDIOBJ)hPalette, GDI_OBJECT_TYPE_PALETTE)) -#define PALETTE_UnlockPalette(pPalette) GDIOBJ_UnlockObjByPtr(pPalette) +#define PALETTE_FreePalette(hPalette) GDIOBJ_FreeObj(GdiHandleTable, (HGDIOBJ)hPalette, GDI_OBJECT_TYPE_PALETTE) +#define PALETTE_LockPalette(hPalette) ((PPALGDI)GDIOBJ_LockObj(GdiHandleTable, (HGDIOBJ)hPalette, GDI_OBJECT_TYPE_PALETTE)) +#define PALETTE_UnlockPalette(pPalette) GDIOBJ_UnlockObjByPtr(GdiHandleTable, pPalette) BOOL INTERNAL_CALL PALETTE_Cleanup(PVOID ObjectBody); HPALETTE FASTCALL PALETTE_Init (VOID); Modified: trunk/reactos/subsystems/win32/win32k/include/pen.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/pen.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/pen.h Sat Apr 1 19:25:40 2006 @@ -6,9 +6,9 @@ /* Internal interface */ -#define PENOBJ_AllocPen() ((HPEN)GDIOBJ_AllocObj(GDI_OBJECT_TYPE_PEN)) -#define PENOBJ_FreePen(hBMObj) GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN) -#define PENOBJ_LockPen(hBMObj) ((PGDIBRUSHOBJ)GDIOBJ_LockObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN)) -#define PENOBJ_UnlockPen(pPenObj) GDIOBJ_UnlockObjByPtr(pPenObj) +#define PENOBJ_AllocPen() ((HPEN)GDIOBJ_AllocObj(GdiHandleTable, GDI_OBJECT_TYPE_PEN)) +#define PENOBJ_FreePen(hBMObj) GDIOBJ_FreeObj(GdiHandleTable, (HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN) +#define PENOBJ_LockPen(hBMObj) ((PGDIBRUSHOBJ)GDIOBJ_LockObj(GdiHandleTable, (HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN)) +#define PENOBJ_UnlockPen(pPenObj) GDIOBJ_UnlockObjByPtr(GdiHandleTable, pPenObj) #endif Modified: trunk/reactos/subsystems/win32/win32k/include/region.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/region.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/region.h Sat Apr 1 19:25:40 2006 @@ -11,9 +11,9 @@ } ROSRGNDATA, *PROSRGNDATA, *LPROSRGNDATA; -#define RGNDATA_FreeRgn(hRgn) GDIOBJ_FreeObj((HGDIOBJ)hRgn, GDI_OBJECT_TYPE_REGION) -#define RGNDATA_LockRgn(hRgn) ((PROSRGNDATA)GDIOBJ_LockObj((HGDIOBJ)hRgn, GDI_OBJECT_TYPE_REGION)) -#define RGNDATA_UnlockRgn(pRgn) GDIOBJ_UnlockObjByPtr(pRgn) +#define RGNDATA_FreeRgn(hRgn) GDIOBJ_FreeObj(GdiHandleTable, (HGDIOBJ)hRgn, GDI_OBJECT_TYPE_REGION) +#define RGNDATA_LockRgn(hRgn) ((PROSRGNDATA)GDIOBJ_LockObj(GdiHandleTable, (HGDIOBJ)hRgn, GDI_OBJECT_TYPE_REGION)) +#define RGNDATA_UnlockRgn(pRgn) GDIOBJ_UnlockObjByPtr(GdiHandleTable, pRgn) HRGN FASTCALL RGNDATA_AllocRgn(INT n); BOOL INTERNAL_CALL RGNDATA_Cleanup(PVOID ObjectBody); Modified: trunk/reactos/subsystems/win32/win32k/include/ssec.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/ssec.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/ssec.h Sat Apr 1 19:25:40 2006 @@ -1,73 +1,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS Win32k subsystem - * PURPOSE: shared sections - * FILE: include/ssec.h - * PROGRAMMER: Thomas Weidenmueller <w3seek(a)reactos.com> - * - */ - -#ifndef _WIN32K_SSEC_H -#define _WIN32K_SSEC_H - -typedef struct _SHARED_SECTION -{ - PSECTION_OBJECT SectionObject; - PVOID SystemMappedBase; - ULONG ViewSize; -} SHARED_SECTION, *PSHARED_SECTION; - -typedef struct _SHARED_SECTIONS_ARRAY -{ - struct _SHARED_SECTIONS_ARRAY *Next; - ULONG nEntries; - SHARED_SECTION SharedSection[0]; -} SHARED_SECTIONS_ARRAY, *PSHARED_SECTIONS_ARRAY; - -typedef struct _SHARED_SECTION_POOL -{ - FAST_MUTEX Lock; - ULONG PoolSize; - ULONG PoolFree; - ULONG SharedSectionCount; - SHARED_SECTIONS_ARRAY SectionsArray; -} SHARED_SECTION_POOL, *PSHARED_SECTION_POOL; - -NTSTATUS INTERNAL_CALL -IntUserCreateSharedSectionPool(IN ULONG MaximumPoolSize, - IN PSHARED_SECTION_POOL *SharedSectionPool); - -VOID INTERNAL_CALL -IntUserFreeSharedSectionPool(IN PSHARED_SECTION_POOL SharedSectionPool); - -NTSTATUS INTERNAL_CALL -InUserDeleteSharedSection(IN PSHARED_SECTION_POOL SharedSectionPool, - IN PVOID SystemMappedBase); - -NTSTATUS INTERNAL_CALL -IntUserCreateSharedSection(IN PSHARED_SECTION_POOL SharedSectionPool, - IN OUT PVOID *SystemMappedBase, - IN OUT ULONG *SharedSectionSize); - -NTSTATUS INTERNAL_CALL -IntUserMapSharedSection(IN PSHARED_SECTION_POOL SharedSectionPool, - IN PEPROCESS Process, - IN PVOID SystemMappedBase, - IN PLARGE_INTEGER SectionOffset OPTIONAL, - IN OUT PVOID *UserMappedBase, - IN PULONG ViewSize OPTIONAL, - IN BOOLEAN ReadOnly); - -NTSTATUS INTERNAL_CALL -IntUserUnMapSharedSection(IN PSHARED_SECTION_POOL SharedSectionPool, - IN PEPROCESS Process, - IN PVOID SystemMappedBase, - IN PVOID UserMappedBase); - -extern PSHARED_SECTION_POOL SessionSharedSectionPool; - -#endif /* ! defined(_WIN32K_SSEC_H) */ - -/* EOF */ - Modified: trunk/reactos/subsystems/win32/win32k/include/text.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/text.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/text.h Sat Apr 1 19:25:40 2006 @@ -12,10 +12,10 @@ /* Internal interface */ #define TEXTOBJ_AllocText() \ - ((HFONT) GDIOBJ_AllocObj (GDI_OBJECT_TYPE_FONT)) -#define TEXTOBJ_FreeText(hBMObj) GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_FONT) -#define TEXTOBJ_LockText(hBMObj) ((PTEXTOBJ) GDIOBJ_LockObj ((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_FONT)) -#define TEXTOBJ_UnlockText(pBMObj) GDIOBJ_UnlockObjByPtr (pBMObj) + ((HFONT) GDIOBJ_AllocObj (GdiHandleTable, GDI_OBJECT_TYPE_FONT)) +#define TEXTOBJ_FreeText(hBMObj) GDIOBJ_FreeObj(GdiHandleTable, (HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_FONT) +#define TEXTOBJ_LockText(hBMObj) ((PTEXTOBJ) GDIOBJ_LockObj (GdiHandleTable, (HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_FONT)) +#define TEXTOBJ_UnlockText(pBMObj) GDIOBJ_UnlockObjByPtr (GdiHandleTable, pBMObj) NTSTATUS FASTCALL TextIntRealizeFont(HFONT FontHandle); NTSTATUS FASTCALL TextIntCreateFontIndirect(CONST LPLOGFONTW lf, HFONT *NewFont); Modified: trunk/reactos/subsystems/win32/win32k/include/win32k.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/win32k.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/win32k.h Sat Apr 1 19:25:40 2006 @@ -14,7 +14,6 @@ /* Internal Win32k Headers */ #include <include/ntuser.h> #include <include/win32.h> -#include <include/ssec.h> #include <include/accelerator.h> #include <include/callback.h> #include <include/class.h> Modified: trunk/reactos/subsystems/win32/win32k/main/dllmain.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/mai…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/main/dllmain.c (original) +++ trunk/reactos/subsystems/win32/win32k/main/dllmain.c Sat Apr 1 19:25:40 2006 @@ -27,13 +27,15 @@ #define NDEBUG #include <debug.h> -BOOL INTERNAL_CALL GDI_CleanupForProcess (struct _EPROCESS *Process); +PGDI_HANDLE_TABLE INTERNAL_CALL GDIOBJ_iAllocHandleTable(OUT PSECTION_OBJECT *SectionObject); +BOOL INTERNAL_CALL GDI_CleanupForProcess (PGDI_HANDLE_TABLE HandleTable, struct _EPROCESS *Process); +/* FIXME */ +PGDI_HANDLE_TABLE GdiHandleTable = NULL; +PSECTION_OBJECT GdiTableSection = NULL; extern ULONG_PTR Win32kSSDT[]; extern UCHAR Win32kSSPT[]; extern ULONG Win32kNumberOfSysCalls; - -PSHARED_SECTION_POOL SessionSharedSectionPool = NULL; NTSTATUS STDCALL @@ -84,7 +86,7 @@ if(Process->Peb != NULL) { /* map the gdi handle table to user land */ - Process->Peb->GdiSharedHandleTable = GDI_MapHandleTable(Process); + Process->Peb->GdiSharedHandleTable = GDI_MapHandleTable(GdiTableSection, Process); } /* setup process flags */ @@ -102,7 +104,7 @@ /* no process windows should exist at this point, or the function will assert! */ DestroyProcessClasses(Win32Process); - GDI_CleanupForProcess(Process); + GDI_CleanupForProcess(GdiHandleTable, Process); co_IntGraphicsCheck(FALSE); @@ -340,13 +342,6 @@ */ PsEstablishWin32Callouts(&CalloutData); - Status = IntUserCreateSharedSectionPool(48 * 1024 * 1024, /* 48 MB by default */ - &SessionSharedSectionPool); - if (!NT_SUCCESS(Status)) - { - DPRINT1("Failed to initialize the shared section pool: Status 0x%x\n", Status); - } - Status = InitUserImpl(); if (!NT_SUCCESS(Status)) { @@ -445,7 +440,12 @@ return(Status); } - InitGdiObjectHandleTable (); + GdiHandleTable = GDIOBJ_iAllocHandleTable(&GdiTableSection); + if (GdiHandleTable == NULL) + { + DPRINT1("Failed to initialize the GDI handle table.\n"); + return STATUS_UNSUCCESSFUL; + } /* Initialize FreeType library */ if (! InitFontSupport()) Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntd…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c Sat Apr 1 19:25:40 2006 @@ -15,6 +15,8 @@ /* swtich this off to get rid of all dx debug msg */ #define DX_DEBUG + +#define DdHandleTable GdiHandleTable /************************************************************************/ @@ -95,7 +97,7 @@ return NULL; } - hDirectDraw = GDIOBJ_AllocObj(GDI_OBJECT_TYPE_DIRECTDRAW); + hDirectDraw = GDIOBJ_AllocObj(DdHandleTable, GDI_OBJECT_TYPE_DIRECTDRAW); if (!hDirectDraw) { /* No more memmory */ @@ -106,7 +108,7 @@ return NULL; } - pDirectDraw = GDIOBJ_LockObj(hDirectDraw, GDI_OBJECT_TYPE_DIRECTDRAW); + pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDraw, GDI_OBJECT_TYPE_DIRECTDRAW); if (!pDirectDraw) { /* invalid handle */ @@ -133,7 +135,7 @@ /* DD_PALETTECALLBACKS setup*/ RtlMoveMemory(&pDirectDraw->Pal, &surface_callbacks, sizeof(DD_PALETTECALLBACKS)); - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); DC_UnlockDc(pDC); return hDirectDraw; @@ -146,7 +148,7 @@ #ifdef DX_DEBUG DPRINT1("NtGdiDdDeleteDirectDrawObject\n"); #endif - return GDIOBJ_FreeObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); + return GDIOBJ_FreeObj(DdHandleTable, hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); } BOOL STDCALL NtGdiDdQueryDirectDrawObject( @@ -201,7 +203,7 @@ } - pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); + pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); if (!pDirectDraw) @@ -226,7 +228,7 @@ #ifdef DX_DEBUG DPRINT1(" Fail to get DirectDraw driver info \n"); #endif - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return FALSE; } @@ -351,7 +353,7 @@ } #endif - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return TRUE; } @@ -364,7 +366,7 @@ { DWORD ddRVal = 0; - PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); #ifdef DX_DEBUG DPRINT1("NtGdiDdGetDriverInfo\n"); #endif @@ -397,7 +399,7 @@ else ddRVal = pDirectDraw->Hal.GetDriverInfo(puGetDriverInfoData); - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return ddRVal; } @@ -425,7 +427,7 @@ DPRINT1("NtGdiDdCreateSurface\n"); #endif - pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); + pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw == NULL) { #ifdef DX_DEBUG @@ -456,7 +458,7 @@ /* But back the orignal PDev */ puCreateSurfaceData->lpDD = lgpl; - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return ddRVal; } @@ -473,7 +475,7 @@ #endif - pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); + pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; @@ -492,7 +494,7 @@ /* But back the orignal PDev */ puWaitForVerticalBlankData->lpDD = lgpl; - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return ddRVal; } @@ -504,7 +506,7 @@ DWORD ddRVal; PDD_DIRECTDRAW_GLOBAL lgpl; - PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); #ifdef DX_DEBUG DPRINT1("NtGdiDdCanCreateSurface\n"); #endif @@ -526,7 +528,7 @@ /* But back the orignal PDev */ puCanCreateSurfaceData->lpDD = lgpl; - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return ddRVal; } @@ -538,7 +540,7 @@ DWORD ddRVal; PDD_DIRECTDRAW_GLOBAL lgpl; - PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); #ifdef DX_DEBUG DPRINT1("NtGdiDdGetScanLine\n"); #endif @@ -560,7 +562,7 @@ /* But back the orignal PDev */ puGetScanLineData->lpDD = lgpl; - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return ddRVal; } @@ -579,7 +581,7 @@ { DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED; - PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); #ifdef DX_DEBUG DPRINT1("NtGdiDdDestroySurface\n"); #endif @@ -605,7 +607,7 @@ } - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return ddRVal; } @@ -620,7 +622,7 @@ DWORD ddRVal; PDD_DIRECTDRAW_GLOBAL lgpl; - PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceTarget, GDI_OBJECT_TYPE_DIRECTDRAW); + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hSurfaceTarget, GDI_OBJECT_TYPE_DIRECTDRAW); #ifdef DX_DEBUG DPRINT1("NtGdiDdFlip\n"); #endif @@ -643,7 +645,7 @@ /* But back the orignal PDev */ puFlipData->lpDD = lgpl; - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return ddRVal; } @@ -656,7 +658,7 @@ DWORD ddRVal; PDD_DIRECTDRAW_GLOBAL lgpl; - PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); #ifdef DX_DEBUG DPRINT1("NtGdiDdLock\n"); #endif @@ -678,7 +680,7 @@ /* But back the orignal PDev */ puLockData->lpDD = lgpl; - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return ddRVal; } @@ -690,7 +692,7 @@ DWORD ddRVal; PDD_DIRECTDRAW_GLOBAL lgpl; - PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); #ifdef DX_DEBUG DPRINT1("NtGdiDdUnlock\n"); #endif @@ -712,7 +714,7 @@ /* But back the orignal PDev */ puUnlockData->lpDD = lgpl; - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return ddRVal; } @@ -725,7 +727,7 @@ DWORD ddRVal; PDD_DIRECTDRAW_GLOBAL lgpl; - PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceDest, GDI_OBJECT_TYPE_DIRECTDRAW); + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hSurfaceDest, GDI_OBJECT_TYPE_DIRECTDRAW); #ifdef DX_DEBUG DPRINT1("NtGdiDdBlt\n"); #endif @@ -747,7 +749,7 @@ /* But back the orignal PDev */ puBltData->lpDD = lgpl; - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return ddRVal; } @@ -759,7 +761,7 @@ DWORD ddRVal; PDD_DIRECTDRAW_GLOBAL lgpl; - PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); #ifdef DX_DEBUG DPRINT1("NtGdiDdSetColorKey\n"); #endif @@ -781,7 +783,7 @@ /* But back the orignal PDev */ puSetColorKeyData->lpDD = lgpl; - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return ddRVal; } @@ -795,7 +797,7 @@ DWORD ddRVal; PDD_DIRECTDRAW_GLOBAL lgpl; - PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceAttached, GDI_OBJECT_TYPE_DIRECTDRAW); + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hSurfaceAttached, GDI_OBJECT_TYPE_DIRECTDRAW); #ifdef DX_DEBUG DPRINT1("NtGdiDdAddAttachedSurface\n"); #endif @@ -817,7 +819,7 @@ /* But back the orignal PDev */ puAddAttachedSurfaceData->lpDD = lgpl; - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return ddRVal; } @@ -829,7 +831,7 @@ DWORD ddRVal; PDD_DIRECTDRAW_GLOBAL lgpl; - PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); #ifdef DX_DEBUG DPRINT1("NtGdiDdGetBltStatus\n"); #endif @@ -851,7 +853,7 @@ /* But back the orignal PDev */ puGetBltStatusData->lpDD = lgpl; - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return ddRVal; } @@ -863,7 +865,7 @@ DWORD ddRVal; PDD_DIRECTDRAW_GLOBAL lgpl; - PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); #ifdef DX_DEBUG DPRINT1("NtGdiDdGetFlipStatus\n"); #endif @@ -885,7 +887,7 @@ /* But back the orignal PDev */ puGetFlipStatusData->lpDD = lgpl; - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return ddRVal; } @@ -898,7 +900,7 @@ DWORD ddRVal; PDD_DIRECTDRAW_GLOBAL lgpl; - PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceDestination, GDI_OBJECT_TYPE_DIRECTDRAW); + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hSurfaceDestination, GDI_OBJECT_TYPE_DIRECTDRAW); #ifdef DX_DEBUG DPRINT1("NtGdiDdUpdateOverlay\n"); #endif @@ -920,7 +922,7 @@ /* But back the orignal PDev */ puUpdateOverlayData->lpDD = lgpl; - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return ddRVal; } @@ -933,7 +935,7 @@ DWORD ddRVal; PDD_DIRECTDRAW_GLOBAL lgpl; - PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceDestination, GDI_OBJECT_TYPE_DIRECTDRAW); + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hSurfaceDestination, GDI_OBJECT_TYPE_DIRECTDRAW); #ifdef DX_DEBUG DPRINT1("NtGdiDdSetOverlayPosition\n"); #endif @@ -955,7 +957,7 @@ /* But back the orignal PDev */ puSetOverlayPositionData->lpDD = lgpl; - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return ddRVal; } @@ -985,7 +987,7 @@ BOOL bComplete ) { - PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); PDD_SURFACE pSurface; #ifdef DX_DEBUG DPRINT1("NtGdiDdCreateSurfaceObject\n"); @@ -994,9 +996,9 @@ return NULL; if (!hSurface) - hSurface = GDIOBJ_AllocObj(GDI_OBJECT_TYPE_DD_SURFACE); - - pSurface = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DD_SURFACE); + hSurface = GDIOBJ_AllocObj(DdHandleTable, GDI_OBJECT_TYPE_DD_SURFACE); + + pSurface = GDIOBJ_LockObj(DdHandleTable, hSurface, GDI_OBJECT_TYPE_DD_SURFACE); /* FIXME - Handle pSurface == NULL!!!! */ RtlMoveMemory(&pSurface->Local, puSurfaceLocal, sizeof(DD_SURFACE_LOCAL)); @@ -1010,8 +1012,8 @@ // FIXME: figure out how to use this pSurface->bComplete = bComplete; - GDIOBJ_UnlockObjByPtr(pSurface); - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pSurface); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return hSurface; } @@ -1026,7 +1028,7 @@ /* FIXME add right GDI_OBJECT_TYPE_ for everthing for now we are using same type */ /* return GDIOBJ_FreeObj(hSurface, GDI_OBJECT_TYPE_DD_SURFACE); */ - return GDIOBJ_FreeObj(hSurface, GDI_OBJECT_TYPE_DD_SURFACE); + return GDIOBJ_FreeObj(DdHandleTable, hSurface, GDI_OBJECT_TYPE_DD_SURFACE); } @@ -1072,7 +1074,7 @@ DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED; PDD_DIRECTDRAW_GLOBAL lgpl; - PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); #ifdef DX_DEBUG DPRINT1("NtGdiDdGetAvailDriverMemory\n"); #endif @@ -1086,7 +1088,7 @@ /* make the call */ // ddRVal = pDirectDraw->DdGetAvailDriverMemory(puGetAvailDriverMemoryData); - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); /* But back the orignal PDev */ @@ -1106,7 +1108,7 @@ DWORD ddRVal; PDD_DIRECTDRAW_GLOBAL lgpl; - PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDraw, GDI_OBJECT_TYPE_DIRECTDRAW); + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDraw, GDI_OBJECT_TYPE_DIRECTDRAW); #ifdef DX_DEBUG DPRINT1("NtGdiDdSetExclusiveMode\n"); @@ -1121,7 +1123,7 @@ /* make the call */ ddRVal = pDirectDraw->DdSetExclusiveMode(puSetExclusiveModeData); - GDIOBJ_UnlockObjByPtr(pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); /* But back the orignal PDev */ puSetExclusiveModeData->lpDD = lgpl; Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c Sat Apr 1 19:25:40 2006 @@ -490,12 +490,12 @@ /* delete bitmaps */ if(bmpMask) { - GDIOBJ_SetOwnership(bmpMask, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(GdiHandleTable, bmpMask, PsGetCurrentProcess()); NtGdiDeleteObject(bmpMask); } if(bmpColor) { - GDIOBJ_SetOwnership(bmpColor, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(GdiHandleTable, bmpColor, PsGetCurrentProcess()); NtGdiDeleteObject(bmpColor); } @@ -587,7 +587,7 @@ CurIcon->Size.cx = bmp->SurfObj.sizlBitmap.cx; CurIcon->Size.cy = bmp->SurfObj.sizlBitmap.cy; BITMAPOBJ_UnlockBitmap(bmp); - GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmColor, NULL); + GDIOBJ_SetOwnership(GdiHandleTable, CurIcon->IconInfo.hbmColor, NULL); } if(CurIcon->IconInfo.hbmMask && (bmp = BITMAPOBJ_LockBitmap(CurIcon->IconInfo.hbmMask))) @@ -598,7 +598,7 @@ CurIcon->Size.cy = bmp->SurfObj.sizlBitmap.cy / 2; } BITMAPOBJ_UnlockBitmap(bmp); - GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmMask, NULL); + GDIOBJ_SetOwnership(GdiHandleTable, CurIcon->IconInfo.hbmMask, NULL); } } else @@ -1142,7 +1142,7 @@ CurIcon->Size.cx = bmp->SurfObj.sizlBitmap.cx; CurIcon->Size.cy = bmp->SurfObj.sizlBitmap.cy; BITMAPOBJ_UnlockBitmap(bmp); - GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmColor, NULL); + GDIOBJ_SetOwnership(GdiHandleTable, CurIcon->IconInfo.hbmColor, NULL); } else { @@ -1154,7 +1154,7 @@ CurIcon->Size.cy = bmp->SurfObj.sizlBitmap.cy / 2; BITMAPOBJ_UnlockBitmap(bmp); - GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmMask, NULL); + GDIOBJ_SetOwnership(GdiHandleTable, CurIcon->IconInfo.hbmMask, NULL); } Ret = TRUE; Modified: trunk/reactos/subsystems/win32/win32k/ntuser/misc.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/misc.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/misc.c Sat Apr 1 19:25:40 2006 @@ -1052,7 +1052,7 @@ BITMAPOBJ_UnlockBitmap(bmp); /* change the bitmap's ownership */ - GDIOBJ_SetOwnership(hNewBitmap, NULL); + GDIOBJ_SetOwnership(GdiHandleTable, hNewBitmap, NULL); } hOldBitmap = (HBITMAP)InterlockedExchange((LONG*)&WinStaObject->hbmWallpaper, (LONG)hNewBitmap); if(hOldBitmap != NULL) Modified: trunk/reactos/subsystems/win32/win32k/ntuser/painting.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/painting.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/painting.c Sat Apr 1 19:25:40 2006 @@ -194,7 +194,7 @@ if (NtGdiCombineRgn(Window->UpdateRegion, Window->UpdateRegion, hRgnWindow, RGN_AND) == NULLREGION) { - GDIOBJ_SetOwnership(Window->UpdateRegion, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(GdiHandleTable, Window->UpdateRegion, PsGetCurrentProcess()); NtGdiDeleteObject(Window->UpdateRegion); Window->UpdateRegion = NULL; if (!(Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT)) @@ -251,7 +251,7 @@ if ((HANDLE) 1 != TempRegion && NULL != TempRegion) { /* NOTE: The region can already be deleted! */ - GDIOBJ_FreeObj(TempRegion, GDI_OBJECT_TYPE_REGION | GDI_OBJECT_TYPE_SILENT); + GDIOBJ_FreeObj(GdiHandleTable, TempRegion, GDI_OBJECT_TYPE_REGION | GDI_OBJECT_TYPE_SILENT); } } @@ -372,13 +372,13 @@ if (Window->UpdateRegion == NULL) { Window->UpdateRegion = NtGdiCreateRectRgn(0, 0, 0, 0); - GDIOBJ_SetOwnership(Window->UpdateRegion, NULL); + GDIOBJ_SetOwnership(GdiHandleTable, Window->UpdateRegion, NULL); } if (NtGdiCombineRgn(Window->UpdateRegion, Window->UpdateRegion, hRgn, RGN_OR) == NULLREGION) { - GDIOBJ_SetOwnership(Window->UpdateRegion, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(GdiHandleTable, Window->UpdateRegion, PsGetCurrentProcess()); NtGdiDeleteObject(Window->UpdateRegion); Window->UpdateRegion = NULL; } @@ -398,7 +398,7 @@ if (NtGdiCombineRgn(Window->UpdateRegion, Window->UpdateRegion, hRgn, RGN_DIFF) == NULLREGION) { - GDIOBJ_SetOwnership(Window->UpdateRegion, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(GdiHandleTable, Window->UpdateRegion, PsGetCurrentProcess()); NtGdiDeleteObject(Window->UpdateRegion); Window->UpdateRegion = NULL; } @@ -761,7 +761,7 @@ if (hRgn != (HANDLE)1 && hRgn != NULL) { /* NOTE: The region can already by deleted! */ - GDIOBJ_FreeObj(hRgn, GDI_OBJECT_TYPE_REGION | GDI_OBJECT_TYPE_SILENT); + GDIOBJ_FreeObj(GdiHandleTable, hRgn, GDI_OBJECT_TYPE_REGION | GDI_OBJECT_TYPE_SILENT); } } @@ -793,7 +793,7 @@ { IntGetClientRect(Window, &Ps.rcPaint); } - GDIOBJ_SetOwnership(Window->UpdateRegion, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(GdiHandleTable, Window->UpdateRegion, PsGetCurrentProcess()); Window->UpdateRegion = NULL; } else Removed: trunk/reactos/subsystems/win32/win32k/ntuser/ssec.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/ssec.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/ssec.c (removed) @@ -1,421 +1,0 @@ -/* - * ReactOS W32 Subsystem - * Copyright (C) 1998 - 2005 ReactOS Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: shared sections support - * FILE: subsys/win32k/misc/ssec.c - * PROGRAMER: Thomas Weidenmueller <w3seek(a)reactos.com> - */ - -#include <w32k.h> - -#define NDEBUG -#include <debug.h> - -/* - * FIXME - instead of mapping the memory into system space using - * MmMapViewInSystemSpace() we should rather use - * MmMapViewInSessionSpace() to map it into session space! - */ - -NTSTATUS INTERNAL_CALL -IntUserCreateSharedSectionPool(IN ULONG MaximumPoolSize, - IN PSHARED_SECTION_POOL *SharedSectionPool) -{ - PSHARED_SECTION_POOL Pool; - ULONG PoolStructSize; - - ASSERT(SharedSectionPool); - - PoolStructSize = ROUND_UP(sizeof(SHARED_SECTION_POOL), PAGE_SIZE); - Pool = ExAllocatePoolWithTag(NonPagedPool, - PoolStructSize, - TAG_SSECTPOOL); - if(Pool != NULL) - { - RtlZeroMemory(Pool, PoolStructSize); - - /* initialize the session heap */ - ExInitializeFastMutex(&Pool->Lock); - Pool->PoolSize = ROUND_UP(MaximumPoolSize, PAGE_SIZE); - Pool->PoolFree = Pool->PoolSize; - Pool->SharedSectionCount = 0; - Pool->SectionsArray.Next = NULL; - Pool->SectionsArray.nEntries = ((PoolStructSize - sizeof(SHARED_SECTION_POOL)) / - sizeof(SHARED_SECTION)) - 1; - - ASSERT(Pool->SectionsArray.nEntries > 0); - - *SharedSectionPool = Pool; - - return STATUS_SUCCESS; - } - - return STATUS_INSUFFICIENT_RESOURCES; -} - - -VOID INTERNAL_CALL -IntUserFreeSharedSectionPool(IN PSHARED_SECTION_POOL SharedSectionPool) -{ - PSHARED_SECTIONS_ARRAY Array, OldArray; - PSHARED_SECTION SharedSection, LastSharedSection; - - ASSERT(SharedSectionPool); - - Array = &SharedSectionPool->SectionsArray; - - ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&SharedSectionPool->Lock); - while(SharedSectionPool->SharedSectionCount > 0 && Array != NULL) - { - for(SharedSection = Array->SharedSection, LastSharedSection = SharedSection + Array->nEntries; - SharedSection != LastSharedSection && SharedSectionPool->SharedSectionCount > 0; - SharedSection++) - { - if(SharedSection->SectionObject != NULL) - { - ASSERT(SharedSection->SystemMappedBase); - - /* FIXME - use MmUnmapViewInSessionSpace() once implemented! */ - MmUnmapViewInSystemSpace(SharedSection->SystemMappedBase); - /* dereference the keep-alive reference so the section get's deleted */ - ObDereferenceObject(SharedSection->SectionObject); - - SharedSectionPool->SharedSectionCount--; - } - } - - OldArray = Array; - Array = Array->Next; - - /* all shared sections in this array were freed, link the following array to - the main session heap and free this array */ - SharedSectionPool->SectionsArray.Next = Array; - ExFreePool(OldArray); - } - - ASSERT(SharedSectionPool->SectionsArray.Next == NULL); - ASSERT(SharedSectionPool->SharedSectionCount == 0); - - ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&SharedSectionPool->Lock); -} - - -NTSTATUS INTERNAL_CALL -IntUserCreateSharedSection(IN PSHARED_SECTION_POOL SharedSectionPool, - IN OUT PVOID *SystemMappedBase, - IN OUT ULONG *SharedSectionSize) -{ - PSHARED_SECTIONS_ARRAY Array, LastArray; - PSHARED_SECTION FreeSharedSection, SharedSection, LastSharedSection; - LARGE_INTEGER SectionSize; - ULONG Size; - NTSTATUS Status; - - ASSERT(SharedSectionPool && SharedSectionSize && (*SharedSectionSize) > 0 && SystemMappedBase); - - FreeSharedSection = NULL; - - Size = ROUND_UP(*SharedSectionSize, PAGE_SIZE); - - ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&SharedSectionPool->Lock); - - if(Size > SharedSectionPool->PoolFree) - { - ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&SharedSectionPool->Lock); - DPRINT1("Shared Section Pool limit (0x%x KB) reached, attempted to allocate a 0x%x KB shared section!\n", - SharedSectionPool->PoolSize / 1024, (*SharedSectionSize) / 1024); - return STATUS_INSUFFICIENT_RESOURCES; - } - - /* walk the array to find a free entry */ - for(Array = &SharedSectionPool->SectionsArray, LastArray = Array; - Array != NULL && FreeSharedSection == NULL; - Array = Array->Next) - { - LastArray = Array; - - for(SharedSection = Array->SharedSection, LastSharedSection = SharedSection + Array->nEntries; - SharedSection != LastSharedSection; - SharedSection++) - { - if(SharedSection->SectionObject == NULL) - { - FreeSharedSection = SharedSection; - break; - } - } - - if(Array->Next != NULL) - { - LastArray = Array; - } - } - - ASSERT(LastArray); - - if(FreeSharedSection == NULL) - { - ULONG nNewEntries; - PSHARED_SECTIONS_ARRAY NewArray; - - ASSERT(LastArray->Next == NULL); - - /* couldn't find a free entry in the array, extend the array */ - - nNewEntries = ((PAGE_SIZE - sizeof(SHARED_SECTIONS_ARRAY)) / sizeof(SHARED_SECTION)) + 1; - NewArray = ExAllocatePoolWithTag(NonPagedPool, - sizeof(SHARED_SECTIONS_ARRAY) + ((nNewEntries - 1) * - sizeof(SHARED_SECTION)), - TAG_SSECTPOOL); - if(NewArray == NULL) - { - ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&SharedSectionPool->Lock); - DPRINT1("Failed to allocate new array for shared sections!\n"); - return STATUS_INSUFFICIENT_RESOURCES; - } - - NewArray->nEntries = nNewEntries; - NewArray->Next = NULL; - LastArray->Next = NewArray; - - Array = NewArray; - FreeSharedSection = &Array->SharedSection[0]; - } - - ASSERT(FreeSharedSection); - - /* now allocate a real section */ - - SectionSize.QuadPart = Size; - Status = MmCreateSection((PVOID)&FreeSharedSection->SectionObject, - SECTION_ALL_ACCESS, - NULL, - &SectionSize, - PAGE_EXECUTE_READWRITE, - SEC_COMMIT, - NULL, - NULL); - if(NT_SUCCESS(Status)) - { - Status = MmMapViewInSystemSpace(FreeSharedSection->SectionObject, - &FreeSharedSection->SystemMappedBase, - &FreeSharedSection->ViewSize); - if(NT_SUCCESS(Status)) - { - (*SharedSectionSize) -= Size; - SharedSectionPool->SharedSectionCount++; - - *SystemMappedBase = FreeSharedSection->SystemMappedBase; - *SharedSectionSize = FreeSharedSection->ViewSize; - } - else - { - ObDereferenceObject(FreeSharedSection->SectionObject); - FreeSharedSection->SectionObject = NULL; - DPRINT1("Failed to map the shared section into system space! Status 0x%x\n", Status); - } - } - - ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&SharedSectionPool->Lock); - - return Status; -} - - -NTSTATUS INTERNAL_CALL -InUserDeleteSharedSection(PSHARED_SECTION_POOL SharedSectionPool, - PVOID SystemMappedBase) -{ - PSHARED_SECTIONS_ARRAY Array; - PSECTION_OBJECT SectionObject; - PSHARED_SECTION SharedSection, LastSharedSection; - NTSTATUS Status; - - ASSERT(SharedSectionPool && SystemMappedBase); - - SectionObject = NULL; - - ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&SharedSectionPool->Lock); - - for(Array = &SharedSectionPool->SectionsArray; - Array != NULL && SectionObject == NULL; - Array = Array->Next) - { - for(SharedSection = Array->SharedSection, LastSharedSection = SharedSection + Array->nEntries; - SharedSection != LastSharedSection; - SharedSection++) - { - if(SharedSection->SystemMappedBase == SystemMappedBase) - { - SectionObject = SharedSection->SectionObject; - SharedSection->SectionObject = NULL; - SharedSection->SystemMappedBase = NULL; - - ASSERT(SharedSectionPool->SharedSectionCount > 0); - SharedSectionPool->SharedSectionCount--; - break; - } - } - } - - ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&SharedSectionPool->Lock); - - if(SectionObject != NULL) - { - Status = MmUnmapViewInSystemSpace(SystemMappedBase); - ObDereferenceObject(SectionObject); - } - else - { - DPRINT1("Couldn't find and delete a shared section with SystemMappedBase=0x%x!\n", SystemMappedBase); - Status = STATUS_UNSUCCESSFUL; - } - - return Status; -} - - -NTSTATUS INTERNAL_CALL -IntUserMapSharedSection(IN PSHARED_SECTION_POOL SharedSectionPool, - IN PEPROCESS Process, - IN PVOID SystemMappedBase, - IN PLARGE_INTEGER SectionOffset OPTIONAL, - IN OUT PVOID *UserMappedBase, - IN PULONG ViewSize OPTIONAL, - IN BOOLEAN ReadOnly) -{ - PSHARED_SECTIONS_ARRAY Array; - PSECTION_OBJECT SectionObject; - PSHARED_SECTION SharedSection, LastSharedSection; - NTSTATUS Status; - - ASSERT(SharedSectionPool && Process && SystemMappedBase && UserMappedBase); - - SectionObject = NULL; - SharedSection = NULL; - - ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&SharedSectionPool->Lock); - - for(Array = &SharedSectionPool->SectionsArray; - Array != NULL && SectionObject == NULL; - Array = Array->Next) - { - for(SharedSection = Array->SharedSection, LastSharedSection = SharedSection + Array->nEntries; - SharedSection != LastSharedSection; - SharedSection++) - { - if(SharedSection->SystemMappedBase == SystemMappedBase) - { - SectionObject = SharedSection->SectionObject; - break; - } - } - } - - if(SectionObject != NULL) - { - ULONG RealViewSize = (ViewSize ? min(*ViewSize, SharedSection->ViewSize) : SharedSection->ViewSize); - - ObReferenceObjectByPointer(SectionObject, - (ReadOnly ? SECTION_MAP_READ : SECTION_MAP_READ | SECTION_MAP_WRITE), - NULL, - KernelMode); - - Status = MmMapViewOfSection(SectionObject, - Process, - UserMappedBase, - 0, - 0, - SectionOffset, - &RealViewSize, - ViewUnmap, /* not sure if we should inherit it... */ - MEM_COMMIT, - (ReadOnly ? PAGE_READONLY : PAGE_READWRITE)); - if(!NT_SUCCESS(Status)) - { - DPRINT1("Failed to map shared section (readonly=%d) into user memory! Status: 0x%x\n", ReadOnly, Status); - } - } - else - { - DPRINT1("Couldn't find and map a shared section with SystemMappedBase=0x%x!\n", SystemMappedBase); - Status = STATUS_UNSUCCESSFUL; - } - - ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&SharedSectionPool->Lock); - - return Status; -} - - -NTSTATUS INTERNAL_CALL -IntUserUnMapSharedSection(IN PSHARED_SECTION_POOL SharedSectionPool, - IN PEPROCESS Process, - IN PVOID SystemMappedBase, - IN PVOID UserMappedBase) -{ - PSHARED_SECTIONS_ARRAY Array; - PSECTION_OBJECT SectionObject; - PSHARED_SECTION SharedSection, LastSharedSection; - NTSTATUS Status; - - ASSERT(SharedSectionPool && Process && SystemMappedBase && UserMappedBase); - - SectionObject = NULL; - - ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&SharedSectionPool->Lock); - - for(Array = &SharedSectionPool->SectionsArray; - Array != NULL && SectionObject == NULL; - Array = Array->Next) - { - for(SharedSection = Array->SharedSection, LastSharedSection = SharedSection + Array->nEntries; - SharedSection != LastSharedSection; - SharedSection++) - { - if(SharedSection->SystemMappedBase == SystemMappedBase) - { - SectionObject = SharedSection->SectionObject; - break; - } - } - } - - ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&SharedSectionPool->Lock); - - if(SectionObject != NULL) - { - Status = MmUnmapViewOfSection(Process, - UserMappedBase); - ObDereferenceObject(SectionObject); - if(!NT_SUCCESS(Status)) - { - DPRINT1("Failed to unmap shared section UserMappedBase=0x%x! Status: 0x%x\n", UserMappedBase, Status); - } - } - else - { - DPRINT1("Couldn't find and unmap a shared section with SystemMappedBase=0x%x!\n", SystemMappedBase); - Status = STATUS_UNSUCCESSFUL; - } - - return Status; -} Modified: trunk/reactos/subsystems/win32/win32k/ntuser/windc.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/windc.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/windc.c Sat Apr 1 19:25:40 2006 @@ -123,7 +123,7 @@ defaultDCstate = NtGdiGetDCState(Dce->hDC); DC_SetOwnership(defaultDCstate, NULL); } - GDIOBJ_SetOwnership(Dce->Self, NULL); + GDIOBJ_SetOwnership(GdiHandleTable, Dce->Self, NULL); DC_SetOwnership(Dce->hDC, NULL); Dce->hwndCurrent = (Window ? Window->hSelf : NULL); Dce->hClipRgn = NULL; @@ -641,9 +641,9 @@ SetDCHook(dce->hDC, NULL, 0L); #endif - if(Force && !GDIOBJ_OwnedByCurrentProcess(dce->hDC)) - { - GDIOBJ_SetOwnership(dce->Self, PsGetCurrentProcess()); + if(Force && !GDIOBJ_OwnedByCurrentProcess(GdiHandleTable, dce->hDC)) + { + GDIOBJ_SetOwnership(GdiHandleTable, dce->Self, PsGetCurrentProcess()); DC_SetOwnership(dce->hDC, PsGetCurrentProcess()); } Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c Sat Apr 1 19:25:40 2006 @@ -1516,7 +1516,7 @@ if (hBitmap == NULL) return 0; - Bitmap = GDIOBJ_LockObj(hBitmap, GDI_OBJECT_TYPE_BITMAP); + Bitmap = GDIOBJ_LockObj(GdiHandleTable, hBitmap, GDI_OBJECT_TYPE_BITMAP); if (Bitmap == NULL) return 0; @@ -1536,7 +1536,7 @@ ExFreePool (buf); } - GDIOBJ_UnlockObjByPtr(Bitmap); + GDIOBJ_UnlockObjByPtr(GdiHandleTable, Bitmap); return res; } Modified: trunk/reactos/subsystems/win32/win32k/objects/brush.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/brush.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/brush.c Sat Apr 1 19:25:40 2006 @@ -42,7 +42,7 @@ if(pBrush->flAttrs & (GDIBRUSH_IS_HATCH | GDIBRUSH_IS_BITMAP)) { ASSERT(pBrush->hbmPattern); - GDIOBJ_SetOwnership(pBrush->hbmPattern, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(GdiHandleTable, pBrush->hbmPattern, PsGetCurrentProcess()); NtGdiDeleteObject(pBrush->hbmPattern); } @@ -297,7 +297,7 @@ BrushObject->hbmPattern = hPattern; /* FIXME: Fill in the rest of fields!!! */ - GDIOBJ_SetOwnership(hPattern, NULL); + GDIOBJ_SetOwnership(GdiHandleTable, hPattern, NULL); BRUSHOBJ_UnlockBrush(BrushObject); @@ -340,7 +340,7 @@ BrushObject->hbmPattern = hPattern; BrushObject->BrushAttr.lbColor = Color & 0xFFFFFF; - GDIOBJ_SetOwnership(hPattern, NULL); + GDIOBJ_SetOwnership(GdiHandleTable, hPattern, NULL); BRUSHOBJ_UnlockBrush(BrushObject); @@ -377,7 +377,7 @@ BrushObject->hbmPattern = hPattern; /* FIXME: Fill in the rest of fields!!! */ - GDIOBJ_SetOwnership(hPattern, NULL); + GDIOBJ_SetOwnership(GdiHandleTable, hPattern, NULL); BRUSHOBJ_UnlockBrush(BrushObject); Modified: trunk/reactos/subsystems/win32/win32k/objects/cliprgn.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/cliprgn.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/cliprgn.c Sat Apr 1 19:25:40 2006 @@ -81,7 +81,7 @@ if (dc->w.hVisRgn == NULL) { dc->w.hVisRgn = NtGdiCreateRectRgn(0, 0, 0, 0); - GDIOBJ_CopyOwnership(hdc, dc->w.hVisRgn); + GDIOBJ_CopyOwnership(GdiHandleTable, hdc, dc->w.hVisRgn); } else { Modified: trunk/reactos/subsystems/win32/win32k/objects/color.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/color.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/color.c Sat Apr 1 19:25:40 2006 @@ -616,7 +616,7 @@ if(!hgdiobj) return Ret; - ptr = GDIOBJ_LockObj(hgdiobj, GDI_OBJECT_TYPE_DONTCARE); + ptr = GDIOBJ_LockObj(GdiHandleTable, hgdiobj, GDI_OBJECT_TYPE_DONTCARE); if (ptr == 0) { SetLastWin32Error(ERROR_INVALID_HANDLE); @@ -642,7 +642,7 @@ break; } - GDIOBJ_UnlockObjByPtr(ptr); + GDIOBJ_UnlockObjByPtr(GdiHandleTable, ptr); return Ret; } Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Sat Apr 1 19:25:40 2006 @@ -1065,7 +1065,7 @@ { PDC DCToDelete; - if (!GDIOBJ_OwnedByCurrentProcess(DCHandle)) + if (!GDIOBJ_OwnedByCurrentProcess(GdiHandleTable, DCHandle)) { SetLastWin32Error(ERROR_INVALID_HANDLE); return FALSE; @@ -1739,7 +1739,7 @@ INT Result = 0; DWORD ObjectType; - GdiObject = GDIOBJ_LockObj(Handle, GDI_OBJECT_TYPE_DONTCARE); + GdiObject = GDIOBJ_LockObj(GdiHandleTable, Handle, GDI_OBJECT_TYPE_DONTCARE); if (NULL == GdiObject) { SetLastWin32Error(ERROR_INVALID_HANDLE); @@ -1780,7 +1780,7 @@ break; } - GDIOBJ_UnlockObjByPtr(GdiObject); + GDIOBJ_UnlockObjByPtr(GdiHandleTable, GdiObject); return Result; } @@ -1857,7 +1857,7 @@ INT result; DWORD objectType; - ptr = GDIOBJ_LockObj(handle, GDI_OBJECT_TYPE_DONTCARE); + ptr = GDIOBJ_LockObj(GdiHandleTable, handle, GDI_OBJECT_TYPE_DONTCARE); if (ptr == 0) { SetLastWin32Error(ERROR_INVALID_HANDLE); @@ -1912,7 +1912,7 @@ result = 0; break; } - GDIOBJ_UnlockObjByPtr(ptr); + GDIOBJ_UnlockObjByPtr(GdiHandleTable, ptr); return result; } @@ -2263,7 +2263,7 @@ RtlCopyMemory(Buf, Driver->Buffer, Driver->MaximumLength); } - hDC = (HDC) GDIOBJ_AllocObj(GDI_OBJECT_TYPE_DC); + hDC = (HDC) GDIOBJ_AllocObj(GdiHandleTable, GDI_OBJECT_TYPE_DC); if (hDC == NULL) { if(Buf) @@ -2339,7 +2339,7 @@ VOID FASTCALL DC_FreeDC(HDC DCToFree) { - if (!GDIOBJ_FreeObj(DCToFree, GDI_OBJECT_TYPE_DC)) + if (!GDIOBJ_FreeObj(GdiHandleTable, DCToFree, GDI_OBJECT_TYPE_DC)) { DPRINT("DC_FreeDC failed\n"); } @@ -2415,21 +2415,21 @@ { PDC DC; - GDIOBJ_SetOwnership(hDC, Owner); + GDIOBJ_SetOwnership(GdiHandleTable, hDC, Owner); DC = DC_LockDc(hDC); if (NULL != DC) { if (NULL != DC->w.hClipRgn) { - GDIOBJ_CopyOwnership(hDC, DC->w.hClipRgn); + GDIOBJ_CopyOwnership(GdiHandleTable, hDC, DC->w.hClipRgn); } if (NULL != DC->w.hVisRgn) { - GDIOBJ_CopyOwnership(hDC, DC->w.hVisRgn); + GDIOBJ_CopyOwnership(GdiHandleTable, hDC, DC->w.hVisRgn); } if (NULL != DC->w.hGCClipRgn) { - GDIOBJ_CopyOwnership(hDC, DC->w.hGCClipRgn); + GDIOBJ_CopyOwnership(GdiHandleTable, hDC, DC->w.hGCClipRgn); } DC_UnlockDc(DC); } Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c Sat Apr 1 19:25:40 2006 @@ -40,19 +40,6 @@ /* apparently the first 10 entries are never used in windows as they are empty */ #define RESERVE_ENTRIES_COUNT 10 -typedef struct _GDI_HANDLE_TABLE -{ - /* the table must be located at the beginning of this structure so it can be - properly mapped! */ - GDI_TABLE_ENTRY Entries[GDI_HANDLE_COUNT]; - - PPAGED_LOOKASIDE_LIST LookasideLists; - - SLIST_HEADER FreeEntriesHead; - SLIST_ENTRY FreeEntries[((GDI_HANDLE_COUNT * sizeof(GDI_TABLE_ENTRY)) << 3) / - (sizeof(SLIST_ENTRY) << 3)]; -} GDI_HANDLE_TABLE, *PGDI_HANDLE_TABLE; - typedef struct { ULONG Type; @@ -63,7 +50,7 @@ /* * Dummy GDI Cleanup Callback */ -BOOL INTERNAL_CALL +static BOOL INTERNAL_CALL GDI_CleanupDummy(PVOID ObjectBody) { return TRUE; @@ -71,7 +58,7 @@ /* Testing shows that regions are the most used GDIObj type, so put that one first for performance */ -const +static const GDI_OBJ_INFO ObjInfo[] = { /* Type */ /* Size */ /* CleanupProc */ @@ -96,7 +83,6 @@ #define OBJTYPE_COUNT (sizeof(ObjInfo) / sizeof(ObjInfo[0])) -static PGDI_HANDLE_TABLE HandleTable = NULL; static LARGE_INTEGER ShortDelay; #define DelayExecution() \ @@ -113,57 +99,80 @@ * Allocate GDI object table. * \param Size - number of entries in the object table. */ -static PGDI_HANDLE_TABLE INTERNAL_CALL -GDIOBJ_iAllocHandleTable(VOID) -{ - PGDI_HANDLE_TABLE handleTable; - ULONG htSize; +PGDI_HANDLE_TABLE INTERNAL_CALL +GDIOBJ_iAllocHandleTable(OUT PSECTION_OBJECT *SectionObject) +{ + PGDI_HANDLE_TABLE HandleTable = NULL; + LARGE_INTEGER htSize; UINT ObjType; UINT i; + ULONG ViewSize = 0; PGDI_TABLE_ENTRY Entry; - - handleTable = NULL; - htSize = sizeof(GDI_HANDLE_TABLE); - - IntUserCreateSharedSection(SessionSharedSectionPool, - (PVOID*)&handleTable, - &htSize); - ASSERT( handleTable ); - RtlZeroMemory(handleTable, sizeof(GDI_HANDLE_TABLE)); + NTSTATUS Status; + + ASSERT(SectionObject != NULL); + + htSize.QuadPart = sizeof(GDI_HANDLE_TABLE); + + Status = MmCreateSection((PVOID*)SectionObject, + SECTION_ALL_ACCESS, + NULL, + &htSize, + PAGE_READWRITE, + SEC_COMMIT, + NULL, + NULL); + if (!NT_SUCCESS(Status)) + return NULL; + + /* FIXME - use MmMapViewInSessionSpace once available! */ + Status = MmMapViewInSystemSpace(*SectionObject, + (PVOID*)&HandleTable, + &ViewSize); + if (!NT_SUCCESS(Status)) + { + ObDereferenceObject(*SectionObject); + *SectionObject = NULL; + return NULL; + } + + RtlZeroMemory(HandleTable, sizeof(GDI_HANDLE_TABLE)); /* * initialize the free entry cache */ - InitializeSListHead(&handleTable->FreeEntriesHead); + InitializeSListHead(&HandleTable->FreeEntriesHead); Entry = &HandleTable->Entries[RESERVE_ENTRIES_COUNT]; for(i = GDI_HANDLE_COUNT - 1; i >= RESERVE_ENTRIES_COUNT; i--) { - InterlockedPushEntrySList(&handleTable->FreeEntriesHead, &handleTable->FreeEntries[i]); - } - - handleTable->LookasideLists = ExAllocatePoolWithTag(NonPagedPool, + InterlockedPushEntrySList(&HandleTable->FreeEntriesHead, &HandleTable->FreeEntries[i]); + } + + HandleTable->LookasideLists = ExAllocatePoolWithTag(NonPagedPool, OBJTYPE_COUNT * sizeof(PAGED_LOOKASIDE_LIST), TAG_GDIHNDTBLE); - if(handleTable->LookasideLists == NULL) - { - InUserDeleteSharedSection(SessionSharedSectionPool, - handleTable); + if(HandleTable->LookasideLists == NULL) + { + MmUnmapViewInSystemSpace(HandleTable); + ObDereferenceObject(*SectionObject); + *SectionObject = NULL; return NULL; } for(ObjType = 0; ObjType < OBJTYPE_COUNT; ObjType++) { - ExInitializePagedLookasideList(handleTable->LookasideLists + ObjType, NULL, NULL, 0, + ExInitializePagedLookasideList(HandleTable->LookasideLists + ObjType, NULL, NULL, 0, ObjInfo[ObjType].Size + sizeof(GDIOBJHDR), TAG_GDIOBJ, 0); } ShortDelay.QuadPart = -5000LL; /* FIXME - 0.5 ms? */ - return handleTable; + return HandleTable; } static __inline PPAGED_LOOKASIDE_LIST -FindLookasideList(DWORD ObjectType) +FindLookasideList(PGDI_HANDLE_TABLE HandleTable, + DWORD ObjectType) { int Index; @@ -227,7 +236,7 @@ #define H 1024 static struct DbgOpenGDIHandle h[H]; -void IntDumpHandleTable() +void IntDumpHandleTable(PGDI_HANDLE_TABLE HandleTable) { int i, n = 0, j, k, J; @@ -318,9 +327,9 @@ */ HGDIOBJ INTERNAL_CALL #ifdef GDI_DEBUG -GDIOBJ_AllocObjDbg(const char* file, int line, ULONG ObjectType) +GDIOBJ_AllocObjDbg(PGDI_HANDLE_TABLE HandleTable, const char* file, int line, ULONG ObjectType) #else /* !GDI_DEBUG */ -GDIOBJ_AllocObj(ULONG ObjectType) +GDIOBJ_AllocObj(PGDI_HANDLE_TABLE HandleTable, ULONG ObjectType) #endif /* GDI_DEBUG */ { PW32PROCESS W32Process; @@ -339,7 +348,7 @@ ASSERT(ObjectType != GDI_OBJECT_TYPE_DONTCARE); - LookasideList = FindLookasideList(ObjectType); + LookasideList = FindLookasideList(HandleTable, ObjectType); if(LookasideList != NULL) { newObject = ExAllocateFromPagedLookasideList(LookasideList); @@ -434,7 +443,7 @@ ExFreeToPagedLookasideList(LookasideList, newObject); DPRINT1("Failed to insert gdi object into the handle table, no handles left!\n"); #ifdef GDI_DEBUG - IntDumpHandleTable(); + IntDumpHandleTable(HandleTable); #endif /* GDI_DEBUG */ } else @@ -461,9 +470,9 @@ */ BOOL INTERNAL_CALL #ifdef GDI_DEBUG -GDIOBJ_FreeObjDbg(const char* file, int line, HGDIOBJ hObj, DWORD ObjectType) +GDIOBJ_FreeObjDbg(PGDI_HANDLE_TABLE HandleTable, const char* file, int line, HGDIOBJ hObj, DWORD ObjectType) #else /* !GDI_DEBUG */ -GDIOBJ_FreeObj(HGDIOBJ hObj, DWORD ObjectType) +GDIOBJ_FreeObj(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ObjectType) #endif /* GDI_DEBUG */ { PGDI_TABLE_ENTRY Entry; @@ -535,7 +544,7 @@ Ret = RunCleanupCallback(GDIHdrToBdy(GdiHdr), Type); /* Now it's time to free the memory */ - LookasideList = FindLookasideList(Type); + LookasideList = FindLookasideList(HandleTable, Type); if(LookasideList != NULL) { ExFreeToPagedLookasideList(LookasideList, GdiHdr); @@ -601,18 +610,6 @@ } return FALSE; -} - -/*! - * Initialization of the GDI object engine. -*/ -VOID INTERNAL_CALL -InitGdiObjectHandleTable (VOID) -{ - DPRINT("InitGdiObjectHandleTable\n"); - - HandleTable = GDIOBJ_iAllocHandleTable(); - DPRINT("HandleTable: %x\n", HandleTable); } /*! @@ -626,7 +623,7 @@ DPRINT("NtGdiDeleteObject handle 0x%08x\n", hObject); return NULL != hObject - ? GDIOBJ_FreeObj(hObject, GDI_OBJECT_TYPE_DONTCARE) : FALSE; + ? GDIOBJ_FreeObj(GdiHandleTable, hObject, GDI_OBJECT_TYPE_DONTCARE) : FALSE; } /*! @@ -634,7 +631,7 @@ * \param Process - PID of the process that will be destroyed. */ BOOL INTERNAL_CALL -GDI_CleanupForProcess (struct _EPROCESS *Process) +GDI_CleanupForProcess (PGDI_HANDLE_TABLE HandleTable, struct _EPROCESS *Process) { PGDI_TABLE_ENTRY Entry, End; PEPROCESS CurrentProcess; @@ -673,7 +670,7 @@ simply ignore this fact here. */ ObjectHandle = (HGDIOBJ)(Index | (Entry->Type & 0xFFFF0000)); - if(GDIOBJ_FreeObj(ObjectHandle, GDI_OBJECT_TYPE_DONTCARE) && + if(GDIOBJ_FreeObj(HandleTable, ObjectHandle, GDI_OBJECT_TYPE_DONTCARE) && W32Process->GDIObjects == 0) { /* there are no more gdi handles for this process, bail */ @@ -705,9 +702,9 @@ */ PGDIOBJ INTERNAL_CALL #ifdef GDI_DEBUG -GDIOBJ_LockObjDbg (const char* file, int line, HGDIOBJ hObj, DWORD ObjectType) +GDIOBJ_LockObjDbg (PGDI_HANDLE_TABLE HandleTable, const char* file, int line, HGDIOBJ hObj, DWORD ObjectType) #else /* !GDI_DEBUG */ -GDIOBJ_LockObj (HGDIOBJ hObj, DWORD ObjectType) +GDIOBJ_LockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ObjectType) #endif /* GDI_DEBUG */ { USHORT HandleIndex; @@ -858,9 +855,9 @@ */ PGDIOBJ INTERNAL_CALL #ifdef GDI_DEBUG -GDIOBJ_ShareLockObjDbg (const char* file, int line, HGDIOBJ hObj, DWORD ObjectType) +GDIOBJ_ShareLockObjDbg (PGDI_HANDLE_TABLE HandleTable, const char* file, int line, HGDIOBJ hObj, DWORD ObjectType) #else /* !GDI_DEBUG */ -GDIOBJ_ShareLockObj (HGDIOBJ hObj, DWORD ObjectType) +GDIOBJ_ShareLockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ObjectType) #endif /* GDI_DEBUG */ { USHORT HandleIndex; @@ -989,7 +986,7 @@ * \param Object Object pointer (as returned by GDIOBJ_LockObj). */ VOID INTERNAL_CALL -GDIOBJ_UnlockObjByPtr(PGDIOBJ Object) +GDIOBJ_UnlockObjByPtr(PGDI_HANDLE_TABLE HandleTable, PGDIOBJ Object) { PGDIOBJHDR GdiHdr = GDIBdyToHdr(Object); #ifdef GDI_DEBUG @@ -1005,7 +1002,7 @@ BOOL INTERNAL_CALL -GDIOBJ_OwnedByCurrentProcess(HGDIOBJ ObjectHandle) +GDIOBJ_OwnedByCurrentProcess(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ ObjectHandle) { PGDI_TABLE_ENTRY Entry; HANDLE ProcessId; @@ -1029,7 +1026,7 @@ } BOOL INTERNAL_CALL -GDIOBJ_ConvertToStockObj(HGDIOBJ *hObj) +GDIOBJ_ConvertToStockObj(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ *hObj) { /* * FIXME !!!!! THIS FUNCTION NEEDS TO BE FIXED - IT IS NOT SAFE WHEN OTHER THREADS @@ -1167,7 +1164,7 @@ } void INTERNAL_CALL -GDIOBJ_SetOwnership(HGDIOBJ ObjectHandle, PEPROCESS NewOwner) +GDIOBJ_SetOwnership(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ ObjectHandle, PEPROCESS NewOwner) { PGDI_TABLE_ENTRY Entry; HANDLE ProcessId, LockedProcessId, PrevProcId; @@ -1302,7 +1299,7 @@ } void INTERNAL_CALL -GDIOBJ_CopyOwnership(HGDIOBJ CopyFrom, HGDIOBJ CopyTo) +GDIOBJ_CopyOwnership(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ CopyFrom, HGDIOBJ CopyTo) { PGDI_TABLE_ENTRY FromEntry; PETHREAD Thread; @@ -1347,14 +1344,14 @@ /* FIXME */ if(NT_SUCCESS(PsLookupProcessByProcessId((HANDLE)((ULONG_PTR)FromPrevProcId & ~0x1), &ProcessTo))) { - GDIOBJ_SetOwnership(CopyTo, ProcessTo); + GDIOBJ_SetOwnership(HandleTable, CopyTo, ProcessTo); ObDereferenceObject(ProcessTo); } } else { /* mark the object as global */ - GDIOBJ_SetOwnership(CopyTo, NULL); + GDIOBJ_SetOwnership(HandleTable, CopyTo, NULL); } (void)InterlockedExchangePointer(&FromEntry->ProcessId, FromPrevProcId); @@ -1417,23 +1414,33 @@ } PVOID INTERNAL_CALL -GDI_MapHandleTable(PEPROCESS Process) -{ - ULONG TableSize = sizeof(HandleTable->Entries); - PVOID MappedGdiTable = NULL; /* FIXME - try preferred GDI_HANDLE_TABLE_BASE_ADDRESS? */ - NTSTATUS Status = IntUserMapSharedSection(SessionSharedSectionPool, - Process, - HandleTable, - NULL, - &MappedGdiTable, - &TableSize, - TRUE); - if(NT_SUCCESS(Status)) - { - return MappedGdiTable; - } - - return NULL; +GDI_MapHandleTable(PSECTION_OBJECT SectionObject, PEPROCESS Process) +{ + PVOID MappedView = NULL; + NTSTATUS Status; + LARGE_INTEGER Offset; + ULONG ViewSize = sizeof(GDI_HANDLE_TABLE); + + Offset.QuadPart = 0; + + ASSERT(SectionObject != NULL); + ASSERT(Process != NULL); + + Status = MmMapViewOfSection(SectionObject, + Process, + &MappedView, + 0, + 0, + &Offset, + &ViewSize, + ViewUnmap, + SEC_NO_CHANGE, + PAGE_READONLY); + + if (!NT_SUCCESS(Status)) + return NULL; + + return MappedView; } /* EOF */ Modified: trunk/reactos/subsystems/win32/win32k/objects/palobj.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/palobj.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/palobj.c Sat Apr 1 19:25:40 2006 @@ -63,7 +63,7 @@ HPALETTE NewPalette; PPALGDI PalGDI; - NewPalette = (HPALETTE) GDIOBJ_AllocObj(GDI_OBJECT_TYPE_PALETTE); + NewPalette = (HPALETTE) GDIOBJ_AllocObj(GdiHandleTable, GDI_OBJECT_TYPE_PALETTE); if (NULL == NewPalette) { return NULL; @@ -112,7 +112,7 @@ PPALGDI PalGDI; unsigned i; - NewPalette = (HPALETTE) GDIOBJ_AllocObj(GDI_OBJECT_TYPE_PALETTE); + NewPalette = (HPALETTE) GDIOBJ_AllocObj(GdiHandleTable, GDI_OBJECT_TYPE_PALETTE); if (NULL == NewPalette) { return NULL; Modified: trunk/reactos/subsystems/win32/win32k/objects/region.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/region.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/region.c Sat Apr 1 19:25:40 2006 @@ -1905,7 +1905,7 @@ HRGN hReg; PROSRGNDATA pReg; - if ((hReg = (HRGN) GDIOBJ_AllocObj(GDI_OBJECT_TYPE_REGION))) + if ((hReg = (HRGN) GDIOBJ_AllocObj(GdiHandleTable, GDI_OBJECT_TYPE_REGION))) { if (NULL != (pReg = RGNDATA_LockRgn(hReg))) { Modified: trunk/reactos/subsystems/win32/win32k/objects/stockobj.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/stockobj.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/stockobj.c Sat Apr 1 19:25:40 2006 @@ -147,7 +147,7 @@ { if (NULL != StockObjects[Object]) { - GDIOBJ_ConvertToStockObj(&StockObjects[Object]); + GDIOBJ_ConvertToStockObj(GdiHandleTable, &StockObjects[Object]); } } @@ -268,7 +268,7 @@ SysColorBrushes[i] = IntGdiCreateSolidBrush(SysColors[i]); if(SysColorBrushes[i] != NULL) { - GDIOBJ_ConvertToStockObj((HGDIOBJ*)&SysColorBrushes[i]); + GDIOBJ_ConvertToStockObj(GdiHandleTable, (HGDIOBJ*)&SysColorBrushes[i]); } } } @@ -285,7 +285,7 @@ SysColorPens[i] = IntGdiCreatePenIndirect(&Pen); if(SysColorPens[i] != NULL) { - GDIOBJ_ConvertToStockObj((HGDIOBJ*)&SysColorPens[i]); + GDIOBJ_ConvertToStockObj(GdiHandleTable, (HGDIOBJ*)&SysColorPens[i]); } } } Modified: trunk/reactos/subsystems/win32/win32k/win32k.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/win…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/win32k.rbuild (original) +++ trunk/reactos/subsystems/win32/win32k/win32k.rbuild Sat Apr 1 19:25:40 2006 @@ -66,11 +66,11 @@ <file>copy.c</file> </compilationunit> <directory name="i386"> - <file>cos_asm.s</file> - <file>sin_asm.s</file> - <file>atan2_asm.s</file> - <file>floor_asm.s</file> - <file>ceil_asm.s</file> + <file>cos_asm.s</file> + <file>sin_asm.s</file> + <file>atan2_asm.s</file> + <file>floor_asm.s</file> + <file>ceil_asm.s</file> </directory> </directory> <directory name="ntddraw"> @@ -115,7 +115,6 @@ <file>winpos.c</file> <file>winsta.c</file> <file>object.c</file> - <file>ssec.c</file> </compilationunit> </directory> <directory name="objects">
19 years
1
0
0
0
[hyperion] 21432: - deleted temporary files, generated files, binaries - migrated project files to Visual C++ 2005 Express - the latest, the best, for free - converted to an Unicode application
by aleksey@studiocerebral.com
Author: hyperion Date: Sat Apr 1 19:02:38 2006 New Revision: 21432 URL:
http://svn.reactos.ru/svn/reactos?rev=21432&view=rev
Log: - deleted temporary files, generated files, binaries - migrated project files to Visual C++ 2005 Express - the latest, the best, for free - converted to an Unicode application Removed: trunk/rosapps/fraginator/Fraginator.exe trunk/rosapps/fraginator/Fraginator.mak trunk/rosapps/fraginator/Fraginator.suo trunk/rosapps/fraginator/unfrag.exe trunk/rosapps/fraginator/unfrag.mak trunk/rosapps/fraginator/unfrag.plg Modified: trunk/rosapps/fraginator/Defragment.cpp trunk/rosapps/fraginator/Defragment.h trunk/rosapps/fraginator/DriveVolume.cpp trunk/rosapps/fraginator/DriveVolume.h trunk/rosapps/fraginator/Fraginator.cpp trunk/rosapps/fraginator/Fraginator.h trunk/rosapps/fraginator/Fraginator.rc trunk/rosapps/fraginator/Fraginator.sln trunk/rosapps/fraginator/Fraginator.vcproj trunk/rosapps/fraginator/MainDialog.cpp trunk/rosapps/fraginator/ReportDialog.cpp trunk/rosapps/fraginator/Unfrag.cpp trunk/rosapps/fraginator/Unfrag.h trunk/rosapps/fraginator/default1.bin trunk/rosapps/fraginator/unfrag.vcproj Modified: trunk/rosapps/fraginator/Defragment.cpp URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Defragment.cpp?r…
============================================================================== --- trunk/rosapps/fraginator/Defragment.cpp (original) +++ trunk/rosapps/fraginator/Defragment.cpp Sat Apr 1 19:02:38 2006 @@ -6,16 +6,16 @@ // and fits it to a given length. If it has to truncate it will first truncate from the path, // substituting in periods. So you might end up with something like: // C:\Program Files\Micro...\Register.exe -int FitName (char *destination, const char *path, const char *filename, uint32 totalWidth) +int FitName (wchar_t *destination, const wchar_t *path, const wchar_t *filename, uint32 totalWidth) { uint32 pathLen=0; uint32 fnLen=0; uint32 halfTotLen=0; uint32 len4fn=0; /* number of chars remaining for filename after path is applied */ uint32 len4path=0; /* number of chars for path before filename is applied */ - char fmtStrPath[20]=""; - char fmtStrFile[20]=""; - char fmtString[40]=""; + wchar_t fmtStrPath[20]=L""; + wchar_t fmtStrFile[20]=L""; + wchar_t fmtString[40]=L""; /* assert (destination != NULL); @@ -24,8 +24,8 @@ assert (totalWidth != 0); */ - pathLen = strlen(path); - fnLen = strlen(filename); + pathLen = wcslen(path); + fnLen = wcslen(filename); if (!(totalWidth % 2)) halfTotLen=totalWidth / 2; else @@ -58,28 +58,28 @@ } /* if halfTotLen was adjusted above to avoid a rounding error, give the - extra char to the filename + extra wchar_t to the filename */ if (halfTotLen < (totalWidth/2)) len4path++; - if (pathLen > len4path) sprintf (fmtStrPath, "%%.%ds...\\", len4path-4); + if (pathLen > len4path) swprintf (fmtStrPath, L"%%.%ds...\\", len4path-4); else - sprintf (fmtStrPath, "%%s"); + swprintf (fmtStrPath, L"%%s"); - if (fnLen > len4fn) sprintf (fmtStrFile, "%%.%ds...", len4fn-3); + if (fnLen > len4fn) swprintf (fmtStrFile, L"%%.%ds...", len4fn-3); else - sprintf (fmtStrFile, "%%s"); - - strcpy (fmtString, fmtStrPath); - strcat (fmtString, fmtStrFile); - /*sprintf (fmtString, "%s%s", fmtStrPath, fmtStrFile);*/ - sprintf (destination, fmtString, path,filename); + swprintf (fmtStrFile, L"%%s"); + + wcscpy (fmtString, fmtStrPath); + wcscat (fmtString, fmtStrFile); + /*swprintf (fmtString, L"%s%s", fmtStrPath, fmtStrFile);*/ + swprintf (destination, fmtString, path,filename); return (1); } -Defragment::Defragment (string Name, DefragType DefragMethod) +Defragment::Defragment (wstring Name, DefragType DefragMethod) { Method = DefragMethod; DoLimitLength = true; @@ -91,10 +91,10 @@ StatusPercent = 0.0f; LastBMPUpdate = GetTickCount (); - SetStatusString ("Opening volume " + Name); + SetStatusString (L"Opening volume " + Name); if (!Volume.Open (Name)) { - SetStatusString ("Error opening volume " + Name); + SetStatusString (L"Error opening volume " + Name); Error = true; Done = true; StatusPercent = 100.0f; @@ -111,7 +111,7 @@ Stop (); while (!IsDoneYet() && !HasError()) { - SetStatusString ("Waiting for thread to stop ..."); + SetStatusString (L"Waiting for thread to stop ..."); Sleep (150); } } @@ -121,7 +121,7 @@ } -void Defragment::SetStatusString (string NewStatus) +void Defragment::SetStatusString (wstring NewStatus) { Lock (); StatusString = NewStatus; @@ -131,9 +131,9 @@ } -string Defragment::GetStatusString (void) -{ - string ReturnVal; +wstring Defragment::GetStatusString (void) +{ + wstring ReturnVal; Lock (); ReturnVal = StatusString; @@ -161,17 +161,17 @@ uint64 FirstFreeLCN; uint64 TotalClusters; uint64 ClustersProgress; - char PrintName[80]; + wchar_t PrintName[80]; int Width = 70; if (Error) goto DoneDefrag; // First thing: build a file list. - SetStatusString ("Getting volume bitmap"); + SetStatusString (L"Getting volume bitmap"); if (!Volume.GetBitmap()) { - SetStatusString ("Could not get volume " + DriveName + " bitmap"); + SetStatusString (L"Could not get volume " + DriveName + L" bitmap"); Error = true; goto DoneDefrag; } @@ -181,10 +181,10 @@ if (PleaseStop) goto DoneDefrag; - SetStatusString ("Obtaining volume geometry"); + SetStatusString (L"Obtaining volume geometry"); if (!Volume.ObtainInfo ()) { - SetStatusString ("Could not obtain volume " + DriveName + " geometry"); + SetStatusString (L"Could not obtain volume " + DriveName + L" geometry"); Error = true; goto DoneDefrag; } @@ -192,10 +192,10 @@ if (PleaseStop) goto DoneDefrag; - SetStatusString ("Building file database for volume " + DriveName); + SetStatusString (L"Building file database for volume " + DriveName); if (!Volume.BuildFileList (PleaseStop, StatusPercent)) { - SetStatusString ("Could not build file database for volume " + DriveName); + SetStatusString (L"Could not build file database for volume " + DriveName); Error = true; goto DoneDefrag; } @@ -203,7 +203,7 @@ if (PleaseStop) goto DoneDefrag; - SetStatusString ("Analyzing database for " + DriveName); + SetStatusString (L"Analyzing database for " + DriveName); TotalClusters = 0; for (i = 0; i < Volume.GetDBFileCount(); i++) { @@ -287,7 +287,7 @@ // What? They want us to pause? Oh ok. if (PleasePause) { - SetStatusString ("Paused"); + SetStatusString (L"Paused"); PleasePause = false; while (PleasePause == false) @@ -300,7 +300,7 @@ if (PleaseStop) { - SetStatusString ("Stopping"); + SetStatusString (L"Stopping"); break; } @@ -374,11 +374,11 @@ else if (!Result || Retry != 1) { // hmm. Wait for a moment, then update the drive bitmap - //SetStatusString ("(Reobtaining volume " + DriveName + " bitmap)"); + //SetStatusString (L"(Reobtaining volume " + DriveName + L" bitmap)"); if (!DoLimitLength) { - SetStatusString (GetStatusString() + string (" .")); + SetStatusString (GetStatusString() + wstring (L" .")); } if (Volume.GetBitmap ()) @@ -394,7 +394,7 @@ } else { - SetStatusString ("Could not re-obtain volume " + DriveName + " bitmap"); + SetStatusString (L"Could not re-obtain volume " + DriveName + L" bitmap"); Error = true; } } @@ -407,22 +407,22 @@ } DoneDefrag: - string OldStatus; + wstring OldStatus; OldStatus = GetStatusString (); StatusPercent = 99.999999f; - SetStatusString ("Closing volume " + DriveName); + SetStatusString (L"Closing volume " + DriveName); Volume.Close (); StatusPercent = 100.0f; - // If there was an error then the string has already been set + // If there was an error then the wstring has already been set if (Error) SetStatusString (OldStatus); else if (PleaseStop) - SetStatusString ("Volume " + DriveName + " defragmentation was stopped"); + SetStatusString (L"Volume " + DriveName + L" defragmentation was stopped"); else - SetStatusString ("Finished defragmenting " + DriveName); + SetStatusString (L"Finished defragmenting " + DriveName); Done = true; @@ -433,7 +433,7 @@ void Defragment::TogglePause (void) { Lock (); - SetStatusString ("Pausing ..."); + SetStatusString (L"Pausing ..."); PleasePause = true; Unlock (); @@ -444,7 +444,7 @@ void Defragment::Stop (void) { Lock (); - SetStatusString ("Stopping ..."); + SetStatusString (L"Stopping ..."); PleaseStop = true; Unlock (); Modified: trunk/rosapps/fraginator/Defragment.h URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Defragment.h?rev…
============================================================================== --- trunk/rosapps/fraginator/Defragment.h (original) +++ trunk/rosapps/fraginator/Defragment.h Sat Apr 1 19:02:38 2006 @@ -14,12 +14,12 @@ #include "Mutex.h" -extern int FitName (char *destination, const char *path, const char *filename, uint32 totalWidth); +extern int FitName (wchar_t *destination, const wchar_t *path, const wchar_t *filename, uint32 totalWidth); typedef struct DefragReport { - string RootPath; + wstring RootPath; uint64 DiskSizeBytes; uint64 DirsCount; uint64 FilesCount; @@ -41,7 +41,7 @@ class Defragment { public: - Defragment (string Name, DefragType DefragMethod); + Defragment (wstring Name, DefragType DefragMethod); ~Defragment (); // Commands @@ -52,7 +52,7 @@ // Info bool IsDoneYet (void); bool HasError (void); - string GetStatusString (void); + wstring GetStatusString (void); double GetStatusPercent (void); DefragType GetDefragType (void) { return (Method); } DefragReport &GetDefragReport (void) { return (Report); } @@ -69,16 +69,16 @@ private: void FastDefrag (void); void ExtensiveDefrag (void); - void SetStatusString (string NewStatus); + void SetStatusString (wstring NewStatus); DWORD LastBMPUpdate; // Last time volume bitmap was updated DefragReport Report; bool DoLimitLength; DefragType Method; - string DriveName; + wstring DriveName; DriveVolume Volume; - string StatusString; - string ErrorString; + wstring StatusString; + wstring ErrorString; double StatusPercent; Mutex DefragMutex; bool Error; Modified: trunk/rosapps/fraginator/DriveVolume.cpp URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/DriveVolume.cpp?…
============================================================================== --- trunk/rosapps/fraginator/DriveVolume.cpp (original) +++ trunk/rosapps/fraginator/DriveVolume.cpp Sat Apr 1 19:02:38 2006 @@ -39,14 +39,14 @@ // "Name" should be the drive letter followed by a colon. ie, "c:" // It's a string to allow for further expansion (ie, defragging over the network?) // or some other baloney reason -bool DriveVolume::Open (string Name) -{ - char FileName[100]; +bool DriveVolume::Open (wstring Name) +{ + wchar_t FileName[100]; bool ReturnVal; - sprintf (FileName, "\\\\.\\%s", Name.c_str()); + swprintf (FileName, L"\\\\.\\%s", Name.c_str()); RootPath = Name.c_str(); - RootPath += "\\"; + RootPath += L"\\"; Handle = CreateFile ( @@ -63,11 +63,11 @@ ReturnVal = false; else { - char VolName[64]; + wchar_t VolName[64]; DWORD VolSN; DWORD VolMaxFileLen; DWORD FSFlags; - char FSName[64]; + wchar_t FSName[64]; BOOL Result; ReturnVal = true; @@ -85,24 +85,24 @@ if (Result) { - char SerialText[10]; + wchar_t SerialText[10]; VolInfo.FileSystem = FSName; VolInfo.MaxNameLen = VolMaxFileLen; VolInfo.Name = VolName; - sprintf (SerialText, "%x-%x", (VolSN & 0xffff0000) >> 16, + swprintf (SerialText, L"%x-%x", (VolSN & 0xffff0000) >> 16, VolSN & 0x0000ffff); - strupr (SerialText); + wcsupr (SerialText); VolInfo.Serial = SerialText; } else { - VolInfo.FileSystem = "(Unknown)"; + VolInfo.FileSystem = L"(Unknown)"; VolInfo.MaxNameLen = 255; - VolInfo.Name = "(Unknown)"; - VolInfo.Serial = "(Unknown)"; + VolInfo.Name = L"(Unknown)"; + VolInfo.Serial = L"(Unknown)"; } } @@ -202,7 +202,7 @@ // Bad result? if (Result == FALSE && GetLastError () != ERROR_MORE_DATA) { - //printf ("\nDeviceIoControl returned false, GetLastError() was not ERROR_MORE_DATA\n"); + //wprintf ("\nDeviceIoControl returned false, GetLastError() was not ERROR_MORE_DATA\n"); free (Bitmap); return (false); } @@ -226,12 +226,12 @@ if (Result == FALSE) { - printf ("\nCouldn't properly read volume bitmap\n"); + wprintf (L"\nCouldn't properly read volume bitmap\n"); free (Bitmap); return (false); } - // Convert to a 'quick use' bitmap + // Convert to a L'quick use' bitmap //const int BitShift[] = { 1, 2, 4, 8, 16, 32, 64, 128 }; VolInfo.ClusterCount = Bitmap->BitmapSize.QuadPart; @@ -331,7 +331,7 @@ } -string &DriveVolume::GetDBDir (uint32 Indice) +wstring &DriveVolume::GetDBDir (uint32 Indice) { return (Directories[Indice]); } @@ -365,17 +365,17 @@ } -bool DriveVolume::ScanDirectory (string DirPrefix, ScanCallback Callback, void *UserData) +bool DriveVolume::ScanDirectory (wstring DirPrefix, ScanCallback Callback, void *UserData) { WIN32_FIND_DATA FindData; HANDLE FindHandle; - string SearchString; + wstring SearchString; uint32 DirIndice; DirIndice = Directories.size() - 1; SearchString = DirPrefix; - SearchString += "*.*"; + SearchString += L"*.*"; ZeroMemory (&FindData, sizeof (FindData)); FindHandle = FindFirstFile (SearchString.c_str(), &FindData); @@ -393,8 +393,8 @@ // First copy over the easy stuff. Info.Name = FindData.cFileName; - // Don't ever include '.' and '..' - if (Info.Name == "." || Info.Name == "..") + // DonLL't ever include '.L' and '..' + if (Info.Name == L"." || Info.Name == L"..") continue; //Info.FullName = DirPrefix + Info.Name; @@ -450,11 +450,11 @@ // If directory, perform recursion if (Info.Attributes.Directory == 1) { - string Dir; + wstring Dir; Dir = GetDBDir (Info.DirIndice); Dir += Info.Name; - Dir += "\\"; + Dir += L"\\"; Directories.push_back (Dir); ScanDirectory (Dir, Callback, UserData); @@ -485,7 +485,7 @@ { BOOL Result; HANDLE Handle; - string FullName; + wstring FullName; BY_HANDLE_FILE_INFORMATION FileInfo; Info.Fragments.resize (0); @@ -529,7 +529,7 @@ if (Result == FALSE) { Info.Attributes.AccessDenied = 1; - printf ("GetFileInformationByHandle ('%s%s') failed\n", GetDBDir (Info.DirIndice).c_str(), + wprintf (L"GetFileInformationByHandle ('%s%s') failed\n", GetDBDir (Info.DirIndice).c_str(), Info.Name.c_str()); CloseHandle (Handle); @@ -544,7 +544,7 @@ DWORD BytesReturned; // Grab info one extent at a time, until it's done grabbing all the extent data - // Yeah, well it doesn't give us a way to ask "how many extents?" that I know of ... + // Yeah, well it doesn't give us a way to ask L"how many extents?" that I know of ... // btw, the Extents variable tends to only reflect memory usage, so when we have // all the extents we look at the structure Win32 gives us for the REAL count! Extents = 10; @@ -668,7 +668,7 @@ bool ReturnVal = false; FileInfo Info; HANDLE FileHandle; - string FullName; + wstring FullName; MOVE_FILE_DATA MoveData; uint64 CurrentLCN; uint64 CurrentVCN; @@ -724,7 +724,7 @@ BOOL Result; DWORD BytesReturned; - //printf ("%3u", i); + //wprintf (L"%3u", i); MoveData.ClusterCount = Info.Fragments[i].Length; MoveData.StartingLcn.QuadPart = CurrentLCN; @@ -733,15 +733,15 @@ MoveData.FileHandle = FileHandle; /* - printf ("\n"); - printf ("StartLCN: %I64u\n", MoveData.StartingLcn.QuadPart); - printf ("StartVCN: %I64u\n", MoveData.StartingVcn.QuadPart); - printf ("Clusters: %u (%I64u-%I64u --> %I64u-%I64u)\n", MoveData.ClusterCount, + wprintf (L"\n"); + wprintf (L"StartLCN: %I64u\n", MoveData.StartingLcn.QuadPart); + wprintf (L"StartVCN: %I64u\n", MoveData.StartingVcn.QuadPart); + wprintf (L"Clusters: %u (%I64u-%I64u --> %I64u-%I64u)\n", MoveData.ClusterCount, Info.Fragments[i].StartLCN, Info.Fragments[i].StartLCN + MoveData.ClusterCount, MoveData.StartingLcn.QuadPart, MoveData.StartingLcn.QuadPart + MoveData.ClusterCount - 1); - printf ("\n"); + wprintf (L"\n"); */ Result = DeviceIoControl @@ -756,7 +756,7 @@ NULL ); - //printf ("\b\b\b"); + //wprintf (L"\b\b\b"); if (Result == FALSE) { Modified: trunk/rosapps/fraginator/DriveVolume.h URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/DriveVolume.h?re…
============================================================================== --- trunk/rosapps/fraginator/DriveVolume.h (original) +++ trunk/rosapps/fraginator/DriveVolume.h Sat Apr 1 19:02:38 2006 @@ -51,7 +51,7 @@ typedef struct { - string Name; + wstring Name; uint32 DirIndice; // indice into directory list uint64 Size; uint64 Clusters; @@ -65,10 +65,10 @@ typedef struct { - string Name; - string Serial; + wstring Name; + wstring Serial; DWORD MaxNameLen; - string FileSystem; + wstring FileSystem; uint64 ClusterCount; uint32 ClusterSize; uint64 TotalBytes; @@ -92,7 +92,7 @@ DriveVolume (); ~DriveVolume (); - bool Open (string Name); // opens the volume + bool Open (wstring Name); // opens the volume void Close (void); bool ObtainInfo (void); // retrieves drive geometry bool GetBitmap (void); // gets drive bitmap @@ -108,7 +108,7 @@ DISK_GEOMETRY GetGeometry (void) { return (Geometry); } VolumeInfo GetVolumeInfo (void) { return (VolInfo); } - string GetRootPath (void) { return (RootPath); } + wstring GetRootPath (void) { return (RootPath); } // Scans drive starting from the root dir and calls a user defined function // for each file/directory encountered. void* UserData is passed to this @@ -116,7 +116,7 @@ bool Scan (ScanCallback Callback, void *UserData); // Retrieve a directory string from the file database - string &GetDBDir (uint32 Indice); + wstring &GetDBDir (uint32 Indice); uint32 GetDBDirCount (void); // Retrieve file strings/info from the file database FileInfo &GetDBFile (uint32 Indice); @@ -137,7 +137,7 @@ friend bool BuildDBCallback (FileInfo &Info, HANDLE &FileHandle, void *UserData); // DirPrefix should be in the form "drive:\\path\\" ie, C:\CRAP\ . - bool ScanDirectory (string DirPrefix, ScanCallback Callback, void *UserData); + bool ScanDirectory (wstring DirPrefix, ScanCallback Callback, void *UserData); // given a file's attributes, should it be processed or not? bool ShouldProcess (FileAttr Attr); @@ -146,8 +146,8 @@ VolumeInfo VolInfo; FileList Files; - vector<string> Directories; // Directories[Files[x].DirIndice] - string RootPath; // ie, C:\ . + vector<wstring> Directories; // Directories[Files[x].DirIndice] + wstring RootPath; // ie, C:\ . HANDLE Handle; DISK_GEOMETRY Geometry; uint32 *BitmapDetail; Modified: trunk/rosapps/fraginator/Fraginator.cpp URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.cpp?r…
============================================================================== --- trunk/rosapps/fraginator/Fraginator.cpp (original) +++ trunk/rosapps/fraginator/Fraginator.cpp Sat Apr 1 19:02:38 2006 @@ -42,7 +42,7 @@ if (!CheckWinVer()) { - MessageBox (GetDesktopWindow(), "Sorry, this program requires Windows 2000.", "Error", MB_OK); + MessageBox (GetDesktopWindow(), L"Sorry, this program requires Windows 2000.", L"Error", MB_OK); return (0); } @@ -51,7 +51,7 @@ #if 0 AllocConsole (); if (_CrtDumpMemoryLeaks ()) - MessageBox (NULL, "Click OK to quit", "Leaks", MB_OK); + MessageBox (NULL, L"Click OK to quit", L"Leaks", MB_OK); #endif return (0); Removed: trunk/rosapps/fraginator/Fraginator.exe URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.exe?r…
============================================================================== Binary file - no diff available. Modified: trunk/rosapps/fraginator/Fraginator.h URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.h?rev…
============================================================================== --- trunk/rosapps/fraginator/Fraginator.h (original) +++ trunk/rosapps/fraginator/Fraginator.h Sat Apr 1 19:02:38 2006 @@ -14,7 +14,7 @@ int WINAPI WinMain (HINSTANCE HInstance, HINSTANCE HPrevInstance, LPSTR CmdLine, int ShowCmd); -Defragment *StartDefragBox (string Drive, DefragType Method); +Defragment *StartDefragBox (wstring Drive, DefragType Method); extern HINSTANCE GlobalHInstance; Removed: trunk/rosapps/fraginator/Fraginator.mak URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.mak?r…
============================================================================== --- trunk/rosapps/fraginator/Fraginator.mak (original) +++ trunk/rosapps/fraginator/Fraginator.mak (removed) @@ -1,224 +1,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Based on Fraginator.dsp -!IF "$(CFG)" == "" -CFG=Fraginator - Win32 Debug -!MESSAGE No configuration specified. Defaulting to Fraginator - Win32 Debug. -!ENDIF - -!IF "$(CFG)" != "Fraginator - Win32 Release" && "$(CFG)" != "Fraginator - Win32 Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "Fraginator.mak" CFG="Fraginator - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "Fraginator - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "Fraginator - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -CPP=xicl6.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "Fraginator - Win32 Release" - -OUTDIR=.\Release -INTDIR=.\Release -# Begin Custom Macros -OutDir=.\Release -# End Custom Macros - -ALL : "$(OUTDIR)\Fraginator.exe" - - -CLEAN : - -@erase "$(INTDIR)\Defragment.obj" - -@erase "$(INTDIR)\DriveVolume.obj" - -@erase "$(INTDIR)\Fraginator.obj" - -@erase "$(INTDIR)\Fraginator.res" - -@erase "$(INTDIR)\MainDialog.obj" - -@erase "$(INTDIR)\ReportDialog.obj" - -@erase "$(INTDIR)\Unfrag.obj" - -@erase "$(INTDIR)\vc60.idb" - -@erase "$(OUTDIR)\Fraginator.exe" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /G6 /Gr /MT /W3 /GX /Ox /Ot /Og /Oi /Ob2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Fp"$(INTDIR)\Fraginator.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c -MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 -RSC_PROJ=/l 0x409 /fo"$(INTDIR)\Fraginator.res" /d "NDEBUG" -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\Fraginator.bsc" -BSC32_SBRS= \ - -LINK32=xilink6.exe -LINK32_FLAGS=comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /machine:I386 /out:"$(OUTDIR)\Fraginator.exe" -LINK32_OBJS= \ - "$(INTDIR)\Defragment.obj" \ - "$(INTDIR)\DriveVolume.obj" \ - "$(INTDIR)\Fraginator.obj" \ - "$(INTDIR)\MainDialog.obj" \ - "$(INTDIR)\ReportDialog.obj" \ - "$(INTDIR)\Unfrag.obj" \ - "$(INTDIR)\Fraginator.res" - -"$(OUTDIR)\Fraginator.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -SOURCE="$(InputPath)" -PostBuild_Desc=Copying to Program Files ... -DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep - -ALL : $(DS_POSTBUILD_DEP) - -# Begin Custom Macros -OutDir=.\Release -# End Custom Macros - -$(DS_POSTBUILD_DEP) : "$(OUTDIR)\Fraginator.exe" - copy Release\Fraginator.exe "c:\Program Files\Fraginator\Fraginator.exe" - echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)" - -!ELSEIF "$(CFG)" == "Fraginator - Win32 Debug" - -OUTDIR=.\Debug -INTDIR=.\Debug -# Begin Custom Macros -OutDir=.\Debug -# End Custom Macros - -ALL : "$(OUTDIR)\Fraginator.exe" - - -CLEAN : - -@erase "$(INTDIR)\Defragment.obj" - -@erase "$(INTDIR)\DriveVolume.obj" - -@erase "$(INTDIR)\Fraginator.obj" - -@erase "$(INTDIR)\Fraginator.res" - -@erase "$(INTDIR)\MainDialog.obj" - -@erase "$(INTDIR)\ReportDialog.obj" - -@erase "$(INTDIR)\Unfrag.obj" - -@erase "$(INTDIR)\vc60.idb" - -@erase "$(INTDIR)\vc60.pdb" - -@erase "$(OUTDIR)\Fraginator.exe" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)\Fraginator.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c -MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 -RSC_PROJ=/l 0x409 /fo"$(INTDIR)\Fraginator.res" /d "_DEBUG" -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\Fraginator.bsc" -BSC32_SBRS= \ - -LINK32=xilink6.exe -LINK32_FLAGS=comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /debug /machine:I386 /out:"$(OUTDIR)\Fraginator.exe" -LINK32_OBJS= \ - "$(INTDIR)\Defragment.obj" \ - "$(INTDIR)\DriveVolume.obj" \ - "$(INTDIR)\Fraginator.obj" \ - "$(INTDIR)\MainDialog.obj" \ - "$(INTDIR)\ReportDialog.obj" \ - "$(INTDIR)\Unfrag.obj" \ - "$(INTDIR)\Fraginator.res" - -"$(OUTDIR)\Fraginator.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ENDIF - -.c{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - - -!IF "$(NO_EXTERNAL_DEPS)" != "1" -!IF EXISTS("Fraginator.dep") -!INCLUDE "Fraginator.dep" -!ELSE -!MESSAGE Warning: cannot find "Fraginator.dep" -!ENDIF -!ENDIF - - -!IF "$(CFG)" == "Fraginator - Win32 Release" || "$(CFG)" == "Fraginator - Win32 Debug" -SOURCE=.\Defragment.cpp - -"$(INTDIR)\Defragment.obj" : $(SOURCE) "$(INTDIR)" - - -SOURCE=.\DriveVolume.cpp - -"$(INTDIR)\DriveVolume.obj" : $(SOURCE) "$(INTDIR)" - - -SOURCE=.\Fraginator.cpp - -"$(INTDIR)\Fraginator.obj" : $(SOURCE) "$(INTDIR)" - - -SOURCE=.\MainDialog.cpp - -"$(INTDIR)\MainDialog.obj" : $(SOURCE) "$(INTDIR)" - - -SOURCE=.\ReportDialog.cpp - -"$(INTDIR)\ReportDialog.obj" : $(SOURCE) "$(INTDIR)" - - -SOURCE=.\Unfrag.cpp - -"$(INTDIR)\Unfrag.obj" : $(SOURCE) "$(INTDIR)" - - -SOURCE=.\Fraginator.rc - -"$(INTDIR)\Fraginator.res" : $(SOURCE) "$(INTDIR)" - $(RSC) $(RSC_PROJ) $(SOURCE) - - - -!ENDIF - Modified: trunk/rosapps/fraginator/Fraginator.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.rc?re…
============================================================================== --- trunk/rosapps/fraginator/Fraginator.rc (original) +++ trunk/rosapps/fraginator/Fraginator.rc Sat Apr 1 19:02:38 2006 @@ -7,7 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include "windows.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -40,17 +40,17 @@ PUSHBUTTON "Start",IDC_STARTSTOP,294,7,45,15 PUSHBUTTON "Help",ID_MAIN_HELP,294,28,45,15 PUSHBUTTON "Exit",IDC_QUIT,294,49,45,15 - CONTROL 110,IDC_STATIC,"Static",SS_BITMAP | SS_SUNKEN | + CONTROL 110,-1,"Static",SS_BITMAP | SS_SUNKEN | WS_BORDER,7,7,63,58 - LTEXT "Choose a drive:",IDC_STATIC,78,40,50,8 - LTEXT "Choose an action:",IDC_STATIC,135,40,58,8 + LTEXT "Choose a drive:",-1,78,40,50,8 + LTEXT "Choose an action:",-1,135,40,58,8 CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER | 0x1,7,71,299,10 CONTROL "Static",IDC_STATUS,"Static",SS_LEFTNOWORDWRAP | SS_SUNKEN | WS_GROUP,7,86,332,10 LTEXT "I am a monkey, hear me eeK",IDC_WISECRACKS,78,15,91,8 LTEXT "100.00%",IDC_PERCENT,311,71,28,8,0,WS_EX_RIGHT - LTEXT "Process Priority:",IDC_STATIC,223,40,51,8 + LTEXT "Process Priority:",-1,223,40,51,8 END IDD_REPORT DIALOG 0, 0, 391, 169 @@ -63,50 +63,50 @@ DEFPUSHBUTTON "Megabytes",IDC_MEGABYTES,115,148,50,14 DEFPUSHBUTTON "Gigabytes",IDC_GIGABYTES,169,148,50,14 DEFPUSHBUTTON "OK",IDC_REPORTOK,334,148,50,14 - RTEXT "Volume",IDC_STATIC,7,7,24,8 - LTEXT "Capacity",IDC_STATIC,7,51,28,8 + RTEXT "Volume",-1,7,7,24,8 + LTEXT "Capacity",-1,7,51,28,8 RTEXT "(Drive Letter)",IDC_DRIVELETTER,63,7,117,10,SS_SUNKEN RTEXT "(Disk Size, Bytes)",IDC_DISKSIZEBYTES,63,51,117,10, SS_SUNKEN RTEXT "(Disk Size, Clusters)",IDC_DISKSIZECLUSTERS,63,73,117, 10,SS_SUNKEN - LTEXT "Total clusters",IDC_STATIC,7,73,43,8 + LTEXT "Total clusters",-1,7,73,43,8 RTEXT "(Cluster size)",IDC_DISKCLUSTERSIZE,63,84,117,10, SS_SUNKEN - LTEXT "Cluster size",IDC_STATIC,7,84,36,8 + LTEXT "Cluster size",-1,7,84,36,8 RTEXT "(Files count)",IDC_FILESCOUNT,267,18,117,10,SS_SUNKEN RTEXT "(Files size, bytes)",IDC_FILESSIZEBYTES,267,29,117,10, SS_SUNKEN - LTEXT "# of files",IDC_STATIC,194,18,28,8 - LTEXT "Total size",IDC_STATIC,194,29,31,8 - LTEXT "Size on disk",IDC_STATIC,194,40,39,8 + LTEXT "# of files",-1,194,18,28,8 + LTEXT "Total size",-1,194,29,31,8 + LTEXT "Size on disk",-1,194,40,39,8 RTEXT "(Total size, bytes)",IDC_FILESSIZEONDISK,267,40,117,10, SS_SUNKEN RTEXT "(Files slack bytes)",IDC_FILESSLACKBYTES,267,51,117,10, SS_SUNKEN - LTEXT "Wasted slack",IDC_STATIC,194,51,44,8 + LTEXT "Wasted slack",-1,194,51,44,8 RTEXT "(Disk Free, Bytes)",IDC_DISKFREEBYTES,63,62,117,10, SS_SUNKEN - LTEXT "Free space",IDC_STATIC,7,62,36,8 + LTEXT "Free space",-1,7,62,36,8 RTEXT "(Files fragmented, count)",IDC_FILESFRAGGED,267,62,117, 10,SS_SUNKEN - LTEXT "Fragmented files",IDC_STATIC,194,62,52,8 + LTEXT "Fragmented files",-1,194,62,52,8 RTEXT "(Dirs count)",IDC_DIRSCOUNT,267,7,117,10,SS_SUNKEN - LTEXT "# of directories",IDC_STATIC,194,7,48,8 - RTEXT "File System",IDC_STATIC,7,40,36,8 + LTEXT "# of directories",-1,194,7,48,8 + RTEXT "File System",-1,7,40,36,8 RTEXT "(File System Name)",IDC_FILESYSTEM,63,40,117,10, SS_SUNKEN - RTEXT "Volume Label",IDC_STATIC,7,18,44,8 + RTEXT "Volume Label",-1,7,18,44,8 RTEXT "(Volume Name)",IDC_VOLUMELABEL,63,18,117,10,SS_SUNKEN - RTEXT "Serial",IDC_STATIC,7,29,18,8 + RTEXT "Serial",-1,7,29,18,8 RTEXT "(Volume Serial)",IDC_VOLUMESERIAL,63,29,117,10, SS_SUNKEN RTEXT "(Average Frags Per File)",IDC_AVERAGEFRAGS,267,73,117, 10,SS_SUNKEN - LTEXT "Average fragments per file",IDC_STATIC,194,73,60,20 + LTEXT "Average fragments per file",-1,194,73,60,20 LTEXT "XX.X% of the files on this drive are fragmented. It is recommended that you perform a SSSSSSS defragmentation.", IDC_RECOMMEND,7,106,377,38,SS_SUNKEN - LTEXT "Recommendations:",IDC_STATIC,7,96,62,8 + LTEXT "Recommendations:",-1,7,96,62,8 END @@ -150,7 +150,7 @@ 2 TEXTINCLUDE BEGIN - "#include ""afxres.h""\r\n" + "#include ""windows.h""\r\n" "\0" END Modified: trunk/rosapps/fraginator/Fraginator.sln URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.sln?r…
============================================================================== --- trunk/rosapps/fraginator/Fraginator.sln (original) +++ trunk/rosapps/fraginator/Fraginator.sln Sat Apr 1 19:02:38 2006 @@ -1,27 +1,25 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual C++ Express 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Fraginator", "Fraginator.vcproj", "{7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unfrag", "unfrag.vcproj", "{8E7E76C1-739B-46E5-99C2-A0504558164B}" EndProject Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Debug|Win32.ActiveCfg = Debug|Win32 + {7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Debug|Win32.Build.0 = Debug|Win32 + {7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Release|Win32.ActiveCfg = Release|Win32 + {7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Release|Win32.Build.0 = Release|Win32 + {8E7E76C1-739B-46E5-99C2-A0504558164B}.Debug|Win32.ActiveCfg = Debug|Win32 + {8E7E76C1-739B-46E5-99C2-A0504558164B}.Debug|Win32.Build.0 = Debug|Win32 + {8E7E76C1-739B-46E5-99C2-A0504558164B}.Release|Win32.ActiveCfg = Release|Win32 + {8E7E76C1-739B-46E5-99C2-A0504558164B}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Debug.ActiveCfg = Debug|Win32 - {7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Debug.Build.0 = Debug|Win32 - {7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Release.ActiveCfg = Release|Win32 - {7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Release.Build.0 = Release|Win32 - {8E7E76C1-739B-46E5-99C2-A0504558164B}.Debug.ActiveCfg = Debug|Win32 - {8E7E76C1-739B-46E5-99C2-A0504558164B}.Debug.Build.0 = Debug|Win32 - {8E7E76C1-739B-46E5-99C2-A0504558164B}.Release.ActiveCfg = Release|Win32 - {8E7E76C1-739B-46E5-99C2-A0504558164B}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection EndGlobal Removed: trunk/rosapps/fraginator/Fraginator.suo URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.suo?r…
============================================================================== Binary file - no diff available. Modified: trunk/rosapps/fraginator/Fraginator.vcproj URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.vcpro…
============================================================================== --- trunk/rosapps/fraginator/Fraginator.vcproj (original) +++ trunk/rosapps/fraginator/Fraginator.vcproj Sat Apr 1 19:02:38 2006 @@ -1,200 +1,292 @@ -<?xml version="1.0" encoding = "Windows-1252"?> +<?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" - Version="7.00" + Version="8,00" Name="Fraginator" - SccProjectName="" - SccLocalPath=""> + ProjectGUID="{7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}" + > <Platforms> <Platform - Name="Win32"/> + Name="Win32" + /> </Platforms> + <ToolFiles> + </ToolFiles> <Configurations> <Configuration Name="Release|Win32" - OutputDirectory=".\Release" - IntermediateDirectory=".\Release" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops" UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE"> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ManagedExtensions="0" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="NDEBUG" + MkTypLibCompatible="true" + SuppressStartupBanner="true" + TargetEnvironment="1" + TypeLibraryName=".\Release/Fraginator.tlb" + /> <Tool Name="VCCLCompilerTool" Optimization="3" - GlobalOptimizations="TRUE" InlineFunctionExpansion="2" - EnableIntrinsicFunctions="TRUE" + EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" - OptimizeForProcessor="2" PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS" - ExceptionHandling="TRUE" + ExceptionHandling="1" RuntimeLibrary="0" StructMemberAlignment="5" - BufferSecurityCheck="FALSE" + BufferSecurityCheck="false" PrecompiledHeaderFile=".\Release/Fraginator.pch" - AssemblerListingLocation=".\Release/" - ObjectFile=".\Release/" - ProgramDataBaseFileName=".\Release/" WarningLevel="3" - SuppressStartupBanner="TRUE" - CompileAsManaged="0" - CallingConvention="1"/> - <Tool - Name="VCCustomBuildTool"/> + SuppressStartupBanner="true" + CallingConvention="1" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="comctl32.lib odbc32.lib odbccp32.lib" - OutputFile=".\Release/Fraginator.exe" + AdditionalDependencies="user32.lib advapi32.lib shell32.lib comctl32.lib" LinkIncremental="1" - SuppressStartupBanner="TRUE" - SubSystem="2"/> - <Tool - Name="VCMIDLTool" - PreprocessorDefinitions="NDEBUG" - MkTypLibCompatible="TRUE" - SuppressStartupBanner="TRUE" - TargetEnvironment="1" - TypeLibraryName=".\Release/Fraginator.tlb"/> + SuppressStartupBanner="true" + GenerateManifest="false" + GenerateDebugInformation="true" + SubSystem="2" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> <Tool Name="VCPostBuildEventTool" Description="Copying to Program Files ..." - CommandLine="copy Release\Fraginator.exe "c:\Program Files\Fraginator\Fraginator.exe""/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> + CommandLine="copy Release\Fraginator.exe "c:\Program Files\Fraginator\Fraginator.exe"" + /> </Configuration> <Configuration Name="Debug|Win32" - OutputDirectory=".\Debug" - IntermediateDirectory=".\Debug" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops" UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE"> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="_DEBUG" + MkTypLibCompatible="true" + SuppressStartupBanner="true" + TargetEnvironment="1" + TypeLibraryName=".\Debug/Fraginator.tlb" + /> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS" BasicRuntimeChecks="3" RuntimeLibrary="1" - PrecompiledHeaderFile=".\Debug/Fraginator.pch" - AssemblerListingLocation=".\Debug/" - ObjectFile=".\Debug/" - ProgramDataBaseFileName=".\Debug/" WarningLevel="3" - SuppressStartupBanner="TRUE" - DebugInformationFormat="4"/> - <Tool - Name="VCCustomBuildTool"/> + SuppressStartupBanner="true" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="comctl32.lib odbc32.lib odbccp32.lib" - OutputFile=".\Debug/Fraginator.exe" + AdditionalDependencies="user32.lib advapi32.lib shell32.lib comctl32.lib" LinkIncremental="2" - SuppressStartupBanner="TRUE" - GenerateDebugInformation="TRUE" - ProgramDatabaseFile=".\Debug/Fraginator.pdb" - SubSystem="2"/> - <Tool - Name="VCMIDLTool" - PreprocessorDefinitions="_DEBUG" - MkTypLibCompatible="TRUE" - SuppressStartupBanner="TRUE" - TargetEnvironment="1" - TypeLibraryName=".\Debug/Fraginator.tlb"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> + SuppressStartupBanner="true" + GenerateManifest="false" + GenerateDebugInformation="true" + SubSystem="2" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> </Configuration> </Configurations> + <References> + </References> <Files> <Filter Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - <File - RelativePath=".\Defragment.cpp"> - </File> - <File - RelativePath=".\DriveVolume.cpp"> - </File> - <File - RelativePath=".\Fraginator.cpp"> - </File> - <File - RelativePath=".\MainDialog.cpp"> - </File> - <File - RelativePath=".\ReportDialog.cpp"> - </File> - <File - RelativePath="Unfrag.cpp"> + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > + <File + RelativePath=".\Defragment.cpp" + > + </File> + <File + RelativePath=".\DriveVolume.cpp" + > + </File> + <File + RelativePath=".\Fraginator.cpp" + > + </File> + <File + RelativePath=".\MainDialog.cpp" + > + </File> + <File + RelativePath=".\ReportDialog.cpp" + > + </File> + <File + RelativePath="Unfrag.cpp" + > </File> </Filter> <Filter Name="Header Files" - Filter="h;hpp;hxx;hm;inl"> - <File - RelativePath=".\Defragment.h"> - </File> - <File - RelativePath=".\DriveVolume.h"> - </File> - <File - RelativePath=".\Fraginator.h"> - </File> - <File - RelativePath=".\MainDialog.h"> - </File> - <File - RelativePath=".\Mutex.h"> - </File> - <File - RelativePath=".\ReportDialog.h"> - </File> - <File - RelativePath=".\Unfrag.h"> - </File> - <File - RelativePath=".\resource.h"> + Filter="h;hpp;hxx;hm;inl" + > + <File + RelativePath=".\Defragment.h" + > + </File> + <File + RelativePath=".\DriveVolume.h" + > + </File> + <File + RelativePath=".\Fraginator.h" + > + </File> + <File + RelativePath=".\MainDialog.h" + > + </File> + <File + RelativePath=".\Mutex.h" + > + </File> + <File + RelativePath=".\ReportDialog.h" + > + </File> + <File + RelativePath=".\resource.h" + > + </File> + <File + RelativePath=".\Unfrag.h" + > </File> </Filter> <Filter Name="Resource Files" - Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> - <File - RelativePath=".\Fraginator Help - Fraginator Icon.bmp"> - </File> - <File - RelativePath=".\Fraginator Motif Icon.bmp"> - </File> - <File - RelativePath=".\Fraginator.rc"> - </File> - <File - RelativePath=".\default1.bin"> - </File> - <File - RelativePath=".\icon1.ico"> + Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" + > + <File + RelativePath=".\default1.bin" + > + </File> + <File + RelativePath=".\Fraginator Help - Fraginator Icon.bmp" + > + </File> + <File + RelativePath=".\Fraginator Motif Icon.bmp" + > + </File> + <File + RelativePath=".\Fraginator.rc" + > + </File> + <File + RelativePath=".\icon1.ico" + > </File> </Filter> </Files> Modified: trunk/rosapps/fraginator/MainDialog.cpp URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/MainDialog.cpp?r…
============================================================================== --- trunk/rosapps/fraginator/MainDialog.cpp (original) +++ trunk/rosapps/fraginator/MainDialog.cpp Sat Apr 1 19:02:38 2006 @@ -6,7 +6,7 @@ #include "ReportDialog.h" -vector<string> DrivesList; +vector<wstring> DrivesList; LRESULT AnalyzeID; LRESULT FastID; LRESULT ExtensiveID; @@ -24,8 +24,8 @@ void InitDialog (HWND Dlg); void UpdateDefragInfo (HWND Dlg); void UpdatePriority (HWND Dlg); -string GetDefaultTitle (void); -string GetDefragTitle (void); +wstring GetDefaultTitle (void); +wstring GetDefragTitle (void); void SetDisables (HWND Dlg); INT_PTR CALLBACK MainDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LParam); @@ -38,7 +38,7 @@ int d; // Clear out wisecracks line for now - SetDlgItemText (Dlg, IDC_WISECRACKS, "\"Defrag, baby!\""); + SetDlgItemText (Dlg, IDC_WISECRACKS, L"\"Defrag, baby!\""); // Make list of logical drives DrivesList.resize (0); @@ -48,10 +48,10 @@ { if (DriveMask & (1 << d)) { - string Name; - - Name = (char)('A' + d); - Name += ':'; + wstring Name; + + Name = (wchar_t)(L'A' + d); + Name += L':'; DrivesList.push_back (Name); } } @@ -67,23 +67,23 @@ // Put in defrag methods DlgItem = GetDlgItem (Dlg, IDC_METHODS_LIST); SendMessage (DlgItem, CB_RESETCONTENT, 0, 0); - AnalyzeID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Analyze Only"); - FastID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Fast Defrag"); - ExtensiveID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Extensive Defrag"); + AnalyzeID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) L"Analyze Only"); + FastID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) L"Fast Defrag"); + ExtensiveID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) L"Extensive Defrag"); // Set up process priorities DlgItem = GetDlgItem (Dlg, IDC_PRIORITY_LIST); SendMessage (Dlg, CB_RESETCONTENT, 0, 0); - PriHighID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "High"); - PriAboveNormID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Above Normal"); - PriNormalID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Normal"); - PriBelowNormID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Below Normal"); - PriIdleID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Idle"); + PriHighID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) L"High"); + PriAboveNormID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) L"Above Normal"); + PriNormalID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) L"Normal"); + PriBelowNormID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) L"Below Normal"); + PriIdleID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) L"Idle"); UpdatePriority (Dlg); // Reset texts and progress meters - SendDlgItemMessage (Dlg, IDC_STATUS, WM_SETTEXT, 0, (LPARAM) ""); - SendDlgItemMessage (Dlg, IDC_PERCENT, WM_SETTEXT, 0, (LPARAM) ""); + SendDlgItemMessage (Dlg, IDC_STATUS, WM_SETTEXT, 0, (LPARAM) L""); + SendDlgItemMessage (Dlg, IDC_PERCENT, WM_SETTEXT, 0, (LPARAM) L""); SendDlgItemMessage (Dlg, IDC_PROGRESS, PBM_SETRANGE, 0, MAKELPARAM (0, 10000)); SendDlgItemMessage (Dlg, IDC_PROGRESS, PBM_SETPOS, 0, 0); @@ -93,10 +93,10 @@ void UpdateDefragInfo (HWND Dlg) { - char PercentText[100]; + wchar_t PercentText[100]; static double OldPercent = 200.0f; - static string OldStatus = "Non"; - string NewStatus; + static wstring OldStatus = L"Non"; + wstring NewStatus; double NewPercent; if (Defrag == NULL) @@ -109,7 +109,7 @@ NewPercent = 0.0f; if (NewPercent != OldPercent) { - sprintf (PercentText, "%6.2f%%", NewPercent); + swprintf (PercentText, L"%6.2f%%", NewPercent); SendDlgItemMessage (Dlg, IDC_PERCENT, WM_SETTEXT, 0, (LPARAM) PercentText); SendDlgItemMessage (Dlg, IDC_PROGRESS, PBM_SETPOS, (WPARAM) (int)(NewPercent * 100.0f), 0); @@ -119,16 +119,16 @@ NewStatus = Defrag->GetStatusString (); if (NewStatus != OldStatus) { // Change & characters to && to avoid underlining - string Status; - string::iterator it; + wstring Status; + wstring::iterator it; Status = NewStatus; it = Status.begin (); while (it < Status.end()) { - if (*it == '&') + if (*it == L'&') { - Status.insert (it, 1, '&'); + Status.insert (it, 1, L'&'); it++; } @@ -145,29 +145,29 @@ } -string GetDefaultTitle (void) -{ - string DefaultText; - - DefaultText = string(string(APPNAME_GUI) + string(" v") + string(APPVER_STR) + - string(" (C) 2000 by Rick Brewster")); +wstring GetDefaultTitle (void) +{ + wstring DefaultText; + + DefaultText = wstring(wstring(APPNAME_GUI) + wstring(L" v") + wstring(APPVER_STR) + + wstring(L" (C) 2000 by Rick Brewster")); return (DefaultText); } -string GetDefragTitle (void) -{ - string DefragText; - char Percent[10]; - - sprintf (Percent, "%.2f%%", Defrag->GetStatusPercent()); +wstring GetDefragTitle (void) +{ + wstring DefragText; + wchar_t Percent[10]; + + swprintf (Percent, L"%.2f%%", Defrag->GetStatusPercent()); DefragText = GetDefaultTitle (); if (Defrag != NULL) { - DefragText = string(Percent) + string (" - ") + Defrag->GetVolume().GetRootPath() + - string (" - ") + DefragText; + DefragText = wstring(Percent) + wstring (L" - ") + Defrag->GetVolume().GetRootPath() + + wstring (L" - ") + DefragText; } return (DefragText); @@ -176,17 +176,17 @@ void SetDisables (HWND Dlg) { - // If a defrag is in process, set 'Start' button to say 'Stop' and disable + // If a defrag is in process, set L'Start' button to say L'Stop' and disable // the Select Drive and Select Action controls if (Defrag != NULL && !Defrag->IsDoneYet() && !Defrag->HasError()) { - SendMessage (GetDlgItem (Dlg, IDC_STARTSTOP), WM_SETTEXT, 0, (LPARAM) "Stop"); + SendMessage (GetDlgItem (Dlg, IDC_STARTSTOP), WM_SETTEXT, 0, (LPARAM) L"Stop"); EnableWindow (GetDlgItem (Dlg, IDC_DRIVES_LIST), FALSE); EnableWindow (GetDlgItem (Dlg, IDC_METHODS_LIST), FALSE); } else { - SendMessage (GetDlgItem (Dlg, IDC_STARTSTOP), WM_SETTEXT, 0, (LPARAM) "Start"); + SendMessage (GetDlgItem (Dlg, IDC_STARTSTOP), WM_SETTEXT, 0, (LPARAM) L"Start"); EnableWindow (GetDlgItem (Dlg, IDC_STARTSTOP), TRUE); EnableWindow (GetDlgItem (Dlg, IDC_QUIT), TRUE); EnableWindow (GetDlgItem (Dlg, IDC_DRIVES_LIST), TRUE); @@ -235,7 +235,7 @@ Error = RegCreateKeyEx ( HKEY_CURRENT_USER, - "Software\\Fraginator", + L"Software\\Fraginator", 0, NULL, REG_OPTION_NON_VOLATILE, @@ -303,7 +303,7 @@ RegSetValueEx ( RegKey, - "Default Action", + L"Default Action", 0, REG_DWORD, (CONST BYTE *)&DefragVal, @@ -313,7 +313,7 @@ RegSetValueEx ( RegKey, - "Process Priority", + L"Process Priority", 0, REG_DWORD, (CONST BYTE *)&PriVal, @@ -346,7 +346,7 @@ Error = RegQueryValueEx ( RegKey, - "Default Action", + L"Default Action", 0, &RegType, (BYTE *)&DTypeVal, @@ -359,7 +359,7 @@ Error = RegQueryValueEx ( RegKey, - "Process Priority", + L"Process Priority", 0, &RegType, (BYTE *)&PriVal, @@ -419,7 +419,7 @@ #define IDLETIME 25 -string OldWindowText = ""; +wstring OldWindowText = L""; INT_PTR CALLBACK MainDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LParam) { @@ -443,7 +443,7 @@ case WM_TIMER: if (Defrag != NULL && !ReEntrance) { - string NewTitle; + wstring NewTitle; SendMessage (Dlg, WM_UPDATEINFO, 0, 0); @@ -503,7 +503,7 @@ case ID_MAIN_HELP: - ShellExecute (Dlg, "open", "Fraginator.chm", "", ".", SW_SHOW); + ShellExecute (Dlg, L"open", L"Fraginator.chm", L"", L".", SW_SHOW); return (1); @@ -524,8 +524,8 @@ case IDC_STARTSTOP: if (Defrag == NULL) - { // "Start" - char Drive[10]; + { // L"Start" + wchar_t Drive[10]; LRESULT ID; DefragType Method; HANDLE H; @@ -536,7 +536,7 @@ SendMessage (GetDlgItem (Dlg, IDC_DRIVES_LIST), WM_GETTEXT, sizeof (Drive) - 1, (LPARAM) Drive); - if (strlen(Drive) != 2 || Drive[1] != ':') + if (wcslen(Drive) != 2 || Drive[1] != L':') return (1); ID = SendMessage (GetDlgItem (Dlg, IDC_METHODS_LIST), CB_GETCURSEL, 0, 0); @@ -559,7 +559,7 @@ } } else - { // "Stop" + { // L"Stop" Stopping = true; Defrag->Stop (); EnableWindow (GetDlgItem (Dlg, IDC_STARTSTOP), FALSE); Modified: trunk/rosapps/fraginator/ReportDialog.cpp URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/ReportDialog.cpp…
============================================================================== --- trunk/rosapps/fraginator/ReportDialog.cpp (original) +++ trunk/rosapps/fraginator/ReportDialog.cpp Sat Apr 1 19:02:38 2006 @@ -6,11 +6,11 @@ #include "resource.h" -void SetReportInfo (HWND Dlg, DefragReport &Report, uint32 BytesDivisor, char *BytesUnits, bool Fractional) +void SetReportInfo (HWND Dlg, DefragReport &Report, uint32 BytesDivisor, wchar_t *BytesUnits, bool Fractional) { - char Text[1000]; - char Text2[1000]; - char Text3[1000]; + wchar_t Text[1000]; + wchar_t Text2[1000]; + wchar_t Text3[1000]; memset (Text, 0, sizeof (Text)); @@ -29,14 +29,14 @@ // DiskSizeBytes if (Fractional) { - sprintf (Text, "%.2f %s", (double)(signed)(Report.DiskSizeBytes / + swprintf (Text, L"%.2f %s", (double)(signed)(Report.DiskSizeBytes / (BytesDivisor / 1024)) / 1024.0, BytesUnits); } else { AddCommas (Text, Report.DiskSizeBytes / BytesDivisor); - strcat (Text, " "); - strcat (Text, BytesUnits); + wcscat (Text, L" "); + wcscat (Text, BytesUnits); } SetDlgItemText (Dlg, IDC_DISKSIZEBYTES, Text); @@ -44,24 +44,24 @@ // DiskFreeBytes if (Fractional) { - sprintf (Text, "%.2f %s", (double)(signed)(Defrag->GetVolume().GetVolumeInfo().FreeBytes / + swprintf (Text, L"%.2f %s", (double)(signed)(Defrag->GetVolume().GetVolumeInfo().FreeBytes / (BytesDivisor / 1024)) / 1024.0, BytesUnits); } else { AddCommas (Text, Defrag->GetVolume().GetVolumeInfo().FreeBytes / BytesDivisor); - strcat (Text, " "); - strcat (Text, BytesUnits); + wcscat (Text, L" "); + wcscat (Text, BytesUnits); } SetDlgItemText (Dlg, IDC_DISKFREEBYTES, Text); // DiskSizeClusters AddCommas (Text, Defrag->GetVolume().GetVolumeInfo().ClusterCount); - strcat (Text, " clusters"); + wcscat (Text, L" clusters"); SetDlgItemText (Dlg, IDC_DISKSIZECLUSTERS, Text); // DiskClusterSize - sprintf (Text, "%u bytes", Defrag->GetVolume().GetVolumeInfo().ClusterSize); + swprintf (Text, L"%u bytes", Defrag->GetVolume().GetVolumeInfo().ClusterSize); SetDlgItemText (Dlg, IDC_DISKCLUSTERSIZE, Text); // DirsCount @@ -73,40 +73,40 @@ SetDlgItemText (Dlg, IDC_FILESCOUNT, Text); // FilesFragged - sprintf (Text, "(%.2f%%)", Report.PercentFragged); + swprintf (Text, L"(%.2f%%)", Report.PercentFragged); AddCommas (Text2, Report.FraggedFiles.size()); - sprintf (Text3, "%s %s", Text, Text2); + swprintf (Text3, L"%s %s", Text, Text2); SetDlgItemText (Dlg, IDC_FILESFRAGGED, Text3); // Average Frags - sprintf (Text, "%.2f", Report.AverageFragments); + swprintf (Text, L"%.2f", Report.AverageFragments); SetDlgItemText (Dlg, IDC_AVERAGEFRAGS, Text); // FilesSizeBytes if (Fractional) { - sprintf (Text, "%.2f %s", (double)(signed)(Report.FilesSizeBytes / + swprintf (Text, L"%.2f %s", (double)(signed)(Report.FilesSizeBytes / (BytesDivisor / 1024)) / 1024.0, BytesUnits); } else { AddCommas (Text, Report.FilesSizeBytes / (uint64)BytesDivisor); - strcat (Text, " "); - strcat (Text, BytesUnits); + wcscat (Text, L" "); + wcscat (Text, BytesUnits); } SetDlgItemText (Dlg, IDC_FILESSIZEBYTES, Text); // Files SizeOnDisk if (Fractional) { - sprintf (Text, "%.2f %s", (double)(signed)((Report.FilesSizeBytes + Report.FilesSlackBytes) / + swprintf (Text, L"%.2f %s", (double)(signed)((Report.FilesSizeBytes + Report.FilesSlackBytes) / (BytesDivisor / 1024)) / 1024.0, BytesUnits); } else { AddCommas (Text, (Report.FilesSizeBytes + Report.FilesSlackBytes) / (uint64)BytesDivisor); - strcat (Text, " "); - strcat (Text, BytesUnits); + wcscat (Text, L" "); + wcscat (Text, BytesUnits); } SetDlgItemText (Dlg, IDC_FILESSIZEONDISK, Text); @@ -114,17 +114,17 @@ // FilesSlackBytes if (Fractional) { - sprintf (Text, "%.2f %s", (double)(signed)(Report.FilesSlackBytes / + swprintf (Text, L"%.2f %s", (double)(signed)(Report.FilesSlackBytes / (BytesDivisor / 1024)) / 1024.0, BytesUnits); } else { AddCommas (Text, Report.FilesSlackBytes / BytesDivisor); - strcat (Text, " "); - strcat (Text, BytesUnits); - } - sprintf (Text2, "(%.2f%%)", Report.PercentSlack); - sprintf (Text3, "%s %s", Text2, Text); + wcscat (Text, L" "); + wcscat (Text, BytesUnits); + } + swprintf (Text2, L"(%.2f%%)", Report.PercentSlack); + swprintf (Text3, L"%s %s", Text2, Text); SetDlgItemText (Dlg, IDC_FILESSLACKBYTES, Text3); // Recommendation @@ -137,55 +137,55 @@ if (Report.AverageFragments >= 1.1f) AFRec = true; - strcpy (Text, "* "); + wcscpy (Text, L"* "); if (PFRec) { - sprintf + swprintf ( Text2, - "%.2f%% of the files on this volume are fragmented. ", + L"%.2f%% of the files on this volume are fragmented. ", Report.PercentFragged ); - strcat (Text, Text2); + wcscat (Text, Text2); } if (AFRec) { - sprintf + swprintf ( Text2, - "The average fragments per file (%.2f) indicates a high degree of fragmentation. ", + L"The average fragments per file (%.2f) indicates a high degree of fragmentation. ", Report.AverageFragments ); - strcat (Text, Text2); + wcscat (Text, Text2); } if (Report.PercentFragged < 5.0f && Report.AverageFragments < 1.1f) - sprintf (Text, "* No defragmentation is necessary at this point."); + swprintf (Text, L"* No defragmentation is necessary at this point."); else if (Report.PercentFragged < 15.0f && Report.AverageFragments < 1.3f) - strcat (Text, "It is recommended that you perform a Fast Defrag."); - else - strcat (Text, "It is recommended that you perform an Extensive Defrag."); + wcscat (Text, L"It is recommended that you perform a Fast Defrag."); + else + wcscat (Text, L"It is recommended that you perform an Extensive Defrag."); // Should we recommend a smaller cluster size? if (Report.PercentSlack >= 10.0f) { - sprintf + swprintf ( Text2, - "\n* A large amount of disk space (%.2f%%) is being lost " - "due to a large (%u bytes) cluster size. It is recommended " - "that you use a disk utility such as Partition Magic to " - "reduce the cluster size of this volume.", + L"\n* A large amount of disk space (%.2f%%) is being lost " + L"due to a large (%u bytes) cluster size. It is recommended " + L"that you use a disk utility such as Partition Magic to " + L"reduce the cluster size of this volume.", Report.PercentSlack, Defrag->GetVolume().GetVolumeInfo().ClusterSize ); - strcat (Text, Text2); + wcscat (Text, Text2); } SetDlgItemText (Dlg, IDC_RECOMMEND, Text); @@ -199,7 +199,7 @@ switch (Msg) { case WM_INITDIALOG: - SetReportInfo (Dlg, Defrag->GetDefragReport (), 1, "bytes", false); + SetReportInfo (Dlg, Defrag->GetDefragReport (), 1, L"bytes", false); return (1); case WM_COMMAND: @@ -210,19 +210,19 @@ return (1); case IDC_GIGABYTES: - SetReportInfo (Dlg, Defrag->GetDefragReport (), 1024*1024*1024, "GB", true); + SetReportInfo (Dlg, Defrag->GetDefragReport (), 1024*1024*1024, L"GB", true); return (1); case IDC_MEGABYTES: - SetReportInfo (Dlg, Defrag->GetDefragReport (), 1024*1024, "MB", false); + SetReportInfo (Dlg, Defrag->GetDefragReport (), 1024*1024, L"MB", false); return (1); case IDC_KILOBYTES: - SetReportInfo (Dlg, Defrag->GetDefragReport (), 1024, "KB", false); + SetReportInfo (Dlg, Defrag->GetDefragReport (), 1024, L"KB", false); return (1); case IDC_BYTES: - SetReportInfo (Dlg, Defrag->GetDefragReport (), 1, "bytes", false); + SetReportInfo (Dlg, Defrag->GetDefragReport (), 1, L"bytes", false); return (1); } } Modified: trunk/rosapps/fraginator/Unfrag.cpp URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Unfrag.cpp?rev=2…
============================================================================== --- trunk/rosapps/fraginator/Unfrag.cpp (original) +++ trunk/rosapps/fraginator/Unfrag.cpp Sat Apr 1 19:02:38 2006 @@ -27,7 +27,7 @@ // Need Windows 2000! // Check for NT first - // Actually what we do is check that we're not on Win31+Win32s and that we're + // Actually what we do is check that weLL're not on Win31+Win32s and that we're // not in Windows 9x. It's possible that there could be more Windows "platforms" // in the future and there's no sense in claiming incompatibility. if (OSVersion.dwPlatformId == VER_PLATFORM_WIN32s || @@ -36,7 +36,7 @@ return (false); } - // Ok we're in Windows NT, now make sure we're in 2000 + // Ok weLL're in Windows NT, now make sure we're in 2000 if (OSVersion.dwMajorVersion < 5) return (false); @@ -45,27 +45,27 @@ } -char *AddCommas (char *Result, uint64 Number) -{ - char Temp[128]; +wchar_t *AddCommas (wchar_t *Result, uint64 Number) +{ + wchar_t Temp[128]; int TempLen; - char *p = NULL; + wchar_t *p = NULL; int AddCommas = 0; - char *StrPosResult = NULL; - char *StrPosOrig = NULL; + wchar_t *StrPosResult = NULL; + wchar_t *StrPosOrig = NULL; // we get the string form of the number, then we count down w/ AddCommas // while copying the string from Temp1 to Result. when AddCommas % 3 == 1, // slap in a commas as well, before the #. - sprintf (Temp, "%I64u", Number); - AddCommas = TempLen = strlen (Temp); + swprintf (Temp, L"%I64u", Number); + AddCommas = TempLen = wcslen (Temp); StrPosOrig = Temp; StrPosResult = Result; while (AddCommas) { if ((AddCommas % 3) == 0 && AddCommas != TempLen) // avoid stuff like ",345" { - *StrPosResult = ','; + *StrPosResult = L','; StrPosResult++; } @@ -84,9 +84,9 @@ void PrintBanner (void) { - printf ("%s v%s\n", APPNAME_CLI, APPVER_STR); - printf ("%s\n", APPCOPYRIGHT); - printf ("\n"); + wprintf (L"%s v%s\n", APPNAME_CLI, APPVER_STR); + wprintf (L"%s\n", APPCOPYRIGHT); + wprintf (L"\n"); return; } @@ -94,23 +94,23 @@ void FraggerHelp (void) { - printf ("Usage: unfrag drive: [...] <-f | -e>\n"); - printf ("\n"); - printf ("drive: : The drive to defrag. Should be two characters long, ie 'c:' or 'd:'.\n"); - printf (" Multiple drives may be given, and all will be simultaneously\n"); - printf (" defragmented using the same options.\n"); - printf ("-f : Do a fast defragmentation. Files that are not fragmented will not be\n"); - printf (" moved. Only one pass is made over the file list. Using this option\n"); - printf (" may result in not all files being defragmented, depending on\n"); - printf (" available disk space.\n"); - printf ("-e : Do an extensive defragmention. Files will be moved in an attempt to\n"); - printf (" defragment both files and free space.\n"); + wprintf (L"Usage: unfrag drive: [...] <-f | -e>\n"); + wprintf (L"\n"); + wprintf (L"drive: : The drive to defrag. Should be two characters long, ie 'c:' or 'd:'.\n"); + wprintf (L" Multiple drives may be given, and all will be simultaneously\n"); + wprintf (L" defragmented using the same options.\n"); + wprintf (L"-f : Do a fast defragmentation. Files that are not fragmented will not be\n"); + wprintf (L" moved. Only one pass is made over the file list. Using this option\n"); + wprintf (L" may result in not all files being defragmented, depending on\n"); + wprintf (L" available disk space.\n"); + wprintf (L"-e : Do an extensive defragmention. Files will be moved in an attempt to\n"); + wprintf (L" defragment both files and free space.\n"); if (!CheckWinVer()) { - printf ("\n"); - printf ("NOTE: This program requires Windows 2000, which is not presently running on\n"); - printf ("this system.\n"); + wprintf (L"\n"); + wprintf (L"NOTE: This program requires Windows 2000, which is not presently running on\n"); + wprintf (L"this system.\n"); } return; @@ -129,7 +129,7 @@ } -Defragment *StartDefragThread (string Drive, DefragType Method, HANDLE &Handle) +Defragment *StartDefragThread (wstring Drive, DefragType Method, HANDLE &Handle) { Defragment *Defragger; unsigned long Thread; @@ -143,12 +143,11 @@ // Main Initialization -int __cdecl main (int argc, char **argv) -{ - vector<string> Drives; +int wmain (int argc, wchar_t **argv) +{ + vector<wstring> Drives; vector<Defragment *> Defrags; DefragType DefragMode = DefragInvalid; - int d; PrintBanner (); @@ -156,21 +155,21 @@ bool ValidCmdLine = false; for (int c = 0; c < argc; c++) { - if (strlen(argv[c]) == 2 && argv[c][1] == ':') - { - Drives.push_back (strupr(argv[c])); + if (wcslen(argv[c]) == 2 && argv[c][1] == L':') + { + Drives.push_back (wcsupr(argv[c])); } else - if (argv[c][0] == '-' || argv[c][0] == '/' && strlen(argv[c]) == 2) + if (argv[c][0] == L'-' || argv[c][0] == L'/' && wcslen(argv[c]) == 2) { switch (tolower(argv[c][1])) { - case '?' : - case 'h' : + case L'?' : + case L'h' : FraggerHelp (); return (0); - case 'f' : + case L'f' : if (DefragMode != DefragInvalid) { ValidCmdLine = false; @@ -180,7 +179,7 @@ ValidCmdLine = true; break; - case 'e' : + case L'e' : if (DefragMode != DefragInvalid) { ValidCmdLine = false; @@ -199,25 +198,25 @@ if (!ValidCmdLine) { - printf ("Invalid command-line options. Use '%s -?' for help.\n", argv[0]); + wprintf (L"Invalid command-line options. Use '%s -?' for help.\n", argv[0]); return (0); } // Check OS requirements if (!CheckWinVer()) { - printf ("Fatal Error: This program requires Windows 2000.\n"); + wprintf (L"Fatal Error: This program requires Windows 2000.\n"); return (0); } - for (d = 0; d < Drives.size (); d++) + for (size_t d = 0; d < Drives.size (); d++) { HANDLE TossMe; Defrags.push_back (StartDefragThread (Drives[d], DefragMode, TossMe)); } - for (d = 0; d < Drives.size () - 1; d++) - printf ("\n "); + for (size_t d = 0; d < Drives.size () - 1; d++) + wprintf (L"\n "); bool Continue = true; HANDLE Screen; @@ -237,14 +236,14 @@ ScreenInfo.dwCursorPosition.Y -= Drives.size(); SetConsoleCursorPosition (Screen, ScreenInfo.dwCursorPosition); - for (d = 0; d < Drives.size (); d++) - { - printf ("\n%6.2f%% %-70s", Defrags[d]->GetStatusPercent(), Defrags[d]->GetStatusString().c_str()); + for (size_t d = 0; d < Drives.size (); d++) + { + wprintf (L"\n%6.2f%% %-70s", Defrags[d]->GetStatusPercent(), Defrags[d]->GetStatusString().c_str()); } // Determine if we should keep going Continue = false; - for (d = 0; d < Drives.size (); d++) + for (size_t d = 0; d < Drives.size (); d++) { if (!Defrags[d]->IsDoneYet() && !Defrags[d]->HasError()) Continue = true; @@ -260,43 +259,43 @@ Drive = new DriveVolume; // First thing: build a file list. - printf ("Opening volume %s ...", Drives[d].c_str()); + wprintf (L"Opening volume %s ...", Drives[d].c_str()); if (!Drive->Open (Drives[d])) { - printf ("FAILED\n\n"); + wprintf (L"FAILED\n\n"); delete Drive; continue; } - printf ("\n"); - - printf (" Getting drive bitmap ..."); + wprintf (L"\n"); + + wprintf (L" Getting drive bitmap ..."); if (!Drive->GetBitmap ()) { - printf ("FAILED\n\n"); + wprintf (L"FAILED\n\n"); delete Drive; continue; } - printf ("\n"); - - printf (" Obtaining drive geometry ..."); + wprintf (L"\n"); + + wprintf (L" Obtaining drive geometry ..."); if (!Drive->ObtainInfo ()) { - printf ("FAILED\n\n"); + wprintf (L"FAILED\n\n"); delete Drive; continue; } - printf ("\n"); - - printf (" Building file database for drive %s ...", Drives[d].c_str()); + wprintf (L"\n"); + + wprintf (L" Building file database for drive %s ...", Drives[d].c_str()); if (!Drive->BuildFileList ()) { - printf ("FAILED\n\n"); + wprintf (L"FAILED\n\n"); delete Drive; continue; } - printf ("\n"); - - printf (" %u files\n", Drive->GetDBFileCount ()); + wprintf (L"\n"); + + wprintf (L" %u files\n", Drive->GetDBFileCount ()); // Analyze only? if (DefragMode == DefragAnalyze) @@ -306,9 +305,9 @@ uint64 SlackBytes = 0; // wasted space due to slack uint32 Fragged = 0; // fragmented files - printf (" Analyzing ..."); + wprintf (L" Analyzing ..."); if (VerboseMode) - printf ("\n"); + wprintf (L"\n"); for (int i = 0; i < Drive->GetDBFileCount(); i++) { @@ -328,16 +327,16 @@ if (VerboseMode) { - printf (" %s%s, ", Drive->GetDBDir (Info.DirIndice).c_str(), Info.Name.c_str()); + wprintf (L" %s%s, ", Drive->GetDBDir (Info.DirIndice).c_str(), Info.Name.c_str()); if (Info.Attributes.AccessDenied) - printf ("access was denied\n"); + wprintf (L"access was denied\n"); else { if (Info.Attributes.Unmovable == 1) - printf ("unmovable, "); - - printf ("%I64u bytes, %I64u bytes on disk, %I64u bytes slack, %u fragments\n", + wprintf (L"unmovable, "); + + wprintf (L"%I64u bytes, %I64u bytes on disk, %I64u bytes slack, %u fragments\n", Info.Size, Used, Slack, Info.Fragments.size()); } } @@ -347,23 +346,23 @@ } if (!VerboseMode) - printf ("\n"); + wprintf (L"\n"); // TODO: Make it not look like ass - printf ("\n"); - printf (" Overall Analysis\n"); - printf (" ----------------\n"); - printf (" %u clusters\n", Drive->GetClusterCount ()); - printf (" %u bytes per cluster\n", Drive->GetClusterSize()); - printf (" %I64u total bytes on drive\n", (uint64)Drive->GetClusterCount() * (uint64)Drive->GetClusterSize()); - printf ("\n"); - printf (" %u files\n", Drive->GetDBFileCount ()); - printf (" %u contiguous files\n", Drive->GetDBFileCount () - Fragged); - printf (" %u fragmented files\n", Fragged); - printf ("\n"); - printf (" %I64u bytes\n", TotalBytes); - printf (" %I64u bytes on disk\n", UsedBytes); - printf (" %I64u bytes slack\n", SlackBytes); + wprintf (L"\n"); + wprintf (L" Overall Analysis\n"); + wprintf (L" ----------------\n"); + wprintf (L" %u clusters\n", Drive->GetClusterCount ()); + wprintf (L" %u bytes per cluster\n", Drive->GetClusterSize()); + wprintf (L" %I64u total bytes on drive\n", (uint64)Drive->GetClusterCount() * (uint64)Drive->GetClusterSize()); + wprintf (L"\n"); + wprintf (L" %u files\n", Drive->GetDBFileCount ()); + wprintf (L" %u contiguous files\n", Drive->GetDBFileCount () - Fragged); + wprintf (L" %u fragmented files\n", Fragged); + wprintf (L"\n"); + wprintf (L" %I64u bytes\n", TotalBytes); + wprintf (L" %I64u bytes on disk\n", UsedBytes); + wprintf (L" %I64u bytes slack\n", SlackBytes); } // Fast defragment! @@ -371,14 +370,14 @@ { uint32 i; uint64 FirstFreeLCN; - char PrintName[80]; + wchar_t PrintName[80]; int Width = 66; if (DefragMode == DefragFast) - printf (" Performing fast file defragmentation ...\n"); + wprintf (L" Performing fast file defragmentation ...\n"); else if (DefragMode == DefragExtensive) - printf (" Performing extensive file defragmentation\n"); + wprintf (L" Performing extensive file defragmentation\n"); // Find first free LCN for speedier searches ... Drive->FindFreeRange (0, 1, FirstFreeLCN); @@ -389,12 +388,12 @@ bool Result; uint64 TargetLCN; - printf ("\r"); + wprintf (L"\r"); Info = Drive->GetDBFile (i); FitName (PrintName, Drive->GetDBDir (Info.DirIndice).c_str(), Info.Name.c_str(), Width); - printf (" %6.2f%% %-66s", (float)i / (float)Drive->GetDBFileCount() * 100.0f, PrintName); + wprintf (L" %6.2f%% %-66s", (float)i / (float)Drive->GetDBFileCount() * 100.0f, PrintName); // Can't defrag 0 byte files :) if (Info.Fragments.size() == 0) @@ -446,17 +445,17 @@ } if (!Success) - printf ("\n -> failed\n"); + wprintf (L"\n -> failed\n"); Drive->FindFreeRange (0, 1, FirstFreeLCN); } } - printf ("\n"); - } - printf ("Closing volume %s ...", Drives[d].c_str()); + wprintf (L"\n"); + } + wprintf (L"Closing volume %s ...", Drives[d].c_str()); delete Drive; - printf ("\n"); + wprintf (L"\n"); } #endif Modified: trunk/rosapps/fraginator/Unfrag.h URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Unfrag.h?rev=214…
============================================================================== --- trunk/rosapps/fraginator/Unfrag.h (original) +++ trunk/rosapps/fraginator/Unfrag.h Sat Apr 1 19:02:38 2006 @@ -32,12 +32,12 @@ #include <stdlib.h> -#define APPNAME_CLI "Unfrag" -#define APPNAME_GUI "Fraginator" -#define APPVER_STR "1.03" +#define APPNAME_CLI L"Unfrag" +#define APPNAME_GUI L"Fraginator" +#define APPVER_STR L"1.03" #define APPVER_NUM 1.03f -#define APPAUTHOR "Rick Brewster" -#define APPCOPYRIGHT "Copyright 2000-2002 Rick Brewster" +#define APPAUTHOR L"Rick Brewster" +#define APPCOPYRIGHT L"Copyright 2000-2002 Rick Brewster" #include <vector> @@ -73,10 +73,10 @@ class Defragment; -extern Defragment *StartDefragThread (string Drive, DefragType Method, HANDLE &Handle); +extern Defragment *StartDefragThread (wstring Drive, DefragType Method, HANDLE &Handle); -extern char *AddCommas (char *Result, uint64 Number); +extern wchar_t *AddCommas (wchar_t *Result, uint64 Number); #endif // UNFRAG_H Modified: trunk/rosapps/fraginator/default1.bin URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/default1.bin?rev…
============================================================================== --- trunk/rosapps/fraginator/default1.bin (original) +++ trunk/rosapps/fraginator/default1.bin Sat Apr 1 19:02:38 2006 @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<?xml version="1.0" encoding="utf-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> Removed: trunk/rosapps/fraginator/unfrag.exe URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/unfrag.exe?rev=2…
============================================================================== Binary file - no diff available. Removed: trunk/rosapps/fraginator/unfrag.mak URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/unfrag.mak?rev=2…
============================================================================== --- trunk/rosapps/fraginator/unfrag.mak (original) +++ trunk/rosapps/fraginator/unfrag.mak (removed) @@ -1,184 +1,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Based on unfrag.dsp -!IF "$(CFG)" == "" -CFG=unfrag - Win32 Debug -!MESSAGE No configuration specified. Defaulting to unfrag - Win32 Debug. -!ENDIF - -!IF "$(CFG)" != "unfrag - Win32 Release" && "$(CFG)" != "unfrag - Win32 Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "unfrag.mak" CFG="unfrag - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "unfrag - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "unfrag - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -CPP=xicl6.exe -RSC=rc.exe - -!IF "$(CFG)" == "unfrag - Win32 Release" - -OUTDIR=.\Release -INTDIR=.\Release -# Begin Custom Macros -OutDir=.\Release -# End Custom Macros - -ALL : "$(OUTDIR)\unfrag.exe" - - -CLEAN : - -@erase "$(INTDIR)\Defragment.obj" - -@erase "$(INTDIR)\DriveVolume.obj" - -@erase "$(INTDIR)\Unfrag.obj" - -@erase "$(INTDIR)\vc60.idb" - -@erase "$(OUTDIR)\unfrag.exe" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /G6 /Gr /MD /W3 /GX /Ox /Ot /Og /Oi /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\unfrag.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\unfrag.bsc" -BSC32_SBRS= \ - -LINK32=xilink6.exe -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\unfrag.pdb" /machine:I386 /out:"$(OUTDIR)\unfrag.exe" -LINK32_OBJS= \ - "$(INTDIR)\Defragment.obj" \ - "$(INTDIR)\DriveVolume.obj" \ - "$(INTDIR)\Unfrag.obj" - -"$(OUTDIR)\unfrag.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -SOURCE="$(InputPath)" -PostBuild_Desc=Copying to Program Files ... -DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep - -ALL : $(DS_POSTBUILD_DEP) - -# Begin Custom Macros -OutDir=.\Release -# End Custom Macros - -$(DS_POSTBUILD_DEP) : "$(OUTDIR)\unfrag.exe" - copy Release\unfrag.exe "c:\Program Files\Fraginator\unfrag.exe" - echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)" - -!ELSEIF "$(CFG)" == "unfrag - Win32 Debug" - -OUTDIR=.\unfrag___Win32_Debug -INTDIR=.\unfrag___Win32_Debug -# Begin Custom Macros -OutDir=.\unfrag___Win32_Debug -# End Custom Macros - -ALL : "$(OUTDIR)\unfrag.exe" - - -CLEAN : - -@erase "$(INTDIR)\Defragment.obj" - -@erase "$(INTDIR)\DriveVolume.obj" - -@erase "$(INTDIR)\Unfrag.obj" - -@erase "$(INTDIR)\vc60.idb" - -@erase "$(INTDIR)\vc60.pdb" - -@erase "$(OUTDIR)\unfrag.exe" - -@erase "$(OUTDIR)\unfrag.ilk" - -@erase "$(OUTDIR)\unfrag.pdb" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\unfrag.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\unfrag.bsc" -BSC32_SBRS= \ - -LINK32=xilink6.exe -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\unfrag.pdb" /debug /machine:I386 /out:"$(OUTDIR)\unfrag.exe" /pdbtype:sept -LINK32_OBJS= \ - "$(INTDIR)\Defragment.obj" \ - "$(INTDIR)\DriveVolume.obj" \ - "$(INTDIR)\Unfrag.obj" - -"$(OUTDIR)\unfrag.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ENDIF - -.c{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - - -!IF "$(NO_EXTERNAL_DEPS)" != "1" -!IF EXISTS("unfrag.dep") -!INCLUDE "unfrag.dep" -!ELSE -!MESSAGE Warning: cannot find "unfrag.dep" -!ENDIF -!ENDIF - - -!IF "$(CFG)" == "unfrag - Win32 Release" || "$(CFG)" == "unfrag - Win32 Debug" -SOURCE=.\Defragment.cpp - -"$(INTDIR)\Defragment.obj" : $(SOURCE) "$(INTDIR)" - - -SOURCE=.\DriveVolume.cpp - -"$(INTDIR)\DriveVolume.obj" : $(SOURCE) "$(INTDIR)" - - -SOURCE=.\Unfrag.cpp - -"$(INTDIR)\Unfrag.obj" : $(SOURCE) "$(INTDIR)" - - - -!ENDIF - Removed: trunk/rosapps/fraginator/unfrag.plg URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/unfrag.plg?rev=2…
============================================================================== --- trunk/rosapps/fraginator/unfrag.plg (original) +++ trunk/rosapps/fraginator/unfrag.plg (removed) @@ -1,48 +1,0 @@ -<html> -<body> -<pre> -<h1>Build Log</h1> -<h3> ---------------------Configuration: unfrag - Win32 Release-------------------- -</h3> -<h3>Command Lines</h3> -Creating temporary file "C:\TEMP\RSP9D8.tmp" with contents -[ -/nologo /G6 /Gr /MD /W3 /GX /Ox /Ot /Og /Oi /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fo"Release/" /Fd"Release/" /FD /c -"C:\src\Fraginator\Defragment.cpp" -"C:\src\Fraginator\DriveVolume.cpp" -"C:\src\Fraginator\Unfrag.cpp" -] -Creating command line "xicl6.exe @C:\TEMP\RSP9D8.tmp" -Creating temporary file "C:\TEMP\RSP9D9.tmp" with contents -[ -kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"Release/unfrag.pdb" /machine:I386 /out:"Release/unfrag.exe" -.\Release\Defragment.obj -.\Release\DriveVolume.obj -.\Release\Unfrag.obj -] -Creating command line "xilink6.exe @C:\TEMP\RSP9D9.tmp" -<h3>Output Window</h3> -Compiling... -Defragment.cpp -DriveVolume.cpp -Unfrag.cpp -Generating Code... -Linking... -xilink6: executing 'C:\PROGRA~1\MIAF9D~1\VC98\Bin\link.exe' -Creating temporary file "C:\TEMP\RSP9DB.bat" with contents -[ -@echo off -copy Release\unfrag.exe "c:\Program Files\Fraginator\unfrag.exe" -] -Creating command line "C:\TEMP\RSP9DB.bat" -Copying to Program Files ... - 1 file(s) copied. - - - -<h3>Results</h3> -unfrag.exe - 0 error(s), 0 warning(s) -</pre> -</body> -</html> Modified: trunk/rosapps/fraginator/unfrag.vcproj URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/unfrag.vcproj?re…
============================================================================== --- trunk/rosapps/fraginator/unfrag.vcproj (original) +++ trunk/rosapps/fraginator/unfrag.vcproj Sat Apr 1 19:02:38 2006 @@ -1,158 +1,233 @@ -<?xml version="1.0" encoding = "Windows-1252"?> +<?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" - Version="7.00" + Version="8,00" Name="unfrag" - SccProjectName="" - SccLocalPath=""> + ProjectGUID="{8E7E76C1-739B-46E5-99C2-A0504558164B}" + > <Platforms> <Platform - Name="Win32"/> + Name="Win32" + /> </Platforms> + <ToolFiles> + </ToolFiles> <Configurations> <Configuration Name="Release|Win32" - OutputDirectory=".\Release" - IntermediateDirectory=".\Release" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops" UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE" - CharacterSet="2"> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName=".\Release/unfrag.tlb" + /> <Tool Name="VCCLCompilerTool" Optimization="3" - GlobalOptimizations="TRUE" InlineFunctionExpansion="2" - EnableIntrinsicFunctions="TRUE" + EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" - OptimizeForProcessor="2" PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE" RuntimeLibrary="0" StructMemberAlignment="5" - BufferSecurityCheck="FALSE" + BufferSecurityCheck="false" PrecompiledHeaderFile=".\Release/unfrag.pch" - AssemblerListingLocation=".\Release/" - ObjectFile=".\Release/" - ProgramDataBaseFileName=".\Release/" WarningLevel="3" - SuppressStartupBanner="TRUE" - CallingConvention="1"/> - <Tool - Name="VCCustomBuildTool"/> + SuppressStartupBanner="true" + CallingConvention="1" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib" - OutputFile=".\Release/unfrag.exe" LinkIncremental="1" - SuppressStartupBanner="TRUE" - ProgramDatabaseFile=".\Release/unfrag.pdb" - SubSystem="1"/> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\Release/unfrag.tlb"/> + SuppressStartupBanner="true" + GenerateManifest="false" + GenerateDebugInformation="true" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> <Tool Name="VCPostBuildEventTool" Description="Copying to Program Files ..." - CommandLine="copy Release\unfrag.exe "c:\Program Files\Fraginator\unfrag.exe""/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> + CommandLine="copy Release\unfrag.exe "c:\Program Files\Fraginator\unfrag.exe"" + /> </Configuration> <Configuration Name="Debug|Win32" - OutputDirectory=".\unfrag___Win32_Debug" - IntermediateDirectory=".\unfrag___Win32_Debug" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops" UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE" - CharacterSet="2"> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName=".\unfrag___Win32_Debug/unfrag.tlb" + /> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE" BasicRuntimeChecks="3" RuntimeLibrary="1" - PrecompiledHeaderFile=".\unfrag___Win32_Debug/unfrag.pch" - AssemblerListingLocation=".\unfrag___Win32_Debug/" - ObjectFile=".\unfrag___Win32_Debug/" - ProgramDataBaseFileName=".\unfrag___Win32_Debug/" WarningLevel="3" - SuppressStartupBanner="TRUE" - DebugInformationFormat="4"/> - <Tool - Name="VCCustomBuildTool"/> + SuppressStartupBanner="true" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib" - OutputFile=".\unfrag___Win32_Debug/unfrag.exe" LinkIncremental="2" - SuppressStartupBanner="TRUE" - GenerateDebugInformation="TRUE" - ProgramDatabaseFile=".\unfrag___Win32_Debug/unfrag.pdb" - SubSystem="1"/> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\unfrag___Win32_Debug/unfrag.tlb"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> + SuppressStartupBanner="true" + GenerateManifest="false" + GenerateDebugInformation="true" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> </Configuration> </Configurations> + <References> + </References> <Files> <Filter Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - <File - RelativePath=".\Defragment.cpp"> - </File> - <File - RelativePath=".\DriveVolume.cpp"> - </File> - <File - RelativePath=".\Unfrag.cpp"> + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > + <File + RelativePath=".\Defragment.cpp" + > + </File> + <File + RelativePath=".\DriveVolume.cpp" + > + </File> + <File + RelativePath=".\Unfrag.cpp" + > </File> </Filter> <Filter Name="Header Files" - Filter="h;hpp;hxx;hm;inl"> - <File - RelativePath=".\Defragment.h"> - </File> - <File - RelativePath=".\DriveVolume.h"> - </File> - <File - RelativePath=".\Mutex.h"> - </File> - <File - RelativePath=".\Unfrag.h"> + Filter="h;hpp;hxx;hm;inl" + > + <File + RelativePath=".\Defragment.h" + > + </File> + <File + RelativePath=".\DriveVolume.h" + > + </File> + <File + RelativePath=".\Mutex.h" + > + </File> + <File + RelativePath=".\Unfrag.h" + > </File> </Filter> <Filter Name="Resource Files" - Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> + Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" + > </Filter> </Files> <Globals>
19 years
1
0
0
0
← Newer
1
...
30
31
32
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