Author: akhaldi Date: Fri Oct 31 15:27:51 2014 New Revision: 65148
URL: http://svn.reactos.org/svn/reactos?rev=65148&view=rev Log: * Sync up to trunk head (r65147).
Added: branches/shell-experiments/dll/win32/shell32/shellstring.c - copied unchanged from r65147, trunk/reactos/dll/win32/shell32/shellstring.c Removed: branches/shell-experiments/dll/win32/shell32/shellstring.cpp branches/shell-experiments/dll/win32/shell32/xdg.h Modified: branches/shell-experiments/ (props changed) branches/shell-experiments/base/applications/logoff/logoff.c branches/shell-experiments/base/applications/network/finger/finger.c branches/shell-experiments/base/applications/network/finger/net.c branches/shell-experiments/base/applications/network/ftp/ftp.c branches/shell-experiments/base/applications/network/ipconfig/ipconfig.c branches/shell-experiments/boot/bootdata/hivedef.inf branches/shell-experiments/boot/freeldr/freeldr/include/arch/pc/x86common.h branches/shell-experiments/dll/cpl/appwiz/addons.c branches/shell-experiments/dll/cpl/appwiz/appwiz.c branches/shell-experiments/dll/cpl/appwiz/appwiz.h branches/shell-experiments/dll/cpl/intl/generalp.c branches/shell-experiments/dll/opengl/opengl32/opengl32.h branches/shell-experiments/dll/win32/shell32/CMakeLists.txt branches/shell-experiments/dll/win32/shell32/brsfolder.cpp branches/shell-experiments/dll/win32/shell32/folders/recyclebin.h branches/shell-experiments/dll/win32/shell32/shell32_main.h branches/shell-experiments/dll/win32/shell32/shlfileop.cpp branches/shell-experiments/dll/win32/syssetup/classinst.c branches/shell-experiments/dll/win32/syssetup/wizard.c branches/shell-experiments/drivers/filesystems/fastfat/cleanup.c branches/shell-experiments/drivers/filesystems/fastfat/create.c branches/shell-experiments/drivers/filesystems/fastfat/finfo.c branches/shell-experiments/drivers/filesystems/fastfat/fsctl.c branches/shell-experiments/drivers/filesystems/fastfat/vfat.h branches/shell-experiments/drivers/filesystems/ntfs/fsctl.c branches/shell-experiments/lib/fslib/vfatlib/vfatlib.c branches/shell-experiments/ntoskrnl/io/iomgr/file.c branches/shell-experiments/ntoskrnl/io/iomgr/rawfs.c branches/shell-experiments/ntoskrnl/se/token.c branches/shell-experiments/win32ss/gdi/ntgdi/freetype.c
Propchange: branches/shell-experiments/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Oct 31 15:27:51 2014 @@ -18,4 +18,4 @@ /branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859 /branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567 /branches/wlan-bringup:54809-54998 -/trunk/reactos:61927-65120 +/trunk/reactos:61927-65147
Modified: branches/shell-experiments/base/applications/logoff/logoff.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicati... ============================================================================== --- branches/shell-experiments/base/applications/logoff/logoff.c [iso-8859-1] (original) +++ branches/shell-experiments/base/applications/logoff/logoff.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -30,6 +30,7 @@
if (AllocAndLoadString(&lpUsage, GetModuleHandle(NULL), IDS_USAGE)) { _putts(lpUsage); + LocalFree(lpUsage); }
} @@ -88,8 +89,10 @@ } default: //Invalid parameter detected - if (AllocAndLoadString(&lpIllegalMsg, GetModuleHandle(NULL), IDS_ILLEGAL_PARAM)) - _putts(lpIllegalMsg); + if (AllocAndLoadString(&lpIllegalMsg, GetModuleHandle(NULL), IDS_ILLEGAL_PARAM)) { + _putts(lpIllegalMsg); + LocalFree(lpIllegalMsg); + } return FALSE; } }
Modified: branches/shell-experiments/base/applications/network/finger/finger.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicati... ============================================================================== --- branches/shell-experiments/base/applications/network/finger/finger.c [iso-8859-1] (original) +++ branches/shell-experiments/base/applications/network/finger/finger.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -151,6 +151,8 @@ /* Tell the user that we couldn't find a usable */ /* WinSock DLL. */ fprintf(stderr, "WSAStartup failed\n"); + free(nargv); + free(used); return; }
Modified: branches/shell-experiments/base/applications/network/finger/net.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicati... ============================================================================== --- branches/shell-experiments/base/applications/network/finger/net.c [iso-8859-1] (original) +++ branches/shell-experiments/base/applications/network/finger/net.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -128,4 +128,5 @@ if (lastc != '\n') putchar('\n'); putchar('\n'); + (void)closesocket(s); }
Modified: branches/shell-experiments/base/applications/network/ftp/ftp.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicati... ============================================================================== --- branches/shell-experiments/base/applications/network/ftp/ftp.c [iso-8859-1] (original) +++ branches/shell-experiments/base/applications/network/ftp/ftp.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -674,6 +674,7 @@ null();// (void) signal(SIGPIPE, oldintp); if (!cpend) { code = -1; + (*closefunc)(fin); return; } if (data >= 0) {
Modified: branches/shell-experiments/base/applications/network/ipconfig/ipconfig.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicati... ============================================================================== --- branches/shell-experiments/base/applications/network/ipconfig/ipconfig.c [iso-8859-1] (original) +++ branches/shell-experiments/base/applications/network/ipconfig/ipconfig.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -232,6 +232,7 @@ }
if (ConType) CharToOem(ConTypeTmp, ConType); + HeapFree(ProcessHeap, 0, ConTypeTmp); } } } @@ -366,6 +367,7 @@ (PBYTE)lpConDesc, &dwDataSize) != ERROR_SUCCESS) { + HeapFree(ProcessHeap, 0, lpConDesc); lpConDesc = NULL; goto CLEANUP; } @@ -382,9 +384,9 @@ RegCloseKey(hBaseKey); if (hClassKey != NULL) RegCloseKey(hClassKey); - if (lpConDesc != NULL) + if (lpPath != NULL) HeapFree(ProcessHeap, 0, lpPath); - if (lpConDesc != NULL) + if (lpKeyClass != NULL) HeapFree(ProcessHeap, 0, lpKeyClass);
return lpConDesc; @@ -714,7 +716,9 @@ Size)) { _tprintf(_T("%s"), lpUsage); - } + } + + HeapFree(ProcessHeap, 0, lpUsage); } }
Modified: branches/shell-experiments/boot/bootdata/hivedef.inf URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/boot/bootdata/... ============================================================================== --- branches/shell-experiments/boot/bootdata/hivedef.inf [iso-8859-1] (original) +++ branches/shell-experiments/boot/bootdata/hivedef.inf [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -2675,8 +2675,8 @@ DESKTOP_SCHEME_19="FurtunÄ" DESKTOP_SCHEME_20="Turcoaz" DESKTOP_SCHEME_21="Grâu" -DESKTOP_SCHEME_SIZE_0="Default size" -TEMP_DIR="%USERPROFILE%\PreferinÈe locale\Temp" +DESKTOP_SCHEME_SIZE_0="Dimensiune implicitÄ" +TEMP_DIR="%USERPROFILE%\Preferinte locale\Temp"
; LANG_RUSSIAN SUBLANG_NEUTRAL
Modified: branches/shell-experiments/boot/freeldr/freeldr/include/arch/pc/x86common.h URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/boot/freeldr/f... ============================================================================== --- branches/shell-experiments/boot/freeldr/freeldr/include/arch/pc/x86common.h [iso-8859-1] (original) +++ branches/shell-experiments/boot/freeldr/freeldr/include/arch/pc/x86common.h [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -17,14 +17,14 @@ #define FREELDR_BASE HEX(F800) #define FREELDR_PE_BASE HEX(10000) #define DISKREADBUFFER HEX(8E000) /* Buffer to store data read in from the disk via the BIOS */ -#define MEMORY_MARGIN HEX(9E000) /* Highest usable address */ +#define MEMORY_MARGIN HEX(9C000) /* Highest usable address */ /* 9F000- 9FFFF is reserved for the EBDA */ -#define DISKREADBUFFER_SIZE HEX(10000)
#define BIOSCALLBUFSEGMENT (BIOSCALLBUFFER/16) /* Buffer to store temporary data for any Int386() call */ #define BIOSCALLBUFOFFSET HEX(0000) /* Buffer to store temporary data for any Int386() call */ #define BIOSCALLBUFSIZE PAGE_SIZE /* max is sizeof(VESA_SVGA_INFO) = 512 */ #define MAX_FREELDR_PE_SIZE (DISKREADBUFFER - FREELDR_PE_BASE) +#define DISKREADBUFFER_SIZE (MEMORY_MARGIN - DISKREADBUFFER)
/* These addresses specify the realmode "BSS section" layout */ #define BSS_RealModeEntry (BSS_START + 0)
Modified: branches/shell-experiments/dll/cpl/appwiz/addons.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/appwiz... ============================================================================== --- branches/shell-experiments/dll/cpl/appwiz/addons.c [iso-8859-1] (original) +++ branches/shell-experiments/dll/cpl/appwiz/addons.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -397,7 +397,7 @@ return FALSE; }
-BOOL install_addon(addon_t addon_type) +BOOL install_addon(addon_t addon_type, HWND hwnd_parent) {
if(!*ARCH_STRING) @@ -411,7 +411,7 @@ * - download the package */ if (install_from_registered_dir() == INSTALL_NEXT) - DialogBoxW(hApplet, addon->dialog_template, 0, installer_proc); + DialogBoxW(hApplet, addon->dialog_template, hwnd_parent, installer_proc);
return TRUE; }
Modified: branches/shell-experiments/dll/cpl/appwiz/appwiz.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/appwiz... ============================================================================== --- branches/shell-experiments/dll/cpl/appwiz/appwiz.c [iso-8859-1] (original) +++ branches/shell-experiments/dll/cpl/appwiz/appwiz.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -14,7 +14,7 @@
HINSTANCE hApplet = NULL;
-static LONG start_params(const WCHAR *params) +static LONG start_params(const WCHAR *params, HWND hwnd_parent) { static const WCHAR install_geckoW[] = {'i','n','s','t','a','l','l','_','g','e','c','k','o',0}; static const WCHAR install_monoW[] = {'i','n','s','t','a','l','l','_','m','o','n','o',0}; @@ -23,12 +23,12 @@ return FALSE;
if(!strcmpW(params, install_geckoW)) { - install_addon(ADDON_GECKO); + install_addon(ADDON_GECKO, hwnd_parent); return TRUE; }
if(!strcmpW(params, install_monoW)) { - install_addon(ADDON_MONO); + install_addon(ADDON_MONO, hwnd_parent); return TRUE; }
@@ -51,7 +51,7 @@ return 1;
case CPL_STARTWPARMSW: - return start_params((const WCHAR *)lParam2); + return start_params((const WCHAR *)lParam2, hwndCPl);
case CPL_INQUIRE: CPlInfo = (CPLINFO*)lParam2;
Modified: branches/shell-experiments/dll/cpl/appwiz/appwiz.h URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/appwiz... ============================================================================== --- branches/shell-experiments/dll/cpl/appwiz/appwiz.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/cpl/appwiz/appwiz.h [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -50,7 +50,7 @@ ADDON_MONO } addon_t;
-BOOL install_addon(addon_t) DECLSPEC_HIDDEN; +BOOL install_addon(addon_t, HWND hwnd_parent) DECLSPEC_HIDDEN;
extern HINSTANCE hInst DECLSPEC_HIDDEN;
Modified: branches/shell-experiments/dll/cpl/intl/generalp.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/cpl/intl/g... ============================================================================== --- branches/shell-experiments/dll/cpl/intl/generalp.c [iso-8859-1] (original) +++ branches/shell-experiments/dll/cpl/intl/generalp.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -234,7 +234,9 @@ TCHAR loc[MAX_STR_SIZE]; INT index;
- GetGeoInfo(gId, GEO_FRIENDLYNAME, loc, MAX_STR_SIZE, LANG_SYSTEM_DEFAULT); + if(GetGeoInfo(gId, GEO_FRIENDLYNAME, loc, MAX_STR_SIZE, LANG_SYSTEM_DEFAULT) == 0) + return TRUE; + index = (INT)SendMessage(hGeoList, CB_ADDSTRING, 0,
Modified: branches/shell-experiments/dll/opengl/opengl32/opengl32.h URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/opengl/ope... ============================================================================== --- branches/shell-experiments/dll/opengl/opengl32/opengl32.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/opengl/opengl32/opengl32.h [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -137,7 +137,7 @@ IntGetCurrentRC(void) { struct Opengl32_ThreadData* data = TlsGetValue(OglTlsIndex); - return data->hglrc; + return data ? data->hglrc : NULL; }
static inline
Modified: branches/shell-experiments/dll/win32/shell32/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/shel... ============================================================================== --- branches/shell-experiments/dll/win32/shell32/CMakeLists.txt [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/CMakeLists.txt [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -43,7 +43,6 @@ shellord.cpp shellpath.cpp shellreg.cpp - shellstring.cpp folders/desktop.cpp folders/fs.cpp folders/mycomp.cpp @@ -77,6 +76,7 @@
add_library(shell32 SHARED ${SOURCE} + shellstring.c vista.c shell32.rc ${CMAKE_CURRENT_BINARY_DIR}/shell32_stubs.c
Modified: branches/shell-experiments/dll/win32/shell32/brsfolder.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/shel... ============================================================================== --- branches/shell-experiments/dll/win32/shell32/brsfolder.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/brsfolder.cpp [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -349,11 +349,11 @@ tvi.cChildren= pEnumIL ? 1 : 0; tvi.mask |= TVIF_CHILDREN;
+ if (!GetName(lpsf, pidl, SHGDN_NORMAL, szBuff)) + return NULL; + lptvid = (TV_ITEMDATA *)SHAlloc( sizeof(TV_ITEMDATA) ); if (!lptvid) - return NULL; - - if (!GetName(lpsf, pidl, SHGDN_NORMAL, szBuff)) return NULL;
tvi.pszText = szBuff;
Modified: branches/shell-experiments/dll/win32/shell32/folders/recyclebin.h URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/shel... ============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/recyclebin.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/recyclebin.h [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -24,6 +24,9 @@
DWORD WINAPI DoDeleteThreadProc(LPVOID lpParameter); HRESULT WINAPI DoDeleteDataObject(IDataObject *pda); + +BOOL TRASH_CanTrashFile(LPCWSTR wszPath); +BOOL TRASH_TrashFile(LPCWSTR wszPath);
class CRecycleBin : public CComCoClass<CRecycleBin, &CLSID_RecycleBin>,
Modified: branches/shell-experiments/dll/win32/shell32/shell32_main.h URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/shel... ============================================================================== --- branches/shell-experiments/dll/win32/shell32/shell32_main.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/shell32_main.h [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -30,7 +30,7 @@ extern HIMAGELIST ShellSmallIconList; extern HIMAGELIST ShellBigIconList;
-extern "C" BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList); +BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList);
/* Iconcache */ #define INVALID_INDEX -1 @@ -128,7 +128,7 @@ void WINAPI _InsertMenuItemW (HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState);
-static BOOL __inline SHELL_OsIsUnicode(void) +static __inline BOOL SHELL_OsIsUnicode(void) { /* if high-bit of version is 0, we are emulating NT */ return !(GetVersion() & 0x80000000); @@ -139,26 +139,26 @@ SHFree(*ptr); \ *ptr = NULL; \ }; -static void __inline __SHCloneStrA(char **target, const char *source) +static __inline void __SHCloneStrA(char **target, const char *source) { *target = (char *)SHAlloc(strlen(source) + 1); strcpy(*target, source); }
-static void __inline __SHCloneStrWtoA(char **target, const WCHAR *source) +static __inline void __SHCloneStrWtoA(char **target, const WCHAR *source) { int len = WideCharToMultiByte(CP_ACP, 0, source, -1, NULL, 0, NULL, NULL); *target = (char *)SHAlloc(len); WideCharToMultiByte(CP_ACP, 0, source, -1, *target, len, NULL, NULL); }
-static void __inline __SHCloneStrW(WCHAR **target, const WCHAR *source) +static __inline void __SHCloneStrW(WCHAR **target, const WCHAR *source) { *target = (WCHAR *)SHAlloc((lstrlenW(source) + 1) * sizeof(WCHAR) ); lstrcpyW(*target, source); }
-static LPWSTR __inline __SHCloneStrAtoW(WCHAR **target, const char *source) +static __inline LPWSTR __SHCloneStrAtoW(WCHAR **target, const char *source) { int len = MultiByteToWideChar(CP_ACP, 0, source, -1, NULL, 0); *target = (WCHAR *)SHAlloc(len * sizeof(WCHAR));
Removed: branches/shell-experiments/dll/win32/shell32/shellstring.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/shel... ============================================================================== --- branches/shell-experiments/dll/win32/shell32/shellstring.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/shellstring.cpp (removed) @@ -1,264 +0,0 @@ -/* - * Copyright 2000 Juergen Schmied - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "precomp.h" - -WINE_DEFAULT_DEBUG_CHANNEL(shell); - -/************************* STRRET functions ****************************/ - -BOOL WINAPI StrRetToStrNA(LPSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl) -{ - TRACE("dest=%p len=0x%x strret=%p(%s) pidl=%p\n", - dest,len,src, - (src->uType == STRRET_WSTR) ? "STRRET_WSTR" : - (src->uType == STRRET_CSTR) ? "STRRET_CSTR" : - (src->uType == STRRET_OFFSET) ? "STRRET_OFFSET" : "STRRET_???", - pidl); - - if (!dest) - return FALSE; - - switch (src->uType) - { - case STRRET_WSTR: - WideCharToMultiByte(CP_ACP, 0, src->pOleStr, -1, dest, len, NULL, NULL); - CoTaskMemFree(src->pOleStr); - break; - - case STRRET_CSTR: - lstrcpynA(dest, src->cStr, len); - break; - - case STRRET_OFFSET: - lstrcpynA(dest, ((LPCSTR)&pidl->mkid)+src->uOffset, len); - break; - - default: - FIXME("unknown type!\n"); - if (len) *dest = '\0'; - return FALSE; - } - TRACE("-- %s\n", debugstr_a(dest) ); - return TRUE; -} - -/************************************************************************/ - -BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl) -{ - TRACE("dest=%p len=0x%x strret=%p(%s) pidl=%p\n", - dest,len,src, - (src->uType == STRRET_WSTR) ? "STRRET_WSTR" : - (src->uType == STRRET_CSTR) ? "STRRET_CSTR" : - (src->uType == STRRET_OFFSET) ? "STRRET_OFFSET" : "STRRET_???", - pidl); - - if (!dest) - return FALSE; - - switch (src->uType) - { - case STRRET_WSTR: - lstrcpynW(dest, src->pOleStr, len); - CoTaskMemFree(src->pOleStr); - break; - - case STRRET_CSTR: - if (!MultiByteToWideChar( CP_ACP, 0, src->cStr, -1, dest, len ) && len) - dest[len-1] = 0; - break; - - case STRRET_OFFSET: - if (!MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->uOffset, -1, dest, len ) && len) - dest[len-1] = 0; - break; - - default: - FIXME("unknown type!\n"); - if (len) *dest = '\0'; - return FALSE; - } - return TRUE; -} - - -/************************************************************************* - * StrRetToStrN [SHELL32.96] - * - * converts a STRRET to a normal string - * - * NOTES - * the pidl is for STRRET OFFSET - */ -EXTERN_C BOOL WINAPI StrRetToStrNAW(LPVOID dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl) -{ - if(SHELL_OsIsUnicode()) - return StrRetToStrNW((LPWSTR)dest, len, src, pidl); - else - return StrRetToStrNA((LPSTR)dest, len, src, pidl); -} - -/************************* OLESTR functions ****************************/ - -/************************************************************************ - * StrToOleStr [SHELL32.163] - * - */ -static int StrToOleStrA (LPWSTR lpWideCharStr, LPCSTR lpMultiByteString) -{ - TRACE("(%p, %p %s)\n", - lpWideCharStr, lpMultiByteString, debugstr_a(lpMultiByteString)); - - return MultiByteToWideChar(0, 0, lpMultiByteString, -1, lpWideCharStr, MAX_PATH); - -} -static int StrToOleStrW (LPWSTR lpWideCharStr, LPCWSTR lpWString) -{ - TRACE("(%p, %p %s)\n", - lpWideCharStr, lpWString, debugstr_w(lpWString)); - - wcscpy (lpWideCharStr, lpWString ); - return wcslen(lpWideCharStr); -} - -EXTERN_C BOOL WINAPI StrToOleStrAW (LPWSTR lpWideCharStr, LPCVOID lpString) -{ - if (SHELL_OsIsUnicode()) - return StrToOleStrW (lpWideCharStr, (LPCWSTR)lpString); - return StrToOleStrA (lpWideCharStr, (LPCSTR)lpString); -} - -/************************************************************************* - * StrToOleStrN [SHELL32.79] - * lpMulti, nMulti, nWide [IN] - * lpWide [OUT] - */ -static BOOL StrToOleStrNA (LPWSTR lpWide, INT nWide, LPCSTR lpStrA, INT nStr) -{ - TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_an(lpStrA,nStr), nStr); - return MultiByteToWideChar (0, 0, lpStrA, nStr, lpWide, nWide); -} -static BOOL StrToOleStrNW (LPWSTR lpWide, INT nWide, LPCWSTR lpStrW, INT nStr) -{ - TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_wn(lpStrW, nStr), nStr); - - if (lstrcpynW (lpWide, lpStrW, nWide)) - { return wcslen (lpWide); - } - return 0; -} - -EXTERN_C BOOL WINAPI StrToOleStrNAW (LPWSTR lpWide, INT nWide, LPCVOID lpStr, INT nStr) -{ - if (SHELL_OsIsUnicode()) - return StrToOleStrNW (lpWide, nWide, (LPCWSTR)lpStr, nStr); - return StrToOleStrNA (lpWide, nWide, (LPCSTR)lpStr, nStr); -} - -/************************************************************************* - * OleStrToStrN [SHELL32.78] - */ -static BOOL OleStrToStrNA (LPSTR lpStr, INT nStr, LPCWSTR lpOle, INT nOle) -{ - TRACE("(%p, %x, %s, %x)\n", lpStr, nStr, debugstr_wn(lpOle,nOle), nOle); - return WideCharToMultiByte (0, 0, lpOle, nOle, lpStr, nStr, NULL, NULL); -} - -static BOOL OleStrToStrNW (LPWSTR lpwStr, INT nwStr, LPCWSTR lpOle, INT nOle) -{ - TRACE("(%p, %x, %s, %x)\n", lpwStr, nwStr, debugstr_wn(lpOle,nOle), nOle); - - if (lstrcpynW ( lpwStr, lpOle, nwStr)) - { return wcslen (lpwStr); - } - return 0; -} - -EXTERN_C BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT nIn) -{ - if (SHELL_OsIsUnicode()) - return OleStrToStrNW ((LPWSTR)lpOut, nOut, (LPCWSTR)lpIn, nIn); - return OleStrToStrNA ((LPSTR)lpOut, nOut, (LPCWSTR)lpIn, nIn); -} - - -/************************************************************************* - * CheckEscapesA [SHELL32.@] - * - * Checks a string for special characters which are not allowed in a path - * and encloses it in quotes if that is the case. - * - * PARAMS - * string [I/O] string to check and on return eventually quoted - * len [I] length of string - * - * RETURNS - * length of actual string - * - * NOTES - * Not really sure if this function returns actually a value at all. - */ -DWORD WINAPI CheckEscapesA( - LPSTR string, /* [I/O] string to check ??*/ - DWORD len) /* [I] is 0 */ -{ - LPWSTR wString; - DWORD ret = 0; - - TRACE("(%s %d)\n", debugstr_a(string), len); - wString = (LPWSTR)LocalAlloc(LPTR, len * sizeof(WCHAR)); - if (wString) - { - MultiByteToWideChar(CP_ACP, 0, string, len, wString, len); - ret = CheckEscapesW(wString, len); - WideCharToMultiByte(CP_ACP, 0, wString, len, string, len, NULL, NULL); - LocalFree(wString); - } - return ret; -} - -static const WCHAR strEscapedChars[] = {' ','"',',',';','^',0}; - -/************************************************************************* - * CheckEscapesW [SHELL32.@] - * - * See CheckEscapesA. - */ -DWORD WINAPI CheckEscapesW( - LPWSTR string, - DWORD len) -{ - DWORD size = wcslen(string); - LPWSTR s, d; - - TRACE("(%s %d) stub\n", debugstr_w(string), len); - - if (StrPBrkW(string, strEscapedChars) && size + 2 <= len) - { - s = &string[size - 1]; - d = &string[size + 2]; - *d-- = 0; - *d-- = '"'; - for (;d > string;) - *d-- = *s--; - *d = '"'; - return size + 2; - } - return size; -}
Modified: branches/shell-experiments/dll/win32/shell32/shlfileop.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/shel... ============================================================================== --- branches/shell-experiments/dll/win32/shell32/shlfileop.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/shlfileop.cpp [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -22,8 +22,6 @@ */
#include "precomp.h" - -#include "xdg.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
Removed: branches/shell-experiments/dll/win32/shell32/xdg.h URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/shel... ============================================================================== --- branches/shell-experiments/dll/win32/shell32/xdg.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/xdg.h (removed) @@ -1,52 +0,0 @@ -/* - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __XDG_H__ -#define __XDG_H__ - -/* - * XDG directories access - */ -#define XDG_DATA_HOME 0 -#define XDG_CONFIG_HOME 1 -#define XDG_DATA_DIRS 2 -#define XDG_CONFIG_DIRS 3 -#define XDG_CACHE_HOME 4 - -const char *XDG_GetPath(int path_id); -char *XDG_BuildPath(int root_id, const char *subpath); -int XDG_MakeDirs(const char *path); - -#define XDG_URLENCODE 0x1 -BOOL XDG_WriteDesktopStringEntry(int fd, const char *keyName, DWORD dwFlags, const char *value); - -typedef struct tagXDG_PARSED_FILE XDG_PARSED_FILE; - -XDG_PARSED_FILE *XDG_ParseDesktopFile(int fd); -char *XDG_GetStringValue(XDG_PARSED_FILE *file, const char *group_name, const char *value_name, DWORD dwFlags); -void XDG_FreeParsedFile(XDG_PARSED_FILE *file); - -/* implemented in trash.c */ -typedef struct tagTRASH_ELEMENT TRASH_ELEMENT; - -BOOL TRASH_CanTrashFile(LPCWSTR wszPath); -BOOL TRASH_TrashFile(LPCWSTR wszPath); -HRESULT TRASH_UnpackItemID(LPCSHITEMID id, TRASH_ELEMENT *element, WIN32_FIND_DATAW *data); -HRESULT TRASH_EnumItems(LPITEMIDLIST **pidls, int *count); -void TRASH_DisposeElement(TRASH_ELEMENT *element); - - -#endif /* __XDG_H__ */
Modified: branches/shell-experiments/dll/win32/syssetup/classinst.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/syss... ============================================================================== --- branches/shell-experiments/dll/win32/syssetup/classinst.c [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/syssetup/classinst.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -8,7 +8,7 @@
#include "precomp.h"
-#define NDEBUG +//#define NDEBUG #include <debug.h>
/*
Modified: branches/shell-experiments/dll/win32/syssetup/wizard.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/syss... ============================================================================== --- branches/shell-experiments/dll/win32/syssetup/wizard.c [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/syssetup/wizard.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -1984,7 +1984,7 @@ PSETUPDATA SetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
/* Run the Wine Gecko prompt */ - Control_RunDLLW(GetDesktopWindow(), 0, L"appwiz.cpl install_gecko", SW_SHOW); + Control_RunDLLW(hwndDlg, 0, L"appwiz.cpl install_gecko", SW_SHOW);
/* Set title font */ SendDlgItemMessage(hwndDlg,
Modified: branches/shell-experiments/drivers/filesystems/fastfat/cleanup.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/drivers/filesy... ============================================================================== --- branches/shell-experiments/drivers/filesystems/fastfat/cleanup.c [iso-8859-1] (original) +++ branches/shell-experiments/drivers/filesystems/fastfat/cleanup.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -24,6 +24,7 @@ PVFAT_IRP_CONTEXT IrpContext) { PVFATFCB pFcb; + PDEVICE_EXTENSION DeviceExt = IrpContext->DeviceExt; PFILE_OBJECT FileObject = IrpContext->FileObject;
DPRINT("VfatCleanupFile(DeviceExt %p, FileObject %p)\n", @@ -37,6 +38,7 @@ if (pFcb->Flags & FCB_IS_VOLUME) { pFcb->OpenHandleCount--; + DeviceExt->OpenHandleCount--;
if (pFcb->OpenHandleCount != 0) { @@ -63,6 +65,7 @@ FileObject->FsContext2);
pFcb->OpenHandleCount--; + DeviceExt->OpenHandleCount--;
if (!(*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY) && FsRtlAreThereCurrentFileLocks(&pFcb->FileLock)) @@ -89,6 +92,7 @@ pFcb->FileObject = NULL; CcUninitializeCacheMap(tmpFileObject, NULL, NULL); ObDereferenceObject(tmpFileObject); + vfatReleaseFCB(IrpContext->DeviceExt, pFcb); }
CcPurgeCacheSection(FileObject->SectionObjectPointer, NULL, 0, FALSE);
Modified: branches/shell-experiments/drivers/filesystems/fastfat/create.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/drivers/filesy... ============================================================================== --- branches/shell-experiments/drivers/filesystems/fastfat/create.c [iso-8859-1] (original) +++ branches/shell-experiments/drivers/filesystems/fastfat/create.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -365,7 +365,6 @@ DPRINT("'%wZ'\n", &FileObject->RelatedFileObject->FileName);
*ParentFcb = FileObject->RelatedFileObject->FsContext; - vfatGrabFCB(DeviceExt, *ParentFcb); } else { @@ -473,10 +472,18 @@ return STATUS_INVALID_PARAMETER; }
+ /* Deny create if the volume is locked */ + if (DeviceExt->Flags & VCB_VOLUME_LOCKED) + { + return STATUS_ACCESS_DENIED; + } + /* This a open operation for the volume itself */ if (FileObject->FileName.Length == 0 && (FileObject->RelatedFileObject == NULL || FileObject->RelatedFileObject->FsContext2 != NULL)) { + DPRINT1("Volume opening\n"); + if (RequestedDisposition != FILE_OPEN && RequestedDisposition != FILE_OPEN_IF) { @@ -497,6 +504,7 @@
pFcb = DeviceExt->VolumeFcb; vfatAttachFCBToFileObject(DeviceExt, pFcb, FileObject); + DeviceExt->OpenHandleCount++;
Irp->IoStatus.Information = FILE_OPENED; return STATUS_SUCCESS; @@ -639,6 +647,7 @@ }
pFcb->OpenHandleCount++; + DeviceExt->OpenHandleCount++; } else if (ParentFcb != NULL) { @@ -884,6 +893,7 @@ }
pFcb->OpenHandleCount++; + DeviceExt->OpenHandleCount++;
/* FIXME : test write access if requested */
Modified: branches/shell-experiments/drivers/filesystems/fastfat/finfo.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/drivers/filesy... ============================================================================== --- branches/shell-experiments/drivers/filesystems/fastfat/finfo.c [iso-8859-1] (original) +++ branches/shell-experiments/drivers/filesystems/fastfat/finfo.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -396,41 +396,53 @@ /* If it exists */ if (NT_SUCCESS(Status)) { + DPRINT("Target file %wZ exists. FCB Flags %08x\n", NewName, TargetFcb->Flags); /* Check whether we are allowed to replace */ if (ReplaceIfExists) { /* If that's a directory or a read-only file, we're not allowed */ - if (vfatFCBIsDirectory(TargetFcb) || ((*TargetFcb->Attributes & FILE_ATTRIBUTE_READONLY) == FILE_ATTRIBUTE_READONLY)); - { + if (vfatFCBIsDirectory(TargetFcb) || ((*TargetFcb->Attributes & FILE_ATTRIBUTE_READONLY) == FILE_ATTRIBUTE_READONLY)) + { + DPRINT("And this is a readonly file!\n"); vfatReleaseFCB(DeviceExt, *ParentFCB); *ParentFCB = NULL; vfatReleaseFCB(DeviceExt, TargetFcb); return STATUS_OBJECT_NAME_COLLISION; }
- /* Attempt to flush (might close the file) */ - if (!MmFlushImageSection(TargetFcb->FileObject->SectionObjectPointer, MmFlushForDelete)) - { + + /* If we still have a file object, close it. */ + if (TargetFcb->FileObject) + { + if (!MmFlushImageSection(TargetFcb->FileObject->SectionObjectPointer, MmFlushForDelete)) + { + DPRINT("MmFlushImageSection failed.\n"); + vfatReleaseFCB(DeviceExt, *ParentFCB); + *ParentFCB = NULL; + vfatReleaseFCB(DeviceExt, TargetFcb); + return STATUS_ACCESS_DENIED; + } + + TargetFcb->FileObject->DeletePending = TRUE; + VfatCloseFile(DeviceExt, TargetFcb->FileObject); + } + + /* If we are here, ensure the file isn't open by anyone! */ + if (TargetFcb->OpenHandleCount != 0) + { + DPRINT("There are still open handles for this file.\n"); vfatReleaseFCB(DeviceExt, *ParentFCB); *ParentFCB = NULL; vfatReleaseFCB(DeviceExt, TargetFcb); return STATUS_ACCESS_DENIED; }
- /* If we are, ensure the file isn't open by anyone! */ - if (TargetFcb->OpenHandleCount != 0) - { - vfatReleaseFCB(DeviceExt, *ParentFCB); - *ParentFCB = NULL; - vfatReleaseFCB(DeviceExt, TargetFcb); - return STATUS_ACCESS_DENIED; - } - /* Effectively delete old file to allow renaming */ + DPRINT("Effectively deleting the file.\n"); VfatDelEntry(DeviceExt, TargetFcb, NULL); - vfatGrabFCB(DeviceExt, *ParentFCB); vfatReleaseFCB(DeviceExt, TargetFcb); *Deleted = TRUE; + return STATUS_SUCCESS; } else {
Modified: branches/shell-experiments/drivers/filesystems/fastfat/fsctl.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/drivers/filesy... ============================================================================== --- branches/shell-experiments/drivers/filesystems/fastfat/fsctl.c [iso-8859-1] (original) +++ branches/shell-experiments/drivers/filesystems/fastfat/fsctl.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -612,6 +612,8 @@ FsRtlNotifyInitializeSync(&DeviceExt->NotifySync); InitializeListHead(&DeviceExt->NotifyList);
+ DPRINT1("Mount success\n"); + Status = STATUS_SUCCESS;
ByeBye: @@ -855,6 +857,72 @@ return Status; }
+static +NTSTATUS +VfatLockOrUnlockVolume( + PVFAT_IRP_CONTEXT IrpContext, + BOOLEAN Lock) +{ + PFILE_OBJECT FileObject; + PDEVICE_EXTENSION DeviceExt; + + DPRINT1("VfatLockOrUnlockVolume(%p, %d)\n", IrpContext, Lock); + + DeviceExt = IrpContext->DeviceExt; + FileObject = IrpContext->FileObject; + + /* Only allow locking with the volume open */ + if (FileObject->FsContext != DeviceExt->VolumeFcb) + { + return STATUS_ACCESS_DENIED; + } + + /* Bail out if it's already in the demanded state */ + if (((DeviceExt->Flags & VCB_VOLUME_LOCKED) && Lock) || + (!(DeviceExt->Flags & VCB_VOLUME_LOCKED) && !Lock)) + { + return STATUS_ACCESS_DENIED; + } + + /* Deny locking if we're not alone */ + if (Lock && DeviceExt->OpenHandleCount != 1) + { + return STATUS_ACCESS_DENIED; + } + + /* Finally, proceed */ + if (Lock) + { + DeviceExt->Flags |= VCB_VOLUME_LOCKED; + } + else + { + DeviceExt->Flags &= ~VCB_VOLUME_LOCKED; + } + + return STATUS_SUCCESS; +} + +static +NTSTATUS +VfatDismountVolume( + PVFAT_IRP_CONTEXT IrpContext) +{ + PDEVICE_EXTENSION DeviceExt; + + DPRINT1("VfatDismountVolume(%p)\n", IrpContext); + + DeviceExt = IrpContext->DeviceExt; + + if (!(DeviceExt->Flags & VCB_VOLUME_LOCKED)) + { + return STATUS_ACCESS_DENIED; + } + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + /* * FUNCTION: File system control */ @@ -896,6 +964,18 @@
case FSCTL_MARK_VOLUME_DIRTY: Status = VfatMarkVolumeDirty(IrpContext); + break; + + case FSCTL_LOCK_VOLUME: + Status = VfatLockOrUnlockVolume(IrpContext, TRUE); + break; + + case FSCTL_UNLOCK_VOLUME: + Status = VfatLockOrUnlockVolume(IrpContext, FALSE); + break; + + case FSCTL_DISMOUNT_VOLUME: + Status = VfatDismountVolume(IrpContext); break;
default:
Modified: branches/shell-experiments/drivers/filesystems/fastfat/vfat.h URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/drivers/filesy... ============================================================================== --- branches/shell-experiments/drivers/filesystems/fastfat/vfat.h [iso-8859-1] (original) +++ branches/shell-experiments/drivers/filesystems/fastfat/vfat.h [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -296,6 +296,9 @@ /* Notifications */ LIST_ENTRY NotifyList; PNOTIFY_SYNC NotifySync; + + /* Incremented on IRP_MJ_CREATE, decremented on IRP_MJ_CLEANUP */ + ULONG OpenHandleCount; } DEVICE_EXTENSION, VCB, *PVCB;
typedef struct
Modified: branches/shell-experiments/drivers/filesystems/ntfs/fsctl.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/drivers/filesy... ============================================================================== --- branches/shell-experiments/drivers/filesystems/ntfs/fsctl.c [iso-8859-1] (original) +++ branches/shell-experiments/drivers/filesystems/ntfs/fsctl.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -528,71 +528,151 @@
static NTSTATUS +GetNfsVolumeData(PDEVICE_EXTENSION DeviceExt, + PIRP Irp) +{ + PIO_STACK_LOCATION Stack; + PNTFS_VOLUME_DATA_BUFFER DataBuffer; + PNTFS_ATTR_RECORD Attribute; + + DataBuffer = (PNTFS_VOLUME_DATA_BUFFER)Irp->UserBuffer; + Stack = IoGetCurrentIrpStackLocation(Irp); + + if (Stack->Parameters.FileSystemControl.OutputBufferLength < sizeof(NTFS_VOLUME_DATA_BUFFER) || + Irp->UserBuffer == NULL) + { + DPRINT1("Invalid output! %d %p\n", Stack->Parameters.FileSystemControl.OutputBufferLength, Irp->UserBuffer); + return STATUS_INVALID_PARAMETER; + } + + DataBuffer->VolumeSerialNumber.QuadPart = DeviceExt->NtfsInfo.SerialNumber; + DataBuffer->NumberSectors.QuadPart = DeviceExt->NtfsInfo.SectorCount; + DataBuffer->TotalClusters.QuadPart = DeviceExt->NtfsInfo.SectorCount / DeviceExt->NtfsInfo.SectorsPerCluster; + DataBuffer->FreeClusters.QuadPart = NtfsGetFreeClusters(DeviceExt); + DataBuffer->TotalReserved.QuadPart = 0LL; // FIXME + DataBuffer->BytesPerSector = DeviceExt->NtfsInfo.BytesPerSector; + DataBuffer->BytesPerCluster = DeviceExt->NtfsInfo.BytesPerCluster; + DataBuffer->BytesPerFileRecordSegment = DeviceExt->NtfsInfo.BytesPerFileRecord; + DataBuffer->ClustersPerFileRecordSegment = DeviceExt->NtfsInfo.BytesPerFileRecord / DeviceExt->NtfsInfo.BytesPerCluster; + DataBuffer->MftStartLcn.QuadPart = DeviceExt->NtfsInfo.MftStart.QuadPart; + DataBuffer->Mft2StartLcn.QuadPart = DeviceExt->NtfsInfo.MftMirrStart.QuadPart; + DataBuffer->MftZoneStart.QuadPart = 0; // FIXME + DataBuffer->MftZoneEnd.QuadPart = 0; // FIXME + + Attribute = (PNTFS_ATTR_RECORD)((ULONG_PTR)DeviceExt->MasterFileTable + DeviceExt->MasterFileTable->AttributeOffset); + while (Attribute < (PNTFS_ATTR_RECORD)((ULONG_PTR)DeviceExt->MasterFileTable + DeviceExt->MasterFileTable->BytesInUse) && + Attribute->Type != AttributeEnd) + { + if (Attribute->Type == AttributeData) + { + ASSERT(Attribute->IsNonResident); + DataBuffer->MftValidDataLength.QuadPart = Attribute->NonResident.DataSize; + + break; + } + + Attribute = (PNTFS_ATTR_RECORD)((ULONG_PTR)Attribute + Attribute->Length); + } + + if (Stack->Parameters.FileSystemControl.OutputBufferLength >= sizeof(NTFS_EXTENDED_VOLUME_DATA) + sizeof(NTFS_VOLUME_DATA_BUFFER)) + { + PNTFS_EXTENDED_VOLUME_DATA ExtendedData = (PNTFS_EXTENDED_VOLUME_DATA)((ULONG_PTR)Irp->UserBuffer + sizeof(NTFS_VOLUME_DATA_BUFFER)); + + ExtendedData->ByteCount = sizeof(NTFS_EXTENDED_VOLUME_DATA); + ExtendedData->MajorVersion = DeviceExt->NtfsInfo.MajorVersion; + ExtendedData->MinorVersion = DeviceExt->NtfsInfo.MinorVersion; + } + + return STATUS_SUCCESS; +} + + +static +NTSTATUS +GetNtfsFileRecord(PDEVICE_EXTENSION DeviceExt, + PIRP Irp) +{ + NTSTATUS Status; + PIO_STACK_LOCATION Stack; + PNTFS_FILE_RECORD_INPUT_BUFFER InputBuffer; + PFILE_RECORD_HEADER FileRecord; + PNTFS_FILE_RECORD_OUTPUT_BUFFER OutputBuffer; + ULONGLONG MFTRecord; + + Stack = IoGetCurrentIrpStackLocation(Irp); + + if (Stack->Parameters.FileSystemControl.InputBufferLength < sizeof(NTFS_FILE_RECORD_INPUT_BUFFER) || + Irp->AssociatedIrp.SystemBuffer == NULL) + { + DPRINT1("Invalid input! %d %p\n", Stack->Parameters.FileSystemControl.InputBufferLength, Irp->AssociatedIrp.SystemBuffer); + return STATUS_INVALID_PARAMETER; + } + + if (Stack->Parameters.FileSystemControl.OutputBufferLength < sizeof(NTFS_FILE_RECORD_OUTPUT_BUFFER) || + Irp->AssociatedIrp.SystemBuffer == NULL) + { + DPRINT1("Invalid output! %d %p\n", Stack->Parameters.FileSystemControl.OutputBufferLength, Irp->AssociatedIrp.SystemBuffer); + return STATUS_BUFFER_TOO_SMALL; + } + + FileRecord = ExAllocatePoolWithTag(NonPagedPool, + DeviceExt->NtfsInfo.BytesPerFileRecord, + TAG_NTFS); + if (FileRecord == NULL) + { + return STATUS_INSUFFICIENT_RESOURCES; + } + + InputBuffer = (PNTFS_FILE_RECORD_INPUT_BUFFER)Irp->AssociatedIrp.SystemBuffer; + + MFTRecord = InputBuffer->FileReferenceNumber.QuadPart; + Status = ReadFileRecord(DeviceExt, MFTRecord, FileRecord); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed reading record: %I64x\n", MFTRecord); + ExFreePoolWithTag(FileRecord, TAG_NTFS); + return Status; + } + + if (Stack->Parameters.FileSystemControl.OutputBufferLength < (FIELD_OFFSET(NTFS_FILE_RECORD_OUTPUT_BUFFER, FileRecordBuffer) + FileRecord->BytesInUse)) + { + DPRINT1("Buffer too small: %lu vs %lu\n", Stack->Parameters.FileSystemControl.OutputBufferLength, FileRecord->BytesInUse); + ExFreePoolWithTag(FileRecord, TAG_NTFS); + return STATUS_BUFFER_TOO_SMALL; + } + + OutputBuffer = (PNTFS_FILE_RECORD_OUTPUT_BUFFER)Irp->AssociatedIrp.SystemBuffer; + OutputBuffer->FileReferenceNumber.QuadPart = MFTRecord; + OutputBuffer->FileRecordLength = FileRecord->BytesInUse; + RtlCopyMemory(OutputBuffer->FileRecordBuffer, FileRecord, FileRecord->BytesInUse); + + ExFreePoolWithTag(FileRecord, TAG_NTFS); + + return STATUS_SUCCESS; +} + + +static +NTSTATUS NtfsUserFsRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp) { NTSTATUS Status; PIO_STACK_LOCATION Stack; PDEVICE_EXTENSION DeviceExt; - PNTFS_VOLUME_DATA_BUFFER DataBuffer; - PNTFS_ATTR_RECORD Attribute;
DPRINT1("NtfsUserFsRequest(%p, %p)\n", DeviceObject, Irp);
Stack = IoGetCurrentIrpStackLocation(Irp); + DeviceExt = DeviceObject->DeviceExtension; switch (Stack->Parameters.FileSystemControl.FsControlCode) { case FSCTL_GET_NTFS_VOLUME_DATA: - DeviceExt = DeviceObject->DeviceExtension; - DataBuffer = (PNTFS_VOLUME_DATA_BUFFER)Irp->UserBuffer; - - if (Stack->Parameters.FileSystemControl.OutputBufferLength < sizeof(NTFS_VOLUME_DATA_BUFFER) || - Irp->UserBuffer == NULL) - { - DPRINT1("Invalid output! %d %p\n", Stack->Parameters.FileSystemControl.OutputBufferLength, Irp->UserBuffer); - Status = STATUS_INVALID_PARAMETER; - break; - } - - DataBuffer->VolumeSerialNumber.QuadPart = DeviceExt->NtfsInfo.SerialNumber; - DataBuffer->NumberSectors.QuadPart = DeviceExt->NtfsInfo.SectorCount; - DataBuffer->TotalClusters.QuadPart = DeviceExt->NtfsInfo.SectorCount / DeviceExt->NtfsInfo.SectorsPerCluster; - DataBuffer->FreeClusters.QuadPart = NtfsGetFreeClusters(DeviceExt); - DataBuffer->TotalReserved.QuadPart = 0LL; // FIXME - DataBuffer->BytesPerSector = DeviceExt->NtfsInfo.BytesPerSector; - DataBuffer->BytesPerCluster = DeviceExt->NtfsInfo.BytesPerCluster; - DataBuffer->BytesPerFileRecordSegment = DeviceExt->NtfsInfo.BytesPerFileRecord; - DataBuffer->ClustersPerFileRecordSegment = DeviceExt->NtfsInfo.BytesPerFileRecord / DeviceExt->NtfsInfo.BytesPerCluster; - DataBuffer->MftStartLcn.QuadPart = DeviceExt->NtfsInfo.MftStart.QuadPart; - DataBuffer->Mft2StartLcn.QuadPart = DeviceExt->NtfsInfo.MftMirrStart.QuadPart; - DataBuffer->MftZoneStart.QuadPart = 0; // FIXME - DataBuffer->MftZoneEnd.QuadPart = 0; // FIXME - - Attribute = (PNTFS_ATTR_RECORD)((ULONG_PTR)DeviceExt->MasterFileTable + DeviceExt->MasterFileTable->AttributeOffset); - while (Attribute < (PNTFS_ATTR_RECORD)((ULONG_PTR)DeviceExt->MasterFileTable + DeviceExt->MasterFileTable->BytesInUse) && - Attribute->Type != AttributeEnd) - { - if (Attribute->Type == AttributeData) - { - ASSERT(Attribute->IsNonResident); - DataBuffer->MftValidDataLength.QuadPart = Attribute->NonResident.DataSize; - - break; - } - - Attribute = (PNTFS_ATTR_RECORD)((ULONG_PTR)Attribute + Attribute->Length); - } - - if (Stack->Parameters.FileSystemControl.OutputBufferLength >= sizeof(NTFS_EXTENDED_VOLUME_DATA) + sizeof(NTFS_VOLUME_DATA_BUFFER)) - { - PNTFS_EXTENDED_VOLUME_DATA ExtendedData = (PNTFS_EXTENDED_VOLUME_DATA)((ULONG_PTR)Irp->UserBuffer + sizeof(NTFS_VOLUME_DATA_BUFFER)); - - ExtendedData->ByteCount = sizeof(NTFS_EXTENDED_VOLUME_DATA); - ExtendedData->MajorVersion = DeviceExt->NtfsInfo.MajorVersion; - ExtendedData->MinorVersion = DeviceExt->NtfsInfo.MinorVersion; - } - - Status = STATUS_SUCCESS; + Status = GetNfsVolumeData(DeviceExt, Irp); + break; + + case FSCTL_GET_NTFS_FILE_RECORD: + Status = GetNtfsFileRecord(DeviceExt, Irp); break;
default:
Modified: branches/shell-experiments/lib/fslib/vfatlib/vfatlib.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/lib/fslib/vfat... ============================================================================== --- branches/shell-experiments/lib/fslib/vfatlib/vfatlib.c [iso-8859-1] (original) +++ branches/shell-experiments/lib/fslib/vfatlib/vfatlib.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -251,6 +251,23 @@ Status = STATUS_INVALID_PARAMETER; }
+ /* Attempt to dismount formatted volume */ + LockStatus = NtFsControlFile(FileHandle, + NULL, + NULL, + NULL, + &Iosb, + FSCTL_DISMOUNT_VOLUME, + NULL, + 0, + NULL, + 0); + if (!NT_SUCCESS(LockStatus)) + { + DPRINT1("Failed to umount volume (Status: 0x%x)\n", LockStatus); + } + + LockStatus = NtFsControlFile(FileHandle, NULL, NULL,
Modified: branches/shell-experiments/ntoskrnl/io/iomgr/file.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/ntoskrnl/io/io... ============================================================================== --- branches/shell-experiments/ntoskrnl/io/iomgr/file.c [iso-8859-1] (original) +++ branches/shell-experiments/ntoskrnl/io/iomgr/file.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -419,28 +419,6 @@ DirectOpen = TRUE; }
-#if 1 - /* FIXME: Small hack still exists, have to check why... - * This is triggered multiple times by usetup and then once per boot. - */ - if (!(DirectOpen) && - !(RemainingName->Length) && - !(OpenPacket->RelatedFileObject) && - ((wcsstr(CompleteName->Buffer, L"Harddisk")) || - (wcsstr(CompleteName->Buffer, L"Floppy"))) && - !(UseDummyFile)) - { - DPRINT1("Using IopParseDevice() hack. Requested invalid attributes: %lx\n", - DesiredAccess & ~(SYNCHRONIZE | - FILE_READ_ATTRIBUTES | - READ_CONTROL | - ACCESS_SYSTEM_SECURITY | - WRITE_OWNER | - WRITE_DAC)); - DirectOpen = TRUE; - } -#endif - /* Check if we have a related FO that wasn't a direct open */ if ((OpenPacket->RelatedFileObject) && !(OpenPacket->RelatedFileObject->Flags & FO_DIRECT_DEVICE_OPEN))
Modified: branches/shell-experiments/ntoskrnl/io/iomgr/rawfs.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/ntoskrnl/io/io... ============================================================================== --- branches/shell-experiments/ntoskrnl/io/iomgr/rawfs.c [iso-8859-1] (original) +++ branches/shell-experiments/ntoskrnl/io/iomgr/rawfs.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -20,6 +20,7 @@ USHORT NodeByteSize; PDEVICE_OBJECT TargetDeviceObject; PVPB Vpb; + PVPB LocalVpb; ULONG VcbState; KMUTEX Mutex; CLONG OpenCount; @@ -34,19 +35,26 @@ VCB Vcb; } VOLUME_DEVICE_OBJECT, *PVOLUME_DEVICE_OBJECT;
+#define VCB_STATE_LOCKED 0x00000001 +#define VCB_STATE_DISMOUNTED 0x00000002 + /* GLOBALS *******************************************************************/
PDEVICE_OBJECT RawDiskDeviceObject, RawCdromDeviceObject, RawTapeDeviceObject;
/* FUNCTIONS *****************************************************************/
-VOID +NTSTATUS NTAPI RawInitializeVcb(IN OUT PVCB Vcb, IN PDEVICE_OBJECT TargetDeviceObject, IN PVPB Vpb) { - PAGED_CODE(); + NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); + + DPRINT("RawInitializeVcb(%p, %p, %p)\n", Vcb, TargetDeviceObject, Vpb);
/* Clear it */ RtlZeroMemory(Vcb, sizeof(VCB)); @@ -57,6 +65,14 @@
/* Initialize the lock */ KeInitializeMutex(&Vcb->Mutex, 0); + + Vcb->LocalVpb = ExAllocatePoolWithTag(NonPagedPool, sizeof(VPB), ' waR'); + if (Vcb->LocalVpb == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + } + + return Status; }
BOOLEAN @@ -68,6 +84,10 @@ PVPB Vpb; BOOLEAN Delete;
+ DPRINT("RawCheckForDismount(%p, %lu)\n", Vcb, CreateOperation); + + ASSERT(KeReadStateMutant(&Vcb->Mutex) == 0); + /* Lock VPB */ IoAcquireVpbSpinLock(&OldIrql);
@@ -75,6 +95,19 @@ Vpb = Vcb->Vpb; if (Vcb->Vpb->ReferenceCount != CreateOperation) { + /* Copy the VPB to our local own to prepare later dismount */ + if (Vcb->LocalVpb != NULL) + { + RtlZeroMemory(Vcb->LocalVpb, sizeof(VPB)); + Vcb->LocalVpb->Type = IO_TYPE_VPB; + Vcb->LocalVpb->Size = sizeof(VPB); + Vcb->LocalVpb->RealDevice = Vcb->Vpb->RealDevice; + Vcb->LocalVpb->DeviceObject = NULL; + Vcb->LocalVpb->Flags = Vcb->Vpb->Flags & VPB_REMOVE_PENDING; + Vcb->Vpb->RealDevice->Vpb = Vcb->LocalVpb; + Vcb->LocalVpb = NULL; + Vcb->Vpb->Flags |= VPB_PERSISTENT; + } /* Don't do anything */ Delete = FALSE; } @@ -93,6 +126,47 @@
/* Release lock and return status */ IoReleaseVpbSpinLock(OldIrql); + + /* If we were to delete, delete volume */ + if (Delete) + { + PVPB DelVpb; + + /* Release our Vcb lock to be able delete us */ + KeReleaseMutex(&Vcb->Mutex, 0); + + /* If we have a local VPB, we'll have to delete it + * but we won't dismount us - something went bad before + */ + if (Vcb->LocalVpb) + { + DelVpb = Vcb->LocalVpb; + } + /* Otherwise, dismount our device if possible */ + else + { + if (Vcb->Vpb->ReferenceCount) + { + ObfDereferenceObject(Vcb->TargetDeviceObject); + IoDeleteDevice((PDEVICE_OBJECT)CONTAINING_RECORD(Vcb, + VOLUME_DEVICE_OBJECT, + Vcb)); + return Delete; + } + + DelVpb = Vcb->Vpb; + } + + /* Delete any of the available VPB and dismount */ + ExFreePool(DelVpb); + ObfDereferenceObject(Vcb->TargetDeviceObject); + IoDeleteDevice((PDEVICE_OBJECT)CONTAINING_RECORD(Vcb, + VOLUME_DEVICE_OBJECT, + Vcb)); + + return Delete; + } + return Delete; }
@@ -103,6 +177,8 @@ IN PVOID Context) { PIO_STACK_LOCATION IoStackLocation = IoGetCurrentIrpStackLocation(Irp); + + DPRINT("RawCompletionRoutine(%p, %p, %p)\n", DeviceObject, Irp, Context);
/* Check if this was a valid sync R/W request */ if (((IoStackLocation->MajorFunction == IRP_MJ_READ) || @@ -128,8 +204,17 @@ IN PIO_STACK_LOCATION IoStackLocation) { NTSTATUS Status; - BOOLEAN Deleted = FALSE; - PAGED_CODE(); + PAGED_CODE(); + + DPRINT("RawClose(%p, %p, %p)\n", Vcb, Irp, IoStackLocation); + + /* If its a stream, not much to do */ + if (IoStackLocation->FileObject->Flags & FO_STREAM_FILE) + { + Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(Irp, IO_DISK_INCREMENT); + return STATUS_SUCCESS; + }
/* Make sure we can clean up */ Status = KeWaitForSingleObject(&Vcb->Mutex, @@ -141,16 +226,9 @@
/* Decrease the open count and check if this is a dismount */ Vcb->OpenCount--; - if (!Vcb->OpenCount) Deleted = RawCheckForDismount(Vcb, FALSE); - - /* Check if we should delete the device */ - KeReleaseMutex(&Vcb->Mutex, FALSE); - if (Deleted) - { - /* Delete it */ - IoDeleteDevice((PDEVICE_OBJECT)CONTAINING_RECORD(Vcb, - VOLUME_DEVICE_OBJECT, - Vcb)); + if (!Vcb->OpenCount || !RawCheckForDismount(Vcb, FALSE)) + { + KeReleaseMutex(&Vcb->Mutex, FALSE); }
/* Complete the request */ @@ -166,10 +244,12 @@ IN PIO_STACK_LOCATION IoStackLocation) { NTSTATUS Status; - BOOLEAN Deleted = FALSE; USHORT ShareAccess; ACCESS_MASK DesiredAccess; - PAGED_CODE(); + BOOLEAN Deleted = FALSE; + PAGED_CODE(); + + DPRINT("RawCreate(%p, %p, %p)\n", Vcb, Irp, IoStackLocation);
/* Make sure we can clean up */ Status = KeWaitForSingleObject(&Vcb->Mutex, @@ -186,10 +266,16 @@ (!(IoStackLocation->Parameters.Create.Options & FILE_DIRECTORY_FILE))) { /* Make sure the VCB isn't locked */ - if (Vcb->VcbState & 1) + if (Vcb->VcbState & VCB_STATE_LOCKED) { /* Refuse the operation */ Status = STATUS_ACCESS_DENIED; + Irp->IoStatus.Information = 0; + } + else if (Vcb->VcbState & VCB_STATE_DISMOUNTED) + { + /* Refuse the operation */ + Status = STATUS_VOLUME_DISMOUNTED; Irp->IoStatus.Information = 0; } else @@ -247,23 +333,19 @@ if (!(NT_SUCCESS(Status)) && !(Vcb->OpenCount)) { /* Check if we can dismount the device */ - Deleted = RawCheckForDismount(Vcb, FALSE); - } - - /* Check if we should delete the device */ - KeReleaseMutex(&Vcb->Mutex, FALSE); - if (Deleted) - { - /* Delete it */ - IoDeleteDevice((PDEVICE_OBJECT)CONTAINING_RECORD(Vcb, - VOLUME_DEVICE_OBJECT, - Vcb)); + Deleted = RawCheckForDismount(Vcb, TRUE); + } + + /* In case of deletion, the mutex is already released */ + if (!Deleted) + { + KeReleaseMutex(&Vcb->Mutex, FALSE); }
/* Complete the request */ - Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Status = Status; IoCompleteRequest(Irp, IO_DISK_INCREMENT); - return STATUS_SUCCESS; + return Status; }
NTSTATUS @@ -274,6 +356,8 @@ { NTSTATUS Status; PAGED_CODE(); + + DPRINT("RawReadWriteDeviceControl(%p, %p, %p)\n", Vcb, Irp, IoStackLocation);
/* Don't do anything if the request was 0 bytes */ if (((IoStackLocation->MajorFunction == IRP_MJ_READ) || @@ -314,6 +398,8 @@ PVOLUME_DEVICE_OBJECT Volume; PFILE_OBJECT FileObject = NULL; PAGED_CODE(); + + DPRINT("RawMountVolume(%p)\n", IoStackLocation);
/* Remember our owner */ DeviceObject = IoStackLocation->Parameters.MountVolume.DeviceObject; @@ -336,9 +422,14 @@ AlignmentRequirement);
/* Setup the VCB */ - RawInitializeVcb(&Volume->Vcb, - IoStackLocation->Parameters.MountVolume.DeviceObject, - IoStackLocation->Parameters.MountVolume.Vpb); + Status = RawInitializeVcb(&Volume->Vcb, + IoStackLocation->Parameters.MountVolume.DeviceObject, + IoStackLocation->Parameters.MountVolume.Vpb); + if (!NT_SUCCESS(Status)) + { + IoDeleteDevice((PDEVICE_OBJECT)Volume); + return Status; + }
/* Set dummy label and serial number */ Volume->Vcb.Vpb->SerialNumber = 0xFFFFFFFF; @@ -390,6 +481,8 @@ { NTSTATUS Status; PAGED_CODE(); + + DPRINT("RawUserFsCtrl(%p, %p)\n", IoStackLocation, Vcb);
/* Lock the device */ Status = KeWaitForSingleObject(&Vcb->Mutex, @@ -502,6 +595,8 @@ NTSTATUS Status; PAGED_CODE();
+ DPRINT("RawFileSystemControl(%p, %p, %p)\n", Vcb, Irp, IoStackLocation); + /* Check the kinds of FSCTLs that we support */ switch (IoStackLocation->MinorFunction) { @@ -563,6 +658,8 @@ PFILE_POSITION_INFORMATION Buffer; PAGED_CODE();
+ DPRINT("RawQueryInformation(%p, %p, %p)\n", Vcb, Irp, IoStackLocation); + /* Get information from the IRP */ Length = &IoStackLocation->Parameters.QueryFile.Length; Buffer = Irp->AssociatedIrp.SystemBuffer; @@ -608,6 +705,8 @@ PDEVICE_OBJECT DeviceObject; PAGED_CODE();
+ DPRINT("RawSetInformation(%p, %p, %p)\n", Vcb, Irp, IoStackLocation); + /* Get information from the IRP */ Buffer = Irp->AssociatedIrp.SystemBuffer;
@@ -649,6 +748,8 @@ IN OUT PULONG Length) { PAGED_CODE(); + + DPRINT("RawQueryFsVolumeInfo(%p, %p, %p)\n", Vcb, Buffer, Length);
/* Clear the buffer and stub it out */ RtlZeroMemory( Buffer, sizeof(FILE_FS_VOLUME_INFORMATION)); @@ -676,6 +777,8 @@ PARTITION_INFORMATION PartitionInformation; BOOLEAN DiskHasPartitions; PAGED_CODE(); + + DPRINT("RawQueryFsSizeInfo(%p, %p, %p)\n", Vcb, Buffer, Length);
/* Validate the buffer */ if (*Length < sizeof(FILE_FS_SIZE_INFORMATION)) @@ -806,6 +909,8 @@ { PAGED_CODE();
+ DPRINT("RawQueryFsDeviceInfo(%p, %p, %p)\n", Vcb, Buffer, Length); + /* Validate buffer */ if (*Length < sizeof(FILE_FS_DEVICE_INFORMATION)) { @@ -832,6 +937,8 @@ const WCHAR szRawFSName[] = L"RAW"; ULONG ReturnLength; PAGED_CODE(); + + DPRINT("RawQueryFsAttributeInfo(%p, %p, %p)\n", Vcb, Buffer, Length);
/* Check if the buffer is large enough for our name ("RAW") */ ReturnLength = FIELD_OFFSET(FILE_FS_ATTRIBUTE_INFORMATION, @@ -859,6 +966,8 @@ ULONG Length; PVOID Buffer; PAGED_CODE(); + + DPRINT("RawQueryVolumeInformation(%p, %p, %p)\n", Vcb, Irp, IoStackLocation);
/* Get IRP Data */ Length = IoStackLocation->Parameters.QueryVolume.Length; @@ -915,6 +1024,8 @@ { NTSTATUS Status; PAGED_CODE(); + + DPRINT("RawCleanup(%p, %p, %p)\n", Vcb, Irp, IoStackLocation);
/* Make sure we can clean up */ Status = KeWaitForSingleObject(&Vcb->Mutex, @@ -924,8 +1035,16 @@ NULL); ASSERT(NT_SUCCESS(Status));
- /* Remove shared access and complete the request */ + /* Remove shared access */ IoRemoveShareAccess(IoStackLocation->FileObject, &Vcb->ShareAccess); + + /* Check if we're to dismount */ + if (Vcb->VcbState & VCB_STATE_DISMOUNTED) + { + ASSERT(Vcb->OpenCount == 1); + RawCheckForDismount(Vcb, FALSE); + } + KeReleaseMutex(&Vcb->Mutex, FALSE); Irp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest(Irp, IO_DISK_INCREMENT); @@ -941,6 +1060,8 @@ PIO_STACK_LOCATION IoStackLocation; PVCB Vcb; PAGED_CODE(); + + DPRINT("RawDispatch(%p, %p)\n", DeviceObject, Irp);
/* Get the stack location */ IoStackLocation = IoGetCurrentIrpStackLocation(Irp);
Modified: branches/shell-experiments/ntoskrnl/se/token.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/ntoskrnl/se/to... ============================================================================== --- branches/shell-experiments/ntoskrnl/se/token.c [iso-8859-1] (original) +++ branches/shell-experiments/ntoskrnl/se/token.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -1909,8 +1909,20 @@ ExFreePoolWithTag(Token->DefaultDacl, TAG_TOKEN_ACL); }
- /* Set the new dacl */ - Token->DefaultDacl = CapturedAcl; + Token->DefaultDacl = ExAllocatePoolWithTag(PagedPool, + CapturedAcl->AclSize, + TAG_TOKEN_ACL); + if (!Token->DefaultDacl) + { + ExFreePoolWithTag(CapturedAcl, TAG_ACL); + Status = STATUS_NO_MEMORY; + } + else + { + /* Set the new dacl */ + RtlCopyMemory(Token->DefaultDacl, CapturedAcl, CapturedAcl->AclSize); + ExFreePoolWithTag(CapturedAcl, TAG_ACL); + } } } else
Modified: branches/shell-experiments/win32ss/gdi/ntgdi/freetype.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/gdi/nt... ============================================================================== --- branches/shell-experiments/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] (original) +++ branches/shell-experiments/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] Fri Oct 31 15:27:51 2014 @@ -3365,6 +3365,11 @@ BrushOrigin.x = 0; BrushOrigin.y = 0;
+ psurf = dc->dclevel.pSurface ; + + if(!psurf) + psurf = psurfDefaultBitmap; + if ((fuOptions & ETO_OPAQUE) && lprc) { DestRect.left = lprc->left; @@ -3383,7 +3388,7 @@ DC_vUpdateBackgroundBrush(dc);
IntEngBitBlt( - &dc->dclevel.pSurface->SurfObj, + &psurf->SurfObj, NULL, NULL, &dc->co.ClipObj, @@ -3573,8 +3578,6 @@ /* Lock blit with a dummy rect */ DC_vPrepareDCsForBlit(dc, NULL, NULL, NULL);
- psurf = dc->dclevel.pSurface ; - if(!psurf) psurf = psurfDefaultBitmap; SurfObj = &psurf->SurfObj ;
EXLATEOBJ_vInitialize(&exloRGB2Dst, &gpalRGB, psurf->ppal, 0, 0, 0);