ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
May 2008
----- 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
25 participants
586 discussions
Start a n
N
ew thread
[dchapyshev] 33317: - Add new dll's to bootcd
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Tue May 6 04:20:48 2008 New Revision: 33317 URL:
http://svn.reactos.org/svn/reactos?rev=33317&view=rev
Log: - Add new dll's to bootcd Modified: trunk/reactos/boot/bootdata/packages/reactos.dff Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] Tue May 6 04:20:48 2008 @@ -233,6 +233,7 @@ dll\win32\icmp\icmp.dll 1 dll\win32\imagehlp\imagehlp.dll 1 dll\win32\imm32\imm32.dll 1 +dll\win32\inetcomm\inetcomm.dll 1 dll\win32\iphlpapi\iphlpapi.dll 1 dll\win32\kernel32\kernel32.dll 1 dll\win32\lsasrv\lsasrv.dll 1 @@ -253,6 +254,7 @@ dll\win32\msvfw32\msvfw32.dll 1 dll\win32\mswsock\mswsock.dll 1 dll\win32\msxml3\msxml3.dll 1 +dll\win32\nddeapi\nddeapi.dll 1 dll\win32\netapi32\netapi32.dll 1 dll\win32\netcfgx\netcfgx.dll 1 dll\win32\netid\netid.dll 1
16 years, 8 months
1
0
0
0
[dchapyshev] 33316: - Add & update headers
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Tue May 6 04:20:08 2008 New Revision: 33316 URL:
http://svn.reactos.org/svn/reactos?rev=33316&view=rev
Log: - Add & update headers Added: trunk/reactos/include/psdk/imnact.idl trunk/reactos/include/psdk/imnxport.idl trunk/reactos/include/psdk/mimeole.idl Modified: trunk/reactos/include/ddk/imm.h trunk/reactos/include/psdk/imm.h trunk/reactos/include/psdk/psdk.rbuild trunk/reactos/include/psdk/wingdi.h trunk/reactos/include/psdk/winuser.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/include/ddk/imm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/imm.h?rev=3331…
Modified: trunk/reactos/include/psdk/imm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/imm.h?rev=333…
Added: trunk/reactos/include/psdk/imnact.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/imnact.idl?re…
Added: trunk/reactos/include/psdk/imnxport.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/imnxport.idl?…
Added: trunk/reactos/include/psdk/mimeole.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/mimeole.idl?r…
Modified: trunk/reactos/include/psdk/psdk.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/psdk.rbuild?r…
Modified: trunk/reactos/include/psdk/wingdi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wingdi.h?rev=…
Modified: trunk/reactos/include/psdk/winuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winuser.h?rev…
16 years, 8 months
1
0
0
0
[dchapyshev] 33315: - Add baseaddress for inetcomm.dll and nddeapi.dll
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Tue May 6 04:17:31 2008 New Revision: 33315 URL:
http://svn.reactos.org/svn/reactos?rev=33315&view=rev
Log: - Add baseaddress for inetcomm.dll and nddeapi.dll Modified: trunk/reactos/baseaddress.rbuild Modified: trunk/reactos/baseaddress.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/baseaddress.rbuild?rev=333…
============================================================================== --- trunk/reactos/baseaddress.rbuild [iso-8859-1] (original) +++ trunk/reactos/baseaddress.rbuild [iso-8859-1] Tue May 6 04:17:31 2008 @@ -110,10 +110,12 @@ <property name="BASEADDRESS_CABINET" value="0x75120000" /> <property name="BASEADDRESS_NETCFGX" value="0x755F0000" /> <property name="BASEADDRESS_IPHLPAPI" value="0x75700000" /> + <property name="BASEADDRESS_NDDEAPI" value="0x75940000" /> <property name="BASEADDRESS_MSGINA" value="0x75970000" /> <property name="BASEADDRESS_CRYPTNET" value="0x75e60000" /> <property name="BASEADDRESS_RPCRT4" value="0x76000000" /> <property name="BASEADDRESS_SHLWAPI" value="0x76120000" /> + <property name="BASEADDRESS_INETCOMM" value="0x76150000" /> <property name="BASEADDRESS_COMCTL32" value="0x76160000" /> <property name="BASEADDRESS_COMDLG32" value="0x76210000" /> <property name="BASEADDRESS_WINSTA" value="0x762F0000" />
16 years, 8 months
1
0
0
0
[dchapyshev] 33314: - advapi32: Small implementation RegConnectRegistryW (from wine) - Add inetcomm.dll from wine - Add nddeapi.dll from wine - Sync imm32 with wine
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Tue May 6 04:16:21 2008 New Revision: 33314 URL:
http://svn.reactos.org/svn/reactos?rev=33314&view=rev
Log: - advapi32: Small implementation RegConnectRegistryW (from wine) - Add inetcomm.dll from wine - Add nddeapi.dll from wine - Sync imm32 with wine Added: trunk/reactos/dll/win32/inetcomm/ trunk/reactos/dll/win32/inetcomm/inetcomm.rbuild (with props) trunk/reactos/dll/win32/inetcomm/inetcomm.spec (with props) trunk/reactos/dll/win32/inetcomm/inetcomm_main.c (with props) trunk/reactos/dll/win32/inetcomm/inetcomm_private.h (with props) trunk/reactos/dll/win32/inetcomm/internettransport.c (with props) trunk/reactos/dll/win32/inetcomm/mimeole.c (with props) trunk/reactos/dll/win32/inetcomm/regsvr.c (with props) trunk/reactos/dll/win32/nddeapi/ trunk/reactos/dll/win32/nddeapi/nddeapi.c (with props) trunk/reactos/dll/win32/nddeapi/nddeapi.rbuild (with props) trunk/reactos/dll/win32/nddeapi/nddeapi.spec (with props) Modified: trunk/reactos/dll/win32/advapi32/reg/reg.c trunk/reactos/dll/win32/imm32/imm.c trunk/reactos/dll/win32/imm32/imm32.spec trunk/reactos/dll/win32/win32.rbuild [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/advapi32/reg/reg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/reg…
Modified: trunk/reactos/dll/win32/imm32/imm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/imm32/imm.c?rev=…
Modified: trunk/reactos/dll/win32/imm32/imm32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/imm32/imm32.spec…
Added: trunk/reactos/dll/win32/inetcomm/inetcomm.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/inetcom…
Added: trunk/reactos/dll/win32/inetcomm/inetcomm.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/inetcom…
Added: trunk/reactos/dll/win32/inetcomm/inetcomm_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/inetcom…
Added: trunk/reactos/dll/win32/inetcomm/inetcomm_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/inetcom…
Added: trunk/reactos/dll/win32/inetcomm/internettransport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/interne…
Added: trunk/reactos/dll/win32/inetcomm/mimeole.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/mimeole…
Added: trunk/reactos/dll/win32/inetcomm/regsvr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/regsvr.…
Added: trunk/reactos/dll/win32/nddeapi/nddeapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/nddeapi/nddeapi.…
Added: trunk/reactos/dll/win32/nddeapi/nddeapi.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/nddeapi/nddeapi.…
Added: trunk/reactos/dll/win32/nddeapi/nddeapi.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/nddeapi/nddeapi.…
Modified: trunk/reactos/dll/win32/win32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/win32.rbuild?rev…
16 years, 8 months
1
0
0
0
[janderwald] 33313: - check for WHQL for display adapters (using d3d9) - destroy all dialogs on exit - fix a bug in destroying the dialogs - halfplement checking WHQL for audio drivers
by janderwald@svn.reactos.org
Author: janderwald Date: Tue May 6 02:46:58 2008 New Revision: 33313 URL:
http://svn.reactos.org/svn/reactos?rev=33313&view=rev
Log: - check for WHQL for display adapters (using d3d9) - destroy all dialogs on exit - fix a bug in destroying the dialogs - halfplement checking WHQL for audio drivers Modified: trunk/reactos/base/applications/dxdiag/display.c trunk/reactos/base/applications/dxdiag/dxdiag.c trunk/reactos/base/applications/dxdiag/dxdiag.rbuild trunk/reactos/base/applications/dxdiag/precomp.h trunk/reactos/base/applications/dxdiag/sound.c Modified: trunk/reactos/base/applications/dxdiag/display.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/d…
============================================================================== --- trunk/reactos/base/applications/dxdiag/display.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/dxdiag/display.c [iso-8859-1] Tue May 6 02:46:58 2008 @@ -215,6 +215,36 @@ HWND hDlgCtrls[5]; DWORD dwMemory; DEVMODE DevMode; + IDirect3D9 * ppObj; + D3DADAPTER_IDENTIFIER9 Identifier; + HRESULT hResult; + + szText[0] = L'\0'; + ppObj = Direct3DCreate9(D3D_SDK_VERSION); + if (ppObj) + { + hResult = IDirect3D9_GetAdapterIdentifier(ppObj, D3DADAPTER_DEFAULT , 2/*D3DENUM_WHQL_LEVEL*/, &Identifier); + if (hResult == D3D_OK) + { + + if (Identifier.WHQLLevel) + { + /* adapter is WHQL certified */ + LoadStringW(hInst, IDS_OPTION_YES, szText, sizeof(szText)/sizeof(WCHAR)); + } + else + { + LoadStringW(hInst, IDS_OPTION_NO, szText, sizeof(szText)/sizeof(WCHAR)); + } + } + IDirect3D9_Release(ppObj); + } + else + { + LoadStringW(hInst, IDS_DEVICE_STATUS_UNKNOWN, szText, sizeof(szText)/sizeof(WCHAR)); + } + szText[(sizeof(szText)/sizeof(WCHAR))-1] = L'\0'; + SendDlgItemMessageW(hwndDlg, IDC_STATIC_ADAPTER_LOGO, WM_SETTEXT, 0, (LPARAM)szText); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, &pDispDevice->DeviceKey[18], 0, KEY_READ, &hKey) != ERROR_SUCCESS) return FALSE; Modified: trunk/reactos/base/applications/dxdiag/dxdiag.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/d…
============================================================================== --- trunk/reactos/base/applications/dxdiag/dxdiag.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/dxdiag/dxdiag.c [iso-8859-1] Tue May 6 02:46:58 2008 @@ -19,11 +19,27 @@ { UINT Index; - for(Index = 0; Index < 7; Index++) + /* destroy default dialogs */ + for(Index = 0; Index < sizeof(pContext->hDialogs) / sizeof(HWND); Index++) { if (pContext->hDialogs[Index]) DestroyWindow(pContext->hDialogs[Index]); } + + /* destroy display dialogs */ + for(Index = 0; Index < pContext->NumDisplayAdapter; Index++) + { + if (pContext->hDisplayWnd[Index]) + DestroyWindow(pContext->hDisplayWnd[Index]); + } + + /* destroy audio dialogs */ + for(Index = 0; Index < pContext->NumSoundAdapter; Index++) + { + if (pContext->hSoundWnd[Index]) + DestroyWindow(pContext->hSoundWnd[Index]); + } + } //--------------------------------------------------------------- Modified: trunk/reactos/base/applications/dxdiag/dxdiag.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/d…
============================================================================== --- trunk/reactos/base/applications/dxdiag/dxdiag.rbuild [iso-8859-1] (original) +++ trunk/reactos/base/applications/dxdiag/dxdiag.rbuild [iso-8859-1] Tue May 6 02:46:58 2008 @@ -20,6 +20,8 @@ <library>version</library> <library>gdi32</library> <library>winmm</library> + <library>wintrust</library> + <library>d3d9</library> <file>system.c</file> <file>display.c</file> <file>sound.c</file> Modified: trunk/reactos/base/applications/dxdiag/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/p…
============================================================================== --- trunk/reactos/base/applications/dxdiag/precomp.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/dxdiag/precomp.h [iso-8859-1] Tue May 6 02:46:58 2008 @@ -13,10 +13,15 @@ #include <setupapi.h> #include <commctrl.h> #include <dinput.h> +#include <d3d9.h> #include <ddraw.h> + #include <dsound.h> #include <mmreg.h> +#include <wintrust.h> +#include <softpub.h> +#include <mscat.h> #include "resource.h" typedef struct @@ -28,10 +33,7 @@ ULONG NumSoundAdapter; HWND * hSoundWnd; HWND hDialogs[5]; - }DXDIAG_CONTEXT, *PDXDIAG_CONTEXT; - - /* globals */ extern HINSTANCE hInst; @@ -44,10 +46,7 @@ INT_PTR CALLBACK InputPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK NetworkPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK HelpPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL GetRegValue(HKEY hBaseKey, LPWSTR SubKey, LPWSTR ValueName, DWORD Type, LPWSTR Result, DWORD Size); -VOID InsertTabCtrlItem(HWND hDlgCtrl, INT Position, LPWSTR uId); -VOID EnumerateDrivers(PVOID Context, HDEVINFO hList, PSP_DEVINFO_DATA pInfoData); /* DirectDraw tests */ VOID DDTests(); @@ -57,6 +56,11 @@ /* display adapter initialization */ void InitializeDisplayAdapters(PDXDIAG_CONTEXT pContext); +/* general functions */ BOOL GetFileVersion(LPCWSTR szAppName, WCHAR * szVer, DWORD szVerSize); BOOL GetFileModifyTime(LPCWSTR pFullPath, WCHAR * szTime, int szTimeSize); +BOOL GetCatFileFromDriverPath(LPWSTR szFileName, LPWSTR szCatFileName); +BOOL GetRegValue(HKEY hBaseKey, LPWSTR SubKey, LPWSTR ValueName, DWORD Type, LPWSTR Result, DWORD Size); +VOID InsertTabCtrlItem(HWND hDlgCtrl, INT Position, LPWSTR uId); +VOID EnumerateDrivers(PVOID Context, HDEVINFO hList, PSP_DEVINFO_DATA pInfoData); #endif Modified: trunk/reactos/base/applications/dxdiag/sound.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/s…
============================================================================== --- trunk/reactos/base/applications/dxdiag/sound.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/dxdiag/sound.c [iso-8859-1] Tue May 6 02:46:58 2008 @@ -11,6 +11,91 @@ //#include <initguid.h> #include <devguid.h> +#if 0 +BOOL +GetCatFileFromDriverPath(LPWSTR szFileName, LPWSTR szCatFileName) +{ + GUID VerifyGuid = DRIVER_ACTION_VERIFY; + HANDLE hFile; + DWORD dwHash; + BYTE bHash[100]; + HCATINFO hCatInfo; + HCATADMIN hActAdmin; + BOOL bRet = FALSE; + CATALOG_INFO CatInfo; + + /* attempt to open file */ + hFile = CreateFileW(szFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (hFile == INVALID_HANDLE_VALUE) + return FALSE; + + /* calculate hash from file handle */ + dwHash = sizeof(bHash); + if (!CryptCATAdminCalcHashFromFileHandle(hFile, &dwHash, bHash, 0)) + { + CloseHandle(hFile); + return FALSE; + } + + /* try open the CAT admin */ + if (!CryptCATAdminAcquireContext(&hActAdmin, &VerifyGuid, 0)) + { + CloseHandle(hFile); + return FALSE; + } + + /* search catalog to find for catalog containing this hash */ + hCatInfo = CryptCATAdminEnumCatalogFromHash(hActAdmin, bHash, dwHash, 0, NULL); + if (hCatInfo != NULL) + { + /* theres a catalog get the filename */ + bRet = CryptCATCatalogInfoFromContext(hCatInfo, &CatInfo, 0); + if (bRet) + wcscpy(szCatFileName, CatInfo.wszCatalogFile); + CryptCATAdminReleaseCatalogContext(hActAdmin, hCatInfo, 0); + } + + /* perform cleanup */ + CloseHandle(hFile); + CryptCATAdminReleaseContext(hActAdmin, 0); + return bRet; +} + +BOOL +IsDriverWHQL(LPWSTR szFileName) +{ + WCHAR szCatFile[MAX_PATH]; + HANDLE hCat; + BOOL bRet = FALSE; + + /* get the driver's cat file */ + if (!GetCatFileFromDriverPath(szFileName, szCatFile)) + { + /* driver has no cat so its definately not WHQL signed */ + return FALSE; + } + + /* open the CAT file */ + hCat = CryptCATOpen(szCatFile, CRYPTCAT_OPEN_EXISTING, 0, 0, 0); + if (hCat == INVALID_HANDLE_VALUE) + { + /* couldnt open cat */ + return FALSE; + } + + /* FIXME + * build certificate chain with CertGetCertificateChain + * verify certificate chain (WinVerifyTrust) + * retrieve signer (WTHelperGetProvSignerFromChain) + */ + + + /* close CAT file */ + CryptCATClose(hCat); + return bRet; +} +#endif + static void SetDeviceDetails(HWND hwndDlg, LPCGUID classGUID, LPCWSTR lpcstrDescription) @@ -18,11 +103,12 @@ HDEVINFO hInfo; DWORD dwIndex = 0; SP_DEVINFO_DATA InfoData; - WCHAR szText[100]; + WCHAR szText[30]; HWND hDlgCtrls[3]; WAVEOUTCAPSW waveOut; UINT numDev; MMRESULT errCode; + /* enumerate waveout devices */ numDev = waveOutGetNumDevs(); @@ -107,6 +193,9 @@ HWND hwndDlg; WCHAR szSound[20]; WCHAR szText[30]; + IDirectSound8 *pObj; + HRESULT hResult; + DWORD dwCertified; if (!lpGuid) return TRUE; @@ -123,6 +212,26 @@ hwndDlg = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_SOUND_DIALOG), pContext->hMainDialog, SoundPageWndProc, (LPARAM)pContext); if (!hwndDlg) return FALSE; + + hResult = DirectSoundCreate8(lpGuid, (LPDIRECTSOUND8*)&pObj, NULL); + if (hResult == DS_OK) + { + szText[0] = L'\0'; + if (IDirectSound8_VerifyCertification(pObj, &dwCertified) == DS_OK) + { + if (dwCertified == DS_CERTIFIED) + LoadStringW(hInst, IDS_OPTION_YES, szText, sizeof(szText)/sizeof(WCHAR)); + else if (dwCertified == DS_UNCERTIFIED) + LoadStringW(hInst, IDS_OPTION_NO, szText, sizeof(szText)/sizeof(WCHAR)); + } + else + { + LoadStringW(hInst, IDS_OPTION_NO, szText, sizeof(szText)/sizeof(WCHAR)); + } + szText[(sizeof(szText)/sizeof(WCHAR))-1] = L'\0'; + SendDlgItemMessageW(hwndDlg, IDC_STATIC_DSOUND_LOGO, WM_SETTEXT, 0, (LPARAM)szText); + IDirectSound8_Release(pObj); + } /* set device name */ SendDlgItemMessageW(hwndDlg, IDC_STATIC_DSOUND_NAME, WM_SETTEXT, 0, (LPARAM)lpcstrDescription); @@ -156,10 +265,10 @@ void InitializeDirectSoundPage(PDXDIAG_CONTEXT pContext) { HRESULT hResult; - //IDirectSound8 *pObj; + /* create DSound object */ -// hResult = DirectSoundCreate8(NULL, (LPDIRECTSOUND8*)&pObj, NULL); + // if (hResult != DS_OK) // return; hResult = DirectSoundEnumerateW(DSEnumCallback, pContext);
16 years, 8 months
1
0
0
0
[janderwald] 33312: - define LPD3DVECTOR_DEFINED when d3d9 and dsound header is used - sync mscat.h from wine and add a few required definitions
by janderwald@svn.reactos.org
Author: janderwald Date: Tue May 6 02:18:38 2008 New Revision: 33312 URL:
http://svn.reactos.org/svn/reactos?rev=33312&view=rev
Log: - define LPD3DVECTOR_DEFINED when d3d9 and dsound header is used - sync mscat.h from wine and add a few required definitions Modified: trunk/reactos/include/psdk/dsound.h trunk/reactos/include/psdk/mscat.h Modified: trunk/reactos/include/psdk/dsound.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/dsound.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/dsound.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/dsound.h [iso-8859-1] Tue May 6 02:18:38 2008 @@ -55,9 +55,16 @@ float x; float y; float z; -} D3DVECTOR, *LPD3DVECTOR; +} D3DVECTOR; #define D3DVECTOR_DEFINED #endif + +#ifndef LPD3DVECTOR_DEFINED +typedef D3DVECTOR *LPD3DVECTOR; +#define LPD3DVECTOR_DEFINED +#endif + + #define DX_SHARED_DEFINES #endif /* DX_SHARED_DEFINES */ Modified: trunk/reactos/include/psdk/mscat.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/mscat.h?rev=3…
============================================================================== --- trunk/reactos/include/psdk/mscat.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/mscat.h [iso-8859-1] Tue May 6 02:18:38 2008 @@ -29,6 +29,12 @@ #endif +#define CRYPTCAT_OPEN_CREATENEW 1 +#define CRYPTCAT_OPEN_ALWAYS 2 +#define CRYPTCAT_OPEN_EXISTING 4 + + + #include <pshpack8.h> typedef struct CRYPTCATMEMBER_ { @@ -45,16 +51,39 @@ CRYPT_ATTR_BLOB sEncodedMemberInfo; } CRYPTCATMEMBER; +typedef struct CRYPTCATATTRIBUTE_ +{ + DWORD cbStruct; + LPWSTR pwszReferenceTag; + DWORD dwAttrTypeAndAction; + DWORD cbValue; + BYTE *pbValue; + DWORD dwReserved; +}CRYPTCATATTRIBUTE; + +typedef struct CATALOG_INFO_ +{ + DWORD cbStruct; + WCHAR wszCatalogFile[MAX_PATH]; +} CATALOG_INFO; + + #include <poppack.h> - BOOL WINAPI CryptCATAdminAcquireContext(HCATADMIN*,const GUID*,DWORD); +BOOL WINAPI CryptCATAdminAddCatalog(HCATADMIN,PWSTR,PWSTR,DWORD); BOOL WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE,DWORD*,BYTE*,DWORD); HCATINFO WINAPI CryptCATAdminEnumCatalogFromHash(HCATADMIN,BYTE*,DWORD,DWORD,HCATINFO*); +BOOL WINAPI CryptCATAdminReleaseCatalogContext(HCATADMIN,HCATINFO,DWORD); BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN,DWORD); +BOOL WINAPI CryptCATAdminRemoveCatalog(HCATADMIN,LPCWSTR,DWORD); BOOL WINAPI CryptCATClose(HANDLE); +BOOL WINAPI CryptCATCatalogInfoFromContext(HCATINFO,CATALOG_INFO*,DWORD); + CRYPTCATMEMBER* WINAPI CryptCATEnumerateMember(HANDLE,CRYPTCATMEMBER*); HANDLE WINAPI CryptCATOpen(LPWSTR,DWORD,HCRYPTPROV,DWORD,DWORD); +CRYPTCATATTRIBUTE* WINAPI CryptCATEnumerateAttr(HANDLE hCatalog, CRYPTCATMEMBER*,CRYPTCATATTRIBUTE*); +CRYPTCATATTRIBUTE* WINAPI CryptCATEnumerateCatAttr(HANDLE,CRYPTCATATTRIBUTE*); #ifdef __cplusplus }
16 years, 8 months
1
0
0
0
[hpoussin] 33311: Fix indentation
by hpoussin@svn.reactos.org
Author: hpoussin Date: Tue May 6 01:57:05 2008 New Revision: 33311 URL:
http://svn.reactos.org/svn/reactos?rev=33311&view=rev
Log: Fix indentation Modified: trunk/reactos/drivers/filesystems/fastfat/dirwr.c Modified: trunk/reactos/drivers/filesystems/fastfat/dirwr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/dirwr.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/dirwr.c [iso-8859-1] Tue May 6 01:57:05 2008 @@ -11,728 +11,718 @@ #define NDEBUG #include "vfat.h" -NTSTATUS -VfatUpdateEntry (PVFATFCB pFcb) /* * update an existing FAT entry */ +NTSTATUS +VfatUpdateEntry( + IN PVFATFCB pFcb) { - PVOID Context; - PDIR_ENTRY PinEntry; - LARGE_INTEGER Offset; - ULONG SizeDirEntry; - ULONG dirIndex; - - ASSERT(pFcb); - ASSERT(pFcb->parentFcb); - - if (pFcb->Flags & FCB_IS_FATX_ENTRY) - { - SizeDirEntry = sizeof(FATX_DIR_ENTRY); - dirIndex = pFcb->startIndex; - } - else - { - SizeDirEntry = sizeof(FAT_DIR_ENTRY); - dirIndex = pFcb->dirIndex; - } - - DPRINT ("updEntry dirIndex %d, PathName \'%wZ\'\n", dirIndex, &pFcb->PathNameU); - - if (vfatFCBIsRoot(pFcb) || (pFcb->Flags & (FCB_IS_FAT|FCB_IS_VOLUME))) - { - return STATUS_SUCCESS; - } - - ASSERT (pFcb->parentFcb); - - Offset.u.HighPart = 0; - Offset.u.LowPart = dirIndex * SizeDirEntry; - if (CcPinRead (pFcb->parentFcb->FileObject, &Offset, SizeDirEntry, - TRUE, &Context, (PVOID*)&PinEntry)) - { - pFcb->Flags &= ~FCB_IS_DIRTY; - RtlCopyMemory(PinEntry, &pFcb->entry, SizeDirEntry); - CcSetDirtyPinnedData(Context, NULL); - CcUnpinData(Context); - return STATUS_SUCCESS; - } - else - { - DPRINT1 ("Failed write to \'%wZ\'.\n", &pFcb->parentFcb->PathNameU); - return STATUS_UNSUCCESSFUL; + PVOID Context; + PDIR_ENTRY PinEntry; + LARGE_INTEGER Offset; + ULONG SizeDirEntry; + ULONG dirIndex; + + ASSERT(pFcb); + ASSERT(pFcb->parentFcb); + + if (pFcb->Flags & FCB_IS_FATX_ENTRY) + { + SizeDirEntry = sizeof(FATX_DIR_ENTRY); + dirIndex = pFcb->startIndex; + } + else + { + SizeDirEntry = sizeof(FAT_DIR_ENTRY); + dirIndex = pFcb->dirIndex; + } + + DPRINT("updEntry dirIndex %d, PathName \'%wZ\'\n", dirIndex, &pFcb->PathNameU); + + if (vfatFCBIsRoot(pFcb) || (pFcb->Flags & (FCB_IS_FAT|FCB_IS_VOLUME))) + { + return STATUS_SUCCESS; + } + + ASSERT(pFcb->parentFcb); + + Offset.u.HighPart = 0; + Offset.u.LowPart = dirIndex * SizeDirEntry; + if (CcPinRead(pFcb->parentFcb->FileObject, &Offset, SizeDirEntry, + TRUE, &Context, (PVOID*)&PinEntry)) + { + pFcb->Flags &= ~FCB_IS_DIRTY; + RtlCopyMemory(PinEntry, &pFcb->entry, SizeDirEntry); + CcSetDirtyPinnedData(Context, NULL); + CcUnpinData(Context); + return STATUS_SUCCESS; + } + else + { + DPRINT1("Failed write to \'%wZ\'.\n", &pFcb->parentFcb->PathNameU); + return STATUS_UNSUCCESSFUL; } } -BOOLEAN -vfatFindDirSpace(PDEVICE_EXTENSION DeviceExt, - PVFATFCB pDirFcb, - ULONG nbSlots, - PULONG start) -{ /* * try to find contiguous entries frees in directory, * extend a directory if is neccesary */ - LARGE_INTEGER FileOffset; - ULONG i, count, size, nbFree = 0; - PDIR_ENTRY pFatEntry; - PVOID Context = NULL; - NTSTATUS Status; - ULONG SizeDirEntry; - FileOffset.QuadPart = 0; - - if (DeviceExt->Flags & VCB_IS_FATX) - SizeDirEntry = sizeof(FATX_DIR_ENTRY); - else - SizeDirEntry = sizeof(FAT_DIR_ENTRY); - - count = pDirFcb->RFCB.FileSize.u.LowPart / SizeDirEntry; - size = DeviceExt->FatInfo.BytesPerCluster / SizeDirEntry; - for (i = 0; i < count; i++, pFatEntry = (PDIR_ENTRY)((ULONG_PTR)pFatEntry + SizeDirEntry)) - { - if (Context == NULL || (i % size) == 0) - { - if (Context) - { +BOOLEAN +vfatFindDirSpace( + IN PDEVICE_EXTENSION DeviceExt, + IN PVFATFCB pDirFcb, + IN ULONG nbSlots, + OUT PULONG start) +{ + LARGE_INTEGER FileOffset; + ULONG i, count, size, nbFree = 0; + PDIR_ENTRY pFatEntry; + PVOID Context = NULL; + NTSTATUS Status; + ULONG SizeDirEntry; + FileOffset.QuadPart = 0; + + if (DeviceExt->Flags & VCB_IS_FATX) + SizeDirEntry = sizeof(FATX_DIR_ENTRY); + else + SizeDirEntry = sizeof(FAT_DIR_ENTRY); + + count = pDirFcb->RFCB.FileSize.u.LowPart / SizeDirEntry; + size = DeviceExt->FatInfo.BytesPerCluster / SizeDirEntry; + for (i = 0; i < count; i++, pFatEntry = (PDIR_ENTRY)((ULONG_PTR)pFatEntry + SizeDirEntry)) + { + if (Context == NULL || (i % size) == 0) + { + if (Context) + { + CcUnpinData(Context); + } + /* FIXME: check return value */ + CcPinRead(pDirFcb->FileObject, &FileOffset, DeviceExt->FatInfo.BytesPerCluster, + TRUE, &Context, (PVOID*)&pFatEntry); + FileOffset.u.LowPart += DeviceExt->FatInfo.BytesPerCluster; + } + if (ENTRY_END(DeviceExt, pFatEntry)) + { + break; + } + if (ENTRY_DELETED(DeviceExt, pFatEntry)) + { + nbFree++; + } + else + { + nbFree = 0; + } + if (nbFree == nbSlots) + { + break; + } + } + if (Context) + { CcUnpinData(Context); - } - // FIXME: check return value - CcPinRead (pDirFcb->FileObject, &FileOffset, DeviceExt->FatInfo.BytesPerCluster, - TRUE, &Context, (PVOID*)&pFatEntry); - FileOffset.u.LowPart += DeviceExt->FatInfo.BytesPerCluster; - } - if (ENTRY_END(DeviceExt, pFatEntry)) - { - break; - } - if (ENTRY_DELETED(DeviceExt, pFatEntry)) - { - nbFree++; - } - else - { - nbFree = 0; + Context = NULL; } if (nbFree == nbSlots) { - break; - } - } - if (Context) - { - CcUnpinData(Context); - Context = NULL; - } - if (nbFree == nbSlots) - { - // found enough contiguous free slots - *start = i - nbSlots + 1; - } - else - { - *start = i - nbFree; - if (*start + nbSlots > count) - { - LARGE_INTEGER AllocationSize; - CHECKPOINT; - // extend the directory - if (vfatFCBIsRoot(pDirFcb) && DeviceExt->FatInfo.FatType != FAT32) - { - // We can't extend a root directory on a FAT12/FAT16/FATX partition - return FALSE; - } - AllocationSize.QuadPart = pDirFcb->RFCB.FileSize.u.LowPart + DeviceExt->FatInfo.BytesPerCluster; - Status = VfatSetAllocationSizeInformation(pDirFcb->FileObject, pDirFcb, - DeviceExt, &AllocationSize); - if (!NT_SUCCESS(Status)) - { - return FALSE; - } - // clear the new dir cluster - FileOffset.u.LowPart = (ULONG)(pDirFcb->RFCB.FileSize.QuadPart - - DeviceExt->FatInfo.BytesPerCluster); - CcPinRead (pDirFcb->FileObject, &FileOffset, DeviceExt->FatInfo.BytesPerCluster, - TRUE, &Context, (PVOID*)&pFatEntry); - if (DeviceExt->Flags & VCB_IS_FATX) - memset(pFatEntry, 0xff, DeviceExt->FatInfo.BytesPerCluster); - else - RtlZeroMemory(pFatEntry, DeviceExt->FatInfo.BytesPerCluster); - } - else if (*start + nbSlots < count) - { - // clear the entry after the last new entry - FileOffset.u.LowPart = (*start + nbSlots) * SizeDirEntry; - CcPinRead (pDirFcb->FileObject, &FileOffset, SizeDirEntry, - TRUE, &Context, (PVOID*)&pFatEntry); - if (DeviceExt->Flags & VCB_IS_FATX) - memset(pFatEntry, 0xff, SizeDirEntry); - else - RtlZeroMemory(pFatEntry, SizeDirEntry); - } - if (Context) - { - CcSetDirtyPinnedData(Context, NULL); - CcUnpinData(Context); - } - } - DPRINT ("nbSlots %d nbFree %d, entry number %d\n", nbSlots, nbFree, *start); - return TRUE; + /* found enough contiguous free slots */ + *start = i - nbSlots + 1; + } + else + { + *start = i - nbFree; + if (*start + nbSlots > count) + { + LARGE_INTEGER AllocationSize; + CHECKPOINT; + /* extend the directory */ + if (vfatFCBIsRoot(pDirFcb) && DeviceExt->FatInfo.FatType != FAT32) + { + /* We can't extend a root directory on a FAT12/FAT16/FATX partition */ + return FALSE; + } + AllocationSize.QuadPart = pDirFcb->RFCB.FileSize.u.LowPart + DeviceExt->FatInfo.BytesPerCluster; + Status = VfatSetAllocationSizeInformation(pDirFcb->FileObject, pDirFcb, + DeviceExt, &AllocationSize); + if (!NT_SUCCESS(Status)) + { + return FALSE; + } + /* clear the new dir cluster */ + FileOffset.u.LowPart = (ULONG)(pDirFcb->RFCB.FileSize.QuadPart - + DeviceExt->FatInfo.BytesPerCluster); + CcPinRead(pDirFcb->FileObject, &FileOffset, DeviceExt->FatInfo.BytesPerCluster, + TRUE, &Context, (PVOID*)&pFatEntry); + if (DeviceExt->Flags & VCB_IS_FATX) + memset(pFatEntry, 0xff, DeviceExt->FatInfo.BytesPerCluster); + else + RtlZeroMemory(pFatEntry, DeviceExt->FatInfo.BytesPerCluster); + } + else if (*start + nbSlots < count) + { + /* clear the entry after the last new entry */ + FileOffset.u.LowPart = (*start + nbSlots) * SizeDirEntry; + CcPinRead(pDirFcb->FileObject, &FileOffset, SizeDirEntry, + TRUE, &Context, (PVOID*)&pFatEntry); + if (DeviceExt->Flags & VCB_IS_FATX) + memset(pFatEntry, 0xff, SizeDirEntry); + else + RtlZeroMemory(pFatEntry, SizeDirEntry); + } + if (Context) + { + CcSetDirtyPinnedData(Context, NULL); + CcUnpinData(Context); + } + } + DPRINT("nbSlots %d nbFree %d, entry number %d\n", nbSlots, nbFree, *start); + return TRUE; } -static NTSTATUS -FATAddEntry (PDEVICE_EXTENSION DeviceExt, - PUNICODE_STRING NameU, - PVFATFCB* Fcb, - PVFATFCB ParentFcb, - ULONG RequestedOptions, - UCHAR ReqAttr) /* create a new FAT entry */ +static NTSTATUS +FATAddEntry( + IN PDEVICE_EXTENSION DeviceExt, + IN PUNICODE_STRING NameU, + IN PVFATFCB* Fcb, + IN PVFATFCB ParentFcb, + IN ULONG RequestedOptions, + IN UCHAR ReqAttr) { - PVOID Context = NULL; - PFAT_DIR_ENTRY pFatEntry; - slot *pSlots; - USHORT nbSlots = 0, j, posCar; - PUCHAR Buffer; - BOOLEAN needTilde = FALSE, needLong = FALSE; - BOOLEAN lCaseBase = FALSE, uCaseBase, lCaseExt = FALSE, uCaseExt; - ULONG CurrentCluster; - LARGE_INTEGER SystemTime, FileOffset; - NTSTATUS Status = STATUS_SUCCESS; - ULONG size; - long i; - - OEM_STRING NameA; - CHAR aName[13]; - BOOLEAN IsNameLegal; - BOOLEAN SpacesFound; - - VFAT_DIRENTRY_CONTEXT DirContext; - WCHAR LongNameBuffer[LONGNAME_MAX_LENGTH + 1]; - WCHAR ShortNameBuffer[13]; - - DPRINT ("addEntry: Name='%wZ', Dir='%wZ'\n", NameU, &ParentFcb->PathNameU); - - DirContext.LongNameU = *NameU; - - nbSlots = (DirContext.LongNameU.Length / sizeof(WCHAR) + 12) / 13 + 1; //nb of entry needed for long name+normal entry - DPRINT ("NameLen= %d, nbSlots =%d\n", DirContext.LongNameU.Length / sizeof(WCHAR), nbSlots); - Buffer = ExAllocatePoolWithTag (NonPagedPool, (nbSlots - 1) * sizeof (FAT_DIR_ENTRY), TAG_VFAT); - if (Buffer == NULL) - { - return STATUS_INSUFFICIENT_RESOURCES; - } - RtlZeroMemory (Buffer, (nbSlots - 1) * sizeof (FAT_DIR_ENTRY)); - pSlots = (slot *) Buffer; - - NameA.Buffer = aName; - NameA.Length = 0; - NameA.MaximumLength = sizeof(aName); - - DirContext.ShortNameU.Buffer = ShortNameBuffer; - DirContext.ShortNameU.Length = 0; - DirContext.ShortNameU.MaximumLength = sizeof(ShortNameBuffer); - - RtlZeroMemory(&DirContext.DirEntry.Fat, sizeof(FAT_DIR_ENTRY)); - - IsNameLegal = RtlIsNameLegalDOS8Dot3(&DirContext.LongNameU, &NameA, &SpacesFound); - - if (!IsNameLegal || SpacesFound) - { - GENERATE_NAME_CONTEXT NameContext; - VFAT_DIRENTRY_CONTEXT SearchContext; - WCHAR ShortSearchName[13]; - needTilde = TRUE; - needLong = TRUE; - RtlZeroMemory(&NameContext, sizeof(GENERATE_NAME_CONTEXT)); - SearchContext.LongNameU.Buffer = LongNameBuffer; - SearchContext.LongNameU.MaximumLength = sizeof(LongNameBuffer); - SearchContext.ShortNameU.Buffer = ShortSearchName; - SearchContext.ShortNameU.MaximumLength = sizeof(ShortSearchName); - - for (i = 0; i < 100; i++) - { - RtlGenerate8dot3Name(&DirContext.LongNameU, FALSE, &NameContext, &DirContext.ShortNameU); - DirContext.ShortNameU.Buffer[DirContext.ShortNameU.Length / sizeof(WCHAR)] = 0; - SearchContext.DirIndex = 0; - Status = FindFile (DeviceExt, ParentFcb, &DirContext.ShortNameU, &SearchContext, TRUE); - if (!NT_SUCCESS(Status)) - { - break; - } - } - if (i == 100) /* FIXME : what to do after this ? */ - { - ExFreePool (Buffer); - CHECKPOINT; - return STATUS_UNSUCCESSFUL; - } - IsNameLegal = RtlIsNameLegalDOS8Dot3(&DirContext.ShortNameU, &NameA, &SpacesFound); - aName[NameA.Length]=0; - } - else - { - aName[NameA.Length] = 0; - for (posCar = 0; posCar < DirContext.LongNameU.Length / sizeof(WCHAR); posCar++) - { - if (DirContext.LongNameU.Buffer[posCar] == L'.') - { - break; - } - } - /* check if the name and the extension contains upper case characters */ - RtlDowncaseUnicodeString(&DirContext.ShortNameU, &DirContext.LongNameU, FALSE); - DirContext.ShortNameU.Buffer[DirContext.ShortNameU.Length / sizeof(WCHAR)] = 0; - uCaseBase = wcsncmp(DirContext.LongNameU.Buffer, - DirContext.ShortNameU.Buffer, posCar) ? TRUE : FALSE; - if (posCar < DirContext.LongNameU.Length/sizeof(WCHAR)) - { - i = DirContext.LongNameU.Length / sizeof(WCHAR) - posCar; - uCaseExt = wcsncmp(DirContext.LongNameU.Buffer + posCar, - DirContext.ShortNameU.Buffer + posCar, i) ? TRUE : FALSE; - } - else - { - uCaseExt = FALSE; - } - /* check if the name and the extension contains lower case characters */ - RtlUpcaseUnicodeString(&DirContext.ShortNameU, &DirContext.LongNameU, FALSE); - DirContext.ShortNameU.Buffer[DirContext.ShortNameU.Length / sizeof(WCHAR)] = 0; - lCaseBase = wcsncmp(DirContext.LongNameU.Buffer, - DirContext.ShortNameU.Buffer, posCar) ? TRUE : FALSE; - if (posCar < DirContext.LongNameU.Length / sizeof(WCHAR)) - { - i = DirContext.LongNameU.Length / sizeof(WCHAR) - posCar; - lCaseExt = wcsncmp(DirContext.LongNameU.Buffer + posCar, - DirContext.ShortNameU.Buffer + posCar, i) ? TRUE : FALSE; - } - else - { - lCaseExt = FALSE; - } - if ((lCaseBase && uCaseBase) || (lCaseExt && uCaseExt)) - { - needLong = TRUE; - } - } - DPRINT ("'%s', '%wZ', needTilde=%d, needLong=%d\n", - aName, &DirContext.LongNameU, needTilde, needLong); - memset(DirContext.DirEntry.Fat.ShortName, ' ', 11); - for (i = 0; i < 8 && aName[i] && aName[i] != '.'; i++) - { - DirContext.DirEntry.Fat.Filename[i] = aName[i]; - } - if (aName[i] == '.') - { - i++; - for (j = 0; j < 3 && aName[i]; j++, i++) - { - DirContext.DirEntry.Fat.Ext[j] = aName[i]; - } - } - if (DirContext.DirEntry.Fat.Filename[0] == 0xe5) - { - DirContext.DirEntry.Fat.Filename[0] = 0x05; - } - - if (needLong) - { - RtlCopyMemory(LongNameBuffer, DirContext.LongNameU.Buffer, DirContext.LongNameU.Length); - DirContext.LongNameU.Buffer = LongNameBuffer; - DirContext.LongNameU.MaximumLength = sizeof(LongNameBuffer); - DirContext.LongNameU.Buffer[DirContext.LongNameU.Length / sizeof(WCHAR)] = 0; - memset(DirContext.LongNameU.Buffer + DirContext.LongNameU.Length / sizeof(WCHAR) + 1, 0xff, - DirContext.LongNameU.MaximumLength - DirContext.LongNameU.Length - sizeof(WCHAR)); - } - else - { - nbSlots = 1; - if (lCaseBase) - { - DirContext.DirEntry.Fat.lCase |= VFAT_CASE_LOWER_BASE; - } - if (lCaseExt) - { - DirContext.DirEntry.Fat.lCase |= VFAT_CASE_LOWER_EXT; - } - } - - DPRINT ("dos name=%11.11s\n", DirContext.DirEntry.Fat.Filename); - - /* set attributes */ - DirContext.DirEntry.Fat.Attrib = ReqAttr; - if (RequestedOptions & FILE_DIRECTORY_FILE) - { - DirContext.DirEntry.Fat.Attrib |= FILE_ATTRIBUTE_DIRECTORY; - } - /* set dates and times */ - KeQuerySystemTime (&SystemTime); -#if 0 - { - TIME_FIELDS tf; - RtlTimeToTimeFields (&SystemTime, &tf); - DPRINT1("%d.%d.%d %02d:%02d:%02d.%03d '%wZ'\n", - tf.Day, tf.Month, tf.Year, tf.Hour, - tf.Minute, tf.Second, tf.Milliseconds, - NameU); - } -#endif - FsdSystemTimeToDosDateTime (DeviceExt, &SystemTime, &DirContext.DirEntry.Fat.CreationDate, - &DirContext.DirEntry.Fat.CreationTime); - DirContext.DirEntry.Fat.UpdateDate = DirContext.DirEntry.Fat.CreationDate; - DirContext.DirEntry.Fat.UpdateTime = DirContext.DirEntry.Fat.CreationTime; - DirContext.DirEntry.Fat.AccessDate = DirContext.DirEntry.Fat.CreationDate; - - if (needLong) - { - /* calculate checksum for 8.3 name */ - for (pSlots[0].alias_checksum = 0, i = 0; i < 11; i++) - { - pSlots[0].alias_checksum = (((pSlots[0].alias_checksum & 1) << 7 - | ((pSlots[0].alias_checksum & 0xfe) >> 1)) - + DirContext.DirEntry.Fat.Filename[i]); - } - /* construct slots and entry */ - for (i = nbSlots - 2; i >= 0; i--) - { - DPRINT ("construct slot %d\n", i); - pSlots[i].attr = 0xf; - if (i) - { - pSlots[i].id = (unsigned char)(nbSlots - i - 1); - } - else - { - pSlots[i].id = (unsigned char)(nbSlots - i - 1 + 0x40); - } - pSlots[i].alias_checksum = pSlots[0].alias_checksum; - RtlCopyMemory (pSlots[i].name0_4, DirContext.LongNameU.Buffer + (nbSlots - i - 2) * 13, 10); - RtlCopyMemory (pSlots[i].name5_10, DirContext.LongNameU.Buffer + (nbSlots - i - 2) * 13 + 5, 12); - RtlCopyMemory (pSlots[i].name11_12, DirContext.LongNameU.Buffer + (nbSlots - i - 2) * 13 + 11, 4); - } - } - /* try to find nbSlots contiguous entries frees in directory */ - if (!vfatFindDirSpace(DeviceExt, ParentFcb, nbSlots, &DirContext.StartIndex)) - { - ExFreePool (Buffer); - return STATUS_DISK_FULL; - } - DirContext.DirIndex = DirContext.StartIndex + nbSlots - 1; - if (RequestedOptions & FILE_DIRECTORY_FILE) - { - CurrentCluster = 0; - Status = NextCluster (DeviceExt, 0, &CurrentCluster, TRUE); - if (CurrentCluster == 0xffffffff || !NT_SUCCESS(Status)) - { - ExFreePool (Buffer); - if (!NT_SUCCESS(Status)) - { - return Status; - } - return STATUS_DISK_FULL; - } - if (DeviceExt->FatInfo.FatType == FAT32) - { - DirContext.DirEntry.Fat.FirstClusterHigh = (unsigned short)(CurrentCluster >> 16); - } - DirContext.DirEntry.Fat.FirstCluster = (unsigned short)CurrentCluster; - } - - i = DeviceExt->FatInfo.BytesPerCluster / sizeof(FAT_DIR_ENTRY); - FileOffset.u.HighPart = 0; - FileOffset.u.LowPart = DirContext.StartIndex * sizeof(FAT_DIR_ENTRY); - if (DirContext.StartIndex / i == DirContext.DirIndex / i) - { - /* one cluster */ - CHECKPOINT; - CcPinRead (ParentFcb->FileObject, &FileOffset, nbSlots * sizeof(FAT_DIR_ENTRY), - TRUE, &Context, (PVOID*)&pFatEntry); - if (nbSlots > 1) - { - RtlCopyMemory(pFatEntry, Buffer, (nbSlots - 1) * sizeof(FAT_DIR_ENTRY)); - } - RtlCopyMemory(pFatEntry + (nbSlots - 1), &DirContext.DirEntry.Fat, sizeof(FAT_DIR_ENTRY)); - } - else - { - /* two clusters */ - CHECKPOINT; - size = DeviceExt->FatInfo.BytesPerCluster - - (DirContext.StartIndex * sizeof(FAT_DIR_ENTRY)) % DeviceExt->FatInfo.BytesPerCluster; - i = size / sizeof(FAT_DIR_ENTRY); - CcPinRead (ParentFcb->FileObject, &FileOffset, size, TRUE, - &Context, (PVOID*)&pFatEntry); - RtlCopyMemory(pFatEntry, Buffer, size); - CcSetDirtyPinnedData(Context, NULL); - CcUnpinData(Context); - FileOffset.u.LowPart += size; - CcPinRead (ParentFcb->FileObject, &FileOffset, - nbSlots * sizeof(FAT_DIR_ENTRY) - size, - TRUE, &Context, (PVOID*)&pFatEntry); - if (nbSlots - 1 > i) - { - RtlCopyMemory(pFatEntry, (PVOID)(Buffer + size), (nbSlots - 1 - i) * sizeof(FAT_DIR_ENTRY)); - } - RtlCopyMemory(pFatEntry + nbSlots - 1 - i, &DirContext.DirEntry.Fat, sizeof(FAT_DIR_ENTRY)); - } - CcSetDirtyPinnedData(Context, NULL); - CcUnpinData(Context); - - /* FIXME: check status */ - vfatMakeFCBFromDirEntry (DeviceExt, ParentFcb, &DirContext, Fcb); - - DPRINT ("new : entry=%11.11s\n", (*Fcb)->entry.Fat.Filename); - DPRINT ("new : entry=%11.11s\n", DirContext.DirEntry.Fat.Filename); - - if (RequestedOptions & FILE_DIRECTORY_FILE) - { - FileOffset.QuadPart = 0; - CcMapData ((*Fcb)->FileObject, &FileOffset, DeviceExt->FatInfo.BytesPerCluster, TRUE, - &Context, (PVOID*)&pFatEntry); - /* clear the new directory cluster */ - RtlZeroMemory (pFatEntry, DeviceExt->FatInfo.BytesPerCluster); - /* create '.' and '..' */ - RtlCopyMemory (&pFatEntry[0].Attrib, &DirContext.DirEntry.Fat.Attrib, sizeof(FAT_DIR_ENTRY) - 11); - RtlCopyMemory (pFatEntry[0].ShortName, ". ", 11); - RtlCopyMemory (&pFatEntry[1].Attrib, &DirContext.DirEntry.Fat.Attrib, sizeof(FAT_DIR_ENTRY) - 11); - RtlCopyMemory (pFatEntry[1].ShortName, ".. ", 11); - pFatEntry[1].FirstCluster = ParentFcb->entry.Fat.FirstCluster; - pFatEntry[1].FirstClusterHigh = ParentFcb->entry.Fat.FirstClusterHigh; - if (vfatFCBIsRoot(ParentFcb)) - { - pFatEntry[1].FirstCluster = 0; - pFatEntry[1].FirstClusterHigh = 0; - } - CcSetDirtyPinnedData(Context, NULL); - CcUnpinData(Context); - } - ExFreePool (Buffer); - DPRINT ("addentry ok\n"); - return STATUS_SUCCESS; + PVOID Context = NULL; + PFAT_DIR_ENTRY pFatEntry; + slot *pSlots; + USHORT nbSlots = 0, j, posCar; + PUCHAR Buffer; + BOOLEAN needTilde = FALSE, needLong = FALSE; + BOOLEAN lCaseBase = FALSE, uCaseBase, lCaseExt = FALSE, uCaseExt; + ULONG CurrentCluster; + LARGE_INTEGER SystemTime, FileOffset; + NTSTATUS Status = STATUS_SUCCESS; + ULONG size; + long i; + + OEM_STRING NameA; + CHAR aName[13]; + BOOLEAN IsNameLegal; + BOOLEAN SpacesFound; + + VFAT_DIRENTRY_CONTEXT DirContext; + WCHAR LongNameBuffer[LONGNAME_MAX_LENGTH + 1]; + WCHAR ShortNameBuffer[13]; + + DPRINT("addEntry: Name='%wZ', Dir='%wZ'\n", NameU, &ParentFcb->PathNameU); + + DirContext.LongNameU = *NameU; + + /* nb of entry needed for long name+normal entry */ + nbSlots = (DirContext.LongNameU.Length / sizeof(WCHAR) + 12) / 13 + 1; + DPRINT("NameLen= %d, nbSlots =%d\n", DirContext.LongNameU.Length / sizeof(WCHAR), nbSlots); + Buffer = ExAllocatePoolWithTag(NonPagedPool, (nbSlots - 1) * sizeof(FAT_DIR_ENTRY), TAG_VFAT); + if (Buffer == NULL) + { + return STATUS_INSUFFICIENT_RESOURCES; + } + RtlZeroMemory(Buffer, (nbSlots - 1) * sizeof(FAT_DIR_ENTRY)); + pSlots = (slot *) Buffer; + + NameA.Buffer = aName; + NameA.Length = 0; + NameA.MaximumLength = sizeof(aName); + + DirContext.ShortNameU.Buffer = ShortNameBuffer; + DirContext.ShortNameU.Length = 0; + DirContext.ShortNameU.MaximumLength = sizeof(ShortNameBuffer); + + RtlZeroMemory(&DirContext.DirEntry.Fat, sizeof(FAT_DIR_ENTRY)); + + IsNameLegal = RtlIsNameLegalDOS8Dot3(&DirContext.LongNameU, &NameA, &SpacesFound); + + if (!IsNameLegal || SpacesFound) + { + GENERATE_NAME_CONTEXT NameContext; + VFAT_DIRENTRY_CONTEXT SearchContext; + WCHAR ShortSearchName[13]; + needTilde = TRUE; + needLong = TRUE; + RtlZeroMemory(&NameContext, sizeof(GENERATE_NAME_CONTEXT)); + SearchContext.LongNameU.Buffer = LongNameBuffer; + SearchContext.LongNameU.MaximumLength = sizeof(LongNameBuffer); + SearchContext.ShortNameU.Buffer = ShortSearchName; + SearchContext.ShortNameU.MaximumLength = sizeof(ShortSearchName); + + for (i = 0; i < 100; i++) + { + RtlGenerate8dot3Name(&DirContext.LongNameU, FALSE, &NameContext, &DirContext.ShortNameU); + DirContext.ShortNameU.Buffer[DirContext.ShortNameU.Length / sizeof(WCHAR)] = 0; + SearchContext.DirIndex = 0; + Status = FindFile(DeviceExt, ParentFcb, &DirContext.ShortNameU, &SearchContext, TRUE); + if (!NT_SUCCESS(Status)) + { + break; + } + } + if (i == 100) /* FIXME : what to do after this ? */ + { + ExFreePoolWithTag(Buffer, TAG_VFAT); + CHECKPOINT; + return STATUS_UNSUCCESSFUL; + } + IsNameLegal = RtlIsNameLegalDOS8Dot3(&DirContext.ShortNameU, &NameA, &SpacesFound); + aName[NameA.Length]=0; + } + else + { + aName[NameA.Length] = 0; + for (posCar = 0; posCar < DirContext.LongNameU.Length / sizeof(WCHAR); posCar++) + { + if (DirContext.LongNameU.Buffer[posCar] == L'.') + { + break; + } + } + /* check if the name and the extension contains upper case characters */ + RtlDowncaseUnicodeString(&DirContext.ShortNameU, &DirContext.LongNameU, FALSE); + DirContext.ShortNameU.Buffer[DirContext.ShortNameU.Length / sizeof(WCHAR)] = 0; + uCaseBase = wcsncmp(DirContext.LongNameU.Buffer, + DirContext.ShortNameU.Buffer, posCar) ? TRUE : FALSE; + if (posCar < DirContext.LongNameU.Length/sizeof(WCHAR)) + { + i = DirContext.LongNameU.Length / sizeof(WCHAR) - posCar; + uCaseExt = wcsncmp(DirContext.LongNameU.Buffer + posCar, + DirContext.ShortNameU.Buffer + posCar, i) ? TRUE : FALSE; + } + else + { + uCaseExt = FALSE; + } + /* check if the name and the extension contains lower case characters */ + RtlUpcaseUnicodeString(&DirContext.ShortNameU, &DirContext.LongNameU, FALSE); + DirContext.ShortNameU.Buffer[DirContext.ShortNameU.Length / sizeof(WCHAR)] = 0; + lCaseBase = wcsncmp(DirContext.LongNameU.Buffer, + DirContext.ShortNameU.Buffer, posCar) ? TRUE : FALSE; + if (posCar < DirContext.LongNameU.Length / sizeof(WCHAR)) + { + i = DirContext.LongNameU.Length / sizeof(WCHAR) - posCar; + lCaseExt = wcsncmp(DirContext.LongNameU.Buffer + posCar, + DirContext.ShortNameU.Buffer + posCar, i) ? TRUE : FALSE; + } + else + { + lCaseExt = FALSE; + } + if ((lCaseBase && uCaseBase) || (lCaseExt && uCaseExt)) + { + needLong = TRUE; + } + } + DPRINT("'%s', '%wZ', needTilde=%d, needLong=%d\n", + aName, &DirContext.LongNameU, needTilde, needLong); + memset(DirContext.DirEntry.Fat.ShortName, ' ', 11); + for (i = 0; i < 8 && aName[i] && aName[i] != '.'; i++) + { + DirContext.DirEntry.Fat.Filename[i] = aName[i]; + } + if (aName[i] == '.') + { + i++; + for (j = 0; j < 3 && aName[i]; j++, i++) + { + DirContext.DirEntry.Fat.Ext[j] = aName[i]; + } + } + if (DirContext.DirEntry.Fat.Filename[0] == 0xe5) + { + DirContext.DirEntry.Fat.Filename[0] = 0x05; + } + + if (needLong) + { + RtlCopyMemory(LongNameBuffer, DirContext.LongNameU.Buffer, DirContext.LongNameU.Length); + DirContext.LongNameU.Buffer = LongNameBuffer; + DirContext.LongNameU.MaximumLength = sizeof(LongNameBuffer); + DirContext.LongNameU.Buffer[DirContext.LongNameU.Length / sizeof(WCHAR)] = 0; + memset(DirContext.LongNameU.Buffer + DirContext.LongNameU.Length / sizeof(WCHAR) + 1, 0xff, + DirContext.LongNameU.MaximumLength - DirContext.LongNameU.Length - sizeof(WCHAR)); + } + else + { + nbSlots = 1; + if (lCaseBase) + { + DirContext.DirEntry.Fat.lCase |= VFAT_CASE_LOWER_BASE; + } + if (lCaseExt) + { + DirContext.DirEntry.Fat.lCase |= VFAT_CASE_LOWER_EXT; + } + } + + DPRINT ("dos name=%11.11s\n", DirContext.DirEntry.Fat.Filename); + + /* set attributes */ + DirContext.DirEntry.Fat.Attrib = ReqAttr; + if (RequestedOptions & FILE_DIRECTORY_FILE) + { + DirContext.DirEntry.Fat.Attrib |= FILE_ATTRIBUTE_DIRECTORY; + } + /* set dates and times */ + KeQuerySystemTime(&SystemTime); + FsdSystemTimeToDosDateTime(DeviceExt, &SystemTime, &DirContext.DirEntry.Fat.CreationDate, + &DirContext.DirEntry.Fat.CreationTime); + DirContext.DirEntry.Fat.UpdateDate = DirContext.DirEntry.Fat.CreationDate; + DirContext.DirEntry.Fat.UpdateTime = DirContext.DirEntry.Fat.CreationTime; + DirContext.DirEntry.Fat.AccessDate = DirContext.DirEntry.Fat.CreationDate; + + if (needLong) + { + /* calculate checksum for 8.3 name */ + for (pSlots[0].alias_checksum = 0, i = 0; i < 11; i++) + { + pSlots[0].alias_checksum = (((pSlots[0].alias_checksum & 1) << 7 + | ((pSlots[0].alias_checksum & 0xfe) >> 1)) + + DirContext.DirEntry.Fat.Filename[i]); + } + /* construct slots and entry */ + for (i = nbSlots - 2; i >= 0; i--) + { + DPRINT("construct slot %d\n", i); + pSlots[i].attr = 0xf; + if (i) + { + pSlots[i].id = (unsigned char)(nbSlots - i - 1); + } + else + { + pSlots[i].id = (unsigned char)(nbSlots - i - 1 + 0x40); + } + pSlots[i].alias_checksum = pSlots[0].alias_checksum; + RtlCopyMemory(pSlots[i].name0_4, DirContext.LongNameU.Buffer + (nbSlots - i - 2) * 13, 10); + RtlCopyMemory(pSlots[i].name5_10, DirContext.LongNameU.Buffer + (nbSlots - i - 2) * 13 + 5, 12); + RtlCopyMemory(pSlots[i].name11_12, DirContext.LongNameU.Buffer + (nbSlots - i - 2) * 13 + 11, 4); + } + } + /* try to find nbSlots contiguous entries frees in directory */ + if (!vfatFindDirSpace(DeviceExt, ParentFcb, nbSlots, &DirContext.StartIndex)) + { + ExFreePoolWithTag(Buffer, TAG_VFAT); + return STATUS_DISK_FULL; + } + DirContext.DirIndex = DirContext.StartIndex + nbSlots - 1; + if (RequestedOptions & FILE_DIRECTORY_FILE) + { + CurrentCluster = 0; + Status = NextCluster(DeviceExt, 0, &CurrentCluster, TRUE); + if (CurrentCluster == 0xffffffff || !NT_SUCCESS(Status)) + { + ExFreePoolWithTag(Buffer, TAG_VFAT); + if (!NT_SUCCESS(Status)) + { + return Status; + } + return STATUS_DISK_FULL; + } + if (DeviceExt->FatInfo.FatType == FAT32) + { + DirContext.DirEntry.Fat.FirstClusterHigh = (unsigned short)(CurrentCluster >> 16); + } + DirContext.DirEntry.Fat.FirstCluster = (unsigned short)CurrentCluster; + } + + i = DeviceExt->FatInfo.BytesPerCluster / sizeof(FAT_DIR_ENTRY); + FileOffset.u.HighPart = 0; + FileOffset.u.LowPart = DirContext.StartIndex * sizeof(FAT_DIR_ENTRY); + if (DirContext.StartIndex / i == DirContext.DirIndex / i) + { + /* one cluster */ + CHECKPOINT; + CcPinRead(ParentFcb->FileObject, &FileOffset, nbSlots * sizeof(FAT_DIR_ENTRY), + TRUE, &Context, (PVOID*)&pFatEntry); + if (nbSlots > 1) + { + RtlCopyMemory(pFatEntry, Buffer, (nbSlots - 1) * sizeof(FAT_DIR_ENTRY)); + } + RtlCopyMemory(pFatEntry + (nbSlots - 1), &DirContext.DirEntry.Fat, sizeof(FAT_DIR_ENTRY)); + } + else + { + /* two clusters */ + CHECKPOINT; + size = DeviceExt->FatInfo.BytesPerCluster - + (DirContext.StartIndex * sizeof(FAT_DIR_ENTRY)) % DeviceExt->FatInfo.BytesPerCluster; + i = size / sizeof(FAT_DIR_ENTRY); + CcPinRead(ParentFcb->FileObject, &FileOffset, size, TRUE, + &Context, (PVOID*)&pFatEntry); + RtlCopyMemory(pFatEntry, Buffer, size); + CcSetDirtyPinnedData(Context, NULL); + CcUnpinData(Context); + FileOffset.u.LowPart += size; + CcPinRead(ParentFcb->FileObject, &FileOffset, + nbSlots * sizeof(FAT_DIR_ENTRY) - size, + TRUE, &Context, (PVOID*)&pFatEntry); + if (nbSlots - 1 > i) + { + RtlCopyMemory(pFatEntry, (PVOID)(Buffer + size), (nbSlots - 1 - i) * sizeof(FAT_DIR_ENTRY)); + } + RtlCopyMemory(pFatEntry + nbSlots - 1 - i, &DirContext.DirEntry.Fat, sizeof(FAT_DIR_ENTRY)); + } + CcSetDirtyPinnedData(Context, NULL); + CcUnpinData(Context); + + /* FIXME: check status */ + vfatMakeFCBFromDirEntry(DeviceExt, ParentFcb, &DirContext, Fcb); + + DPRINT("new : entry=%11.11s\n", (*Fcb)->entry.Fat.Filename); + DPRINT("new : entry=%11.11s\n", DirContext.DirEntry.Fat.Filename); + + if (RequestedOptions & FILE_DIRECTORY_FILE) + { + FileOffset.QuadPart = 0; + CcMapData((*Fcb)->FileObject, &FileOffset, DeviceExt->FatInfo.BytesPerCluster, TRUE, + &Context, (PVOID*)&pFatEntry); + /* clear the new directory cluster */ + RtlZeroMemory(pFatEntry, DeviceExt->FatInfo.BytesPerCluster); + /* create '.' and '..' */ + RtlCopyMemory(&pFatEntry[0].Attrib, &DirContext.DirEntry.Fat.Attrib, sizeof(FAT_DIR_ENTRY) - 11); + RtlCopyMemory(pFatEntry[0].ShortName, ". ", 11); + RtlCopyMemory(&pFatEntry[1].Attrib, &DirContext.DirEntry.Fat.Attrib, sizeof(FAT_DIR_ENTRY) - 11); + RtlCopyMemory(pFatEntry[1].ShortName, ".. ", 11); + pFatEntry[1].FirstCluster = ParentFcb->entry.Fat.FirstCluster; + pFatEntry[1].FirstClusterHigh = ParentFcb->entry.Fat.FirstClusterHigh; + if (vfatFCBIsRoot(ParentFcb)) + { + pFatEntry[1].FirstCluster = 0; + pFatEntry[1].FirstClusterHigh = 0; + } + CcSetDirtyPinnedData(Context, NULL); + CcUnpinData(Context); + } + ExFreePoolWithTag(Buffer, TAG_VFAT); + DPRINT("addentry ok\n"); + return STATUS_SUCCESS; } -static NTSTATUS -FATXAddEntry (PDEVICE_EXTENSION DeviceExt, - PUNICODE_STRING NameU, - PVFATFCB* Fcb, - PVFATFCB ParentFcb, - ULONG RequestedOptions, - UCHAR ReqAttr) /* create a new FAT entry */ +static NTSTATUS +FATXAddEntry( + IN PDEVICE_EXTENSION DeviceExt, + IN PUNICODE_STRING NameU, + IN PVFATFCB* Fcb, + IN PVFATFCB ParentFcb, + IN ULONG RequestedOptions, + IN UCHAR ReqAttr) { - PVOID Context = NULL; - LARGE_INTEGER SystemTime, FileOffset; - OEM_STRING NameA; - VFAT_DIRENTRY_CONTEXT DirContext; - PFATX_DIR_ENTRY pFatXDirEntry; - ULONG Index; - - DPRINT ("addEntry: Name='%wZ', Dir='%wZ'\n", NameU, &ParentFcb->PathNameU); - - DirContext.LongNameU = *NameU; - - if (DirContext.LongNameU.Length / sizeof(WCHAR) > 42) - { - /* name too long */ - CHECKPOINT; - return STATUS_NAME_TOO_LONG; - } - - /* try to find 1 entry free in directory */ - if (!vfatFindDirSpace(DeviceExt, ParentFcb, 1, &DirContext.StartIndex)) - { - return STATUS_DISK_FULL; - } - Index = DirContext.DirIndex = DirContext.StartIndex; - if (!vfatFCBIsRoot(ParentFcb)) - { - DirContext.DirIndex += 2; - DirContext.StartIndex += 2; - } - - DirContext.ShortNameU.Buffer = 0; - DirContext.ShortNameU.Length = 0; - DirContext.ShortNameU.MaximumLength = 0; - RtlZeroMemory(&DirContext.DirEntry.FatX, sizeof(FATX_DIR_ENTRY)); - memset(DirContext.DirEntry.FatX.Filename, 0xff, 42); - DirContext.DirEntry.FatX.FirstCluster = 0; - DirContext.DirEntry.FatX.FileSize = 0; - - /* set file name */ - NameA.Buffer = (PCHAR)DirContext.DirEntry.FatX.Filename; - NameA.Length = 0; - NameA.MaximumLength = 42; - RtlUnicodeStringToOemString(&NameA, &DirContext.LongNameU, FALSE); - DirContext.DirEntry.FatX.FilenameLength = (unsigned char)NameA.Length; - - /* set attributes */ - DirContext.DirEntry.FatX.Attrib = ReqAttr; - if (RequestedOptions & FILE_DIRECTORY_FILE) - { - DirContext.DirEntry.FatX.Attrib |= FILE_ATTRIBUTE_DIRECTORY; - } - - /* set dates and times */ - KeQuerySystemTime (&SystemTime); -#if 0 - { - TIME_FIELDS tf; - RtlTimeToTimeFields (&SystemTime, &tf); - DPRINT1("%d.%d.%d %02d:%02d:%02d.%03d '%wZ'\n", - tf.Day, tf.Month, tf.Year, tf.Hour, - tf.Minute, tf.Second, tf.Milliseconds, - NameU); - } -#endif - - - FsdSystemTimeToDosDateTime(DeviceExt, &SystemTime, &DirContext.DirEntry.FatX.CreationDate, - &DirContext.DirEntry.FatX.CreationTime); - DirContext.DirEntry.FatX.UpdateDate = DirContext.DirEntry.FatX.CreationDate; - DirContext.DirEntry.FatX.UpdateTime = DirContext.DirEntry.FatX.CreationTime; - DirContext.DirEntry.FatX.AccessDate = DirContext.DirEntry.FatX.CreationDate; - DirContext.DirEntry.FatX.AccessTime = DirContext.DirEntry.FatX.CreationTime; - - /* add entry into parent directory */ - FileOffset.u.HighPart = 0; - FileOffset.u.LowPart = Index * sizeof(FATX_DIR_ENTRY); - CcPinRead(ParentFcb->FileObject, &FileOffset, sizeof(FATX_DIR_ENTRY), - TRUE, &Context, (PVOID*)&pFatXDirEntry); - RtlCopyMemory(pFatXDirEntry, &DirContext.DirEntry.FatX, sizeof(FATX_DIR_ENTRY)); - CcSetDirtyPinnedData(Context, NULL); - CcUnpinData(Context); - - /* FIXME: check status */ - vfatMakeFCBFromDirEntry(DeviceExt, ParentFcb, &DirContext, Fcb); - - DPRINT("addentry ok\n"); - return STATUS_SUCCESS; + PVOID Context = NULL; + LARGE_INTEGER SystemTime, FileOffset; + OEM_STRING NameA; + VFAT_DIRENTRY_CONTEXT DirContext; + PFATX_DIR_ENTRY pFatXDirEntry; + ULONG Index; + + DPRINT("addEntry: Name='%wZ', Dir='%wZ'\n", NameU, &ParentFcb->PathNameU); + + DirContext.LongNameU = *NameU; + + if (DirContext.LongNameU.Length / sizeof(WCHAR) > 42) + { + /* name too long */ + CHECKPOINT; + return STATUS_NAME_TOO_LONG; + } + + /* try to find 1 entry free in directory */ + if (!vfatFindDirSpace(DeviceExt, ParentFcb, 1, &DirContext.StartIndex)) + { + return STATUS_DISK_FULL; + } + Index = DirContext.DirIndex = DirContext.StartIndex; + if (!vfatFCBIsRoot(ParentFcb)) + { + DirContext.DirIndex += 2; + DirContext.StartIndex += 2; + } + + DirContext.ShortNameU.Buffer = 0; + DirContext.ShortNameU.Length = 0; + DirContext.ShortNameU.MaximumLength = 0; + RtlZeroMemory(&DirContext.DirEntry.FatX, sizeof(FATX_DIR_ENTRY)); + memset(DirContext.DirEntry.FatX.Filename, 0xff, 42); + DirContext.DirEntry.FatX.FirstCluster = 0; + DirContext.DirEntry.FatX.FileSize = 0; + + /* set file name */ + NameA.Buffer = (PCHAR)DirContext.DirEntry.FatX.Filename; + NameA.Length = 0; + NameA.MaximumLength = 42; + RtlUnicodeStringToOemString(&NameA, &DirContext.LongNameU, FALSE); + DirContext.DirEntry.FatX.FilenameLength = (unsigned char)NameA.Length; + + /* set attributes */ + DirContext.DirEntry.FatX.Attrib = ReqAttr; + if (RequestedOptions & FILE_DIRECTORY_FILE) + { + DirContext.DirEntry.FatX.Attrib |= FILE_ATTRIBUTE_DIRECTORY; + } + + /* set dates and times */ + KeQuerySystemTime(&SystemTime); + FsdSystemTimeToDosDateTime(DeviceExt, &SystemTime, &DirContext.DirEntry.FatX.CreationDate, + &DirContext.DirEntry.FatX.CreationTime); + DirContext.DirEntry.FatX.UpdateDate = DirContext.DirEntry.FatX.CreationDate; + DirContext.DirEntry.FatX.UpdateTime = DirContext.DirEntry.FatX.CreationTime; + DirContext.DirEntry.FatX.AccessDate = DirContext.DirEntry.FatX.CreationDate; + DirContext.DirEntry.FatX.AccessTime = DirContext.DirEntry.FatX.CreationTime; + + /* add entry into parent directory */ + FileOffset.u.HighPart = 0; + FileOffset.u.LowPart = Index * sizeof(FATX_DIR_ENTRY); + CcPinRead(ParentFcb->FileObject, &FileOffset, sizeof(FATX_DIR_ENTRY), + TRUE, &Context, (PVOID*)&pFatXDirEntry); + RtlCopyMemory(pFatXDirEntry, &DirContext.DirEntry.FatX, sizeof(FATX_DIR_ENTRY)); + CcSetDirtyPinnedData(Context, NULL); + CcUnpinData(Context); + + /* FIXME: check status */ + vfatMakeFCBFromDirEntry(DeviceExt, ParentFcb, &DirContext, Fcb); + + DPRINT("addentry ok\n"); + return STATUS_SUCCESS; } NTSTATUS -VfatAddEntry (PDEVICE_EXTENSION DeviceExt, - PUNICODE_STRING NameU, - PVFATFCB *Fcb, - PVFATFCB ParentFcb, - ULONG RequestedOptions, - UCHAR ReqAttr) +VfatAddEntry( + IN PDEVICE_EXTENSION DeviceExt, + IN PUNICODE_STRING NameU, + IN PVFATFCB *Fcb, + IN PVFATFCB ParentFcb, + IN ULONG RequestedOptions, + IN UCHAR ReqAttr) { - if (DeviceExt->Flags & VCB_IS_FATX) - return FATXAddEntry(DeviceExt, NameU, Fcb, ParentFcb, RequestedOptions, ReqAttr); - else - return FATAddEntry(DeviceExt, NameU, Fcb, ParentFcb, RequestedOptions, ReqAttr); + if (DeviceExt->Flags & VCB_IS_FATX) + return FATXAddEntry(DeviceExt, NameU, Fcb, ParentFcb, RequestedOptions, ReqAttr); + else + return FATAddEntry(DeviceExt, NameU, Fcb, ParentFcb, RequestedOptions, ReqAttr); } -static NTSTATUS -FATDelEntry (PDEVICE_EXTENSION DeviceExt, PVFATFCB pFcb) /* * deleting an existing FAT entry */ +static NTSTATUS +FATDelEntry( + IN PDEVICE_EXTENSION DeviceExt, + IN PVFATFCB pFcb) { - ULONG CurrentCluster = 0, NextCluster, i; - PVOID Context = NULL; - LARGE_INTEGER Offset; - PFAT_DIR_ENTRY pDirEntry; - - ASSERT(pFcb); - ASSERT(pFcb->parentFcb); - - DPRINT ("delEntry PathName \'%wZ\'\n", &pFcb->PathNameU); - DPRINT ("delete entry: %d to %d\n", pFcb->startIndex, pFcb->dirIndex); - Offset.u.HighPart = 0; - for (i = pFcb->startIndex; i <= pFcb->dirIndex; i++) - { - if (Context == NULL || ((i * sizeof(FAT_DIR_ENTRY)) % PAGE_SIZE) == 0) - { - if (Context) - { - CcSetDirtyPinnedData(Context, NULL); - CcUnpinData(Context); - } - Offset.u.LowPart = (i * sizeof(FAT_DIR_ENTRY) / PAGE_SIZE) * PAGE_SIZE; - CcPinRead (pFcb->parentFcb->FileObject, &Offset, PAGE_SIZE, TRUE, - &Context, (PVOID*)&pDirEntry); - } - pDirEntry[i % (PAGE_SIZE / sizeof(FAT_DIR_ENTRY))].Filename[0] = 0xe5; - if (i == pFcb->dirIndex) - { - CurrentCluster = - vfatDirEntryGetFirstCluster (DeviceExt, - (PDIR_ENTRY)&pDirEntry[i % (PAGE_SIZE / sizeof(FAT_DIR_ENTRY))]); - } - } - if (Context) - { - CcSetDirtyPinnedData(Context, NULL); - CcUnpinData(Context); - } - - while (CurrentCluster && CurrentCluster != 0xffffffff) - { - GetNextCluster (DeviceExt, CurrentCluster, &NextCluster); - /* FIXME: check status */ - WriteCluster(DeviceExt, CurrentCluster, 0); - CurrentCluster = NextCluster; - } - return STATUS_SUCCESS; + ULONG CurrentCluster = 0, NextCluster, i; + PVOID Context = NULL; + LARGE_INTEGER Offset; + PFAT_DIR_ENTRY pDirEntry; + + ASSERT(pFcb); + ASSERT(pFcb->parentFcb); + + DPRINT("delEntry PathName \'%wZ\'\n", &pFcb->PathNameU); + DPRINT("delete entry: %d to %d\n", pFcb->startIndex, pFcb->dirIndex); + Offset.u.HighPart = 0; + for (i = pFcb->startIndex; i <= pFcb->dirIndex; i++) + { + if (Context == NULL || ((i * sizeof(FAT_DIR_ENTRY)) % PAGE_SIZE) == 0) + { + if (Context) + { + CcSetDirtyPinnedData(Context, NULL); + CcUnpinData(Context); + } + Offset.u.LowPart = (i * sizeof(FAT_DIR_ENTRY) / PAGE_SIZE) * PAGE_SIZE; + CcPinRead(pFcb->parentFcb->FileObject, &Offset, PAGE_SIZE, TRUE, + &Context, (PVOID*)&pDirEntry); + } + pDirEntry[i % (PAGE_SIZE / sizeof(FAT_DIR_ENTRY))].Filename[0] = 0xe5; + if (i == pFcb->dirIndex) + { + CurrentCluster = + vfatDirEntryGetFirstCluster(DeviceExt, + (PDIR_ENTRY)&pDirEntry[i % (PAGE_SIZE / sizeof(FAT_DIR_ENTRY))]); + } + } + if (Context) + { + CcSetDirtyPinnedData(Context, NULL); + CcUnpinData(Context); + } + + while (CurrentCluster && CurrentCluster != 0xffffffff) + { + GetNextCluster(DeviceExt, CurrentCluster, &NextCluster); + /* FIXME: check status */ + WriteCluster(DeviceExt, CurrentCluster, 0); + CurrentCluster = NextCluster; + } + return STATUS_SUCCESS; } -static NTSTATUS -FATXDelEntry (PDEVICE_EXTENSION DeviceExt, PVFATFCB pFcb) /* * deleting an existing FAT entry */ +static NTSTATUS +FATXDelEntry( + IN PDEVICE_EXTENSION DeviceExt, + IN PVFATFCB pFcb) { - ULONG CurrentCluster = 0, NextCluster; - PVOID Context = NULL; - LARGE_INTEGER Offset; - PFATX_DIR_ENTRY pDirEntry; - ULONG StartIndex; - - ASSERT(pFcb); - ASSERT(pFcb->parentFcb); - ASSERT(pFcb->Flags & FCB_IS_FATX_ENTRY); - - StartIndex = pFcb->startIndex; - - DPRINT ("delEntry PathName \'%wZ\'\n", &pFcb->PathNameU); - DPRINT ("delete entry: %d\n", StartIndex); - Offset.u.HighPart = 0; - Offset.u.LowPart = (StartIndex * sizeof(FATX_DIR_ENTRY) / PAGE_SIZE) * PAGE_SIZE; - if (!CcPinRead (pFcb->parentFcb->FileObject, &Offset, PAGE_SIZE, TRUE, - &Context, (PVOID*)&pDirEntry)) - { - DPRINT1("CcPinRead(Offset %x:%x, Length %d) failed\n", Offset.u.HighPart, Offset.u.LowPart, PAGE_SIZE); - return STATUS_UNSUCCESSFUL; - } - pDirEntry = &pDirEntry[StartIndex % (PAGE_SIZE / sizeof(FATX_DIR_ENTRY))]; - pDirEntry->FilenameLength = 0xe5; - CurrentCluster = vfatDirEntryGetFirstCluster (DeviceExt, - (PDIR_ENTRY)pDirEntry); - CcSetDirtyPinnedData(Context, NULL); - CcUnpinData(Context); - - while (CurrentCluster && CurrentCluster != 0xffffffff) - { - GetNextCluster (DeviceExt, CurrentCluster, &NextCluster); - /* FIXME: check status */ - WriteCluster(DeviceExt, CurrentCluster, 0); - CurrentCluster = NextCluster; - } - return STATUS_SUCCESS; + ULONG CurrentCluster = 0, NextCluster; + PVOID Context = NULL; + LARGE_INTEGER Offset; + PFATX_DIR_ENTRY pDirEntry; + ULONG StartIndex; + + ASSERT(pFcb); + ASSERT(pFcb->parentFcb); + ASSERT(pFcb->Flags & FCB_IS_FATX_ENTRY); + + StartIndex = pFcb->startIndex; + + DPRINT("delEntry PathName \'%wZ\'\n", &pFcb->PathNameU); + DPRINT("delete entry: %d\n", StartIndex); + Offset.u.HighPart = 0; + Offset.u.LowPart = (StartIndex * sizeof(FATX_DIR_ENTRY) / PAGE_SIZE) * PAGE_SIZE; + if (!CcPinRead(pFcb->parentFcb->FileObject, &Offset, PAGE_SIZE, TRUE, + &Context, (PVOID*)&pDirEntry)) + { + DPRINT1("CcPinRead(Offset %x:%x, Length %d) failed\n", Offset.u.HighPart, Offset.u.LowPart, PAGE_SIZE); + return STATUS_UNSUCCESSFUL; + } + pDirEntry = &pDirEntry[StartIndex % (PAGE_SIZE / sizeof(FATX_DIR_ENTRY))]; + pDirEntry->FilenameLength = 0xe5; + CurrentCluster = vfatDirEntryGetFirstCluster(DeviceExt, + (PDIR_ENTRY)pDirEntry); + CcSetDirtyPinnedData(Context, NULL); + CcUnpinData(Context); + + while (CurrentCluster && CurrentCluster != 0xffffffff) + { + GetNextCluster(DeviceExt, CurrentCluster, &NextCluster); + /* FIXME: check status */ + WriteCluster(DeviceExt, CurrentCluster, 0); + CurrentCluster = NextCluster; + } + return STATUS_SUCCESS; } NTSTATUS -VfatDelEntry (PDEVICE_EXTENSION DeviceExt, PVFATFCB pFcb) +VfatDelEntry( + IN PDEVICE_EXTENSION DeviceExt, + IN PVFATFCB pFcb) { - if (DeviceExt->Flags & VCB_IS_FATX) - return FATXDelEntry(DeviceExt, pFcb); - else - return FATDelEntry(DeviceExt, pFcb); + if (DeviceExt->Flags & VCB_IS_FATX) + return FATXDelEntry(DeviceExt, pFcb); + else + return FATDelEntry(DeviceExt, pFcb); } /* EOF */
16 years, 8 months
1
0
0
0
[jimtabor] 33310: Quick implementation of DxEngCreateMemoryDC and DxEngCleanDC. It compiles. 8^D
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon May 5 23:22:49 2008 New Revision: 33310 URL:
http://svn.reactos.org/svn/reactos?rev=33310&view=rev
Log: Quick implementation of DxEngCreateMemoryDC and DxEngCleanDC. It compiles. 8^D Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c trunk/reactos/subsystems/win32/win32k/objects/dc.c Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] Mon May 5 23:22:49 2008 @@ -263,5 +263,7 @@ INT STDCALL IntGdiSetStretchBltMode(HDC hDC, INT stretchBltMode); VOID FASTCALL IntGdiReferencePdev(PGDIDEVICE pPDev); VOID FASTCALL IntGdiUnreferencePdev(PGDIDEVICE pPDev, DWORD CleanUpType); +HDC FASTCALL IntGdiCreateDisplayDC(HDEV hDev, ULONG DcType, BOOL EmptyDC); +BOOL FASTCALL IntGdiCleanDC(HDC hDC); #endif /* not __WIN32K_DC_H */ Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c [iso-8859-1] Mon May 5 23:22:49 2008 @@ -654,8 +654,7 @@ STDCALL DxEngCreateMemoryDC(HDEV hDev) { - UNIMPLEMENTED; - return NULL; + return IntGdiCreateDisplayDC(hDev, DC_TYPE_MEMORY, FALSE); } /************************************************************************/ @@ -732,8 +731,7 @@ STDCALL DxEngCleanDC(HDC hdc) { - UNIMPLEMENTED; - return FALSE; + return IntGdiCleanDC(hdc); } /************************************************************************/ Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] Mon May 5 23:22:49 2008 @@ -31,6 +31,7 @@ static GDIDEVICE PrimarySurface; static KEVENT VideoDriverNeedsPreparation; static KEVENT VideoDriverPrepared; +static PDC defaultDCstate = NULL; EDD_DIRECTDRAW_GLOBAL edd_DdirectDraw_Global; NTSTATUS FASTCALL @@ -926,6 +927,47 @@ return Ret; +} + + +HDC FASTCALL +IntGdiCreateDisplayDC(HDEV hDev, ULONG DcType, BOOL EmptyDC) +{ + HDC hDC; + UNICODE_STRING DriverName; + RtlInitUnicodeString(&DriverName, L"DISPLAY"); + + if (DcType != DC_TYPE_MEMORY) + hDC = IntGdiCreateDC(&DriverName, NULL, NULL, NULL, (DcType == DC_TYPE_INFO)); + else + hDC = NtGdiCreateCompatibleDC(NULL); // OH~ Yuck! I think I taste vomit in my mouth! +// +// There is room to grow here~ +// + +// +// If NULL, first time through! Build the default (was window) dc! +// + if (hDC && !defaultDCstate) // Ultra HAX! Dedicated to GvG! + { // This is a cheesy way to do this. + PDC dc = DC_LockDc ( hDC ); + defaultDCstate = ExAllocatePoolWithTag(PagedPool, sizeof(DC), TAG_DC); + RtlZeroMemory(defaultDCstate, sizeof(DC)); + IntGdiCopyToSaveState(dc, defaultDCstate); + DC_UnlockDc( dc ); + } + return hDC; +} + +BOOL FASTCALL +IntGdiCleanDC(HDC hDC) +{ + PDC dc; + dc = DC_LockDc ( hDC ); + // Clean the DC + if (defaultDCstate) IntGdiCopyFromSaveState(dc, defaultDCstate, hDC ); + DC_UnlockDc(dc); + return TRUE; } //
16 years, 8 months
1
0
0
0
[jimtabor] 33309: Win32k: - Rewrite EngAcquire/ReleaseSemaphore. - Add internal fastcalls for them and tag. - Fix DxEngUn/LockShareSem. - Tested with Qemu. Needs Dx testing.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon May 5 22:40:38 2008 New Revision: 33309 URL:
http://svn.reactos.org/svn/reactos?rev=33309&view=rev
Log: Win32k: - Rewrite EngAcquire/ReleaseSemaphore. - Add internal fastcalls for them and tag. - Fix DxEngUn/LockShareSem. - Tested with Qemu. Needs Dx testing. Modified: trunk/reactos/subsystems/win32/win32k/eng/semaphor.c trunk/reactos/subsystems/win32/win32k/include/eng.h trunk/reactos/subsystems/win32/win32k/include/tags.h trunk/reactos/subsystems/win32/win32k/include/win32.h trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c trunk/reactos/subsystems/win32/win32k/objects/dc.c Modified: trunk/reactos/subsystems/win32/win32k/eng/semaphor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/semaphor.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/semaphor.c [iso-8859-1] Mon May 5 22:40:38 2008 @@ -11,7 +11,7 @@ EngCreateSemaphore ( VOID ) { //
www.osr.com/ddk/graphics/gdifncs_95lz.htm
- PERESOURCE psem = ExAllocatePool ( NonPagedPool, sizeof(ERESOURCE) ); + PERESOURCE psem = ExAllocatePoolWithTag( NonPagedPool, sizeof(ERESOURCE), TAG_GSEM ); if ( !psem ) return NULL; if ( !NT_SUCCESS(ExInitializeResourceLite ( psem )) ) @@ -22,6 +22,14 @@ return (HSEMAPHORE)psem; } +VOID +FASTCALL +IntGdiAcquireSemaphore ( HSEMAPHORE hsem ) +{ + KeEnterCriticalRegion(); + ExAcquireResourceExclusiveLite ( (PERESOURCE)hsem, TRUE ); +} + /* * @implemented */ @@ -30,9 +38,20 @@ EngAcquireSemaphore ( IN HSEMAPHORE hsem ) { //
www.osr.com/ddk/graphics/gdifncs_14br.htm
+ PW32THREAD W32Thread; ASSERT(hsem); - KeEnterCriticalRegion(); - ExAcquireResourceExclusiveLite ( (PERESOURCE)hsem, TRUE ); + IntGdiAcquireSemaphore ( hsem ); + W32Thread = PsGetThreadWin32Thread(PsGetCurrentThread()); + if (W32Thread) W32Thread->dwEngAcquireCount++; +} + + +VOID +FASTCALL +IntGdiReleaseSemaphore ( HSEMAPHORE hsem ) +{ + ExReleaseResourceLite ( (PERESOURCE)hsem ); + KeLeaveCriticalRegion(); } /* @@ -43,9 +62,11 @@ EngReleaseSemaphore ( IN HSEMAPHORE hsem ) { //
www.osr.com/ddk/graphics/gdifncs_5u3r.htm
+ PW32THREAD W32Thread; ASSERT(hsem); - ExReleaseResourceLite ( (PERESOURCE)hsem ); - KeLeaveCriticalRegion(); + W32Thread = PsGetThreadWin32Thread(PsGetCurrentThread()); + if (W32Thread) --W32Thread->dwEngAcquireCount; + IntGdiReleaseSemaphore ( hsem ); } /* Modified: trunk/reactos/subsystems/win32/win32k/include/eng.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/eng.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/eng.h [iso-8859-1] Mon May 5 22:40:38 2008 @@ -20,4 +20,7 @@ PWINDOW_OBJECT Window, FLONG flChanged); +VOID FASTCALL IntGdiAcquireSemaphore ( HSEMAPHORE hsem ); +VOID FASTCALL IntGdiReleaseSemaphore ( HSEMAPHORE hsem ); + #endif /* _WIN32K_ENG_H */ Modified: trunk/reactos/subsystems/win32/win32k/include/tags.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/tags.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/tags.h [iso-8859-1] Mon May 5 22:40:38 2008 @@ -81,6 +81,7 @@ #define TAG_WNDOBJ TAG('W', 'N', 'D', 'O') /* window object */ #define TAG_XLATEOBJ TAG('X', 'L', 'A', 'O') /* xlate object */ #define TAG_BITMAPOBJ TAG('B', 'M', 'P', 'O') /* bitmap object */ +#define TAG_GSEM TAG('G', 's', 'e', 'm') /* Gdi Semaphore */ /* misc */ #define TAG_DRIVER TAG('G', 'D', 'R', 'V') /* video drivers */ Modified: trunk/reactos/subsystems/win32/win32k/include/win32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/win32.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/win32.h [iso-8859-1] Mon May 5 22:40:38 2008 @@ -13,6 +13,7 @@ HANDLE hDesktop; PVOID pgdiDcattr; PVOID pgdiBrushAttr; + DWORD dwEngAcquireCount; BOOLEAN IsExiting; SINGLE_LIST_ENTRY ReferencesList; ULONG Hooks; Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c [iso-8859-1] Mon May 5 22:40:38 2008 @@ -9,7 +9,7 @@ #include <w32k.h> #include <debug.h> -ERESOURCE ghsemShareDevLock; +HSEMAPHORE ghsemShareDevLock = NULL; ULONG gcEngFuncs = DXENG_INDEX_DxEngLoadImage + 1; DRVFN gaEngFuncs [] = @@ -171,23 +171,17 @@ * * @remarks. * It is being used in various ntuser* functions and ntgdi* -* ReactOS specific: It is not in use yet. +* ReactOS specific: It is not in use yet? *SystemResourcesList *--*/ BOOLEAN STDCALL DxEngLockShareSem() { - BOOLEAN retVal = FALSE; DPRINT1("ReactX Calling : DxEngLockShareSem\n"); -#if 0 - if (ExIsResourceAcquiredExclusiveLite(&ghsemShareDevLock) == FALSE) - { - KeEnterCriticalRegion(); - retVal = ExAcquireResourceExclusiveLite(&ghsemShareDevLock, TRUE); - } -#endif - return retVal; + if(!ghsemShareDevLock) ghsemShareDevLock = EngCreateSemaphore(); // Hax, should be in dllmain.c + IntGdiAcquireSemaphore(ghsemShareDevLock); + return TRUE; } /*++ @@ -200,7 +194,7 @@ * This function returns TRUE no matter what. * * @remarks. -* ReactOS specific: It is not in use yet. +* ReactOS specific: It is not in use yet? * *--*/ BOOLEAN @@ -208,14 +202,7 @@ DxEngUnlockShareSem() { DPRINT1("ReactX Calling : DxEngUnlockShareSem\n"); - -#if 0 - if (ExIsResourceAcquiredExclusiveLite(&ghsemShareDevLock) == TRUE) - { - ExReleaseResourceLite(&ghsemShareDevLock); - KeLeaveCriticalRegion(); - } -#endif + IntGdiReleaseSemaphore(ghsemShareDevLock); return TRUE; } Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] Mon May 5 22:40:38 2008 @@ -2705,21 +2705,21 @@ IntGdiReferencePdev(PGDIDEVICE pPDev) { if(!hsemDriverMgmt) hsemDriverMgmt = EngCreateSemaphore(); // Hax, should be in dllmain.c - EngAcquireSemaphore(hsemDriverMgmt); + IntGdiAcquireSemaphore(hsemDriverMgmt); pPDev->cPdevRefs++; - EngReleaseSemaphore(hsemDriverMgmt); + IntGdiReleaseSemaphore(hsemDriverMgmt); } VOID FASTCALL IntGdiUnreferencePdev(PGDIDEVICE pPDev, DWORD CleanUpType) { - EngAcquireSemaphore(hsemDriverMgmt); + IntGdiAcquireSemaphore(hsemDriverMgmt); pPDev->cPdevRefs--; if (!pPDev->cPdevRefs) { // Handle the destruction of pPDev or GDIDEVICE or PDEVOBJ or PDEV etc. } - EngReleaseSemaphore(hsemDriverMgmt); + IntGdiReleaseSemaphore(hsemDriverMgmt); }
16 years, 8 months
1
0
0
0
[mpiulachs] 33308: -solve msi circular dependency warning and avoid unnecessary msi.dll rebuilds See issue #3131 for more details.
by mpiulachs@svn.reactos.org
Author: mpiulachs Date: Mon May 5 18:19:38 2008 New Revision: 33308 URL:
http://svn.reactos.org/svn/reactos?rev=33308&view=rev
Log: -solve msi circular dependency warning and avoid unnecessary msi.dll rebuilds See issue #3131 for more details. Modified: trunk/reactos/dll/win32/msi/msi.rbuild Modified: trunk/reactos/dll/win32/msi/msi.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msi.rbuild?r…
============================================================================== --- trunk/reactos/dll/win32/msi/msi.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msi.rbuild [iso-8859-1] Mon May 5 18:19:38 2008 @@ -50,7 +50,6 @@ <file>update.c</file> <file>upgrade.c</file> <file>where.c</file> - <file>msiserver.idl</file> <file>msi.rc</file> <include base="msi" root="intermediate">.</include> <file>msi.spec</file> @@ -72,8 +71,12 @@ <library>uuid</library> <library>ntdll</library> <dependency>msi_msiserver_typelib</dependency> + <dependency>msiheader</dependency> </module> <module name="msi_msiserver_typelib" type="embeddedtypelib" allowwarnings="true"> <file>msiserver.idl</file> </module> +<module name="msiheader" type="idlheader"> + <file>msiserver.idl</file> +</module> </group>
16 years, 8 months
1
0
0
0
← Newer
1
...
45
46
47
48
49
50
51
...
59
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Results per page:
10
25
50
100
200