ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2022
----- 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
28 participants
173 discussions
Start a n
N
ew thread
[reactos] 01/11: [NTOSKRNL] Implement InterlockedExchangeSizeT macro
by George Bișoc
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=47cb3c20a3cf809ebec05…
commit 47cb3c20a3cf809ebec052f1a5c84f693c1efa98 Author: George Bișoc <george.bisoc(a)reactos.org> AuthorDate: Sun Jan 2 20:21:22 2022 +0100 Commit: George Bișoc <george.bisoc(a)reactos.org> CommitDate: Tue Jan 11 10:10:56 2022 +0100 [NTOSKRNL] Implement InterlockedExchangeSizeT macro --- ntoskrnl/include/internal/ex.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ntoskrnl/include/internal/ex.h b/ntoskrnl/include/internal/ex.h index 2b8b0026794..a8273001523 100644 --- a/ntoskrnl/include/internal/ex.h +++ b/ntoskrnl/include/internal/ex.h @@ -1537,6 +1537,14 @@ XIPInit( #define InterlockedCompareExchangeSizeT(Destination, Exchange, Comperand) \ (SIZE_T)InterlockedCompareExchangePointer((PVOID*)(Destination), (PVOID)(SIZE_T)(Exchange), (PVOID)(SIZE_T)(Comperand)) +#ifdef _WIN64 +#define InterlockedExchangeSizeT(Target, Value) \ + (SIZE_T)InterlockedExchange64((PLONG64)Target, (LONG64)Value) +#else +#define InterlockedExchangeSizeT(Target, Value) \ + (SIZE_T)InterlockedExchange((PLONG)Target, (LONG)Value) +#endif + #define ExfInterlockedCompareExchange64UL(Destination, Exchange, Comperand) \ (ULONGLONG)ExfInterlockedCompareExchange64((PLONGLONG)(Destination), (PLONGLONG)(Exchange), (PLONGLONG)(Comperand))
2 years, 11 months
1
0
0
0
[reactos] 01/01: [SHELL32] Fix folders on recycle bin and adjust the column size (#4234)
by Jesús Sanz del Rey
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=47f6745bcdfb833b0311e…
commit 47f6745bcdfb833b0311e052f04e6cd5634660eb Author: Jesús Sanz del Rey <jesussanz2003(a)gmail.com> AuthorDate: Tue Jan 11 00:40:25 2022 +0100 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Jan 11 00:40:25 2022 +0100 [SHELL32] Fix folders on recycle bin and adjust the column size (#4234) CORE-11000 - Now, folders can be sent to recycle bin (fixed a bug inside the implementation). - Adjust column size of the RecycleBin virtual folder in details mode. --- dll/win32/shell32/folders/CRecycleBin.cpp | 39 ++++++++++++--------- dll/win32/shell32/shellrecyclebin/recyclebin.c | 28 ++++++++++++++- dll/win32/shell32/shellrecyclebin/recyclebin.h | 10 ++++++ dll/win32/shell32/shellrecyclebin/recyclebin_v5.c | 2 +- .../shellrecyclebin/recyclebin_v5_enumerator.c | 40 +++++++++++++++++++++- 5 files changed, 99 insertions(+), 20 deletions(-) diff --git a/dll/win32/shell32/folders/CRecycleBin.cpp b/dll/win32/shell32/folders/CRecycleBin.cpp index cba7c52e42e..48d285c9ac7 100644 --- a/dll/win32/shell32/folders/CRecycleBin.cpp +++ b/dll/win32/shell32/folders/CRecycleBin.cpp @@ -39,14 +39,14 @@ typedef struct static const columninfo RecycleBinColumns[] = { - {IDS_SHV_COLUMN_NAME, &FMTID_Storage, PID_STG_NAME, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 30}, - {IDS_SHV_COLUMN_DELFROM, &FMTID_Displaced, PID_DISPLACED_FROM, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 30}, - {IDS_SHV_COLUMN_DELDATE, &FMTID_Displaced, PID_DISPLACED_DATE, SHCOLSTATE_TYPE_DATE | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 20}, - {IDS_SHV_COLUMN_SIZE, &FMTID_Storage, PID_STG_SIZE, SHCOLSTATE_TYPE_INT | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 20}, - {IDS_SHV_COLUMN_TYPE, &FMTID_Storage, PID_STG_STORAGETYPE, SHCOLSTATE_TYPE_INT | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 20}, - {IDS_SHV_COLUMN_MODIFIED, &FMTID_Storage, PID_STG_WRITETIME, SHCOLSTATE_TYPE_DATE | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 20}, - /* {"creation time", &FMTID_Storage, PID_STG_CREATETIME, SHCOLSTATE_TYPE_DATE, LVCFMT_LEFT, 20}, */ - /* {"attribs", &FMTID_Storage, PID_STG_ATTRIBUTES, SHCOLSTATE_TYPE_STR, LVCFMT_LEFT, 20}, */ + {IDS_SHV_COLUMN_NAME, &FMTID_Storage, PID_STG_NAME, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 25}, + {IDS_SHV_COLUMN_DELFROM, &FMTID_Displaced, PID_DISPLACED_FROM, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 35}, + {IDS_SHV_COLUMN_DELDATE, &FMTID_Displaced, PID_DISPLACED_DATE, SHCOLSTATE_TYPE_DATE | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 15}, + {IDS_SHV_COLUMN_SIZE, &FMTID_Storage, PID_STG_SIZE, SHCOLSTATE_TYPE_INT | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10}, + {IDS_SHV_COLUMN_TYPE, &FMTID_Storage, PID_STG_STORAGETYPE, SHCOLSTATE_TYPE_INT | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 15}, + {IDS_SHV_COLUMN_MODIFIED, &FMTID_Storage, PID_STG_WRITETIME, SHCOLSTATE_TYPE_DATE | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 15}, + /* {"creation time", &FMTID_Storage, PID_STG_CREATETIME, SHCOLSTATE_TYPE_DATE, LVCFMT_LEFT, 20}, */ + /* {"attribs", &FMTID_Storage, PID_STG_ATTRIBUTES, SHCOLSTATE_TYPE_STR, LVCFMT_LEFT, 20}, */ }; #define COLUMN_NAME 0 @@ -745,21 +745,26 @@ HRESULT WINAPI CRecycleBin::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, LPS FormatDateTime(buffer, MAX_PATH, &pFileDetails->LastModification); break; case COLUMN_TYPE: - // FIXME: We should in fact use a UNICODE version of _ILGetFileType - szTypeName[0] = L'\0'; - wcscpy(buffer, PathFindExtensionW(pFileDetails->szName)); - if (!( HCR_MapTypeToValueW(buffer, buffer, _countof(buffer), TRUE) && - HCR_MapTypeToValueW(buffer, szTypeName, _countof(szTypeName), FALSE ))) { + SEARCH_CONTEXT Context; + Context.pFileDetails = pFileDetails; + Context.bFound = FALSE; + EnumerateRecycleBinW(NULL, CBSearchRecycleBin, (PVOID)&Context); + + if (Context.bFound) + { + GetDeletedFileTypeNameW(Context.hDeletedFile, buffer, _countof(buffer), NULL); + + CloseRecycleBinHandle(Context.hDeletedFile); + } /* load localized file string */ - szTypeName[0] = '\0'; - if(LoadStringW(shell32_hInstance, IDS_ANY_FILE, szTypeName, _countof(szTypeName))) + else if (LoadStringW(shell32_hInstance, IDS_ANY_FILE, szTypeName, _countof(szTypeName))) { - szTypeName[63] = '\0'; StringCchPrintfW(buffer, _countof(buffer), szTypeName, PathFindExtensionW(pFileDetails->szName)); } + + return SHSetStrRet(&pDetails->str, buffer); } - return SHSetStrRet(&pDetails->str, szTypeName); default: return E_FAIL; } diff --git a/dll/win32/shell32/shellrecyclebin/recyclebin.c b/dll/win32/shell32/shellrecyclebin/recyclebin.c index 50d06a9608c..a6392496012 100644 --- a/dll/win32/shell32/shellrecyclebin/recyclebin.c +++ b/dll/win32/shell32/shellrecyclebin/recyclebin.c @@ -3,7 +3,7 @@ * LICENSE: GPL v2 - See COPYING in the top level directory * FILE: lib/recyclebin/recyclebin.c * PURPOSE: Public interface - * PROGRAMMERS: Copyright 2006-2007 Herv� Poussineau (hpoussin(a)reactos.org) + * PROGRAMMERS: Copyright 2006-2007 Hervé Poussineau (hpoussin(a)reactos.org) */ #include "recyclebin_private.h" @@ -252,6 +252,32 @@ cleanup: return FALSE; } +BOOL WINAPI +GetDeletedFileTypeNameW( + IN HANDLE hDeletedFile, + OUT LPWSTR pTypeName, + IN DWORD BufferSize, + OUT LPDWORD RequiredSize OPTIONAL) +{ + IRecycleBinFile *prbf = (IRecycleBinFile *)hDeletedFile; + SIZE_T FinalSize; + + HRESULT hr = IRecycleBinFile_GetTypeName(prbf, BufferSize, pTypeName, &FinalSize); + + if (SUCCEEDED(hr)) + { + if (RequiredSize) + *RequiredSize = (DWORD)FinalSize; + + return TRUE; + } + if (HRESULT_FACILITY(hr) == FACILITY_WIN32) + SetLastError(HRESULT_CODE(hr)); + else + SetLastError(ERROR_GEN_FAILURE); + return FALSE; +} + BOOL WINAPI GetDeletedFileDetailsA( IN HANDLE hDeletedFile, diff --git a/dll/win32/shell32/shellrecyclebin/recyclebin.h b/dll/win32/shell32/shellrecyclebin/recyclebin.h index 2fa2d00139b..50c020c839f 100644 --- a/dll/win32/shell32/shellrecyclebin/recyclebin.h +++ b/dll/win32/shell32/shellrecyclebin/recyclebin.h @@ -131,6 +131,13 @@ EnumerateRecycleBinW( #define EnumerateRecycleBin EnumerateRecycleBinA #endif +BOOL WINAPI +GetDeletedFileTypeNameW( + IN HANDLE hDeletedFile, + OUT LPWSTR pTypeName, + IN DWORD BufferSize, + OUT LPDWORD RequiredSize OPTIONAL); + /* Gets details about a deleted file * hDeletedFile: handle of the deleted file to get details about * BufferSize: size of the 'FileDetails' buffer, in bytes @@ -196,6 +203,7 @@ DECLARE_INTERFACE_(IRecycleBinFile, IUnknown) STDMETHOD(GetPhysicalFileSize)(THIS_ ULARGE_INTEGER *pPhysicalFileSize) PURE; STDMETHOD(GetAttributes)(THIS_ DWORD *pAttributes) PURE; STDMETHOD(GetFileName)(THIS_ SIZE_T BufferSize, LPWSTR Buffer, SIZE_T *RequiredSize) PURE; + STDMETHOD(GetTypeName)(THIS_ SIZE_T BufferSize, LPWSTR Buffer, SIZE_T *RequiredSize) PURE; STDMETHOD(Delete)(THIS) PURE; STDMETHOD(Restore)(THIS) PURE; @@ -264,6 +272,8 @@ EXTERN_C const IID IID_IRecycleBin; (This)->lpVtbl->GetAttributes(This, pAttributes) #define IRecycleBinFile_GetFileName(This, BufferSize, Buffer, RequiredSize) \ (This)->lpVtbl->GetFileName(This, BufferSize, Buffer, RequiredSize) +#define IRecycleBinFile_GetTypeName(This, BufferSize, Buffer, RequiredSize) \ + (This)->lpVtbl->GetTypeName(This, BufferSize, Buffer, RequiredSize) #define IRecycleBinFile_Delete(This) \ (This)->lpVtbl->Delete(This) #define IRecycleBinFile_Restore(This) \ diff --git a/dll/win32/shell32/shellrecyclebin/recyclebin_v5.c b/dll/win32/shell32/shellrecyclebin/recyclebin_v5.c index 5bbd9548997..3344b2c035c 100644 --- a/dll/win32/shell32/shellrecyclebin/recyclebin_v5.c +++ b/dll/win32/shell32/shellrecyclebin/recyclebin_v5.c @@ -234,7 +234,7 @@ RecycleBin5_RecycleBin5_DeleteFile( return HRESULT_FROM_WIN32(ERROR_INVALID_NAME); } - hFile = CreateFileW(szFullName, 0, 0, NULL, OPEN_EXISTING, 0, NULL); + hFile = CreateFileW(szFullName, 0, 0, NULL, OPEN_EXISTING, (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) ? FILE_FLAG_BACKUP_SEMANTICS : 0, NULL); if (hFile == INVALID_HANDLE_VALUE) { hr = HRESULT_FROM_WIN32(GetLastError()); diff --git a/dll/win32/shell32/shellrecyclebin/recyclebin_v5_enumerator.c b/dll/win32/shell32/shellrecyclebin/recyclebin_v5_enumerator.c index 7e5814af174..bbe4fa1e834 100644 --- a/dll/win32/shell32/shellrecyclebin/recyclebin_v5_enumerator.c +++ b/dll/win32/shell32/shellrecyclebin/recyclebin_v5_enumerator.c @@ -3,7 +3,7 @@ * LICENSE: GPL v2 - See COPYING in the top level directory * FILE: lib/recyclebin/recyclebin_v5_enumerator.c * PURPOSE: Enumerates contents of a MS Windows 2000/XP/2003 recyclebin - * PROGRAMMERS: Copyright 2006-2007 Herv� Poussineau (hpoussin(a)reactos.org) + * PROGRAMMERS: Copyright 2006-2007 Hervé Poussineau (hpoussin(a)reactos.org) */ #include "recyclebin_private.h" @@ -210,6 +210,43 @@ RecycleBin5File_RecycleBinFile_GetFileName( return S_OK; } +static HRESULT STDMETHODCALLTYPE +RecycleBin5File_RecycleBinFile_GetTypeName( + IN IRecycleBinFile *This, + IN SIZE_T BufferSize, + IN OUT LPWSTR Buffer, + OUT SIZE_T *RequiredSize) +{ + HRESULT hr; + + struct RecycleBin5File *s = CONTAINING_RECORD(This, struct RecycleBin5File, recycleBinFileImpl); + DWORD dwRequired; + DWORD dwAttributes; + SHFILEINFOW shFileInfo; + + TRACE("(%p, %u, %p, %p)\n", This, BufferSize, Buffer, RequiredSize); + + hr = RecycleBin5File_RecycleBinFile_GetAttributes(This, &dwAttributes); + if (!SUCCEEDED(hr)) + return hr; + + hr = SHGetFileInfoW(s->FullName, dwAttributes, &shFileInfo, sizeof(shFileInfo), SHGFI_TYPENAME | SHGFI_USEFILEATTRIBUTES); + if (!SUCCEEDED(hr)) + return hr; + + dwRequired = (DWORD)(wcslen(shFileInfo.szTypeName) + 1) * sizeof(WCHAR); + if (RequiredSize) + *RequiredSize = dwRequired; + + if (BufferSize == 0 && !Buffer) + return S_OK; + + if (BufferSize < dwRequired) + return E_OUTOFMEMORY; + CopyMemory(Buffer, shFileInfo.szTypeName, dwRequired); + return S_OK; +} + static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_Delete( IN IRecycleBinFile *This) @@ -239,6 +276,7 @@ CONST_VTBL struct IRecycleBinFileVtbl RecycleBin5FileVtbl = RecycleBin5File_RecycleBinFile_GetPhysicalFileSize, RecycleBin5File_RecycleBinFile_GetAttributes, RecycleBin5File_RecycleBinFile_GetFileName, + RecycleBin5File_RecycleBinFile_GetTypeName, RecycleBin5File_RecycleBinFile_Delete, RecycleBin5File_RecycleBinFile_Restore, };
2 years, 11 months
1
0
0
0
[reactos] 01/01: [SHELL32] Fix recycle bin handle reference leaking (#4222)
by Jesús Sanz del Rey
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dae6035b3b3a0e21a61ea…
commit dae6035b3b3a0e21a61ea4cac32d5bc46c2abe66 Author: Jesús Sanz del Rey <jesussanz2003(a)gmail.com> AuthorDate: Tue Jan 11 00:20:23 2022 +0100 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Jan 11 00:20:23 2022 +0100 [SHELL32] Fix recycle bin handle reference leaking (#4222) CORE-13730 There was a handle reference leak in the recycler bin and the bin wasn't removing the copied file after restoring it. Close the handle were the memory leak was and move the file when restoring it. --- dll/win32/shell32/folders/CRecycleBin.cpp | 21 ++++++++++----------- dll/win32/shell32/shellrecyclebin/recyclebin_v5.c | 4 ++-- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/dll/win32/shell32/folders/CRecycleBin.cpp b/dll/win32/shell32/folders/CRecycleBin.cpp index dbf03672cee..cba7c52e42e 100644 --- a/dll/win32/shell32/folders/CRecycleBin.cpp +++ b/dll/win32/shell32/folders/CRecycleBin.cpp @@ -380,19 +380,18 @@ HRESULT WINAPI CRecycleBinItemContextMenu::InvokeCommand(LPCMINVOKECOMMANDINFO l if (!Context.bFound) return E_FAIL; - if (lpcmi->lpVerb == MAKEINTRESOURCEA(1)) - { - /* restore file */ - if (RestoreFile(Context.hDeletedFile)) - return S_OK; - else - return E_FAIL; - } + BOOL ret = TRUE; + + /* restore file */ + if (lpcmi->lpVerb == MAKEINTRESOURCEA(1)) + ret = RestoreFile(Context.hDeletedFile); + /* delete file */ else - { DeleteFileHandleToRecycleBin(Context.hDeletedFile); - return E_NOTIMPL; - } + + CloseRecycleBinHandle(Context.hDeletedFile); + + return (ret ? S_OK : E_FAIL); } else if (lpcmi->lpVerb == MAKEINTRESOURCEA(3)) { diff --git a/dll/win32/shell32/shellrecyclebin/recyclebin_v5.c b/dll/win32/shell32/shellrecyclebin/recyclebin_v5.c index 766bf4f4631..5bbd9548997 100644 --- a/dll/win32/shell32/shellrecyclebin/recyclebin_v5.c +++ b/dll/win32/shell32/shellrecyclebin/recyclebin_v5.c @@ -3,7 +3,7 @@ * LICENSE: GPL v2 - See COPYING in the top level directory * FILE: lib/recyclebin/recyclebin_v5.c * PURPOSE: Deals with recycle bins of Windows 2000/XP/2003 - * PROGRAMMERS: Copyright 2006-2007 Herv� Poussineau (hpoussin(a)reactos.org) + * PROGRAMMERS: Copyright 2006-2007 Hervé Poussineau (hpoussin(a)reactos.org) */ #include "recyclebin_private.h" @@ -500,7 +500,7 @@ RecycleBin5_RecycleBin5_Restore( { /* Restore file */ ZeroMemory(&op, sizeof(op)); - op.wFunc = FO_COPY; + op.wFunc = FO_MOVE; op.pFrom = pDeletedFileName; op.pTo = pDeletedFile->FileNameW;
2 years, 11 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Some minor improvements (#4264)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3456538e3a8ce41d5653f…
commit 3456538e3a8ce41d5653fc6492e67964ee22776c Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Jan 10 21:44:13 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Jan 10 21:44:13 2022 +0900 [MSPAINT] Some minor improvements (#4264) - Fix Japanese IDS_MINIATURETITLE resource string. - Fix Japanese IDM_VIEWSHOWMINIATURE menu item text. - Fix DWORD as COLORREF. - Improve some OnPaint's. CORE-17969 --- base/applications/mspaint/drawing.cpp | 2 +- base/applications/mspaint/drawing.h | 2 +- base/applications/mspaint/imgarea.cpp | 6 ++++-- base/applications/mspaint/lang/ja-JP.rc | 4 ++-- base/applications/mspaint/palette.cpp | 2 +- base/applications/mspaint/selection.cpp | 21 +++++++++++---------- base/applications/mspaint/selection.h | 1 - base/applications/mspaint/toolsettings.cpp | 2 +- 8 files changed, 21 insertions(+), 19 deletions(-) diff --git a/base/applications/mspaint/drawing.cpp b/base/applications/mspaint/drawing.cpp index d7453ff198a..059559252b9 100644 --- a/base/applications/mspaint/drawing.cpp +++ b/base/applications/mspaint/drawing.cpp @@ -246,7 +246,7 @@ RectSel(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2) } void -SelectionFrame(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, DWORD system_selection_color) +SelectionFrame(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF system_selection_color) { HBRUSH oldBrush; LOGBRUSH logbrush; diff --git a/base/applications/mspaint/drawing.h b/base/applications/mspaint/drawing.h index 737d035250a..017b71f6ddb 100644 --- a/base/applications/mspaint/drawing.h +++ b/base/applications/mspaint/drawing.h @@ -32,6 +32,6 @@ void Brush(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, LONG sty void RectSel(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2); -void SelectionFrame(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, DWORD system_selection_color); +void SelectionFrame(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF system_selection_color); void Text(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, LPCTSTR lpchText, HFONT font, LONG style); diff --git a/base/applications/mspaint/imgarea.cpp b/base/applications/mspaint/imgarea.cpp index 6c117591dc6..cfa9a84d8d3 100644 --- a/base/applications/mspaint/imgarea.cpp +++ b/base/applications/mspaint/imgarea.cpp @@ -143,8 +143,10 @@ LRESULT CImgAreaWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b DeleteObject(SelectObject(hdc, oldPen)); } EndPaint(&ps); - selectionWindow.Invalidate(FALSE); - miniature.Invalidate(FALSE); + if (selectionWindow.IsWindowVisible()) + selectionWindow.Invalidate(FALSE); + if (miniature.IsWindowVisible()) + miniature.Invalidate(FALSE); if (textEditWindow.IsWindowVisible()) textEditWindow.Invalidate(FALSE); return 0; diff --git a/base/applications/mspaint/lang/ja-JP.rc b/base/applications/mspaint/lang/ja-JP.rc index 02fa6324bd4..8da4c05a2a5 100644 --- a/base/applications/mspaint/lang/ja-JP.rc +++ b/base/applications/mspaint/lang/ja-JP.rc @@ -71,7 +71,7 @@ BEGIN END MENUITEM SEPARATOR MENUITEM "グリッドを表示(&G)\tCtrl+G", IDM_VIEWSHOWGRID - MENUITEM "実寸表示(&H)", IDM_VIEWSHOWMINIATURE + MENUITEM "縮小表示(&H)", IDM_VIEWSHOWMINIATURE END MENUITEM "全画面表示(&F)\tCtrl+F", IDM_VIEWFULLSCREEN END @@ -212,7 +212,7 @@ BEGIN IDS_INFOTEXT "GNU Lesser General Public License (LGPL, 詳細は
www.gnu.org
) の下で利用可能です。" IDS_SAVEPROMPTTEXT "%s の変更内容を保存しますか?" IDS_DEFAULTFILENAME "無題" - IDS_MINIATURETITLE "縮小図" + IDS_MINIATURETITLE "縮小表示" IDS_TOOLTIP1 "自由選択" IDS_TOOLTIP2 "選択" IDS_TOOLTIP3 "消しゴム" diff --git a/base/applications/mspaint/palette.cpp b/base/applications/mspaint/palette.cpp index c83dad82580..9667397a5bf 100644 --- a/base/applications/mspaint/palette.cpp +++ b/base/applications/mspaint/palette.cpp @@ -15,13 +15,13 @@ LRESULT CPaletteWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { RECT rc = { 0, 0, 31, 32 }; - HDC hDC = GetDC(); HPEN oldPen; HBRUSH oldBrush; int i, a, b; DefWindowProc(WM_PAINT, wParam, lParam); + HDC hDC = GetDC(); for(b = 2; b < 30; b++) for(a = 2; a < 29; a++) if ((a + b) % 2 == 1) diff --git a/base/applications/mspaint/selection.cpp b/base/applications/mspaint/selection.cpp index 90bcbde70bb..c2c32880f97 100644 --- a/base/applications/mspaint/selection.cpp +++ b/base/applications/mspaint/selection.cpp @@ -22,7 +22,9 @@ const LPCTSTR CSelectionWindow::m_lpszCursorLUT[9] = { /* action to mouse cursor }; BOOL -ColorKeyedMaskBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, HBITMAP hbmMask, int xMask, int yMask, DWORD dwRop, COLORREF keyColor) +ColorKeyedMaskBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, + HDC hdcSrc, int nXSrc, int nYSrc, HBITMAP hbmMask, int xMask, int yMask, + DWORD dwRop, COLORREF keyColor) { HDC hTempDC; HDC hTempDC2; @@ -88,13 +90,14 @@ int CSelectionWindow::IdentifyCorner(int iXPos, int iYPos, int iWidth, int iHeig LRESULT CSelectionWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { + DefWindowProc(WM_PAINT, wParam, lParam); if (!m_bMoving) { HDC hDC = GetDC(); - DefWindowProc(WM_PAINT, wParam, lParam); - SelectionFrame(hDC, 1, 1, Zoomed(selectionModel.GetDestRectWidth()) + 5, - Zoomed(selectionModel.GetDestRectHeight()) + 5, - m_dwSystemSelectionColor); + SelectionFrame(hDC, 1, 1, + Zoomed(selectionModel.GetDestRectWidth()) + (GRIP_SIZE * 2) - 1, + Zoomed(selectionModel.GetDestRectHeight()) + (GRIP_SIZE * 2) - 1, + GetSysColor(COLOR_HIGHLIGHT)); ReleaseDC(hDC); } return 0; @@ -103,7 +106,7 @@ LRESULT CSelectionWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& LRESULT CSelectionWindow::OnEraseBkgnd(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { // do nothing => transparent background - return 0; + return TRUE; } LRESULT CSelectionWindow::OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) @@ -111,16 +114,14 @@ LRESULT CSelectionWindow::OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL m_bMoving = FALSE; m_iAction = ACTION_MOVE; /* update the system selection color */ - m_dwSystemSelectionColor = GetSysColor(COLOR_HIGHLIGHT); - SendMessage(WM_PAINT, 0, MAKELPARAM(0, 0)); + Invalidate(); return 0; } LRESULT CSelectionWindow::OnSysColorChange(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { /* update the system selection color */ - m_dwSystemSelectionColor = GetSysColor(COLOR_HIGHLIGHT); - SendMessage(WM_PAINT, 0, MAKELPARAM(0, 0)); + Invalidate(); return 0; } diff --git a/base/applications/mspaint/selection.h b/base/applications/mspaint/selection.h index 4dcd5541bdb..82ba84a6016 100644 --- a/base/applications/mspaint/selection.h +++ b/base/applications/mspaint/selection.h @@ -55,7 +55,6 @@ private: POINT m_ptPos; POINT m_ptFrac; POINT m_ptDelta; - DWORD m_dwSystemSelectionColor; int IdentifyCorner(int iXPos, int iYPos, int iWidth, int iHeight); }; diff --git a/base/applications/mspaint/toolsettings.cpp b/base/applications/mspaint/toolsettings.cpp index 4639d81da66..0c3d3e0bdf9 100644 --- a/base/applications/mspaint/toolsettings.cpp +++ b/base/applications/mspaint/toolsettings.cpp @@ -33,12 +33,12 @@ LRESULT CToolSettingsWindow::OnVScroll(UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT CToolSettingsWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { - HDC hdc = GetDC(); RECT rect1 = { 0, 0, 42, 66 }; RECT rect2 = { 0, 70, 42, 136 }; DefWindowProc(WM_PAINT, wParam, lParam); + HDC hdc = GetDC(); DrawEdge(hdc, &rect1, BDR_SUNKENOUTER, (toolsModel.GetActiveTool() == TOOL_ZOOM) ? BF_RECT : BF_RECT | BF_MIDDLE); DrawEdge(hdc, &rect2, (toolsModel.GetActiveTool() >= TOOL_RECT) ? BDR_SUNKENOUTER : 0, BF_RECT | BF_MIDDLE); switch (toolsModel.GetActiveTool())
2 years, 11 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Don't hide selection on zooming (#4266)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=edf92c004d5d7e6994596…
commit edf92c004d5d7e69945961266c156aa6445a6d8a Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Jan 10 21:41:00 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Jan 10 21:41:00 2022 +0900 [MSPAINT] Don't hide selection on zooming (#4266) - Don't hide the selection window on zooming. - Move the selection window by calling placeSelWin() when zoomed. CORE-17969 --- base/applications/mspaint/selection.cpp | 6 ++++++ base/applications/mspaint/selection.h | 2 ++ base/applications/mspaint/toolsmodel.cpp | 2 ++ base/applications/mspaint/winproc.cpp | 1 - 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/base/applications/mspaint/selection.cpp b/base/applications/mspaint/selection.cpp index 8edd85ba173..90bcbde70bb 100644 --- a/base/applications/mspaint/selection.cpp +++ b/base/applications/mspaint/selection.cpp @@ -285,3 +285,9 @@ LRESULT CSelectionWindow::OnMouseWheel(UINT nMsg, WPARAM wParam, LPARAM lParam, { return ::SendMessage(GetParent(), nMsg, wParam, lParam); } + +LRESULT CSelectionWindow::OnToolsModelZoomChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ + placeSelWin(); + return 0; +} diff --git a/base/applications/mspaint/selection.h b/base/applications/mspaint/selection.h index 44c9bac0ade..4dcd5541bdb 100644 --- a/base/applications/mspaint/selection.h +++ b/base/applications/mspaint/selection.h @@ -26,6 +26,7 @@ public: MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp) MESSAGE_HANDLER(WM_PALETTEMODELCOLORCHANGED, OnPaletteModelColorChanged) MESSAGE_HANDLER(WM_TOOLSMODELSETTINGSCHANGED, OnToolsModelSettingsChanged) + MESSAGE_HANDLER(WM_TOOLSMODELZOOMCHANGED, OnToolsModelZoomChanged) MESSAGE_HANDLER(WM_SELECTIONMODELREFRESHNEEDED, OnSelectionModelRefreshNeeded) MESSAGE_HANDLER(WM_CAPTURECHANGED, OnCaptureChanged) MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown) @@ -42,6 +43,7 @@ public: LRESULT OnLButtonUp(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnPaletteModelColorChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnToolsModelSettingsChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnToolsModelZoomChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnSelectionModelRefreshNeeded(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnCaptureChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnKeyDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); diff --git a/base/applications/mspaint/toolsmodel.cpp b/base/applications/mspaint/toolsmodel.cpp index f5725207a1c..021df46d336 100644 --- a/base/applications/mspaint/toolsmodel.cpp +++ b/base/applications/mspaint/toolsmodel.cpp @@ -181,6 +181,8 @@ void ToolsModel::NotifyZoomChanged() toolSettingsWindow.SendMessage(WM_TOOLSMODELZOOMCHANGED); if (textEditWindow.IsWindow()) textEditWindow.SendMessage(WM_TOOLSMODELZOOMCHANGED); + if (selectionWindow.IsWindow()) + selectionWindow.SendMessage(WM_TOOLSMODELZOOMCHANGED); } void ToolsModel::OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) diff --git a/base/applications/mspaint/winproc.cpp b/base/applications/mspaint/winproc.cpp index 43b0f812c1f..a0af103f080 100644 --- a/base/applications/mspaint/winproc.cpp +++ b/base/applications/mspaint/winproc.cpp @@ -36,7 +36,6 @@ zoomTo(int newZoom, int mouseX, int mouseY) toolsModel.SetZoom(newZoom); - selectionWindow.ShowWindow(SW_HIDE); imageArea.MoveWindow(GRIP_SIZE, GRIP_SIZE, Zoomed(imageModel.GetWidth()), Zoomed(imageModel.GetHeight()), FALSE); scrollboxWindow.Invalidate(TRUE); imageArea.Invalidate(FALSE);
2 years, 11 months
1
0
0
0
[reactos] 01/01: [SDK:DDK][NTOS:PNP] Implement PnP arbiters initialization
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fec440d8b88b334815dc9…
commit fec440d8b88b334815dc9e84f6abc9c15947f66f Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Mon Jan 10 06:35:45 2022 +0300 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Jan 10 06:35:45 2022 +0300 [SDK:DDK][NTOS:PNP] Implement PnP arbiters initialization --- ntoskrnl/io/pnpmgr/arbiters.c | 514 ++++++++++++++++++++++++++++++++++++++ ntoskrnl/io/pnpmgr/arbs.c | 123 --------- ntoskrnl/ntos.cmake | 2 +- sdk/lib/drivers/arbiter/arbiter.c | 386 +++++++++++++++++++++++++++- sdk/lib/drivers/arbiter/arbiter.h | 76 +++--- 5 files changed, 928 insertions(+), 173 deletions(-) diff --git a/ntoskrnl/io/pnpmgr/arbiters.c b/ntoskrnl/io/pnpmgr/arbiters.c new file mode 100644 index 00000000000..9a299c08ac6 --- /dev/null +++ b/ntoskrnl/io/pnpmgr/arbiters.c @@ -0,0 +1,514 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: Root arbiters of the PnP manager + * COPYRIGHT: Copyright 2020 Vadim Galyant <vgal(a)rambler.ru> + */ + +/* INCLUDES ******************************************************************/ + +#include <ntoskrnl.h> + +#define NDEBUG +#include <debug.h> + +/* GLOBALS *******************************************************************/ + +extern ARBITER_INSTANCE IopRootBusNumberArbiter; +extern ARBITER_INSTANCE IopRootIrqArbiter; +extern ARBITER_INSTANCE IopRootDmaArbiter; +extern ARBITER_INSTANCE IopRootMemArbiter; +extern ARBITER_INSTANCE IopRootPortArbiter; + +/* DATA **********************************************************************/ + +/* FUNCTIONS *****************************************************************/ + +/* BusNumber arbiter */ + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopBusNumberUnpackRequirement( + _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, + _Out_ PUINT64 OutMinimumAddress, + _Out_ PUINT64 OutMaximumAddress, + _Out_ PUINT32 OutLength, + _Out_ PUINT32 OutAlignment) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopBusNumberPackResource( + _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, + _In_ UINT64 Start, + _Out_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopBusNumberUnpackResource( + _In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor, + _Out_ PUINT64 Start, + _Out_ PUINT32 Length) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +INT32 +NTAPI +IopBusNumberScoreRequirement( + _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return 0; +} + +#define ARB_MAX_BUS_NUMBER 0xFF + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopBusNumberInitialize(VOID) +{ + NTSTATUS Status; + + PAGED_CODE(); + + DPRINT("IopRootBusNumberArbiter %p\n", &IopRootBusNumberArbiter); + + IopRootBusNumberArbiter.UnpackRequirement = IopBusNumberUnpackRequirement; + IopRootBusNumberArbiter.PackResource = IopBusNumberPackResource; + IopRootBusNumberArbiter.UnpackResource = IopBusNumberUnpackResource; + IopRootBusNumberArbiter.ScoreRequirement = IopBusNumberScoreRequirement; + + Status = ArbInitializeArbiterInstance(&IopRootBusNumberArbiter, + NULL, + CmResourceTypeBusNumber, + L"RootBusNumber", + L"Root", + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("IopBusNumberInitialize: Status %p\n", Status); + ASSERT(FALSE); + return Status; + } + + Status = RtlAddRange(IopRootBusNumberArbiter.Allocation, + (UINT64)(ARB_MAX_BUS_NUMBER + 1), + (UINT64)(-1), + 0, + 0, + NULL, + NULL); + + return Status; +} + +/* Irq arbiter */ + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopIrqUnpackRequirement( + _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, + _Out_ PUINT64 OutMinimumVector, + _Out_ PUINT64 OutMaximumVector, + _Out_ PUINT32 OutParam1, + _Out_ PUINT32 OutParam2) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopIrqPackResource( + _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, + _In_ UINT64 Start, + _Out_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopIrqUnpackResource( + _In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor, + _Out_ PUINT64 Start, + _Out_ PUINT32 OutLength) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +INT32 +NTAPI +IopIrqScoreRequirement( + _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return 0; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopIrqTranslateOrdering( + _Out_ PIO_RESOURCE_DESCRIPTOR OutIoDescriptor, + _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopIrqInitialize(VOID) +{ + NTSTATUS Status; + + PAGED_CODE(); + + DPRINT("IopRootIrqArbiter %p\n", &IopRootIrqArbiter); + + IopRootIrqArbiter.UnpackRequirement = IopIrqUnpackRequirement; + IopRootIrqArbiter.PackResource = IopIrqPackResource; + IopRootIrqArbiter.UnpackResource = IopIrqUnpackResource; + IopRootIrqArbiter.ScoreRequirement = IopIrqScoreRequirement; + + Status = ArbInitializeArbiterInstance(&IopRootIrqArbiter, + NULL, + CmResourceTypeInterrupt, + L"RootIRQ", + L"Root", + IopIrqTranslateOrdering); + return Status; +} + +/* Dma arbiter */ + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopDmaUnpackRequirement( + _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, + _Out_ PUINT64 OutMinimumChannel, + _Out_ PUINT64 OutMaximumChannel, + _Out_ PUINT32 OutParam1, + _Out_ PUINT32 OutParam2) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopDmaPackResource( + _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, + _In_ UINT64 Start, + _Out_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopDmaUnpackResource( + _In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor, + _Out_ PUINT64 Start, + _Out_ PUINT32 OutLength) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +INT32 +NTAPI +IopDmaScoreRequirement( + _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return 0; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopDmaOverrideConflict( + _In_ PARBITER_INSTANCE Arbiter) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopDmaInitialize(VOID) +{ + NTSTATUS Status; + + PAGED_CODE(); + + DPRINT("IopRootDmaArbiter %p\n", &IopRootDmaArbiter); + + IopRootDmaArbiter.UnpackRequirement = IopDmaUnpackRequirement; + IopRootDmaArbiter.PackResource = IopDmaPackResource; + IopRootDmaArbiter.UnpackResource = IopDmaUnpackResource; + IopRootDmaArbiter.ScoreRequirement = IopDmaScoreRequirement; + + IopRootDmaArbiter.OverrideConflict = IopDmaOverrideConflict; + + Status = ArbInitializeArbiterInstance(&IopRootDmaArbiter, + NULL, + CmResourceTypeDma, + L"RootDMA", + L"Root", + NULL); + return Status; +} + +/* Common for Memory and Port arbiters */ + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopGenericUnpackRequirement( + _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, + _Out_ PUINT64 OutMinimumAddress, + _Out_ PUINT64 OutMaximumAddress, + _Out_ PUINT32 OutLength, + _Out_ PUINT32 OutAlignment) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopGenericPackResource( + _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, + _In_ UINT64 Start, + _Out_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopGenericUnpackResource( + _In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor, + _Out_ PUINT64 Start, + _Out_ PUINT32 OutLength) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +INT32 +NTAPI +IopGenericScoreRequirement( + _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return 0; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopGenericTranslateOrdering( + _Out_ PIO_RESOURCE_DESCRIPTOR OutIoDescriptor, + _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Memory arbiter */ + +CODE_SEG("PAGE") +BOOLEAN +NTAPI +IopMemFindSuitableRange( + _In_ PARBITER_INSTANCE Arbiter, + _In_ PARBITER_ALLOCATION_STATE State) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return FALSE; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopMemInitialize(VOID) +{ + NTSTATUS Status; + + PAGED_CODE(); + + DPRINT("IopRootMemArbiter %p\n", &IopRootMemArbiter); + + IopRootMemArbiter.UnpackRequirement = IopGenericUnpackRequirement; + IopRootMemArbiter.PackResource = IopGenericPackResource; + IopRootMemArbiter.UnpackResource = IopGenericUnpackResource; + IopRootMemArbiter.ScoreRequirement = IopGenericScoreRequirement; + + IopRootMemArbiter.FindSuitableRange = IopMemFindSuitableRange; + + Status = ArbInitializeArbiterInstance(&IopRootMemArbiter, + NULL, + CmResourceTypeMemory, + L"RootMemory", + L"Root", + IopGenericTranslateOrdering); + if (!NT_SUCCESS(Status)) + { + DPRINT1("IopMemInitialize: Status %p\n", Status); + ASSERT(FALSE); + return Status; + } + + Status = RtlAddRange(IopRootMemArbiter.Allocation, + 0, + (UINT64)(PAGE_SIZE - 1), + 0, + 0, + NULL, + NULL); + + return Status; +} + +/* Port arbiter */ + +CODE_SEG("PAGE") +BOOLEAN +NTAPI +IopPortFindSuitableRange( + _In_ PARBITER_INSTANCE Arbiter, + _In_ PARBITER_ALLOCATION_STATE State) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return FALSE; +} + +CODE_SEG("PAGE") +VOID +NTAPI +IopPortAddAllocation( + _In_ PARBITER_INSTANCE Arbiter, + _In_ PARBITER_ALLOCATION_STATE ArbState) +{ + PAGED_CODE(); + + UNIMPLEMENTED; +} + +CODE_SEG("PAGE") +VOID +NTAPI +IopPortBacktrackAllocation( + _In_ PARBITER_INSTANCE Arbiter, + _Inout_ PARBITER_ALLOCATION_STATE ArbState) +{ + PAGED_CODE(); + + UNIMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +IopPortInitialize(VOID) +{ + NTSTATUS Status; + + PAGED_CODE(); + + DPRINT("IopRootPortArbiter %p\n", &IopRootPortArbiter); + + IopRootPortArbiter.UnpackRequirement = IopGenericUnpackRequirement; + IopRootPortArbiter.PackResource = IopGenericPackResource; + IopRootPortArbiter.UnpackResource = IopGenericUnpackResource; + IopRootPortArbiter.ScoreRequirement = IopGenericScoreRequirement; + + IopRootPortArbiter.FindSuitableRange = IopPortFindSuitableRange; + IopRootPortArbiter.AddAllocation = IopPortAddAllocation; + IopRootPortArbiter.BacktrackAllocation = IopPortBacktrackAllocation; + + Status = ArbInitializeArbiterInstance(&IopRootPortArbiter, + NULL, + CmResourceTypePort, + L"RootPort", + L"Root", + IopGenericTranslateOrdering); + return Status; +} diff --git a/ntoskrnl/io/pnpmgr/arbs.c b/ntoskrnl/io/pnpmgr/arbs.c deleted file mode 100644 index 09bab2ad735..00000000000 --- a/ntoskrnl/io/pnpmgr/arbs.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * PROJECT: ReactOS Kernel - * COPYRIGHT: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) - * FILE: ntoskrnl/io/pnpmgr/arbs.c - * PURPOSE: Root arbiters of the PnP manager - * PROGRAMMERS: Copyright 2020 Vadim Galyant <vgal(a)rambler.ru> - */ - -/* INCLUDES ******************************************************************/ - -#include <ntoskrnl.h> - -#define NDEBUG -#include <debug.h> - -/* GLOBALS *******************************************************************/ - -extern ARBITER_INSTANCE IopRootBusNumberArbiter; -extern ARBITER_INSTANCE IopRootIrqArbiter; -extern ARBITER_INSTANCE IopRootDmaArbiter; -extern ARBITER_INSTANCE IopRootMemArbiter; -extern ARBITER_INSTANCE IopRootPortArbiter; - -/* DATA **********************************************************************/ - -/* FUNCTIONS *****************************************************************/ - -/* BusNumber arbiter */ - -NTSTATUS -NTAPI -IopBusNumberInitialize(VOID) -{ - NTSTATUS Status; - - DPRINT("IopRootBusNumberArbiter %p\n", &IopRootBusNumberArbiter); - - Status = ArbInitializeArbiterInstance(&IopRootBusNumberArbiter, - NULL, - CmResourceTypeBusNumber, - L"RootBusNumber", - L"Root", - NULL); - return Status; -} - -/* Irq arbiter */ - -NTSTATUS -NTAPI -IopIrqInitialize(VOID) -{ - NTSTATUS Status; - - DPRINT("IopRootIrqArbiter %p\n", &IopRootIrqArbiter); - - Status = ArbInitializeArbiterInstance(&IopRootIrqArbiter, - NULL, - CmResourceTypeInterrupt, - L"RootIRQ", - L"Root", - NULL); - return Status; -} - -/* Dma arbiter */ - -NTSTATUS -NTAPI -IopDmaInitialize(VOID) -{ - NTSTATUS Status; - - DPRINT("IopRootDmaArbiter %p\n", &IopRootDmaArbiter); - - Status = ArbInitializeArbiterInstance(&IopRootDmaArbiter, - NULL, - CmResourceTypeDma, - L"RootDMA", - L"Root", - NULL); - return Status; -} - -/* Memory arbiter */ - -NTSTATUS -NTAPI -IopMemInitialize(VOID) -{ - NTSTATUS Status; - - DPRINT("IopRootMemArbiter %p\n", &IopRootMemArbiter); - - Status = ArbInitializeArbiterInstance(&IopRootMemArbiter, - NULL, - CmResourceTypeMemory, - L"RootMemory", - L"Root", - NULL); - return Status; -} - -/* Port arbiter */ - -NTSTATUS -NTAPI -IopPortInitialize(VOID) -{ - NTSTATUS Status; - - DPRINT("IopRootPortArbiter %p\n", &IopRootPortArbiter); - - Status = ArbInitializeArbiterInstance(&IopRootPortArbiter, - NULL, - CmResourceTypePort, - L"RootPort", - L"Root", - NULL); - return Status; -} - -/* EOF */ diff --git a/ntoskrnl/ntos.cmake b/ntoskrnl/ntos.cmake index d4bfd5f08a3..89802e07c41 100644 --- a/ntoskrnl/ntos.cmake +++ b/ntoskrnl/ntos.cmake @@ -151,7 +151,7 @@ list(APPEND SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/io/iomgr/symlink.c ${REACTOS_SOURCE_DIR}/ntoskrnl/io/iomgr/util.c ${REACTOS_SOURCE_DIR}/ntoskrnl/io/iomgr/volume.c - ${REACTOS_SOURCE_DIR}/ntoskrnl/io/pnpmgr/arbs.c + ${REACTOS_SOURCE_DIR}/ntoskrnl/io/pnpmgr/arbiters.c ${REACTOS_SOURCE_DIR}/ntoskrnl/io/pnpmgr/devaction.c ${REACTOS_SOURCE_DIR}/ntoskrnl/io/pnpmgr/devnode.c ${REACTOS_SOURCE_DIR}/ntoskrnl/io/pnpmgr/plugplay.c diff --git a/sdk/lib/drivers/arbiter/arbiter.c b/sdk/lib/drivers/arbiter/arbiter.c index 9d7d5561de4..e4e1c719ac7 100644 --- a/sdk/lib/drivers/arbiter/arbiter.c +++ b/sdk/lib/drivers/arbiter/arbiter.c @@ -1,16 +1,14 @@ /* - * PROJECT: ReactOS Kernel - * COPYRIGHT: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) - * FILE: lib/drivers/arbiter/arbiter.c - * PURPOSE: Hardware Resources Arbiter Library - * PROGRAMMERS: Copyright 2020 Vadim Galyant <vgal(a)rambler.ru> + * PROJECT: ReactOS Kernel&Driver SDK + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: Hardware Resources Arbiter Library + * COPYRIGHT: Copyright 2020 Vadim Galyant <vgal(a)rambler.ru> */ /* INCLUDES *******************************************************************/ #include <ntifs.h> -#include <ndk/rtltypes.h> - +#include <ndk/rtlfuncs.h> #include "arbiter.h" #define NDEBUG @@ -22,6 +20,263 @@ /* FUNCTIONS ******************************************************************/ +CODE_SEG("PAGE") +NTSTATUS +NTAPI +ArbTestAllocation( + _In_ PARBITER_INSTANCE Arbiter, + _In_ PLIST_ENTRY ArbitrationList) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +ArbRetestAllocation( + _In_ PARBITER_INSTANCE Arbiter, + _In_ PLIST_ENTRY ArbitrationList) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +ArbCommitAllocation( + _In_ PARBITER_INSTANCE Arbiter) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +ArbRollbackAllocation( + _In_ PARBITER_INSTANCE Arbiter) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* FIXME: the prototype is not correct yet. */ +CODE_SEG("PAGE") +NTSTATUS +NTAPI +ArbAddReserved( + _In_ PARBITER_INSTANCE Arbiter) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +ArbPreprocessEntry( + _In_ PARBITER_INSTANCE Arbiter, + _Inout_ PARBITER_ALLOCATION_STATE ArbState) +{ + PAGED_CODE(); + + return STATUS_SUCCESS; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +ArbAllocateEntry( + _In_ PARBITER_INSTANCE Arbiter, + _Inout_ PARBITER_ALLOCATION_STATE ArbState) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +BOOLEAN +NTAPI +ArbGetNextAllocationRange( + _In_ PARBITER_INSTANCE Arbiter, + _Inout_ PARBITER_ALLOCATION_STATE ArbState) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return FALSE; +} + +CODE_SEG("PAGE") +BOOLEAN +NTAPI +ArbFindSuitableRange( + _In_ PARBITER_INSTANCE Arbiter, + _Inout_ PARBITER_ALLOCATION_STATE ArbState) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return FALSE; +} + +CODE_SEG("PAGE") +VOID +NTAPI +ArbAddAllocation( + _In_ PARBITER_INSTANCE Arbiter, + _Inout_ PARBITER_ALLOCATION_STATE ArbState) +{ + PAGED_CODE(); + + UNIMPLEMENTED; +} + +CODE_SEG("PAGE") +VOID +NTAPI +ArbBacktrackAllocation( + _In_ PARBITER_INSTANCE Arbiter, + _Inout_ PARBITER_ALLOCATION_STATE ArbState) +{ + PAGED_CODE(); + + UNIMPLEMENTED; +} + +/* FIXME: the prototype is not correct yet. */ +CODE_SEG("PAGE") +NTSTATUS +NTAPI +ArbOverrideConflict( + _In_ PARBITER_INSTANCE Arbiter) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +ArbBootAllocation( + _In_ PARBITER_INSTANCE Arbiter, + _In_ PLIST_ENTRY ArbitrationList) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* FIXME: the prototype is not correct yet. */ +CODE_SEG("PAGE") +NTSTATUS +NTAPI +ArbQueryConflict( + _In_ PARBITER_INSTANCE Arbiter) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* FIXME: the prototype is not correct yet. */ +CODE_SEG("PAGE") +NTSTATUS +NTAPI +ArbStartArbiter( + _In_ PARBITER_INSTANCE Arbiter) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +ArbAddOrdering( + _Out_ PARBITER_ORDERING_LIST OrderList, + _In_ UINT64 MinimumAddress, + _In_ UINT64 MaximumAddress) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +ArbPruneOrdering( + _Out_ PARBITER_ORDERING_LIST OrderingList, + _In_ UINT64 MinimumAddress, + _In_ UINT64 MaximumAddress) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +ArbInitializeOrderingList( + _Out_ PARBITER_ORDERING_LIST OrderList) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +CODE_SEG("PAGE") +VOID +NTAPI +ArbFreeOrderingList( + _Out_ PARBITER_ORDERING_LIST OrderList) +{ + PAGED_CODE(); + + UNIMPLEMENTED; +} + +CODE_SEG("PAGE") +NTSTATUS +NTAPI +ArbBuildAssignmentOrdering( + _Inout_ PARBITER_INSTANCE ArbInstance, + _In_ PCWSTR OrderName, + _In_ PCWSTR ReservedOrderName, + _In_ PARB_TRANSLATE_ORDERING TranslateOrderingFunction) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_SUCCESS; +} + +CODE_SEG("PAGE") NTSTATUS NTAPI ArbInitializeArbiterInstance( @@ -34,11 +289,118 @@ ArbInitializeArbiterInstance( { NTSTATUS Status; - DPRINT("ArbInitializeArbiterInstance: Initializing %S Arbiter\n", ArbiterName); - UNIMPLEMENTED; + PAGED_CODE(); + + DPRINT("ArbInitializeArbiterInstance: '%S'\n", ArbiterName); + + ASSERT(Arbiter->UnpackRequirement != NULL); + ASSERT(Arbiter->PackResource != NULL); + ASSERT(Arbiter->UnpackResource != NULL); + ASSERT(Arbiter->MutexEvent == NULL); + ASSERT(Arbiter->Allocation == NULL); + ASSERT(Arbiter->PossibleAllocation == NULL); + ASSERT(Arbiter->AllocationStack == NULL); + + Arbiter->Signature = ARBITER_SIGNATURE; + Arbiter->BusDeviceObject = BusDeviceObject; + + Arbiter->MutexEvent = ExAllocatePoolWithTag(NonPagedPool, sizeof(KEVENT), TAG_ARBITER); + if (!Arbiter->MutexEvent) + { + DPRINT1("ArbInitializeArbiterInstance: STATUS_INSUFFICIENT_RESOURCES\n"); + return STATUS_INSUFFICIENT_RESOURCES; + } + + KeInitializeEvent(Arbiter->MutexEvent, SynchronizationEvent, TRUE); + + Arbiter->AllocationStack = ExAllocatePoolWithTag(PagedPool, PAGE_SIZE, TAG_ARB_ALLOCATION); + if (!Arbiter->AllocationStack) + { + DPRINT1("ArbInitializeArbiterInstance: STATUS_INSUFFICIENT_RESOURCES\n"); + ExFreePoolWithTag(Arbiter->MutexEvent, TAG_ARBITER); + return STATUS_INSUFFICIENT_RESOURCES; + } + + Arbiter->AllocationStackMaxSize = PAGE_SIZE; + + Arbiter->Allocation = ExAllocatePoolWithTag(PagedPool, sizeof(RTL_RANGE_LIST), TAG_ARB_RANGE); + if (!Arbiter->Allocation) + { + DPRINT1("ArbInitializeArbiterInstance: STATUS_INSUFFICIENT_RESOURCES\n"); + ExFreePoolWithTag(Arbiter->AllocationStack, TAG_ARB_ALLOCATION); + ExFreePoolWithTag(Arbiter->MutexEvent, TAG_ARBITER); + return STATUS_INSUFFICIENT_RESOURCES; + } + + Arbiter->PossibleAllocation = ExAllocatePoolWithTag(PagedPool, sizeof(RTL_RANGE_LIST), TAG_ARB_RANGE); + if (!Arbiter->PossibleAllocation) + { + DPRINT1("ArbInitializeArbiterInstance: STATUS_INSUFFICIENT_RESOURCES\n"); + ExFreePoolWithTag(Arbiter->Allocation, TAG_ARB_RANGE); + ExFreePoolWithTag(Arbiter->AllocationStack, TAG_ARB_ALLOCATION); + ExFreePoolWithTag(Arbiter->MutexEvent, TAG_ARBITER); + return STATUS_INSUFFICIENT_RESOURCES; + } + + RtlInitializeRangeList(Arbiter->Allocation); + RtlInitializeRangeList(Arbiter->PossibleAllocation); + + Arbiter->Name = ArbiterName; + Arbiter->ResourceType = ResourceType; + Arbiter->TransactionInProgress = FALSE; + + if (!Arbiter->TestAllocation) + Arbiter->TestAllocation = ArbTestAllocation; + + if (!Arbiter->RetestAllocation) + Arbiter->RetestAllocation = ArbRetestAllocation; + + if (!Arbiter->CommitAllocation) + Arbiter->CommitAllocation = ArbCommitAllocation; + + if (!Arbiter->RollbackAllocation) + Arbiter->RollbackAllocation = ArbRollbackAllocation; + + if (!Arbiter->AddReserved) + Arbiter->AddReserved = ArbAddReserved; + + if (!Arbiter->PreprocessEntry) + Arbiter->PreprocessEntry = ArbPreprocessEntry; + + if (!Arbiter->AllocateEntry) + Arbiter->AllocateEntry = ArbAllocateEntry; + + if (!Arbiter->GetNextAllocationRange) + Arbiter->GetNextAllocationRange = ArbGetNextAllocationRange; + + if (!Arbiter->FindSuitableRange) + Arbiter->FindSuitableRange = ArbFindSuitableRange; + + if (!Arbiter->AddAllocation) + Arbiter->AddAllocation = ArbAddAllocation; + + if (!Arbiter->BacktrackAllocation) + Arbiter->BacktrackAllocation = ArbBacktrackAllocation; + + if (!Arbiter->OverrideConflict) + Arbiter->OverrideConflict = ArbOverrideConflict; + + if (!Arbiter->BootAllocation) + Arbiter->BootAllocation = ArbBootAllocation; + + if (!Arbiter->QueryConflict) + Arbiter->QueryConflict = ArbQueryConflict; + + if (!Arbiter->StartArbiter) + Arbiter->StartArbiter = ArbStartArbiter; + + Status = ArbBuildAssignmentOrdering(Arbiter, OrderName, OrderName, TranslateOrderingFunction); + if (NT_SUCCESS(Status)) + { + return STATUS_SUCCESS; + } + + DPRINT1("ArbInitializeArbiterInstance: Status %X\n", Status); - Status = STATUS_SUCCESS; return Status; } - -/* EOF */ diff --git a/sdk/lib/drivers/arbiter/arbiter.h b/sdk/lib/drivers/arbiter/arbiter.h index 6b8be2fb207..98e81711671 100644 --- a/sdk/lib/drivers/arbiter/arbiter.h +++ b/sdk/lib/drivers/arbiter/arbiter.h @@ -1,50 +1,53 @@ /* - * PROJECT: ReactOS Kernel - * COPYRIGHT: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) - * FILE: lib/drivers/arbiter/arbiter.h - * PURPOSE: Hardware Resources Arbiter Library - * PROGRAMMERS: Copyright 2020 Vadim Galyant <vgal(a)rambler.ru> + * PROJECT: ReactOS Kernel&Driver SDK + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: Hardware Resources Arbiter Library + * COPYRIGHT: Copyright 2020 Vadim Galyant <vgal(a)rambler.ru> */ -#ifndef _ARBITER_H -#define _ARBITER_H +#pragma once + +#define ARBITER_SIGNATURE 'sbrA' +#define TAG_ARBITER 'MbrA' +#define TAG_ARB_ALLOCATION 'AbrA' +#define TAG_ARB_RANGE 'RbrA' typedef struct _ARBITER_ORDERING { - ULONGLONG Start; - ULONGLONG End; + UINT64 Start; + UINT64 End; } ARBITER_ORDERING, *PARBITER_ORDERING; typedef struct _ARBITER_ORDERING_LIST { - USHORT Count; - USHORT Maximum; + UINT16 Count; + UINT16 Maximum; PARBITER_ORDERING Orderings; } ARBITER_ORDERING_LIST, *PARBITER_ORDERING_LIST; typedef struct _ARBITER_ALTERNATIVE { - ULONGLONG Minimum; - ULONGLONG Maximum; - ULONG Length; - ULONG Alignment; - LONG Priority; - ULONG Flags; + UINT64 Minimum; + UINT64 Maximum; + UINT32 Length; + UINT32 Alignment; + INT32 Priority; + UINT32 Flags; PIO_RESOURCE_DESCRIPTOR Descriptor; - ULONG Reserved[3]; + UINT32 Reserved[3]; } ARBITER_ALTERNATIVE, *PARBITER_ALTERNATIVE; typedef struct _ARBITER_ALLOCATION_STATE { - ULONGLONG Start; - ULONGLONG End; - ULONGLONG CurrentMinimum; - ULONGLONG CurrentMaximum; + UINT64 Start; + UINT64 End; + UINT64 CurrentMinimum; + UINT64 CurrentMaximum; PARBITER_LIST_ENTRY Entry; PARBITER_ALTERNATIVE CurrentAlternative; - ULONG AlternativeCount; + UINT32 AlternativeCount; PARBITER_ALTERNATIVE Alternatives; - USHORT Flags; + UINT16 Flags; UCHAR RangeAttributes; UCHAR RangeAvailableAttributes; ULONG_PTR WorkSpace; @@ -55,27 +58,27 @@ typedef struct _ARBITER_INSTANCE *PARBITER_INSTANCE; typedef NTSTATUS (NTAPI * PARB_UNPACK_REQUIREMENT)( _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, - _Out_ PULONGLONG OutMinimumAddress, - _Out_ PULONGLONG OutMaximumAddress, - _Out_ PULONG OutLength, - _Out_ PULONG OutAlignment + _Out_ PUINT64 OutMinimumAddress, + _Out_ PUINT64 OutMaximumAddress, + _Out_ PUINT32 OutLength, + _Out_ PUINT32 OutAlignment ); typedef NTSTATUS (NTAPI * PARB_PACK_RESOURCE)( _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, - _In_ ULONGLONG Start, + _In_ UINT64 Start, _Out_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor ); typedef NTSTATUS (NTAPI * PARB_UNPACK_RESOURCE)( _In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor, - _Out_ PULONGLONG Start, - _Out_ PULONG OutLength + _Out_ PUINT64 Start, + _Out_ PUINT32 OutLength ); -typedef LONG +typedef INT32 (NTAPI * PARB_SCORE_REQUIREMENT)( _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor ); @@ -176,7 +179,7 @@ typedef NTSTATUS typedef struct _ARBITER_INSTANCE { - ULONG Signature; + UINT32 Signature; PKEVENT MutexEvent; PCWSTR Name; CM_RESOURCE_TYPE ResourceType; @@ -184,9 +187,9 @@ typedef struct _ARBITER_INSTANCE PRTL_RANGE_LIST PossibleAllocation; ARBITER_ORDERING_LIST OrderingList; ARBITER_ORDERING_LIST ReservedList; - LONG ReferenceCount; + INT32 ReferenceCount; PARBITER_INTERFACE Interface; - ULONG AllocationStackMaxSize; + UINT32 AllocationStackMaxSize; PARBITER_ALLOCATION_STATE AllocationStack; PARB_UNPACK_REQUIREMENT UnpackRequirement; PARB_PACK_RESOURCE PackResource; @@ -221,6 +224,7 @@ typedef NTSTATUS _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor ); +CODE_SEG("PAGE") NTSTATUS NTAPI ArbInitializeArbiterInstance( @@ -231,5 +235,3 @@ ArbInitializeArbiterInstance( _In_ PCWSTR OrderName, _In_ PARB_TRANSLATE_ORDERING TranslateOrderingFunction ); - -#endif /* _ARBITER_H */
2 years, 11 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Prepare for debugging (#4257)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b2f8d62cd1a116fb2cad2…
commit b2f8d62cd1a116fb2cad2af889e9c6651e942e42 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Jan 10 08:50:37 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Jan 10 08:50:37 2022 +0900 [MSPAINT] Prepare for debugging (#4257) - Add #include <debug.h> and add link to ntdll.dll for debugging. - Add CopyDIBImage helper function. CORE-17969 --- base/applications/mspaint/CMakeLists.txt | 2 +- base/applications/mspaint/dib.h | 5 +++++ base/applications/mspaint/history.cpp | 15 +++++++++------ base/applications/mspaint/precomp.h | 3 +++ base/applications/mspaint/selectionmodel.cpp | 5 ++--- base/applications/mspaint/winproc.cpp | 4 ++-- 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/base/applications/mspaint/CMakeLists.txt b/base/applications/mspaint/CMakeLists.txt index fcf694a08ca..03c71c21359 100644 --- a/base/applications/mspaint/CMakeLists.txt +++ b/base/applications/mspaint/CMakeLists.txt @@ -32,6 +32,6 @@ add_executable(mspaint ${SOURCE} rsrc.rc) set_module_type(mspaint win32gui UNICODE) target_link_libraries(mspaint uuid cpprt atl_classes) set_target_cpp_properties(mspaint WITH_EXCEPTIONS) -add_importlibs(mspaint hhctrl comdlg32 shell32 user32 gdi32 advapi32 comctl32 msvcrt kernel32 rpcrt4 shlwapi) +add_importlibs(mspaint hhctrl comdlg32 shell32 user32 gdi32 advapi32 comctl32 msvcrt kernel32 rpcrt4 shlwapi ntdll) add_pch(mspaint precomp.h SOURCE) add_cd_file(TARGET mspaint DESTINATION reactos/system32 FOR all) diff --git a/base/applications/mspaint/dib.h b/base/applications/mspaint/dib.h index 6bbb56d9c6d..21c73a7dd13 100644 --- a/base/applications/mspaint/dib.h +++ b/base/applications/mspaint/dib.h @@ -11,6 +11,11 @@ HBITMAP CreateDIBWithProperties(int width, int height); HBITMAP CreateColorDIB(int width, int height, COLORREF rgb); +static inline HBITMAP CopyDIBImage(HBITMAP hbm, INT cx = 0, INT cy = 0) +{ + return (HBITMAP)CopyImage(hbm, IMAGE_BITMAP, cx, cy, LR_COPYRETURNORG | LR_CREATEDIBSECTION); +} + int GetDIBWidth(HBITMAP hbm); int GetDIBHeight(HBITMAP hbm); diff --git a/base/applications/mspaint/history.cpp b/base/applications/mspaint/history.cpp index 221dffc52d7..1a5cd8966a8 100644 --- a/base/applications/mspaint/history.cpp +++ b/base/applications/mspaint/history.cpp @@ -44,8 +44,9 @@ ImageModel::ImageModel() void ImageModel::CopyPrevious() { + DPRINT("%s: %d\n", __FUNCTION__, currInd); DeleteObject(hBms[(currInd + 1) % HISTORYSIZE]); - hBms[(currInd + 1) % HISTORYSIZE] = (HBITMAP) CopyImage(hBms[currInd], IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG); + hBms[(currInd + 1) % HISTORYSIZE] = CopyDIBImage(hBms[currInd]); currInd = (currInd + 1) % HISTORYSIZE; if (undoSteps < HISTORYSIZE - 1) undoSteps++; @@ -56,6 +57,7 @@ void ImageModel::CopyPrevious() void ImageModel::Undo() { + DPRINT("%s: %d\n", __FUNCTION__, undoSteps); if (undoSteps > 0) { int oldWidth = GetWidth(); @@ -74,6 +76,7 @@ void ImageModel::Undo() void ImageModel::Redo() { + DPRINT("%s: %d\n", __FUNCTION__, redoSteps); if (redoSteps > 0) { int oldWidth = GetWidth(); @@ -92,9 +95,9 @@ void ImageModel::Redo() void ImageModel::ResetToPrevious() { + DPRINT("%s: %d\n", __FUNCTION__, currInd); DeleteObject(hBms[currInd]); - hBms[currInd] = - (HBITMAP) CopyImage(hBms[(currInd + HISTORYSIZE - 1) % HISTORYSIZE], IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG); + hBms[currInd] = CopyDIBImage(hBms[(currInd + HISTORYSIZE - 1) % HISTORYSIZE]); SelectObject(hDrawingDC, hBms[currInd]); NotifyImageChanged(); } @@ -183,9 +186,9 @@ void ImageModel::StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSk { int oldWidth = GetWidth(); int oldHeight = GetHeight(); - Insert((HBITMAP) CopyImage(hBms[currInd], IMAGE_BITMAP, - GetWidth() * nStretchPercentX / 100, - GetHeight() * nStretchPercentY / 100, 0)); + INT newWidth = oldWidth * nStretchPercentX / 100; + INT newHeight = oldHeight * nStretchPercentY / 100; + Insert(CopyDIBImage(hBms[currInd], newWidth, newHeight)); if (GetWidth() != oldWidth || GetHeight() != oldHeight) NotifyDimensionsChanged(); NotifyImageChanged(); diff --git a/base/applications/mspaint/precomp.h b/base/applications/mspaint/precomp.h index 5e2756b2fa1..1f27501432f 100644 --- a/base/applications/mspaint/precomp.h +++ b/base/applications/mspaint/precomp.h @@ -21,6 +21,9 @@ #include <shellapi.h> #include <htmlhelp.h> +#define NDEBUG +#include <debug.h> + #define WM_TOOLSMODELTOOLCHANGED (WM_APP + 0) #define WM_TOOLSMODELSETTINGSCHANGED (WM_APP + 1) #define WM_TOOLSMODELZOOMCHANGED (WM_APP + 2) diff --git a/base/applications/mspaint/selectionmodel.cpp b/base/applications/mspaint/selectionmodel.cpp index 464b6bdca64..50c6ad4a53f 100644 --- a/base/applications/mspaint/selectionmodel.cpp +++ b/base/applications/mspaint/selectionmodel.cpp @@ -170,9 +170,8 @@ void SelectionModel::InsertFromHBITMAP(HBITMAP hBm) HDC hTempDC; HBITMAP hTempMask; - DeleteObject(SelectObject(m_hDC, m_hBm = (HBITMAP) CopyImage(hBm, - IMAGE_BITMAP, 0, 0, - LR_COPYRETURNORG))); + m_hBm = CopyDIBImage(hBm); + DeleteObject(SelectObject(m_hDC, m_hBm)); SetRectEmpty(&m_rcSrc); m_rcDest.left = m_rcDest.top = 0; diff --git a/base/applications/mspaint/winproc.cpp b/base/applications/mspaint/winproc.cpp index 7a739f76cca..43b0f812c1f 100644 --- a/base/applications/mspaint/winproc.cpp +++ b/base/applications/mspaint/winproc.cpp @@ -534,7 +534,7 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH case IDM_EDITCOPY: OpenClipboard(); EmptyClipboard(); - SetClipboardData(CF_BITMAP, CopyImage(selectionModel.GetBitmap(), IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG)); + SetClipboardData(CF_BITMAP, CopyDIBImage(selectionModel.GetBitmap())); CloseClipboard(); break; case IDM_EDITCUT: @@ -653,7 +653,7 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH toolsModel.SetBackgroundTransparent(!toolsModel.IsBackgroundTransparent()); break; case IDM_IMAGECROP: - imageModel.Insert((HBITMAP) CopyImage(selectionModel.GetBitmap(), IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG)); + imageModel.Insert(CopyDIBImage(selectionModel.GetBitmap())); break; case IDM_VIEWTOOLBOX:
2 years, 11 months
1
0
0
0
[reactos] 01/01: [SHELL32] Use the already existing g_pszShell32 instead of re-defining a new variable holding the very same string.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=48d1a7bf4dadb63c19153…
commit 48d1a7bf4dadb63c191535769bc1f2cdddc39795 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Jan 9 22:44:21 2022 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Jan 9 22:44:21 2022 +0100 [SHELL32] Use the already existing g_pszShell32 instead of re-defining a new variable holding the very same string. --- dll/win32/shell32/dialogs/dialogs.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dll/win32/shell32/dialogs/dialogs.cpp b/dll/win32/shell32/dialogs/dialogs.cpp index 73de2f363ac..4b05a92ef31 100644 --- a/dll/win32/shell32/dialogs/dialogs.cpp +++ b/dll/win32/shell32/dialogs/dialogs.cpp @@ -164,8 +164,6 @@ DoLoadIcons(HWND hwndDlg, PPICK_ICON_CONTEXT pIconContext, LPCWSTR pszFile) return (pIconContext->nIcons > 0); } -static const LPCWSTR s_pszDefaultPath = L"%SystemRoot%\\system32\\shell32.dll"; - static void NoIconsInFile(HWND hwndDlg, PPICK_ICON_CONTEXT pIconContext) { // Show an error message @@ -174,7 +172,7 @@ static void NoIconsInFile(HWND hwndDlg, PPICK_ICON_CONTEXT pIconContext) MessageBoxW(hwndDlg, strText, strTitle, MB_ICONWARNING); // Load the default icons - DoLoadIcons(hwndDlg, pIconContext, s_pszDefaultPath); + DoLoadIcons(hwndDlg, pIconContext, g_pszShell32); } // Icon size @@ -388,7 +386,7 @@ BOOL WINAPI PickIconDlg( } // Set the default value - StringCchCopyW(IconContext.szPath, _countof(IconContext.szPath), s_pszDefaultPath); + StringCchCopyW(IconContext.szPath, _countof(IconContext.szPath), g_pszShell32); } // Show the dialog
2 years, 11 months
1
0
0
0
[reactos] 01/01: [SHELL32] Use wide char string literals.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=83be315abffe14f0b391f…
commit 83be315abffe14f0b391ff9cd543010aa0d57b9e Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Jan 9 22:38:31 2022 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Jan 9 22:39:29 2022 +0100 [SHELL32] Use wide char string literals. Import parts of Wine commit b215536852dc5a132108db92c90a41c70b738e50 shell32: Use wide char string literals. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dll/win32/shell32/CDefView.cpp | 6 +- dll/win32/shell32/CQueryAssociations.cpp | 45 +-- dll/win32/shell32/dialogs/dialogs.cpp | 3 +- dll/win32/shell32/dialogs/view.cpp | 8 +- dll/win32/shell32/folders/CControlPanelFolder.cpp | 3 +- dll/win32/shell32/folders/CDrivesFolder.cpp | 12 +- dll/win32/shell32/folders/CFSFolder.cpp | 45 +-- dll/win32/shell32/folders/CRegFolder.cpp | 18 +- dll/win32/shell32/iconcache.cpp | 22 +- dll/win32/shell32/shlexec.cpp | 152 +++++----- dll/win32/shell32/shlfileop.cpp | 26 +- dll/win32/shell32/wine/brsfolder.c | 17 +- dll/win32/shell32/wine/classes.c | 42 +-- dll/win32/shell32/wine/control.c | 7 +- dll/win32/shell32/wine/shell32_main.c | 106 ++++--- dll/win32/shell32/wine/shellole.c | 11 +- dll/win32/shell32/wine/shellord.c | 32 +- dll/win32/shell32/wine/shellpath.c | 337 ++++++++-------------- dll/win32/shell32/wine/shellstring.c | 4 +- dll/win32/shell32/wine/shlmenu.c | 3 +- dll/win32/shell32/wine/shpolicy.c | 20 +- 21 files changed, 337 insertions(+), 582 deletions(-) diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp index 8a4fc939789..45d1e4ce827 100644 --- a/dll/win32/shell32/CDefView.cpp +++ b/dll/win32/shell32/CDefView.cpp @@ -40,10 +40,6 @@ TODO: WINE_DEFAULT_DEBUG_CHANNEL(shell); -#undef SV_CLASS_NAME - -static const WCHAR SV_CLASS_NAME[] = {'S', 'H', 'E', 'L', 'L', 'D', 'L', 'L', '_', 'D', 'e', 'f', 'V', 'i', 'e', 'w', 0}; - typedef struct { BOOL bIsAscending; @@ -298,7 +294,7 @@ class CDefView : { { sizeof(WNDCLASSEX), CS_PARENTDC, StartWindowProc, 0, 0, NULL, NULL, - LoadCursor(NULL, IDC_ARROW), NULL, NULL, SV_CLASS_NAME, NULL + LoadCursor(NULL, IDC_ARROW), NULL, NULL, L"SHELLDLL_DefView", NULL }, NULL, NULL, IDC_ARROW, TRUE, 0, _T("") }; diff --git a/dll/win32/shell32/CQueryAssociations.cpp b/dll/win32/shell32/CQueryAssociations.cpp index a11a79a65fd..093a536b4a1 100644 --- a/dll/win32/shell32/CQueryAssociations.cpp +++ b/dll/win32/shell32/CQueryAssociations.cpp @@ -73,8 +73,6 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::Init( HKEY hkeyProgid, HWND hWnd) { - static const WCHAR szProgID[] = L"ProgID"; - TRACE("(%p)->(%d,%s,%p,%p)\n", this, cfFlags, debugstr_w(pszAssoc), @@ -128,11 +126,7 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::Init( { HKEY progIdKey; /* for a clsid, the progid is the default value of the ProgID subkey */ - ret = RegOpenKeyExW(this->hkeySource, - szProgID, - 0, - KEY_READ, - &progIdKey); + ret = RegOpenKeyExW(this->hkeySource, L"ProgID", 0, KEY_READ, &progIdKey); if (ret != ERROR_SUCCESS) return S_OK; hr = this->GetValue(progIdKey, NULL, (void**)&progId, NULL); @@ -274,8 +268,6 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetString( DWORD size, retval = 0; UINT flen; WCHAR *bufW; - static const WCHAR translationW[] = L"\\VarFileInfo\\Translation"; - static const WCHAR fileDescFmtW[] = L"\\StringFileInfo\\%04x%04x\\FileDescription"; WCHAR fileDescW[41]; hr = this->GetExecutable(pszExtra, path, MAX_PATH, &len); @@ -297,13 +289,14 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetString( { goto get_friendly_name_fail; } - if (VerQueryValueW(verinfoW, translationW, (LPVOID *)&bufW, &flen)) + if (VerQueryValueW(verinfoW, L"\\VarFileInfo\\Translation", (LPVOID *)&bufW, &flen)) { UINT i; DWORD *langCodeDesc = (DWORD *)bufW; for (i = 0; i < flen / sizeof(DWORD); i++) { - sprintfW(fileDescW, fileDescFmtW, LOWORD(langCodeDesc[i]), HIWORD(langCodeDesc[i])); + sprintfW(fileDescW, L"\\StringFileInfo\\%04x%04x\\FileDescription", + LOWORD(langCodeDesc[i]), HIWORD(langCodeDesc[i])); if (VerQueryValueW(verinfoW, fileDescW, (LPVOID *)&bufW, &flen)) { /* Does strlenW(bufW) == 0 mean we use the filename? */ @@ -325,10 +318,8 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetString( } case ASSOCSTR_CONTENTTYPE: { - static const WCHAR Content_TypeW[] = L"Content Type"; - DWORD size = 0; - DWORD ret = RegGetValueW(this->hkeySource, NULL, Content_TypeW, RRF_RT_REG_SZ, NULL, NULL, &size); + DWORD ret = RegGetValueW(this->hkeySource, NULL, L"Content Type", RRF_RT_REG_SZ, NULL, NULL, &size); if (ret != ERROR_SUCCESS) { return HRESULT_FROM_WIN32(ret); @@ -336,7 +327,7 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetString( WCHAR *contentType = static_cast<WCHAR *>(HeapAlloc(GetProcessHeap(), 0, size)); if (contentType != NULL) { - ret = RegGetValueW(this->hkeySource, NULL, Content_TypeW, RRF_RT_REG_SZ, NULL, contentType, &size); + ret = RegGetValueW(this->hkeySource, NULL, L"Content Type", RRF_RT_REG_SZ, NULL, contentType, &size); if (ret == ERROR_SUCCESS) { hr = this->ReturnString(flags, pszOut, pcchOut, contentType, strlenW(contentType) + 1); @@ -355,16 +346,15 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetString( } case ASSOCSTR_DEFAULTICON: { - static const WCHAR DefaultIconW[] = L"DefaultIcon"; DWORD ret; DWORD size = 0; - ret = RegGetValueW(this->hkeyProgID, DefaultIconW, NULL, RRF_RT_REG_SZ, NULL, NULL, &size); + ret = RegGetValueW(this->hkeyProgID, L"DefaultIcon", NULL, RRF_RT_REG_SZ, NULL, NULL, &size); if (ret == ERROR_SUCCESS) { WCHAR *icon = static_cast<WCHAR *>(HeapAlloc(GetProcessHeap(), 0, size)); if (icon) { - ret = RegGetValueW(this->hkeyProgID, DefaultIconW, NULL, RRF_RT_REG_SZ, NULL, icon, &size); + ret = RegGetValueW(this->hkeyProgID, L"DefaultIcon", NULL, RRF_RT_REG_SZ, NULL, icon, &size); if (ret == ERROR_SUCCESS) { hr = this->ReturnString(flags, pszOut, pcchOut, icon, strlenW(icon) + 1); @@ -388,8 +378,7 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetString( } case ASSOCSTR_SHELLEXTENSION: { - static const WCHAR shellexW[] = L"ShellEx\\"; - WCHAR keypath[sizeof(shellexW) / sizeof(shellexW[0]) + 39], guid[39]; + WCHAR keypath[ARRAY_SIZE(L"ShellEx\\") + 39], guid[39]; CLSID clsid; HKEY hkey; @@ -398,7 +387,7 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetString( { return hr; } - strcpyW(keypath, shellexW); + strcpyW(keypath, L"ShellEx\\"); strcatW(keypath, pszExtra); LONG ret = RegOpenKeyExW(this->hkeySource, keypath, 0, KEY_READ, &hkey); if (ret) @@ -467,8 +456,6 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetKey( */ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetData(ASSOCF cfFlags, ASSOCDATA assocdata, LPCWSTR pszExtra, LPVOID pvOut, DWORD *pcbOut) { - static const WCHAR edit_flags[] = L"EditFlags"; - TRACE("(%p,0x%8x,0x%8x,%s,%p,%p)\n", this, cfFlags, assocdata, debugstr_w(pszExtra), pvOut, pcbOut); @@ -488,7 +475,7 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetData(ASSOCF cfFlags, ASSOCDATA void *data; DWORD size; - HRESULT hres = this->GetValue(this->hkeyProgID, edit_flags, &data, &size); + HRESULT hres = this->GetValue(this->hkeyProgID, L"EditFlags", &data, &size); if(FAILED(hres)) { return hres; @@ -582,8 +569,6 @@ HRESULT CQueryAssociations::GetCommand(const WCHAR *extra, WCHAR **command) LONG ret; WCHAR *extra_from_reg = NULL; WCHAR *filetype; - static const WCHAR commandW[] = L"command"; - static const WCHAR shellW[] = L"shell"; /* When looking for file extension it's possible to have a default value that points to another key that contains 'shell/<verb>/command' subtree. */ @@ -597,17 +582,17 @@ HRESULT CQueryAssociations::GetCommand(const WCHAR *extra, WCHAR **command) if (ret == ERROR_SUCCESS) { - ret = RegOpenKeyExW(hkeyFile, shellW, 0, KEY_READ, &hkeyShell); + ret = RegOpenKeyExW(hkeyFile, L"shell", 0, KEY_READ, &hkeyShell); RegCloseKey(hkeyFile); } else { - ret = RegOpenKeyExW(this->hkeySource, shellW, 0, KEY_READ, &hkeyShell); + ret = RegOpenKeyExW(this->hkeySource, L"shell", 0, KEY_READ, &hkeyShell); } } else { - ret = RegOpenKeyExW(this->hkeySource, shellW, 0, KEY_READ, &hkeyShell); + ret = RegOpenKeyExW(this->hkeySource, L"shell", 0, KEY_READ, &hkeyShell); } if (ret) @@ -659,7 +644,7 @@ HRESULT CQueryAssociations::GetCommand(const WCHAR *extra, WCHAR **command) return HRESULT_FROM_WIN32(ret); } /* open command subkey */ - ret = RegOpenKeyExW(hkeyVerb, commandW, 0, KEY_READ, &hkeyCommand); + ret = RegOpenKeyExW(hkeyVerb, L"command", 0, KEY_READ, &hkeyCommand); RegCloseKey(hkeyVerb); if (ret) { diff --git a/dll/win32/shell32/dialogs/dialogs.cpp b/dll/win32/shell32/dialogs/dialogs.cpp index 832e32c8a96..73de2f363ac 100644 --- a/dll/win32/shell32/dialogs/dialogs.cpp +++ b/dll/win32/shell32/dialogs/dialogs.cpp @@ -435,7 +435,6 @@ static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline) { const WCHAR *src; WCHAR *dest, *result, *result_end=NULL; - static const WCHAR dotexeW[] = L".exe"; result = (WCHAR *)HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*(strlenW(cmdline)+5)); @@ -466,7 +465,7 @@ static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline) *dest = 0; if (INVALID_FILE_ATTRIBUTES != GetFileAttributesW(result)) break; - strcatW(dest, dotexeW); + strcatW(dest, L".exe"); if (INVALID_FILE_ATTRIBUTES != GetFileAttributesW(result)) break; } diff --git a/dll/win32/shell32/dialogs/view.cpp b/dll/win32/shell32/dialogs/view.cpp index 648915a0441..e8603d345d3 100644 --- a/dll/win32/shell32/dialogs/view.cpp +++ b/dll/win32/shell32/dialogs/view.cpp @@ -441,9 +441,6 @@ ViewTree_LoadTree(HKEY hKey, LPCWSTR pszKeyName, DWORD dwParentID) static BOOL ViewTree_LoadAll(VOID) { - static const WCHAR s_szAdvanced[] = - L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"; - // free if already existed if (s_ViewTreeEntries) { @@ -453,8 +450,9 @@ static BOOL ViewTree_LoadAll(VOID) s_ViewTreeEntryCount = 0; HKEY hKey; - if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, s_szAdvanced, 0, - KEY_READ, &hKey) != ERROR_SUCCESS) + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", + 0, KEY_READ, &hKey) != ERROR_SUCCESS) { return FALSE; // failure } diff --git a/dll/win32/shell32/folders/CControlPanelFolder.cpp b/dll/win32/shell32/folders/CControlPanelFolder.cpp index e4133520100..c4d9eddf670 100644 --- a/dll/win32/shell32/folders/CControlPanelFolder.cpp +++ b/dll/win32/shell32/folders/CControlPanelFolder.cpp @@ -623,10 +623,9 @@ HRESULT WINAPI CControlPanelFolder::Initialize(PCIDLIST_ABSOLUTE pidl) /* Create the inner reg folder */ HRESULT hr; - static const WCHAR* pszCPanelPath = L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"; hr = CRegFolder_CreateInstance(&CLSID_ControlPanel, pidlRoot, - pszCPanelPath, + L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}", L"ControlPanel", IID_PPV_ARG(IShellFolder2, &m_regFolder)); if (FAILED_UNEXPECTEDLY(hr)) diff --git a/dll/win32/shell32/folders/CDrivesFolder.cpp b/dll/win32/shell32/folders/CDrivesFolder.cpp index 35c4952c060..a64182e1dc9 100644 --- a/dll/win32/shell32/folders/CDrivesFolder.cpp +++ b/dll/win32/shell32/folders/CDrivesFolder.cpp @@ -411,8 +411,6 @@ getIconLocationForDrive(IShellFolder *psf, PCITEMID_CHILD pidl, UINT uFlags, WCHAR wszPath[MAX_PATH]; WCHAR wszAutoRunInfPath[MAX_PATH]; WCHAR wszValue[MAX_PATH], wszTemp[MAX_PATH]; - static const WCHAR wszAutoRunInf[] = { 'a','u','t','o','r','u','n','.','i','n','f',0 }; - static const WCHAR wszAutoRun[] = { 'a','u','t','o','r','u','n',0 }; // get path if (!ILGetDisplayNameExW(psf, pidl, wszPath, 0)) @@ -422,10 +420,10 @@ getIconLocationForDrive(IShellFolder *psf, PCITEMID_CHILD pidl, UINT uFlags, // build the full path of autorun.inf StringCchCopyW(wszAutoRunInfPath, _countof(wszAutoRunInfPath), wszPath); - PathAppendW(wszAutoRunInfPath, wszAutoRunInf); + PathAppendW(wszAutoRunInfPath, L"autorun.inf"); // autorun.inf --> wszValue - if (GetPrivateProfileStringW(wszAutoRun, L"icon", NULL, wszValue, _countof(wszValue), + if (GetPrivateProfileStringW(L"autorun", L"icon", NULL, wszValue, _countof(wszValue), wszAutoRunInfPath) && wszValue[0] != 0) { // wszValue --> wszTemp @@ -977,8 +975,6 @@ HRESULT WINAPI CDrivesFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFla { WCHAR wszDrive[18] = {0}; DWORD dwVolumeSerialNumber, dwMaximumComponentLength, dwFileSystemFlags; - static const WCHAR wszOpenBracket[] = {' ', '(', 0}; - static const WCHAR wszCloseBracket[] = {')', 0}; lstrcpynW(wszDrive, pszPath, 4); pszPath[0] = L'\0'; @@ -1012,10 +1008,10 @@ HRESULT WINAPI CDrivesFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFla pszPath[MAX_PATH-7] = L'\0'; } } - wcscat (pszPath, wszOpenBracket); + wcscat (pszPath, L" ("); wszDrive[2] = L'\0'; wcscat (pszPath, wszDrive); - wcscat (pszPath, wszCloseBracket); + wcscat (pszPath, L")"); } if (SUCCEEDED(hr)) diff --git a/dll/win32/shell32/folders/CFSFolder.cpp b/dll/win32/shell32/folders/CFSFolder.cpp index b1c578ada8b..72325d3973b 100644 --- a/dll/win32/shell32/folders/CFSFolder.cpp +++ b/dll/win32/shell32/folders/CFSFolder.cpp @@ -136,9 +136,7 @@ HRESULT GetCLSIDForFileType(PCUIDLIST_RELATIVE pidl, LPCWSTR KeyName, CLSID* pcl static HRESULT getDefaultIconLocation(LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT uFlags) { - static const WCHAR folder[] = { 'F', 'o', 'l', 'd', 'e', 'r', 0 }; - - if (!HCR_GetIconW(folder, szIconFile, NULL, cchMax, piIndex)) + if (!HCR_GetIconW(L"Folder", szIconFile, NULL, cchMax, piIndex)) { lstrcpynW(szIconFile, swShell32Name, cchMax); *piIndex = -IDI_SHELL_FOLDER; @@ -156,12 +154,10 @@ getDefaultIconLocation(LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT uFlags return S_OK; } -static const WCHAR s_shellClassInfo[] = { '.', 'S', 'h', 'e', 'l', 'l', 'C', 'l', 'a', 's', 's', 'I', 'n', 'f', 'o', 0 }; - static BOOL getShellClassInfo(LPCWSTR Entry, LPWSTR pszValue, DWORD cchValueLen, LPCWSTR IniFile) { - return GetPrivateProfileStringW(s_shellClassInfo, Entry, NULL, pszValue, cchValueLen, IniFile); + return GetPrivateProfileStringW(L".ShellClassInfo", Entry, NULL, pszValue, cchValueLen, IniFile); } static HRESULT @@ -171,12 +167,6 @@ getIconLocationForFolder(IShellFolder * psf, PCITEMID_CHILD pidl, UINT uFlags, DWORD dwFileAttrs; WCHAR wszPath[MAX_PATH]; WCHAR wszIniFullPath[MAX_PATH]; - static const WCHAR iconFile[] = { 'I', 'c', 'o', 'n', 'F', 'i', 'l', 'e', 0 }; - static const WCHAR clsid[] = { 'C', 'L', 'S', 'I', 'D', 0 }; - static const WCHAR clsid2[] = { 'C', 'L', 'S', 'I', 'D', '2', 0 }; - static const WCHAR iconIndex[] = { 'I', 'c', 'o', 'n', 'I', 'n', 'd', 'e', 'x', 0 }; - static const WCHAR iconResource[] = { 'I', 'c', 'o', 'n', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 0 }; - static const WCHAR wszDesktopIni[] = { 'd','e','s','k','t','o','p','.','i','n','i',0 }; if (uFlags & GIL_DEFAULTICON) goto Quit; @@ -194,10 +184,10 @@ getIconLocationForFolder(IShellFolder * psf, PCITEMID_CHILD pidl, UINT uFlags, // build the full path of ini file StringCchCopyW(wszIniFullPath, _countof(wszIniFullPath), wszPath); - PathAppendW(wszIniFullPath, wszDesktopIni); + PathAppendW(wszIniFullPath, L"desktop.ini"); WCHAR wszValue[MAX_PATH], wszTemp[MAX_PATH]; - if (getShellClassInfo(iconFile, wszValue, _countof(wszValue), wszIniFullPath)) + if (getShellClassInfo(L"IconFile", wszValue, _countof(wszValue), wszIniFullPath)) { // wszValue --> wszTemp ExpandEnvironmentStringsW(wszValue, wszTemp, _countof(wszTemp)); @@ -211,20 +201,20 @@ getIconLocationForFolder(IShellFolder * psf, PCITEMID_CHILD pidl, UINT uFlags, // wszPath --> szIconFile GetFullPathNameW(wszPath, cchMax, szIconFile, NULL); - *piIndex = GetPrivateProfileIntW(s_shellClassInfo, iconIndex, 0, wszIniFullPath); + *piIndex = GetPrivateProfileIntW(L".ShellClassInfo", L"IconIndex", 0, wszIniFullPath); return S_OK; } - else if (getShellClassInfo(clsid, wszValue, _countof(wszValue), wszIniFullPath) && + else if (getShellClassInfo(L"CLSID", wszValue, _countof(wszValue), wszIniFullPath) && HCR_GetIconW(wszValue, szIconFile, NULL, cchMax, piIndex)) { return S_OK; } - else if (getShellClassInfo(clsid2, wszValue, _countof(wszValue), wszIniFullPath) && + else if (getShellClassInfo(L"CLSID2", wszValue, _countof(wszValue), wszIniFullPath) && HCR_GetIconW(wszValue, szIconFile, NULL, cchMax, piIndex)) { return S_OK; } - else if (getShellClassInfo(iconResource, wszValue, _countof(wszValue), wszIniFullPath)) + else if (getShellClassInfo(L"IconResource", wszValue, _countof(wszValue), wszIniFullPath)) { // wszValue --> wszTemp ExpandEnvironmentStringsW(wszValue, wszTemp, _countof(wszTemp)); @@ -590,6 +580,7 @@ static HRESULT SHELL32_GetCLSIDForDirectory(LPCWSTR pwszDir, LPCWSTR KeyName, CL { WCHAR wszCLSIDValue[CHARS_IN_GUID]; WCHAR wszDesktopIni[MAX_PATH]; + StringCchCopyW(wszDesktopIni, MAX_PATH, pwszDir); StringCchCatW(wszDesktopIni, MAX_PATH, L"\\desktop.ini"); @@ -1265,10 +1256,6 @@ HRESULT WINAPI CFSFolder::GetUIObjectOf(HWND hwndOwner, return hr; } -static const WCHAR AdvancedW[] = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"; -static const WCHAR HideFileExtW[] = L"HideFileExt"; -static const WCHAR NeverShowExtW[] = L"NeverShowExt"; - /****************************************************************************** * SHELL_FS_HideExtension [Internal] * @@ -1289,11 +1276,12 @@ BOOL SHELL_FS_HideExtension(LPCWSTR szPath) BOOL doHide = FALSE; /* The default value is FALSE (win98 at least) */ LONG lError; - lError = RegCreateKeyExW(HKEY_CURRENT_USER, AdvancedW, 0, NULL, 0, KEY_ALL_ACCESS, NULL, + lError = RegCreateKeyExW(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", + 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey, NULL); if (lError == ERROR_SUCCESS) { - lError = RegQueryValueExW(hKey, HideFileExtW, NULL, NULL, (LPBYTE)&dwData, &dwDataSize); + lError = RegQueryValueExW(hKey, L"HideFileExt", NULL, NULL, (LPBYTE)&dwData, &dwDataSize); if (lError == ERROR_SUCCESS) doHide = dwData; RegCloseKey(hKey); @@ -1312,7 +1300,7 @@ BOOL SHELL_FS_HideExtension(LPCWSTR szPath) lError = RegOpenKeyW(HKEY_CLASSES_ROOT, classname, &hKey); if (lError == ERROR_SUCCESS) { - lError = RegQueryValueExW(hKey, NeverShowExtW, NULL, NULL, NULL, NULL); + lError = RegQueryValueExW(hKey, L"NeverShowExt", NULL, NULL, NULL, NULL); if (lError == ERROR_SUCCESS) doHide = TRUE; @@ -1716,13 +1704,10 @@ HRESULT WINAPI CFSFolder::GetFolderTargetInfo(PERSIST_FOLDER_TARGET_INFO * ppfti HRESULT CFSFolder::_CreateExtensionUIObject(PCUIDLIST_RELATIVE pidl, REFIID riid, LPVOID *ppvOut) { - static const WCHAR formatW[] = {'S','h','e','l','l','E','x','\\', - '{','%','0','8','x','-','%','0','4','x','-','%','0','4','x','-', - '%','0','2','x','%','0','2','x','-','%','0','2','x','%','0','2','x', - '%','0','2','x','%','0','2','x','%','0','2','x','%','0','2','x','}',0}; WCHAR buf[MAX_PATH]; - sprintfW(buf, formatW, riid.Data1, riid.Data2, riid.Data3, + sprintfW(buf, L"ShellEx\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", + riid.Data1, riid.Data2, riid.Data3, riid.Data4[0], riid.Data4[1], riid.Data4[2], riid.Data4[3], riid.Data4[4], riid.Data4[5], riid.Data4[6], riid.Data4[7]); diff --git a/dll/win32/shell32/folders/CRegFolder.cpp b/dll/win32/shell32/folders/CRegFolder.cpp index 77a2b323a8b..71e5e062eb8 100644 --- a/dll/win32/shell32/folders/CRegFolder.cpp +++ b/dll/win32/shell32/folders/CRegFolder.cpp @@ -141,14 +141,9 @@ HRESULT CGuidItemExtractIcon_CreateInstance(LPCITEMIDLIST pidl, REFIID iid, LPVO return E_FAIL; /* my computer and other shell extensions */ - static const WCHAR fmt[] = { 'C', 'L', 'S', 'I', 'D', '\\', - '{', '%', '0', '8', 'l', 'x', '-', '%', '0', '4', 'x', '-', '%', '0', '4', 'x', '-', - '%', '0', '2', 'x', '%', '0', '2', 'x', '-', '%', '0', '2', 'x', '%', '0', '2', 'x', - '%', '0', '2', 'x', '%', '0', '2', 'x', '%', '0', '2', 'x', '%', '0', '2', 'x', '}', 0 - }; WCHAR xriid[50]; - swprintf(xriid, fmt, + swprintf(xriid, L"CLSID\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", riid->Data1, riid->Data2, riid->Data3, riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7]); @@ -156,8 +151,6 @@ HRESULT CGuidItemExtractIcon_CreateInstance(LPCITEMIDLIST pidl, REFIID iid, LPVO const WCHAR* iconname = NULL; if (_ILIsBitBucket(pidl)) { - static const WCHAR szFull[] = {'F','u','l','l',0}; - static const WCHAR szEmpty[] = {'E','m','p','t','y',0}; CComPtr<IEnumIDList> EnumIDList; CoInitialize(NULL); @@ -175,9 +168,9 @@ HRESULT CGuidItemExtractIcon_CreateInstance(LPCITEMIDLIST pidl, REFIID iid, LPVO if (SUCCEEDED(hr) && (hr = EnumIDList->Next(1, &pidl, &itemcount)) == S_OK) { CoTaskMemFree(pidl); - iconname = szFull; + iconname = L"Full"; } else { - iconname = szEmpty; + iconname = L"Empty"; } } @@ -225,12 +218,13 @@ CRegFolderEnum::~CRegFolderEnum() HRESULT CRegFolderEnum::Initialize(LPCWSTR lpszEnumKeyName, DWORD dwFlags) { WCHAR KeyName[MAX_PATH]; - static const WCHAR KeyNameFormat[] = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\%s\\Namespace"; if (!(dwFlags & SHCONTF_FOLDERS)) return S_OK; - HRESULT hr = StringCchPrintfW(KeyName, MAX_PATH, KeyNameFormat, lpszEnumKeyName); + HRESULT hr = StringCchPrintfW(KeyName, MAX_PATH, + L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\%s\\Namespace", + lpszEnumKeyName); if (FAILED_UNEXPECTEDLY(hr)) return hr; diff --git a/dll/win32/shell32/iconcache.cpp b/dll/win32/shell32/iconcache.cpp index 6560bae2de2..9a55f0f9fc0 100644 --- a/dll/win32/shell32/iconcache.cpp +++ b/dll/win32/shell32/iconcache.cpp @@ -659,32 +659,26 @@ static int SIC_LoadOverlayIcon(int icon_idx) LPCWSTR iconPath; int iconIdx; - static const WCHAR wszShellIcons[] = { - 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\', - 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', - 'E','x','p','l','o','r','e','r','\\','S','h','e','l','l',' ','I','c','o','n','s',0 - }; - static const WCHAR wszNumFmt[] = {'%','d',0}; - iconPath = swShell32Name; /* default: load icon from shell32.dll */ iconIdx = icon_idx; - if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, wszShellIcons, 0, KEY_READ, &hKeyShellIcons) == ERROR_SUCCESS) + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons", + 0, KEY_READ, &hKeyShellIcons) == ERROR_SUCCESS) { DWORD count = sizeof(buffer); - swprintf(wszIdx, wszNumFmt, icon_idx); + swprintf(wszIdx, L"%d", icon_idx); /* read icon path and index */ if (RegQueryValueExW(hKeyShellIcons, wszIdx, NULL, NULL, (LPBYTE)buffer, &count) == ERROR_SUCCESS) { - LPWSTR p = wcschr(buffer, ','); + LPWSTR p = wcschr(buffer, ','); - if (p) - *p++ = 0; + if (p) + *p++ = 0; - iconPath = buffer; - iconIdx = _wtoi(p); + iconPath = buffer; + iconIdx = _wtoi(p); } RegCloseKey(hKeyShellIcons); diff --git a/dll/win32/shell32/shlexec.cpp b/dll/win32/shell32/shlexec.cpp index d5bdf5452e6..955d2af840e 100644 --- a/dll/win32/shell32/shlexec.cpp +++ b/dll/win32/shell32/shlexec.cpp @@ -25,10 +25,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(exec); -static const WCHAR wszOpen[] = L"open"; -static const WCHAR wszExe[] = L".exe"; -static const WCHAR wszCom[] = L".com"; - #define SEE_MASK_CLASSALL (SEE_MASK_CLASSNAME | SEE_MASK_CLASSKEY) typedef UINT_PTR (*SHELL_ExecuteW32)(const WCHAR *lpCmd, WCHAR *env, BOOL shWait, @@ -270,7 +266,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, DWORD len, const WCHAR* fmt, const WCHAR* if (!done || (*fmt == '1')) { /*FIXME Is the call to SearchPathW() really needed? We already have separated out the parameter string in args. */ - if (SearchPathW(lpDir, lpFile, wszExe, sizeof(xlpFile) / sizeof(WCHAR), xlpFile, NULL)) + if (SearchPathW(lpDir, lpFile, L".exe", ARRAY_SIZE(xlpFile), xlpFile, NULL)) cmd = xlpFile; else cmd = lpFile; @@ -353,7 +349,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, DWORD len, const WCHAR* fmt, const WCHAR* pv = SHLockShared(hmem, 0); chars = swprintf(buf, L":%p", pv); - if (chars >= sizeof(buf) / sizeof(WCHAR)) + if (chars >= ARRAY_SIZE(buf)) ERR("pidl format buffer too small!\n"); used += chars; @@ -547,7 +543,6 @@ static UINT_PTR SHELL_ExecuteW(const WCHAR *lpCmd, WCHAR *env, BOOL shWait, */ static LPWSTR SHELL_BuildEnvW( const WCHAR *path ) { - static const WCHAR wPath[] = L"PATH="; WCHAR *strings, *new_env; WCHAR *p, *p2; int total = wcslen(path) + 1; @@ -558,7 +553,7 @@ static LPWSTR SHELL_BuildEnvW( const WCHAR *path ) while (*p) { int len = wcslen(p) + 1; - if (!_wcsnicmp( p, wPath, 5 )) got_path = TRUE; + if (!_wcsnicmp( p, L"PATH=", 5 )) got_path = TRUE; total += len; p += len; } @@ -576,7 +571,7 @@ static LPWSTR SHELL_BuildEnvW( const WCHAR *path ) { int len = wcslen(p) + 1; memcpy(p2, p, len * sizeof(WCHAR)); - if (!_wcsnicmp( p, wPath, 5 )) + if (!_wcsnicmp( p, L"PATH=", 5 )) { p2[len - 1] = ';'; wcscpy( p2 + len, path ); @@ -587,7 +582,7 @@ static LPWSTR SHELL_BuildEnvW( const WCHAR *path ) } if (!got_path) { - wcscpy(p2, wPath); + wcscpy(p2, L"PATH="); wcscat(p2, path); p2 += wcslen(p2) + 1; } @@ -620,7 +615,7 @@ static BOOL SHELL_TryAppPathW( LPCWSTR szName, LPWSTR lpResult, WCHAR **env) if (res) { // Add ".exe" extension, if extension does not exists - if (PathAddExtensionW(buffer, wszExe)) + if (PathAddExtensionW(buffer, L".exe")) { res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, buffer, 0, KEY_READ, &hkApp); } @@ -664,20 +659,19 @@ end: */ static UINT SHELL_FindExecutableByVerb(LPCWSTR lpVerb, LPWSTR key, LPWSTR classname, LPWSTR command, LONG commandlen) { - static const WCHAR wCommand[] = L"\\command"; HKEY hkeyClass; WCHAR verb[MAX_PATH]; if (RegOpenKeyExW(HKEY_CLASSES_ROOT, classname, 0, 0x02000000, &hkeyClass)) return SE_ERR_NOASSOC; - if (!HCR_GetDefaultVerbW(hkeyClass, lpVerb, verb, sizeof(verb) / sizeof(verb[0]))) + if (!HCR_GetDefaultVerbW(hkeyClass, lpVerb, verb, ARRAY_SIZE(verb))) return SE_ERR_NOASSOC; RegCloseKey(hkeyClass); /* Looking for ...buffer\shell\<verb>\command */ wcscat(classname, L"\\shell\\"); wcscat(classname, verb); - wcscat(classname, wCommand); + wcscat(classname, L"\\command"); if (RegQueryValueW(HKEY_CLASSES_ROOT, classname, command, &commandlen) == ERROR_SUCCESS) @@ -688,7 +682,6 @@ static UINT SHELL_FindExecutableByVerb(LPCWSTR lpVerb, LPWSTR key, LPWSTR classn LPWSTR tmp; WCHAR param[256]; LONG paramlen = sizeof(param); - static const WCHAR wSpace[] = {' ', 0}; /* FIXME: it seems all Windows version don't behave the same here. * the doc states that this ddeexec information can be found after @@ -697,14 +690,14 @@ static UINT SHELL_FindExecutableByVerb(LPCWSTR lpVerb, LPWSTR key, LPWSTR classn */ /* Get the parameters needed by the application from the associated ddeexec key */ - tmp = strstrW(classname, wCommand); + tmp = strstrW(classname, L"\\command"); tmp[0] = '\0'; wcscat(classname, wDdeexec); if (RegQueryValueW(HKEY_CLASSES_ROOT, classname, param, ¶mlen) == ERROR_SUCCESS) { paramlen /= sizeof(WCHAR); - wcscat(command, wSpace); + wcscat(command, L" "); wcscat(command, param); commandlen += paramlen; } @@ -768,13 +761,13 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb, return 33; } - if (SearchPathW(lpPath, lpFile, wszExe, sizeof(xlpFile) / sizeof(WCHAR), xlpFile, NULL)) + if (SearchPathW(lpPath, lpFile, L".exe", ARRAY_SIZE(xlpFile), xlpFile, NULL)) { TRACE("SearchPathW returned non-zero\n"); lpFile = xlpFile; /* The file was found in the application-supplied default directory (or the system search path) */ } - else if (lpPath && SearchPathW(NULL, lpFile, wszExe, sizeof(xlpFile)/sizeof(WCHAR), xlpFile, NULL)) + else if (lpPath && SearchPathW(NULL, lpFile, L".exe", ARRAY_SIZE(xlpFile), xlpFile, NULL)) { TRACE("SearchPathW returned non-zero\n"); lpFile = xlpFile; @@ -817,7 +810,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb, /* See if it's a program - if GetProfileString fails, we skip this * section. Actually, if GetProfileString fails, we've probably * got a lot more to worry about than running a program... */ - if (GetProfileStringW(L"windows", L"programs", L"exe pif bat cmd com", wBuffer, sizeof(wBuffer) / sizeof(WCHAR)) > 0) + if (GetProfileStringW(L"windows", L"programs", L"exe pif bat cmd com", wBuffer, ARRAY_SIZE(wBuffer)) > 0) { CharLowerW(wBuffer); tok = wBuffer; @@ -849,7 +842,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb, &classnamelen) == ERROR_SUCCESS) { classnamelen /= sizeof(WCHAR); - if (classnamelen == sizeof(classname) / sizeof(WCHAR)) + if (classnamelen == ARRAY_SIZE(classname)) classnamelen--; classname[classnamelen] = '\0'; @@ -897,7 +890,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb, { /* Toss the leading dot */ extension++; - if (GetProfileStringW(L"extensions", extension, L"", command, sizeof(command) / sizeof(WCHAR)) > 0) + if (GetProfileStringW(L"extensions", extension, L"", command, ARRAY_SIZE(command)) > 0) { if (wcslen(command) != 0) { @@ -966,33 +959,30 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec unsigned ret = SE_ERR_NOASSOC; BOOL unicode = !(GetVersion() & 0x80000000); - if (strlenW(key) + 1 > sizeof(regkey) / sizeof(regkey[0])) + if (strlenW(key) + 1 > ARRAY_SIZE(regkey)) { FIXME("input parameter %s larger than buffer\n", debugstr_w(key)); return 2; } wcscpy(regkey, key); - static const WCHAR wApplication[] = L"\\application"; - endkeyLen = sizeof(regkey) / sizeof(regkey[0]) - (endkey - regkey); - if (strlenW(wApplication) + 1 > endkeyLen) + endkeyLen = ARRAY_SIZE(regkey) - (endkey - regkey); + if (strlenW(L"\\application") + 1 > endkeyLen) { - FIXME("endkey %s overruns buffer\n", debugstr_w(wApplication)); + FIXME("endkey %s overruns buffer\n", debugstr_w(L"\\application")); return 2; } - wcscpy(endkey, wApplication); + wcscpy(endkey, L"\\application"); applen = sizeof(app); if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, app, &applen) != ERROR_SUCCESS) { WCHAR command[1024], fullpath[MAX_PATH]; - static const WCHAR wSo[] = L".so"; - DWORD sizeSo = sizeof(wSo) / sizeof(WCHAR); LPWSTR ptr = NULL; DWORD ret = 0; /* Get application command from start string and find filename of application */ if (*start == '"') { - if (strlenW(start + 1) + 1 > sizeof(command) / sizeof(command[0])) + if (strlenW(start + 1) + 1 > ARRAY_SIZE(command)) { FIXME("size of input parameter %s larger than buffer\n", debugstr_w(start + 1)); @@ -1001,7 +991,7 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec wcscpy(command, start + 1); if ((ptr = wcschr(command, '"'))) * ptr = 0; - ret = SearchPathW(NULL, command, wszExe, sizeof(fullpath) / sizeof(WCHAR), fullpath, &ptr); + ret = SearchPathW(NULL, command, L".exe", ARRAY_SIZE(fullpath), fullpath, &ptr); } else { @@ -1012,11 +1002,11 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec int idx = space - start; memcpy(command, start, idx * sizeof(WCHAR)); command[idx] = '\0'; - if ((ret = SearchPathW(NULL, command, wszExe, sizeof(fullpath) / sizeof(WCHAR), fullpath, &ptr))) + if ((ret = SearchPathW(NULL, command, L".exe", ARRAY_SIZE(fullpath), fullpath, &ptr))) break; } if (!ret) - ret = SearchPathW(NULL, start, wszExe, sizeof(fullpath) / sizeof(WCHAR), fullpath, &ptr); + ret = SearchPathW(NULL, start, L".exe", ARRAY_SIZE(fullpath), fullpath, &ptr); } if (!ret) @@ -1024,7 +1014,7 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec ERR("Unable to find application path for command %s\n", debugstr_w(start)); return ERROR_ACCESS_DENIED; } - if (strlenW(ptr) + 1 > sizeof(app) / sizeof(app[0])) + if (strlenW(ptr) + 1 > ARRAY_SIZE(app)) { FIXME("size of found path %s larger than buffer\n", debugstr_w(ptr)); return 2; @@ -1032,9 +1022,8 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec wcscpy(app, ptr); /* Remove extensions (including .so) */ - ptr = app + wcslen(app) - (sizeSo - 1); - if (wcslen(app) >= sizeSo && - !wcscmp(ptr, wSo)) + ptr = app + wcslen(app) - 3; + if (ptr > app && !wcscmp(ptr, L".so")) *ptr = 0; ptr = const_cast<LPWSTR>(strrchrW(app, '.')); @@ -1042,13 +1031,12 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec *ptr = 0; } - static const WCHAR wTopic[] = L"\\topic"; - if (strlenW(wTopic) + 1 > endkeyLen) + if (strlenW(L"\\topic") + 1 > endkeyLen) { - FIXME("endkey %s overruns buffer\n", debugstr_w(wTopic)); + FIXME("endkey %s overruns buffer\n", debugstr_w(L"\\topic")); return 2; } - wcscpy(endkey, wTopic); + wcscpy(endkey, L"\\topic"); topiclen = sizeof(topic); if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, topic, &topiclen) != ERROR_SUCCESS) { @@ -1104,13 +1092,12 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec SetLastError(ERROR_DDE_FAIL); return 30; /* whatever */ } - static const WCHAR wIfexec[] = L"\\ifexec"; - if (strlenW(wIfexec) + 1 > endkeyLen) + if (strlenW(L"\\ifexec") + 1 > endkeyLen) { - FIXME("endkey %s overruns buffer\n", debugstr_w(wIfexec)); + FIXME("endkey %s overruns buffer\n", debugstr_w(L"\\ifexec")); return 2; } - strcpyW(endkey, wIfexec); + strcpyW(endkey, L"\\ifexec"); ifexeclen = sizeof(ifexec); if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, ifexec, &ifexeclen) == ERROR_SUCCESS) { @@ -1118,8 +1105,8 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec } } - SHELL_ArgifyW(static_res, sizeof(static_res)/sizeof(WCHAR), exec, lpFile, pidl, szCommandline, &resultLen, NULL); - if (resultLen > sizeof(static_res)/sizeof(WCHAR)) + SHELL_ArgifyW(static_res, ARRAY_SIZE(static_res), exec, lpFile, pidl, szCommandline, &resultLen, NULL); + if (resultLen > ARRAY_SIZE(static_res)) { res = dynamic_res = static_cast<WCHAR *>(HeapAlloc(GetProcessHeap(), 0, resultLen * sizeof(WCHAR))); SHELL_ArgifyW(dynamic_res, resultLen, exec, lpFile, pidl, szCommandline, NULL, NULL); @@ -1185,12 +1172,12 @@ static UINT_PTR execute_from_key(LPCWSTR key, LPCWSTR lpFile, WCHAR *env, /* Is there a replace() function anywhere? */ cmdlen /= sizeof(WCHAR); - if (cmdlen >= sizeof(cmd) / sizeof(WCHAR)) - cmdlen = sizeof(cmd) / sizeof(WCHAR) - 1; + if (cmdlen >= ARRAY_SIZE(cmd)) + cmdlen = ARRAY_SIZE(cmd) - 1; cmd[cmdlen] = '\0'; - SHELL_ArgifyW(param, sizeof(param) / sizeof(WCHAR), cmd, lpFile, (LPITEMIDLIST)psei->lpIDList, szCommandline, &resultLen, + SHELL_ArgifyW(param, ARRAY_SIZE(param), cmd, lpFile, (LPITEMIDLIST)psei->lpIDList, szCommandline, &resultLen, (psei->lpDirectory && *psei->lpDirectory) ? psei->lpDirectory : NULL); - if (resultLen > sizeof(param) / sizeof(WCHAR)) + if (resultLen > ARRAY_SIZE(param)) ERR("Argify buffer not large enough, truncating\n"); } @@ -1277,11 +1264,11 @@ HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpR if (lpDirectory) { - GetCurrentDirectoryW(sizeof(old_dir) / sizeof(WCHAR), old_dir); + GetCurrentDirectoryW(ARRAY_SIZE(old_dir), old_dir); SetCurrentDirectoryW(lpDirectory); } - retval = SHELL_FindExecutable(lpDirectory, lpFile, wszOpen, res, MAX_PATH, NULL, NULL, NULL, NULL); + retval = SHELL_FindExecutable(lpDirectory, lpFile, L"open", res, MAX_PATH, NULL, NULL, NULL, NULL); if (retval > 32) strcpyW(lpResult, res); @@ -1522,7 +1509,7 @@ static LONG ShellExecute_FromContextMenu( LPSHELLEXECUTEINFOW sei ) i = 0; while (1) { - r = RegEnumKeyW(hkeycm, i++, szguid, sizeof(szguid) / sizeof(szguid[0])); + r = RegEnumKeyW(hkeycm, i++, szguid, ARRAY_SIZE(szguid)); if (r != ERROR_SUCCESS) break; @@ -1569,7 +1556,7 @@ static UINT_PTR SHELL_execute_class(LPCWSTR wszApplicationName, LPSHELLEXECUTEIN TRACE("SEE_MASK_CLASSNAME->%s, doc->%s\n", debugstr_w(execCmd), debugstr_w(wszApplicationName)); wcmd[0] = '\0'; - done = SHELL_ArgifyW(wcmd, sizeof(wcmd) / sizeof(WCHAR), execCmd, wszApplicationName, (LPITEMIDLIST)psei->lpIDList, NULL, &resultLen, + done = SHELL_ArgifyW(wcmd, ARRAY_SIZE(wcmd), execCmd, wszApplicationName, (LPITEMIDLIST)psei->lpIDList, NULL, &resultLen, (psei->lpDirectory && *psei->lpDirectory) ? psei->lpDirectory : NULL); if (!done && wszApplicationName[0]) { @@ -1583,7 +1570,7 @@ static UINT_PTR SHELL_execute_class(LPCWSTR wszApplicationName, LPSHELLEXECUTEIN else strcatW(wcmd, wszApplicationName); } - if (resultLen > sizeof(wcmd) / sizeof(WCHAR)) + if (resultLen > ARRAY_SIZE(wcmd)) ERR("Argify buffer not large enough... truncating\n"); return execfunc(wcmd, NULL, FALSE, psei, psei_out); } @@ -1603,22 +1590,21 @@ static UINT_PTR SHELL_execute_class(LPCWSTR wszApplicationName, LPSHELLEXECUTEIN static BOOL SHELL_translate_idlist(LPSHELLEXECUTEINFOW sei, LPWSTR wszParameters, DWORD parametersLen, LPWSTR wszApplicationName, DWORD dwApplicationNameLen) { - static const WCHAR wExplorer[] = L"explorer.exe"; WCHAR buffer[MAX_PATH]; BOOL appKnownSingular = FALSE; /* last chance to translate IDList: now also allow CLSID paths */ - if (SUCCEEDED(SHELL_GetPathFromIDListForExecuteW((LPCITEMIDLIST)sei->lpIDList, buffer, sizeof(buffer)/sizeof(WCHAR)))) { + if (SUCCEEDED(SHELL_GetPathFromIDListForExecuteW((LPCITEMIDLIST)sei->lpIDList, buffer, ARRAY_SIZE(buffer)))) { if (buffer[0] == ':' && buffer[1] == ':') { /* open shell folder for the specified class GUID */ if (strlenW(buffer) + 1 > parametersLen) ERR("parameters len exceeds buffer size (%i > %i), truncating\n", lstrlenW(buffer) + 1, parametersLen); lstrcpynW(wszParameters, buffer, parametersLen); - if (strlenW(wExplorer) > dwApplicationNameLen) - ERR("application len exceeds buffer size (%i > %i), truncating\n", - lstrlenW(wExplorer) + 1, dwApplicationNameLen); - lstrcpynW(wszApplicationName, wExplorer, dwApplicationNameLen); + if (strlenW(L"explorer.exe") > dwApplicationNameLen) + ERR("application len exceeds buffer size (%i), truncating\n", + dwApplicationNameLen); + lstrcpynW(wszApplicationName, L"explorer.exe", dwApplicationNameLen); appKnownSingular = TRUE; sei->fMask &= ~SEE_MASK_INVOKEIDLIST; @@ -1686,8 +1672,6 @@ static UINT_PTR SHELL_quote_and_execute(LPCWSTR wcmd, LPCWSTR wszParameters, LPC static UINT_PTR SHELL_execute_url(LPCWSTR lpFile, LPCWSTR wcmd, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc) { - static const WCHAR wShell[] = L"\\shell\\"; - static const WCHAR wCommand[] = L"\\command"; UINT_PTR retval; WCHAR *lpstrProtocol; LPCWSTR lpstrRes; @@ -1702,17 +1686,17 @@ static UINT_PTR SHELL_execute_url(LPCWSTR lpFile, LPCWSTR wcmd, LPSHELLEXECUTEIN TRACE("Got URL: %s\n", debugstr_w(lpFile)); /* Looking for ...<protocol>\shell\<lpVerb>\command */ - len = iSize + lstrlenW(wShell) + lstrlenW(wCommand) + 1; + len = iSize + lstrlenW(L"\\shell\\") + lstrlenW(L"\\command") + 1; if (psei->lpVerb && *psei->lpVerb) len += lstrlenW(psei->lpVerb); else - len += lstrlenW(wszOpen); + len += lstrlenW(L"open"); lpstrProtocol = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); memcpy(lpstrProtocol, lpFile, iSize * sizeof(WCHAR)); lpstrProtocol[iSize] = '\0'; - strcatW(lpstrProtocol, wShell); - strcatW(lpstrProtocol, psei->lpVerb && *psei->lpVerb ? psei->lpVerb : wszOpen); - strcatW(lpstrProtocol, wCommand); + strcatW(lpstrProtocol, L"\\shell\\"); + strcatW(lpstrProtocol, psei->lpVerb && *psei->lpVerb ? psei->lpVerb : L"open"); + strcatW(lpstrProtocol, L"\\command"); retval = execute_from_key(lpstrProtocol, lpFile, NULL, psei->lpParameters, wcmd, execfunc, psei, psei_out); @@ -1728,14 +1712,14 @@ static void do_error_dialog(UINT_PTR retval, HWND hwnd, WCHAR* filename) error_code = GetLastError(); if (retval == SE_ERR_NOASSOC) - LoadStringW(shell32_hInstance, IDS_SHLEXEC_NOASSOC, msg, sizeof(msg) / sizeof(WCHAR)); + LoadStringW(shell32_hInstance, IDS_SHLEXEC_NOASSOC, msg, ARRAY_SIZE(msg)); else FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY, NULL, error_code, LANG_USER_DEFAULT, msg, - sizeof(msg) / sizeof(WCHAR), + ARRAY_SIZE(msg), (va_list*)msgArguments); MessageBoxW(hwnd, msg, NULL, MB_ICONERROR); @@ -1774,9 +1758,9 @@ static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) WCHAR parametersBuffer[1024], dirBuffer[MAX_PATH], wcmdBuffer[1024]; WCHAR *wszApplicationName, *wszParameters, *wszDir, *wcmd; DWORD dwApplicationNameLen = MAX_PATH + 2; - DWORD parametersLen = sizeof(parametersBuffer) / sizeof(WCHAR); - DWORD dirLen = sizeof(dirBuffer) / sizeof(WCHAR); - DWORD wcmdLen = sizeof(wcmdBuffer) / sizeof(WCHAR); + DWORD parametersLen = ARRAY_SIZE(parametersBuffer); + DWORD dirLen = ARRAY_SIZE(dirBuffer); + DWORD wcmdLen = ARRAY_SIZE(wcmdBuffer); DWORD len; SHELLEXECUTEINFOW sei_tmp; /* modifiable copy of SHELLEXECUTEINFO struct */ WCHAR wfileName[MAX_PATH]; @@ -2112,7 +2096,7 @@ static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) if (lpQuotedFile) { retval = SHELL_FindExecutable(sei_tmp.lpDirectory, L"explorer", - wszOpen, wExec, MAX_PATH, + L"open", wExec, MAX_PATH, NULL, &env, NULL, NULL); if (retval > 32) { @@ -2480,20 +2464,20 @@ HRESULT WINAPI ShellExecCmdLine( StringCchCopyW(szFile, _countof(szFile), szFile2); } else if (SearchPathW(NULL, szFile, NULL, _countof(szFile2), szFile2, NULL) || - SearchPathW(NULL, szFile, wszExe, _countof(szFile2), szFile2, NULL) || - SearchPathW(NULL, szFile, wszCom, _countof(szFile2), szFile2, NULL) || + SearchPathW(NULL, szFile, L".exe", _countof(szFile2), szFile2, NULL) || + SearchPathW(NULL, szFile, L".com", _countof(szFile2), szFile2, NULL) || SearchPathW(pwszStartDir, szFile, NULL, _countof(szFile2), szFile2, NULL) || - SearchPathW(pwszStartDir, szFile, wszExe, _countof(szFile2), szFile2, NULL) || - SearchPathW(pwszStartDir, szFile, wszCom, _countof(szFile2), szFile2, NULL)) + SearchPathW(pwszStartDir, szFile, L".exe", _countof(szFile2), szFile2, NULL) || + SearchPathW(pwszStartDir, szFile, L".com", _countof(szFile2), szFile2, NULL)) { StringCchCopyW(szFile, _countof(szFile), szFile2); } else if (SearchPathW(NULL, lpCommand, NULL, _countof(szFile2), szFile2, NULL) || - SearchPathW(NULL, lpCommand, wszExe, _countof(szFile2), szFile2, NULL) || - SearchPathW(NULL, lpCommand, wszCom, _countof(szFile2), szFile2, NULL) || + SearchPathW(NULL, lpCommand, L".exe", _countof(szFile2), szFile2, NULL) || + SearchPathW(NULL, lpCommand, L".com", _countof(szFile2), szFile2, NULL) || SearchPathW(pwszStartDir, lpCommand, NULL, _countof(szFile2), szFile2, NULL) || - SearchPathW(pwszStartDir, lpCommand, wszExe, _countof(szFile2), szFile2, NULL) || - SearchPathW(pwszStartDir, lpCommand, wszCom, _countof(szFile2), szFile2, NULL)) + SearchPathW(pwszStartDir, lpCommand, L".exe", _countof(szFile2), szFile2, NULL) || + SearchPathW(pwszStartDir, lpCommand, L".com", _countof(szFile2), szFile2, NULL)) { StringCchCopyW(szFile, _countof(szFile), szFile2); pchParams = NULL; diff --git a/dll/win32/shell32/shlfileop.cpp b/dll/win32/shell32/shlfileop.cpp index 59aa0cf2b09..fbd06a767b8 100644 --- a/dll/win32/shell32/shlfileop.cpp +++ b/dll/win32/shell32/shlfileop.cpp @@ -35,9 +35,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); #define NEW_FILENAME_ON_COPY_TRIES 100 -static const WCHAR wWildcardFile[] = {'*',0}; -static const WCHAR wWildcardChars[] = {'*','?',0}; - typedef struct { SHFILEOPSTRUCTW *req; @@ -87,8 +84,6 @@ static BOOL _FileOpCount(FILE_OPERATION *op, LPWSTR pwszBuf, BOOL bFolder, DWORD /* Confirm dialogs with an optional "Yes To All" as used in file operations confirmations */ -static const WCHAR CONFIRM_MSG_PROP[] = {'W','I','N','E','_','C','O','N','F','I','R','M',0}; - struct confirm_msg_info { LPWSTR lpszText; @@ -139,7 +134,7 @@ static INT_PTR ConfirmMsgBox_Paint(HWND hDlg) /* this will remap the rect to dialog coords */ MapWindowPoints(GetDlgItem(hDlg, IDC_YESTOALL_MESSAGE), hDlg, (LPPOINT)&r, 2); hOldFont = (HFONT)SelectObject(hdc, (HFONT)SendDlgItemMessageW(hDlg, IDC_YESTOALL_MESSAGE, WM_GETFONT, 0, 0)); - DrawTextW(hdc, (LPWSTR)GetPropW(hDlg, CONFIRM_MSG_PROP), -1, &r, DT_NOPREFIX | DT_PATH_ELLIPSIS | DT_WORDBREAK); + DrawTextW(hdc, (LPWSTR)GetPropW(hDlg, L"WINE_CONFIRM"), -1, &r, DT_NOPREFIX | DT_PATH_ELLIPSIS | DT_WORDBREAK); SelectObject(hdc, hOldFont); EndPaint(hDlg, &ps); @@ -157,7 +152,7 @@ static INT_PTR ConfirmMsgBox_Init(HWND hDlg, LPARAM lParam) SetWindowTextW(hDlg, info->lpszCaption); ShowWindow(GetDlgItem(hDlg, IDC_YESTOALL_MESSAGE), SW_HIDE); - SetPropW(hDlg, CONFIRM_MSG_PROP, info->lpszText); + SetPropW(hDlg, L"WINE_CONFIRM", info->lpszText); SendDlgItemMessageW(hDlg, IDC_YESTOALL_ICON, STM_SETICON, (WPARAM)info->hIcon, 0); /* compute the text height and resize the dialog */ @@ -379,7 +374,7 @@ BOOL SHELL_DeleteDirectoryW(FILE_OPERATION *op, LPCWSTR pszDir, BOOL bShowUI) WCHAR szTemp[MAX_PATH]; /* Make sure the directory exists before eventually prompting the user */ - PathCombineW(szTemp, pszDir, wWildcardFile); + PathCombineW(szTemp, pszDir, L"*"); hFind = FindFirstFileW(szTemp, &wfd); if (hFind == INVALID_HANDLE_VALUE) return FALSE; @@ -960,7 +955,7 @@ int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES s static DWORD SHFindAttrW(LPCWSTR pName, BOOL fileOnly) { WIN32_FIND_DATAW wfd; - BOOL b_FileMask = fileOnly && (NULL != StrPBrkW(pName, wWildcardChars)); + BOOL b_FileMask = fileOnly && (NULL != StrPBrkW(pName, L"*?")); DWORD dwAttr = INVALID_FILE_ATTRIBUTES; HANDLE hFind = FindFirstFileW(pName, &wfd); @@ -1238,7 +1233,7 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles) } /* parse wildcard files if they are in the filename */ - if (StrPBrkW(szCurFile, wWildcardChars)) + if (StrPBrkW(szCurFile, L"*?")) { parse_wildcard_files(flList, szCurFile, &i); flList->bAnyFromWildcard = TRUE; @@ -1318,8 +1313,6 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST WCHAR szFrom[MAX_PATH], szTo[MAX_PATH]; FILE_LIST flFromNew, flToNew; - static const WCHAR wildCardFiles[] = {'*','.','*',0}; - if (IsDotDir(feFrom->szFilename)) return; @@ -1364,7 +1357,7 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST szTo[lstrlenW(szTo) + 1] = '\0'; SHNotifyCreateDirectoryW(szTo, NULL); - PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles); + PathCombineW(szFrom, feFrom->szFullPath, L"*.*"); szFrom[lstrlenW(szFrom) + 1] = '\0'; ZeroMemory(&flFromNew, sizeof(FILE_LIST)); @@ -1582,9 +1575,8 @@ static BOOL confirm_delete_list(HWND hWnd, DWORD fFlags, BOOL fTrash, const FILE if (flFrom->dwNumFiles > 1) { WCHAR tmp[8]; - const WCHAR format[] = {'%','d',0}; - wnsprintfW(tmp, sizeof(tmp)/sizeof(tmp[0]), format, flFrom->dwNumFiles); + wnsprintfW(tmp, sizeof(tmp)/sizeof(tmp[0]), L"%d", flFrom->dwNumFiles); return SHELL_ConfirmDialogW(hWnd, (fTrash?ASK_TRASH_MULTIPLE_ITEM:ASK_DELETE_MULTIPLE_ITEM), tmp, NULL); } else @@ -1704,14 +1696,12 @@ static void move_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST WCHAR szFrom[MAX_PATH], szTo[MAX_PATH]; FILE_LIST flFromNew, flToNew; - static const WCHAR wildCardFiles[] = {'*','.','*',0}; - if (IsDotDir(feFrom->szFilename)) return; SHNotifyCreateDirectoryW(szDestPath, NULL); - PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles); + PathCombineW(szFrom, feFrom->szFullPath, L"*.*"); szFrom[lstrlenW(szFrom) + 1] = '\0'; lstrcpyW(szTo, szDestPath); diff --git a/dll/win32/shell32/wine/brsfolder.c b/dll/win32/shell32/wine/brsfolder.c index 84c7c63a5f0..17a0236b944 100644 --- a/dll/win32/shell32/wine/brsfolder.c +++ b/dll/win32/shell32/wine/brsfolder.c @@ -117,12 +117,6 @@ static void FillTreeView(browse_info*, LPSHELLFOLDER, static HTREEITEM InsertTreeViewItem( browse_info*, IShellFolder *, LPCITEMIDLIST, LPCITEMIDLIST, IEnumIDList*, HTREEITEM); -static const WCHAR szBrowseFolderInfo[] = { - '_','_','W','I','N','E','_', - 'B','R','S','F','O','L','D','E','R','D','L','G','_', - 'I','N','F','O',0 -}; - static inline DWORD BrowseFlagsToSHCONTF(UINT ulFlags) { return SHCONTF_FOLDERS | (ulFlags & BIF_BROWSEINCLUDEFILES ? SHCONTF_NONFOLDERS : 0); @@ -772,7 +766,7 @@ static BOOL BrsFolder_OnCreate( HWND hWnd, browse_info *info ) LPBROWSEINFOW lpBrowseInfo = info->lpBrowseInfo; info->hWnd = hWnd; - SetPropW( hWnd, szBrowseFolderInfo, info ); + SetPropW( hWnd, L"__WINE_BRSFOLDERDLG_INFO", info ); if (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE) FIXME("flags BIF_NEWDIALOGSTYLE partially implemented\n"); @@ -1285,7 +1279,7 @@ static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam, if (msg == WM_INITDIALOG) return BrsFolder_OnCreate( hWnd, (browse_info*) lParam ); - info = GetPropW( hWnd, szBrowseFolderInfo ); + info = GetPropW( hWnd, L"__WINE_BRSFOLDERDLG_INFO" ); switch (msg) { @@ -1348,13 +1342,6 @@ static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam, return FALSE; } -#ifndef __REACTOS__ -static const WCHAR swBrowseTemplateName[] = { - 'S','H','B','R','S','F','O','R','F','O','L','D','E','R','_','M','S','G','B','O','X',0}; -static const WCHAR swNewBrowseTemplateName[] = { - 'S','H','N','E','W','B','R','S','F','O','R','F','O','L','D','E','R','_','M','S','G','B','O','X',0}; -#endif - /************************************************************************* * SHBrowseForFolderA [SHELL32.@] * SHBrowseForFolder [SHELL32.@] diff --git a/dll/win32/shell32/wine/classes.c b/dll/win32/shell32/wine/classes.c index b2a5ca54256..df2099914da 100644 --- a/dll/win32/shell32/wine/classes.c +++ b/dll/win32/shell32/wine/classes.c @@ -127,10 +127,6 @@ BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bP return TRUE; } -static const WCHAR swShell[] = {'s','h','e','l','l','\\',0}; -static const WCHAR swOpen[] = {'o','p','e','n',0}; -static const WCHAR swCommand[] = {'\\','c','o','m','m','a','n','d',0}; - BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len ) { WCHAR sTemp[MAX_PATH]; @@ -147,12 +143,12 @@ BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD l size=len; *szDest='\0'; - if (!RegQueryValueW(hkeyClass, swShell, szDest, &size) && *szDest) + if (!RegQueryValueW(hkeyClass, L"shell\\", szDest, &size) && *szDest) { /* The MSDN says to first try the default verb */ - lstrcpyW(sTemp, swShell); + lstrcpyW(sTemp, L"shell\\"); lstrcatW(sTemp, szDest); - lstrcatW(sTemp, swCommand); + lstrcatW(sTemp, L"\\command"); if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey)) { RegCloseKey(hkey); @@ -162,13 +158,11 @@ BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD l } /* then fallback to 'open' */ - lstrcpyW(sTemp, swShell); - lstrcatW(sTemp, swOpen); - lstrcatW(sTemp, swCommand); + lstrcpyW(sTemp, L"shell\\open\\command"); if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey)) { RegCloseKey(hkey); - lstrcpynW(szDest, swOpen, len); + lstrcpynW(szDest, L"open", len); TRACE("default verb=open\n"); return TRUE; } @@ -213,9 +207,9 @@ BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LP if (HCR_GetDefaultVerbW(hkeyClass, szVerb, sTempVerb, sizeof(sTempVerb)/sizeof(sTempVerb[0]))) { WCHAR sTemp[MAX_PATH]; - lstrcpyW(sTemp, swShell); + lstrcpyW(sTemp, L"shell\\"); lstrcatW(sTemp, sTempVerb); - lstrcatW(sTemp, swCommand); + lstrcatW(sTemp, L"\\command"); ret = (ERROR_SUCCESS == SHGetValueW(hkeyClass, sTemp, NULL, NULL, szDest, &len)); } if (szClass) @@ -293,7 +287,6 @@ static BOOL HCR_RegGetIconA(HKEY hkey, LPSTR szDest, LPCSTR szName, DWORD len, i BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx) { - static const WCHAR swDefaultIcon[] = {'\\','D','e','f','a','u','l','t','I','c','o','n',0}; HKEY hkey; WCHAR sTemp[MAX_PATH]; BOOL ret = FALSE; @@ -301,7 +294,7 @@ BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int TRACE("%s\n",debugstr_w(szClass) ); lstrcpynW(sTemp, szClass, MAX_PATH); - lstrcatW(sTemp, swDefaultIcon); + lstrcatW(sTemp, L"\\DefaultIcon"); if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey)) { @@ -346,8 +339,6 @@ BOOL HCR_GetIconA(LPCSTR szClass, LPSTR szDest, LPCSTR szName, DWORD len, int* p * * Gets the name of a registered class */ -static const WCHAR swEmpty[] = {0}; - BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len) { HKEY hkey; @@ -376,10 +367,8 @@ BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len) if (HCR_RegOpenClassIDKey(riid, &hkey)) #endif { - static const WCHAR wszLocalizedString[] = - { 'L','o','c','a','l','i','z','e','d','S','t','r','i','n','g', 0 }; - if (!RegLoadMUIStringW(hkey, wszLocalizedString, szDest, len, NULL, 0, NULL) || - !RegQueryValueExW(hkey, swEmpty, 0, NULL, (LPBYTE)szDest, &len)) + if (!RegLoadMUIStringW(hkey, L"LocalizedString", szDest, len, NULL, 0, NULL) || + !RegQueryValueExW(hkey, L"", 0, NULL, (LPBYTE)szDest, &len)) { ret = TRUE; } @@ -524,12 +513,7 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes) LPOLESTR pwszCLSID; LONG lResult; DWORD dwTemp, dwLen; - static const WCHAR wszAttributes[] = { 'A','t','t','r','i','b','u','t','e','s',0 }; - static const WCHAR wszCallForAttributes[] = { - 'C','a','l','l','F','o','r','A','t','t','r','i','b','u','t','e','s',0 }; - WCHAR wszShellFolderKey[] = { 'C','L','S','I','D','\\','{','0','0','0','2','1','4','0','0','-', - '0','0','0','0','-','0','0','0','0','-','C','0','0','0','-','0','0','0','0','0','0','0', - '0','0','0','4','6','}','\\','S','h','e','l','l','F','o','l','d','e','r',0 }; + WCHAR wszShellFolderKey[] = L"CLSID\\{00021400-0000-0000-C000-000000000046}\\ShellFolder"; TRACE("(pidlFolder=%p, pdwAttributes=%p)\n", pidlFolder, pdwAttributes); @@ -560,7 +544,7 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes) #endif dwLen = sizeof(DWORD); - lResult = RegQueryValueExW(hSFKey, wszCallForAttributes, 0, NULL, (LPBYTE)&dwTemp, &dwLen); + lResult = RegQueryValueExW(hSFKey, L"CallForAttributes", 0, NULL, (LPBYTE)&dwTemp, &dwLen); if ((lResult == ERROR_SUCCESS) && (dwTemp & *pdwAttributes)) { LPSHELLFOLDER psfDesktop, psfFolder; HRESULT hr; @@ -578,7 +562,7 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes) } if (FAILED(hr)) return FALSE; } else { - lResult = RegQueryValueExW(hSFKey, wszAttributes, 0, NULL, (LPBYTE)&dwTemp, &dwLen); + lResult = RegQueryValueExW(hSFKey, L"Attributes", 0, NULL, (LPBYTE)&dwTemp, &dwLen); RegCloseKey(hSFKey); if (lResult == ERROR_SUCCESS) { *pdwAttributes &= dwTemp; diff --git a/dll/win32/shell32/wine/control.c b/dll/win32/shell32/wine/control.c index 9e8852c3a25..34c7b3bcf5b 100644 --- a/dll/win32/shell32/wine/control.c +++ b/dll/win32/shell32/wine/control.c @@ -697,20 +697,17 @@ static void Control_RegisterRegistryApplets(HWND hWnd, CPanel *panel, HKEY hkey_ static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst) { + static const WCHAR wszRegPath[] = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls"; HANDLE h; WIN32_FIND_DATAW fd; WCHAR buffer[MAX_PATH]; - static const WCHAR wszAllCpl[] = {'*','.','c','p','l',0}; - static const WCHAR wszRegPath[] = {'S','O','F','T','W','A','R','E','\\','M','i','c','r','o','s','o','f','t', - '\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n', - '\\','C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','C','p','l','s',0}; WCHAR *p; /* first add .cpl files in the system directory */ GetSystemDirectoryW( buffer, MAX_PATH ); p = buffer + strlenW(buffer); *p++ = '\\'; - lstrcpyW(p, wszAllCpl); + lstrcpyW(p, L"*.cpl"); if ((h = FindFirstFileW(buffer, &fd)) != INVALID_HANDLE_VALUE) { do { diff --git a/dll/win32/shell32/wine/shell32_main.c b/dll/win32/shell32/wine/shell32_main.c index 616356c00b1..b31dedcba2c 100644 --- a/dll/win32/shell32/wine/shell32_main.c +++ b/dll/win32/shell32/wine/shell32_main.c @@ -557,10 +557,6 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, /* get the type name */ if (SUCCEEDED(hr) && (flags & SHGFI_TYPENAME)) { - static const WCHAR szFolder[] = { 'F','o','l','d','e','r',0 }; - static const WCHAR szFile[] = { 'F','i','l','e',0 }; - static const WCHAR szSpaceFile[] = { ' ','f','i','l','e',0 }; - if (!(flags & SHGFI_USEFILEATTRIBUTES) || (flags & SHGFI_PIDL)) { char ftype[80]; @@ -571,7 +567,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, else { if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - strcatW (psfi->szTypeName, szFolder); + strcatW (psfi->szTypeName, L"Folder"); else { WCHAR sTemp[64]; @@ -580,7 +576,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, if (sTemp[0] == 0 || (sTemp[0] == '.' && sTemp[1] == 0)) { /* "name" or "name." => "File" */ - lstrcpynW (psfi->szTypeName, szFile, 64); + lstrcpynW (psfi->szTypeName, L"File", 64); } else if (!( HCR_MapTypeToValueW(sTemp, sTemp, 64, TRUE) && HCR_MapTypeToValueW(sTemp, psfi->szTypeName, 80, FALSE ))) @@ -588,11 +584,11 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, if (sTemp[0]) { lstrcpynW (psfi->szTypeName, sTemp, 64); - strcatW (psfi->szTypeName, szSpaceFile); + strcatW (psfi->szTypeName, L" file"); } else { - lstrcpynW (psfi->szTypeName, szFile, 64); + lstrcpynW (psfi->szTypeName, L"File", 64); } } } @@ -639,7 +635,6 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, else { WCHAR* szExt; - static const WCHAR p1W[] = {'%','1',0}; WCHAR sTemp [MAX_PATH]; szExt = PathFindExtensionW(szFullPath); @@ -648,7 +643,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) && HCR_GetIconW(sTemp, sTemp, NULL, MAX_PATH, &psfi->iIcon)) { - if (lstrcmpW(p1W, sTemp)) + if (lstrcmpW(L"%1", sTemp)) strcpyW(psfi->szDisplayName, sTemp); else { @@ -697,15 +692,13 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, psfi->iIcon = SIC_GetIconIndex(swShell32Name, -IDI_SHELL_FOLDER, 0); else { - static const WCHAR p1W[] = {'%','1',0}; - psfi->iIcon = 0; szExt = PathFindExtensionW(sTemp); if ( szExt && HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) && HCR_GetIconW(sTemp, sTemp, NULL, MAX_PATH, &icon_idx)) { - if (!lstrcmpW(p1W,sTemp)) /* icon is in the file */ + if (!lstrcmpW(L"%1",sTemp)) /* icon is in the file */ strcpyW(sTemp, szFullPath); if (flags & SHGFI_SYSICONINDEX) @@ -1138,12 +1131,14 @@ INT_PTR CALLBACK AboutAuthorsDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM */ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { +#ifdef __REACTOS__ + static DWORD cxLogoBmp; static DWORD cyLogoBmp, cyLineBmp; static HBITMAP hLogoBmp, hLineBmp; static HWND hWndAuthors; - switch(msg) + switch (msg) { case WM_INITDIALOG: { @@ -1151,7 +1146,6 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM if (info) { - const WCHAR szRegKey[] = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"; HKEY hRegKey; MEMORYSTATUSEX MemStat; WCHAR szAppTitle[512]; @@ -1171,51 +1165,49 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM } hLineBmp = (HBITMAP)LoadImage(shell32_hInstance, MAKEINTRESOURCE(IDB_LINEBAR), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); - if(hLogoBmp && hLineBmp) + if (hLogoBmp && hLineBmp) { BITMAP bmpLogo; - GetObject( hLogoBmp, sizeof(BITMAP), &bmpLogo ); + GetObject(hLogoBmp, sizeof(BITMAP), &bmpLogo); cxLogoBmp = bmpLogo.bmWidth; cyLogoBmp = bmpLogo.bmHeight; - GetObject( hLineBmp, sizeof(BITMAP), &bmpLogo ); + GetObject(hLineBmp, sizeof(BITMAP), &bmpLogo); cyLineBmp = bmpLogo.bmHeight; } // Set App-specific stuff (icon, app name, szOtherStuff string) SendDlgItemMessageW(hWnd, IDC_ABOUT_ICON, STM_SETICON, (WPARAM)info->hIcon, 0); - GetWindowTextW( hWnd, szAppTitleTemplate, sizeof(szAppTitleTemplate) / sizeof(WCHAR) ); - swprintf( szAppTitle, szAppTitleTemplate, info->szApp ); - SetWindowTextW( hWnd, szAppTitle ); + GetWindowTextW(hWnd, szAppTitleTemplate, ARRAY_SIZE(szAppTitleTemplate)); + swprintf(szAppTitle, szAppTitleTemplate, info->szApp); + SetWindowTextW(hWnd, szAppTitle); - SetDlgItemTextW( hWnd, IDC_ABOUT_APPNAME, info->szApp ); -#ifdef __REACTOS__ - SetDlgItemTextW( hWnd, IDC_ABOUT_VERSION, info->szOSVersion ); -#endif - SetDlgItemTextW( hWnd, IDC_ABOUT_OTHERSTUFF, info->szOtherStuff ); + SetDlgItemTextW(hWnd, IDC_ABOUT_APPNAME, info->szApp); + SetDlgItemTextW(hWnd, IDC_ABOUT_VERSION, info->szOSVersion); + SetDlgItemTextW(hWnd, IDC_ABOUT_OTHERSTUFF, info->szOtherStuff); // Set the registered user and organization name - if(RegOpenKeyExW( HKEY_LOCAL_MACHINE, szRegKey, 0, KEY_QUERY_VALUE, &hRegKey ) == ERROR_SUCCESS) + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", + 0, KEY_QUERY_VALUE, &hRegKey) == ERROR_SUCCESS) { - SetRegTextData( hWnd, hRegKey, L"RegisteredOwner", IDC_ABOUT_REG_USERNAME ); - SetRegTextData( hWnd, hRegKey, L"RegisteredOrganization", IDC_ABOUT_REG_ORGNAME ); -#ifdef __REACTOS__ - if(GetWindowTextLengthW( GetDlgItem( hWnd, IDC_ABOUT_REG_USERNAME ) ) == 0 && - GetWindowTextLengthW( GetDlgItem( hWnd, IDC_ABOUT_REG_ORGNAME ) ) == 0) + SetRegTextData(hWnd, hRegKey, L"RegisteredOwner", IDC_ABOUT_REG_USERNAME); + SetRegTextData(hWnd, hRegKey, L"RegisteredOrganization", IDC_ABOUT_REG_ORGNAME); + + if (GetWindowTextLengthW(GetDlgItem(hWnd, IDC_ABOUT_REG_USERNAME)) == 0 && + GetWindowTextLengthW(GetDlgItem(hWnd, IDC_ABOUT_REG_ORGNAME)) == 0) { - ShowWindow( GetDlgItem( hWnd, IDC_ABOUT_REG_TO ), SW_HIDE ); + ShowWindow(GetDlgItem(hWnd, IDC_ABOUT_REG_TO), SW_HIDE); } -#endif - RegCloseKey( hRegKey ); + RegCloseKey(hRegKey); } // Set the value for the installed physical memory MemStat.dwLength = sizeof(MemStat); - if( GlobalMemoryStatusEx(&MemStat) ) + if (GlobalMemoryStatusEx(&MemStat)) { WCHAR szBuf[12]; @@ -1239,24 +1231,24 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM MemStat.ullTotalPhys /= 1024; dTotalPhys = (double)MemStat.ullTotalPhys / 1024; - wcscpy( szUnits, L"PB" ); + wcscpy(szUnits, L"PB"); } else { dTotalPhys = (double)MemStat.ullTotalPhys / 1024; - wcscpy( szUnits, L"TB" ); + wcscpy(szUnits, L"TB"); } } else { dTotalPhys = (double)MemStat.ullTotalPhys / 1024; - wcscpy( szUnits, L"GB" ); + wcscpy(szUnits, L"GB"); } // We need the decimal point of the current locale to display the RAM size correctly if (GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, szDecimalSeparator, - sizeof(szDecimalSeparator) / sizeof(WCHAR)) > 0) + ARRAY_SIZE(szDecimalSeparator)) > 0) { UCHAR uDecimals; UINT uIntegral; @@ -1271,16 +1263,16 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM else { // We're dealing with MBs, don't show any decimals - swprintf( szBuf, L"%u MB", (UINT)MemStat.ullTotalPhys / 1024 / 1024 ); + swprintf(szBuf, L"%u MB", (UINT)MemStat.ullTotalPhys / 1024 / 1024); } - SetDlgItemTextW( hWnd, IDC_ABOUT_PHYSMEM, szBuf); + SetDlgItemTextW(hWnd, IDC_ABOUT_PHYSMEM, szBuf); } // Add the Authors dialog - hWndAuthors = CreateDialogW( shell32_hInstance, MAKEINTRESOURCEW(IDD_ABOUT_AUTHORS), hWnd, AboutAuthorsDlgProc ); - LoadStringW( shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, sizeof(szAuthorsText) / sizeof(WCHAR) ); - SetDlgItemTextW( hWnd, IDC_ABOUT_AUTHORS, szAuthorsText ); + hWndAuthors = CreateDialogW(shell32_hInstance, MAKEINTRESOURCEW(IDD_ABOUT_AUTHORS), hWnd, AboutAuthorsDlgProc); + LoadStringW(shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, ARRAY_SIZE(szAuthorsText)); + SetDlgItemTextW(hWnd, IDC_ABOUT_AUTHORS, szAuthorsText); } return TRUE; @@ -1288,7 +1280,7 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM case WM_PAINT: { - if(hLogoBmp && hLineBmp) + if (hLogoBmp && hLineBmp) { PAINTSTRUCT ps; HDC hdc; @@ -1298,7 +1290,7 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM hdc = BeginPaint(hWnd, &ps); hdcMem = CreateCompatibleDC(hdc); - if(hdcMem) + if (hdcMem) { hOldObj = SelectObject(hdcMem, hLogoBmp); BitBlt(hdc, 0, 0, cxLogoBmp, cyLogoBmp, hdcMem, 0, 0, SRCCOPY); @@ -1312,7 +1304,8 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM EndPaint(hWnd, &ps); } - }; break; + break; + } case WM_COMMAND: { @@ -1328,29 +1321,32 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM static BOOL bShowingAuthors = FALSE; WCHAR szAuthorsText[20]; - if(bShowingAuthors) + if (bShowingAuthors) { - LoadStringW( shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, sizeof(szAuthorsText) / sizeof(WCHAR) ); - ShowWindow( hWndAuthors, SW_HIDE ); + LoadStringW(shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, ARRAY_SIZE(szAuthorsText)); + ShowWindow(hWndAuthors, SW_HIDE); } else { - LoadStringW( shell32_hInstance, IDS_SHELL_ABOUT_BACK, szAuthorsText, sizeof(szAuthorsText) / sizeof(WCHAR) ); - ShowWindow( hWndAuthors, SW_SHOW ); + LoadStringW(shell32_hInstance, IDS_SHELL_ABOUT_BACK, szAuthorsText, ARRAY_SIZE(szAuthorsText)); + ShowWindow(hWndAuthors, SW_SHOW); } - SetDlgItemTextW( hWnd, IDC_ABOUT_AUTHORS, szAuthorsText ); + SetDlgItemTextW(hWnd, IDC_ABOUT_AUTHORS, szAuthorsText); bShowingAuthors = !bShowingAuthors; return TRUE; } } - }; break; + break; + } case WM_CLOSE: EndDialog(hWnd, TRUE); break; } +#endif // __REACTOS__ + return 0; } diff --git a/dll/win32/shell32/wine/shellole.c b/dll/win32/shell32/wine/shellole.c index ae9a39bb8fa..6ede109f92e 100644 --- a/dll/win32/shell32/wine/shellole.c +++ b/dll/win32/shell32/wine/shellole.c @@ -113,10 +113,7 @@ HRESULT WINAPI SHCoCreateInstance( CLSID iid; const CLSID * myclsid = clsid; WCHAR sKeyName[MAX_PATH]; - static const WCHAR sCLSID[] = {'C','L','S','I','D','\\','\0'}; WCHAR sClassID[60]; - static const WCHAR sInProcServer32[] = {'\\','I','n','p','r','o','c','S','e','r','v','e','r','3','2','\0'}; - static const WCHAR sLoadWithoutCOM[] = {'L','o','a','d','W','i','t','h','o','u','t','C','O','M','\0'}; WCHAR sDllPath[MAX_PATH]; HKEY hKey = 0; DWORD dwSize; @@ -144,16 +141,14 @@ HRESULT WINAPI SHCoCreateInstance( } /* we look up the dll path in the registry */ - SHStringFromGUIDW(myclsid, sClassID, sizeof(sClassID)/sizeof(WCHAR)); - lstrcpyW(sKeyName, sCLSID); - lstrcatW(sKeyName, sClassID); - lstrcatW(sKeyName, sInProcServer32); + SHStringFromGUIDW(myclsid, sClassID, ARRAY_SIZE(sClassID)); + swprintf(sKeyName, L"CLSID\\%s\\InprocServer32", sClassID); if (RegOpenKeyExW(HKEY_CLASSES_ROOT, sKeyName, 0, KEY_READ, &hKey)) return E_ACCESSDENIED; /* if a special registry key is set, we load a shell extension without help of OLE32 */ - if (!SHQueryValueExW(hKey, sLoadWithoutCOM, 0, 0, 0, 0)) + if (!SHQueryValueExW(hKey, L"LoadWithoutCOM", 0, 0, 0, 0)) { /* load an external dll without ole32 */ HANDLE hLibrary; diff --git a/dll/win32/shell32/wine/shellord.c b/dll/win32/shell32/wine/shellord.c index 0b3965711c2..fde33759c2a 100644 --- a/dll/win32/shell32/wine/shellord.c +++ b/dll/win32/shell32/wine/shellord.c @@ -809,7 +809,6 @@ static INT SHADD_create_add_mru_data(HANDLE mruhandle, LPCSTR doc_name, LPCSTR n void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv) { #ifdef __REACTOS__ - static const WCHAR szExplorerKey[] = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer"; INT ret; WCHAR szTargetPath[MAX_PATH], szLinkDir[MAX_PATH], szLinkFile[MAX_PATH], szDescription[80]; WCHAR szPath[MAX_PATH]; @@ -884,7 +883,8 @@ void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv) TRACE("Users Recent dir %S\n", szLinkDir); /* open Explorer key */ - error = RegCreateKeyExW(HKEY_CURRENT_USER, szExplorerKey, 0, NULL, 0, + error = RegCreateKeyExW(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer", + 0, NULL, 0, KEY_READ | KEY_WRITE, NULL, &hExplorerKey, NULL); if (error) { @@ -1613,17 +1613,6 @@ BOOL WINAPI DAD_ShowDragImage(BOOL bShow) return FALSE; } -static const WCHAR szwCabLocation[] = { - 'S','o','f','t','w','a','r','e','\\', - 'M','i','c','r','o','s','o','f','t','\\', - 'W','i','n','d','o','w','s','\\', - 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', - 'E','x','p','l','o','r','e','r','\\', - 'C','a','b','i','n','e','t','S','t','a','t','e',0 -}; - -static const WCHAR szwSettings[] = { 'S','e','t','t','i','n','g','s',0 }; - /************************************************************************* * ReadCabinetState [SHELL32.651] NT 4.0 * @@ -1638,11 +1627,11 @@ BOOL WINAPI ReadCabinetState(CABINETSTATE *cs, int length) if( (cs == NULL) || (length < (int)sizeof(*cs)) ) return FALSE; - r = RegOpenKeyW( HKEY_CURRENT_USER, szwCabLocation, &hkey ); + r = RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState", &hkey ); if( r == ERROR_SUCCESS ) { type = REG_BINARY; - r = RegQueryValueExW( hkey, szwSettings, + r = RegQueryValueExW( hkey, L"Settings", NULL, &type, (LPBYTE)cs, (LPDWORD)&length ); RegCloseKey( hkey ); @@ -1685,11 +1674,11 @@ BOOL WINAPI WriteCabinetState(CABINETSTATE *cs) if( cs == NULL ) return FALSE; - r = RegCreateKeyExW( HKEY_CURRENT_USER, szwCabLocation, 0, + r = RegCreateKeyExW( HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL); if( r == ERROR_SUCCESS ) { - r = RegSetValueExW( hkey, szwSettings, 0, + r = RegSetValueExW( hkey, L"Settings", 0, REG_BINARY, (LPBYTE) cs, cs->cLength); RegCloseKey( hkey ); @@ -2021,7 +2010,6 @@ HPSXA WINAPI SHCreatePropSheetExtArray(HKEY hKey, LPCWSTR pszSubKey, UINT max_if */ HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, LPDATAOBJECT pDataObj) { - static const WCHAR szPropSheetSubKey[] = {'s','h','e','l','l','e','x','\\','P','r','o','p','e','r','t','y','S','h','e','e','t','H','a','n','d','l','e','r','s',0}; WCHAR szHandler[64]; DWORD dwHandlerLen; WCHAR szClsidHandler[39]; @@ -2044,7 +2032,7 @@ HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_ if (lRet != ERROR_SUCCESS) return NULL; - lRet = RegOpenKeyExW(hkBase, szPropSheetSubKey, 0, KEY_ENUMERATE_SUB_KEYS, &hkPropSheetHandlers); + lRet = RegOpenKeyExW(hkBase, L"shellex\\PropertySheetHandlers", 0, KEY_ENUMERATE_SUB_KEYS, &hkPropSheetHandlers); RegCloseKey(hkBase); if (lRet == ERROR_SUCCESS) { @@ -2316,8 +2304,6 @@ BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, const WCHAR *basename; WCHAR *dst_basename; int i=2; - static const WCHAR lnkformat[] = {'%','s','.','l','n','k',0}; - static const WCHAR lnkformatnum[] = {'%','s',' ','(','%','d',')','.','l','n','k',0}; TRACE("(%s, %s, %p, %p, 0x%08x)\n", debugstr_w(pszLinkTo), debugstr_w(pszDir), pszName, pfMustCopy, uFlags); @@ -2349,11 +2335,11 @@ BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, dst_basename = pszName + strlenW(pszName); - snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, lnkformat, basename); + snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, L"%s.lnk", basename); while (GetFileAttributesW(pszName) != INVALID_FILE_ATTRIBUTES) { - snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, lnkformatnum, basename, i); + snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, L"%s (%d).lnk", basename, i); i++; } diff --git a/dll/win32/shell32/wine/shellpath.c b/dll/win32/shell32/wine/shellpath.c index 7745285af6e..736092b20a5 100644 --- a/dll/win32/shell32/wine/shellpath.c +++ b/dll/win32/shell32/wine/shellpath.c @@ -58,6 +58,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); static const BOOL is_win64 = sizeof(void *) > sizeof(int); #ifdef __REACTOS__ + /* FIXME: Remove this */ typedef enum _NT_PRODUCT_TYPE { @@ -70,7 +71,6 @@ typedef enum _NT_PRODUCT_TYPE static BOOL DoGetProductType(PNT_PRODUCT_TYPE ProductType) { - static const WCHAR ProductOptions[] = L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions"; HKEY hKey; LONG error; WCHAR szValue[9]; @@ -85,7 +85,7 @@ DoGetProductType(PNT_PRODUCT_TYPE ProductType) *ProductType = NtProductServer; - error = RegOpenKeyExW(HKEY_LOCAL_MACHINE, ProductOptions, 0, KEY_READ, &hKey); + error = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions", 0, KEY_READ, &hKey); if (error) return FALSE; @@ -104,7 +104,9 @@ DoGetProductType(PNT_PRODUCT_TYPE ProductType) RegCloseKey(hKey); return TRUE; } -#endif + +#endif // __REACTOS__ + /* ########## Combining and Constructing paths ########## */ @@ -370,14 +372,12 @@ BOOL PathIsExeW (LPCWSTR lpszPath) LPCWSTR lpszExtension = PathGetExtensionW(lpszPath); int i; static const WCHAR lpszExtensions[][4] = - {{'e','x','e','\0'}, {'c','o','m','\0'}, {'p','i','f','\0'}, - {'c','m','d','\0'}, {'b','a','t','\0'}, {'s','c','f','\0'}, - {'s','c','r','\0'}, {'\0'} }; + {L"exe", L"com", L"pif", L"cmd", L"bat", L"scf", L"scr", L"" }; TRACE("path=%s\n",debugstr_w(lpszPath)); for(i=0; lpszExtensions[i][0]; i++) - if (!strcmpiW(lpszExtension,lpszExtensions[i])) return TRUE; + if (!wcsicmp(lpszExtension,lpszExtensions[i])) return TRUE; return FALSE; } @@ -507,9 +507,7 @@ BOOL WINAPI PathYetAnotherMakeUniqueName(LPWSTR buffer, LPCWSTR path, LPCWSTR sh /* now try to make it unique */ while (PathFileExistsW(retW)) { - static const WCHAR fmtW[] = {'%','s',' ','(','%','d',')','%','s',0}; - - sprintfW(retW, fmtW, pathW, i, ext); + sprintfW(retW, L"%s (%d)%s", pathW, i, ext); i++; } @@ -813,125 +811,28 @@ LONG WINAPI PathProcessCommandAW ( ########## special ########## */ -static const WCHAR szCurrentVersion[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\0'}; -static const WCHAR Administrative_ToolsW[] = {'A','d','m','i','n','i','s','t','r','a','t','i','v','e',' ','T','o','o','l','s','\0'}; -static const WCHAR AppDataW[] = {'A','p','p','D','a','t','a','\0'}; -#ifndef __REACTOS__ -static const WCHAR AppData_LocalLowW[] = {'A','p','p','D','a','t','a','\\','L','o','c','a','l','L','o','w','\0'}; -static const WCHAR Application_DataW[] = {'A','p','p','l','i','c','a','t','i','o','n',' ','D','a','t','a','\0'}; -#endif -static const WCHAR CacheW[] = {'C','a','c','h','e','\0'}; -static const WCHAR CD_BurningW[] = {'C','D',' ','B','u','r','n','i','n','g','\0'}; -static const WCHAR Common_Administrative_ToolsW[] = {'C','o','m','m','o','n',' ','A','d','m','i','n','i','s','t','r','a','t','i','v','e',' ','T','o','o','l','s','\0'}; -static const WCHAR Common_AppDataW[] = {'C','o','m','m','o','n',' ','A','p','p','D','a','t','a','\0'}; -static const WCHAR Common_DesktopW[] = {'C','o','m','m','o','n',' ','D','e','s','k','t','o','p','\0'}; -static const WCHAR Common_DocumentsW[] = {'C','o','m','m','o','n',' ','D','o','c','u','m','e','n','t','s','\0'}; -static const WCHAR Common_FavoritesW[] = {'C','o','m','m','o','n',' ','F','a','v','o','r','i','t','e','s','\0'}; -static const WCHAR CommonFilesDirW[] = {'C','o','m','m','o','n','F','i','l','e','s','D','i','r','\0'}; -static const WCHAR CommonFilesDirX86W[] = {'C','o','m','m','o','n','F','i','l','e','s','D','i','r',' ','(','x','8','6',')','\0'}; -static const WCHAR CommonMusicW[] = {'C','o','m','m','o','n','M','u','s','i','c','\0'}; -static const WCHAR CommonPicturesW[] = {'C','o','m','m','o','n','P','i','c','t','u','r','e','s','\0'}; -static const WCHAR Common_ProgramsW[] = {'C','o','m','m','o','n',' ','P','r','o','g','r','a','m','s','\0'}; -static const WCHAR Common_StartUpW[] = {'C','o','m','m','o','n',' ','S','t','a','r','t','U','p','\0'}; -static const WCHAR Common_Start_MenuW[] = {'C','o','m','m','o','n',' ','S','t','a','r','t',' ','M','e','n','u','\0'}; -static const WCHAR Common_TemplatesW[] = {'C','o','m','m','o','n',' ','T','e','m','p','l','a','t','e','s','\0'}; -static const WCHAR CommonVideoW[] = {'C','o','m','m','o','n','V','i','d','e','o','\0'}; -#ifndef __REACTOS__ -static const WCHAR ContactsW[] = {'C','o','n','t','a','c','t','s','\0'}; -#endif -static const WCHAR CookiesW[] = {'C','o','o','k','i','e','s','\0'}; -static const WCHAR DesktopW[] = {'D','e','s','k','t','o','p','\0'}; -#ifndef __REACTOS__ -static const WCHAR DocumentsW[] = {'D','o','c','u','m','e','n','t','s','\0'}; -static const WCHAR DownloadsW[] = {'D','o','w','n','l','o','a','d','s','\0'}; -#endif -static const WCHAR FavoritesW[] = {'F','a','v','o','r','i','t','e','s','\0'}; -static const WCHAR FontsW[] = {'F','o','n','t','s','\0'}; -static const WCHAR HistoryW[] = {'H','i','s','t','o','r','y','\0'}; -#ifndef __REACTOS__ -static const WCHAR LinksW[] = {'L','i','n','k','s','\0'}; -#endif -static const WCHAR Local_AppDataW[] = {'L','o','c','a','l',' ','A','p','p','D','a','t','a','\0'}; -#ifndef __REACTOS__ -static const WCHAR Local_Settings_Application_DataW[] = {'L','o','c','a','l',' ','S','e','t','t','i','n','g','s','\\','A','p','p','l','i','c','a','t','i','o','n',' ','D','a','t','a','\0'}; -#endif -static const WCHAR Local_Settings_CD_BurningW[] = {'L','o','c','a','l',' ','S','e','t','t','i','n','g','s','\\','A','p','p','l','i','c','a','t','i','o','n',' ','D','a','t','a','\\','M','i','c','r','o','s','o','f','t','\\','C','D',' ','B','u','r','n','i','n','g','\0'}; -#ifndef __REACTOS__ -static const WCHAR Local_Settings_HistoryW[] = {'L','o','c','a','l',' ','S','e','t','t','i','n','g','s','\\','H','i','s','t','o','r','y','\0'}; -static const WCHAR Local_Settings_Temporary_Internet_FilesW[] = {'L','o','c','a','l',' ','S','e','t','t','i','n','g','s','\\','T','e','m','p','o','r','a','r','y',' ','I','n','t','e','r','n','e','t',' ','F','i','l','e','s','\0'}; -static const WCHAR Microsoft_Windows_GameExplorerW[] = {'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','G','a','m','e','E','x','p','l','o','r','e','r','\0'}; -static const WCHAR Microsoft_Windows_LibrariesW[] = {'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','L','i','b','r','a','r','i','e','s','\0'}; -static const WCHAR Microsoft_Windows_RingtonesW[] = {'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','R','i','n','g','t','o','n','e','s','\0'}; -static const WCHAR MusicW[] = {'M','u','s','i','c','\0'}; -static const WCHAR Music_PlaylistsW[] = {'M','u','s','i','c','\\','P','l','a','y','l','i','s','t','s','\0'}; -static const WCHAR Music_Sample_MusicW[] = {'M','u','s','i','c','\\','S','a','m','p','l','e',' ','M','u','s','i','c','\0'}; -static const WCHAR Music_Sample_PlaylistsW[] = {'M','u','s','i','c','\\','S','a','m','p','l','e',' ','P','l','a','y','l','i','s','t','s','\0'}; -#endif -static const WCHAR My_MusicW[] = {'M','y',' ','M','u','s','i','c','\0'}; -static const WCHAR My_PicturesW[] = {'M','y',' ','P','i','c','t','u','r','e','s','\0'}; -static const WCHAR My_VideoW[] = {'M','y',' ','V','i','d','e','o','\0'}; -static const WCHAR NetHoodW[] = {'N','e','t','H','o','o','d','\0'}; -static const WCHAR OEM_LinksW[] = {'O','E','M',' ','L','i','n','k','s','\0'}; -static const WCHAR PersonalW[] = {'P','e','r','s','o','n','a','l','\0'}; +/* !! MISSING Win2k3-compatible paths from the list below; absent from Wine !! */ #ifndef __REACTOS__ -static const WCHAR PicturesW[] = {'P','i','c','t','u','r','e','s','\0'}; -static const WCHAR Pictures_Sample_PicturesW[] = {'P','i','c','t','u','r','e','s','\\','S','a','m','p','l','e',' ','P','i','c','t','u','r','e','s','\0'}; -static const WCHAR Pictures_Slide_ShowsW[] = {'P','i','c','t','u','r','e','s','\\','S','l','i','d','e',' ','S','h','o','w','s','\0'}; -#endif -static const WCHAR PrintHoodW[] = {'P','r','i','n','t','H','o','o','d','\0'}; -#ifndef __REACTOS__ -static const WCHAR Program_FilesW[] = {'P','r','o','g','r','a','m',' ','F','i','l','e','s','\0'}; -static const WCHAR Program_Files_Common_FilesW[] = {'P','r','o','g','r','a','m',' ','F','i','l','e','s','\\','C','o','m','m','o','n',' ','F','i','l','e','s','\0'}; -#endif -static const WCHAR Program_Files_x86W[] = {'P','r','o','g','r','a','m',' ','F','i','l','e','s',' ','(','x','8','6',')','\0'}; -static const WCHAR Program_Files_x86_Common_FilesW[] = {'P','r','o','g','r','a','m',' ','F','i','l','e','s',' ','(','x','8','6',')','\\','C','o','m','m','o','n',' ','F','i','l','e','s','\0'}; -static const WCHAR ProgramFilesDirW[] = {'P','r','o','g','r','a','m','F','i','l','e','s','D','i','r','\0'}; -static const WCHAR ProgramFilesDirX86W[] = {'P','r','o','g','r','a','m','F','i','l','e','s','D','i','r',' ','(','x','8','6',')','\0'}; -static const WCHAR ProgramsW[] = {'P','r','o','g','r','a','m','s','\0'}; -#ifndef __REACTOS__ -static const WCHAR PublicW[] = {'P','u','b','l','i','c',0}; -#endif -static const WCHAR RecentW[] = {'R','e','c','e','n','t','\0'}; -static const WCHAR ResourcesW[] = {'R','e','s','o','u','r','c','e','s','\0'}; -#ifndef __REACTOS__ -static const WCHAR Saved_GamesW[] = {'S','a','v','e','d',' ','G','a','m','e','s','\0'}; -static const WCHAR SearchesW[] = {'S','e','a','r','c','h','e','s','\0'}; -#endif -static const WCHAR SendToW[] = {'S','e','n','d','T','o','\0'}; -static const WCHAR StartUpW[] = {'S','t','a','r','t','U','p','\0'}; -static const WCHAR Start_MenuW[] = {'S','t','a','r','t',' ','M','e','n','u','\0'}; -#ifndef __REACTOS__ -static const WCHAR Start_Menu_ProgramsW[] = {'S','t','a','r','t',' ','M','e','n','u','\\','P','r','o','g','r','a','m','s','\0'}; -static const WCHAR Start_Menu_Admin_ToolsW[] = {'S','t','a','r','t',' ','M','e','n','u','\\','P','r','o','g','r','a','m','s','\\','A','d','m','i','n','i','s','t','r','a','t','i','v','e',' ','T','o','o','l','s','\0'}; -static const WCHAR Start_Menu_StartupW[] = {'S','t','a','r','t',' ','M','e','n','u','\\','P','r','o','g','r','a','m','s','\\','S','t','a','r','t','U','p','\0'}; -#endif -static const WCHAR TemplatesW[] = {'T','e','m','p','l','a','t','e','s','\0'}; +static const WCHAR Application_DataW[] = L"Application Data"; +static const WCHAR Local_Settings_Application_DataW[] = L"Local Settings\\Application Data"; +static const WCHAR Local_Settings_HistoryW[] = L"Local Settings\\History"; +static const WCHAR Local_Settings_Temporary_Internet_FilesW[] = L"Local Settings\\Temporary Internet Files"; +static const WCHAR MusicW[] = L"Music"; +static const WCHAR PicturesW[] = L"Pictures"; +static const WCHAR Program_FilesW[] = L"Program Files"; +static const WCHAR Program_Files_Common_FilesW[] = L"Program Files\\Common Files"; +static const WCHAR Start_Menu_ProgramsW[] = L"Start Menu\\Programs"; +static const WCHAR Start_Menu_Admin_ToolsW[] = L"Start Menu\\Programs\\Administrative Tools"; +static const WCHAR Start_Menu_StartupW[] = L"Start Menu\\Programs\\StartUp"; +#endif + +/* Long strings that are repeated many times: keep them here */ +static const WCHAR szSHFolders[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"; +static const WCHAR szSHUserFolders[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders"; #ifndef __REACTOS__ -static const WCHAR UsersW[] = {'U','s','e','r','s','\0'}; -static const WCHAR UsersPublicW[] = {'U','s','e','r','s','\\','P','u','b','l','i','c','\0'}; -static const WCHAR VideosW[] = {'V','i','d','e','o','s','\0'}; -static const WCHAR Videos_Sample_VideosW[] = {'V','i','d','e','o','s','\\','S','a','m','p','l','e',' ','V','i','d','e','o','s','\0'}; +static const WCHAR szKnownFolderDescriptions[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions"; +static const WCHAR szKnownFolderRedirections[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders"; #endif -static const WCHAR DefaultW[] = {'.','D','e','f','a','u','l','t','\0'}; -static const WCHAR AllUsersProfileW[] = {'%','A','L','L','U','S','E','R','S','P','R','O','F','I','L','E','%','\0'}; -#ifndef __REACTOS__ -static const WCHAR PublicProfileW[] = {'%','P','U','B','L','I','C','%',0}; -#endif -static const WCHAR UserProfileW[] = {'%','U','S','E','R','P','R','O','F','I','L','E','%','\0'}; -static const WCHAR SystemDriveW[] = {'%','S','y','s','t','e','m','D','r','i','v','e','%','\0'}; -#ifndef __REACTOS__ -static const WCHAR ProfileListW[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s',' ','N','T','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','P','r','o','f','i','l','e','L','i','s','t',0}; -static const WCHAR ProfilesDirectoryW[] = {'P','r','o','f','i','l','e','s','D','i','r','e','c','t','o','r','y',0}; -static const WCHAR AllUsersProfileValueW[] = {'A','l','l','U','s','e','r','s','P','r','o','f','i','l','e','\0'}; -#endif -static const WCHAR szSHFolders[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r','\\','S','h','e','l','l',' ','F','o','l','d','e','r','s','\0'}; -static const WCHAR szSHUserFolders[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r','\\','U','s','e','r',' ','S','h','e','l','l',' ','F','o','l','d','e','r','s','\0'}; -static const WCHAR szDefaultProfileDirW[] = {'u','s','e','r','s',0}; -#ifndef __REACTOS__ -static const WCHAR szKnownFolderDescriptions[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r','\\','F','o','l','d','e','r','D','e','s','c','r','i','p','t','i','o','n','s','\0'}; -static const WCHAR szKnownFolderRedirections[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r','\\','U','s','e','r',' ','S','h','e','l','l',' ','F','o','l','d','e','r','s',0}; -#endif -static const WCHAR AllUsersW[] = {'P','u','b','l','i','c',0}; typedef enum _CSIDL_Type { CSIDL_Type_User, @@ -971,7 +872,7 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x00 - CSIDL_DESKTOP */ &FOLDERID_Desktop, CSIDL_Type_User, - DesktopW, + L"Desktop", MAKEINTRESOURCEW(IDS_DESKTOPDIRECTORY), #ifdef __REACTOS__ 0 @@ -988,7 +889,7 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x02 - CSIDL_PROGRAMS */ &FOLDERID_Programs, CSIDL_Type_User, - ProgramsW, + L"Programs", MAKEINTRESOURCEW(IDS_PROGRAMS), #ifdef __REACTOS__ 0 @@ -1013,34 +914,34 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x05 - CSIDL_PERSONAL */ &FOLDERID_Documents, CSIDL_Type_User, - PersonalW, + L"Personal", MAKEINTRESOURCEW(IDS_PERSONAL), -IDI_SHELL_MY_DOCUMENTS }, { /* 0x06 - CSIDL_FAVORITES */ &FOLDERID_Favorites, CSIDL_Type_User, - FavoritesW, + L"Favorites", MAKEINTRESOURCEW(IDS_FAVORITES), -IDI_SHELL_FAVORITES }, { /* 0x07 - CSIDL_STARTUP */ &FOLDERID_Startup, CSIDL_Type_User, - StartUpW, + L"StartUp", MAKEINTRESOURCEW(IDS_STARTUP) }, { /* 0x08 - CSIDL_RECENT */ &FOLDERID_Recent, CSIDL_Type_User, - RecentW, + L"Recent", MAKEINTRESOURCEW(IDS_RECENT), -IDI_SHELL_RECENT_DOCUMENTS }, { /* 0x09 - CSIDL_SENDTO */ &FOLDERID_SendTo, CSIDL_Type_User, - SendToW, + L"SendTo", MAKEINTRESOURCEW(IDS_SENDTO) }, { /* 0x0a - CSIDL_BITBUCKET - Recycle Bin */ @@ -1052,7 +953,7 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x0b - CSIDL_STARTMENU */ &FOLDERID_StartMenu, CSIDL_Type_User, - Start_MenuW, + L"Start Menu", MAKEINTRESOURCEW(IDS_STARTMENU), -IDI_SHELL_TSKBAR_STARTMENU }, @@ -1070,7 +971,7 @@ static const CSIDL_DATA CSIDL_Data[] = #else CSIDL_Type_User, #endif - My_MusicW, + L"My Music", MAKEINTRESOURCEW(IDS_MYMUSIC), -IDI_SHELL_MY_MUSIC }, @@ -1081,7 +982,7 @@ static const CSIDL_DATA CSIDL_Data[] = #else CSIDL_Type_User, #endif - My_VideoW, + L"My Video", MAKEINTRESOURCEW(IDS_MYVIDEO), -IDI_SHELL_MY_MOVIES }, @@ -1094,7 +995,7 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x10 - CSIDL_DESKTOPDIRECTORY */ &FOLDERID_Desktop, CSIDL_Type_User, - DesktopW, + L"Desktop", MAKEINTRESOURCEW(IDS_DESKTOPDIRECTORY), #ifdef __REACTOS__ 0 @@ -1119,34 +1020,34 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x13 - CSIDL_NETHOOD */ &FOLDERID_NetHood, CSIDL_Type_User, - NetHoodW, + L"NetHood", MAKEINTRESOURCEW(IDS_NETHOOD), -IDI_SHELL_NETWORK }, { /* 0x14 - CSIDL_FONTS */ &FOLDERID_Fonts, CSIDL_Type_WindowsPath, - FontsW, - FontsW, + L"Fonts", + L"Fonts", -IDI_SHELL_FONTS_FOLDER }, { /* 0x15 - CSIDL_TEMPLATES */ &FOLDERID_Templates, CSIDL_Type_User, - TemplatesW, + L"Templates", MAKEINTRESOURCEW(IDS_TEMPLATES) }, { /* 0x16 - CSIDL_COMMON_STARTMENU */ &FOLDERID_CommonStartMenu, CSIDL_Type_AllUsers, - Common_Start_MenuW, + L"Common Start Menu", MAKEINTRESOURCEW(IDS_STARTMENU), -IDI_SHELL_TSKBAR_STARTMENU }, { /* 0x17 - CSIDL_COMMON_PROGRAMS */ &FOLDERID_CommonPrograms, CSIDL_Type_AllUsers, - Common_ProgramsW, + L"Common Programs", MAKEINTRESOURCEW(IDS_PROGRAMS), #ifdef __REACTOS__ 0 @@ -1157,13 +1058,13 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x18 - CSIDL_COMMON_STARTUP */ &FOLDERID_CommonStartup, CSIDL_Type_AllUsers, - Common_StartUpW, + L"Common StartUp", MAKEINTRESOURCEW(IDS_STARTUP) }, { /* 0x19 - CSIDL_COMMON_DESKTOPDIRECTORY */ &FOLDERID_PublicDesktop, CSIDL_Type_AllUsers, - Common_DesktopW, + L"Common Desktop", MAKEINTRESOURCEW(IDS_DESKTOPDIRECTORY), #ifdef __REACTOS__ 0 @@ -1174,20 +1075,20 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x1a - CSIDL_APPDATA */ &FOLDERID_RoamingAppData, CSIDL_Type_User, - AppDataW, + L"AppData", MAKEINTRESOURCEW(IDS_APPDATA) }, { /* 0x1b - CSIDL_PRINTHOOD */ &FOLDERID_PrintHood, CSIDL_Type_User, - PrintHoodW, + L"PrintHood", MAKEINTRESOURCEW(IDS_PRINTHOOD), -IDI_SHELL_PRINTERS_FOLDER }, { /* 0x1c - CSIDL_LOCAL_APPDATA */ &FOLDERID_LocalAppData, CSIDL_Type_User, - Local_AppDataW, + L"Local AppData", MAKEINTRESOURCEW(IDS_LOCAL_APPDATA) }, { /* 0x1d - CSIDL_ALTSTARTUP */ @@ -1205,32 +1106,32 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x1f - CSIDL_COMMON_FAVORITES */ &FOLDERID_Favorites, CSIDL_Type_AllUsers, - Common_FavoritesW, + L"Common Favorites", MAKEINTRESOURCEW(IDS_FAVORITES), -IDI_SHELL_FAVORITES }, { /* 0x20 - CSIDL_INTERNET_CACHE */ &FOLDERID_InternetCache, CSIDL_Type_User, - CacheW, + L"Cache", MAKEINTRESOURCEW(IDS_INTERNET_CACHE) }, { /* 0x21 - CSIDL_COOKIES */ &FOLDERID_Cookies, CSIDL_Type_User, - CookiesW, + L"Cookies", MAKEINTRESOURCEW(IDS_COOKIES) }, { /* 0x22 - CSIDL_HISTORY */ &FOLDERID_History, CSIDL_Type_User, - HistoryW, + L"History", MAKEINTRESOURCEW(IDS_HISTORY) }, { /* 0x23 - CSIDL_COMMON_APPDATA */ &FOLDERID_ProgramData, CSIDL_Type_AllUsers, - Common_AppDataW, + L"Common AppData", MAKEINTRESOURCEW(IDS_APPDATA) }, { /* 0x24 - CSIDL_WINDOWS */ @@ -1250,7 +1151,7 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x26 - CSIDL_PROGRAM_FILES */ &FOLDERID_ProgramFiles, CSIDL_Type_CurrVer, - ProgramFilesDirW, + L"ProgramFilesDir", MAKEINTRESOURCEW(IDS_PROGRAM_FILES), #ifdef __REACTOS__ 0 @@ -1265,7 +1166,7 @@ static const CSIDL_DATA CSIDL_Data[] = #else CSIDL_Type_User, #endif - My_PicturesW, + L"My Pictures", MAKEINTRESOURCEW(IDS_MYPICTURES), -IDI_SHELL_MY_PICTURES }, @@ -1285,47 +1186,47 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x2a - CSIDL_PROGRAM_FILESX86 */ &FOLDERID_ProgramFilesX86, CSIDL_Type_CurrVer, - ProgramFilesDirX86W, - Program_Files_x86W, + L"ProgramFilesDir (x86)", + L"Program Files (x86)", -IDI_SHELL_PROGRAMS_FOLDER }, { /* 0x2b - CSIDL_PROGRAM_FILES_COMMON */ &FOLDERID_ProgramFilesCommon, CSIDL_Type_CurrVer, - CommonFilesDirW, + L"CommonFilesDir", MAKEINTRESOURCEW(IDS_PROGRAM_FILES_COMMON), -IDI_SHELL_PROGRAMS_FOLDER }, { /* 0x2c - CSIDL_PROGRAM_FILES_COMMONX86 */ &FOLDERID_ProgramFilesCommonX86, CSIDL_Type_CurrVer, - CommonFilesDirX86W, - Program_Files_x86_Common_FilesW, + L"CommonFilesDir (x86)", + L"Program Files (x86)\\Common Files", -IDI_SHELL_PROGRAMS_FOLDER }, { /* 0x2d - CSIDL_COMMON_TEMPLATES */ &FOLDERID_CommonTemplates, CSIDL_Type_AllUsers, - Common_TemplatesW, + L"Common Templates", MAKEINTRESOURCEW(IDS_TEMPLATES) }, { /* 0x2e - CSIDL_COMMON_DOCUMENTS */ &FOLDERID_PublicDocuments, CSIDL_Type_AllUsers, - Common_DocumentsW, + L"Common Documents", MAKEINTRESOURCEW(IDS_PERSONAL), -IDI_SHELL_MY_DOCUMENTS }, { /* 0x2f - CSIDL_COMMON_ADMINTOOLS */ &FOLDERID_CommonAdminTools, CSIDL_Type_AllUsers, - Common_Administrative_ToolsW, + L"Common Administrative Tools", MAKEINTRESOURCEW(IDS_ADMINTOOLS) }, { /* 0x30 - CSIDL_ADMINTOOLS */ &FOLDERID_AdminTools, CSIDL_Type_User, - Administrative_ToolsW, + L"Administrative Tools", MAKEINTRESOURCEW(IDS_ADMINTOOLS) }, { /* 0x31 - CSIDL_CONNECTIONS */ @@ -1356,21 +1257,21 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x35 - CSIDL_COMMON_MUSIC */ &FOLDERID_PublicMusic, CSIDL_Type_AllUsers, - CommonMusicW, + L"CommonMusic", MAKEINTRESOURCEW(IDS_COMMON_MUSIC), -IDI_SHELL_MY_MUSIC }, { /* 0x36 - CSIDL_COMMON_PICTURES */ &FOLDERID_PublicPictures, CSIDL_Type_AllUsers, - CommonPicturesW, + L"CommonPictures", MAKEINTRESOURCEW(IDS_COMMON_PICTURES), -IDI_SHELL_MY_PICTURES }, { /* 0x37 - CSIDL_COMMON_VIDEO */ &FOLDERID_PublicVideos, CSIDL_Type_AllUsers, - CommonVideoW, + L"CommonVideo", MAKEINTRESOURCEW(IDS_COMMON_VIDEO), -IDI_SHELL_MY_MOVIES }, @@ -1378,7 +1279,7 @@ static const CSIDL_DATA CSIDL_Data[] = &FOLDERID_ResourceDir, CSIDL_Type_WindowsPath, NULL, - ResourcesW + L"Resources" }, { /* 0x39 - CSIDL_RESOURCES_LOCALIZED */ &FOLDERID_LocalizedResourcesDir, @@ -1390,13 +1291,13 @@ static const CSIDL_DATA CSIDL_Data[] = &FOLDERID_CommonOEMLinks, CSIDL_Type_AllUsers, NULL, - OEM_LinksW + L"OEM Links" }, { /* 0x3b - CSIDL_CDBURN_AREA */ &FOLDERID_CDBurning, CSIDL_Type_User, - CD_BurningW, - Local_Settings_CD_BurningW + L"CD Burning", + L"Local Settings\\Application Data\\Microsoft\\CD Burning" }, { /* 0x3c unassigned */ &GUID_NULL, @@ -1446,7 +1347,7 @@ static const CSIDL_DATA CSIDL_Data[] = &FOLDERID_Contacts, CSIDL_Type_User, NULL, - ContactsW + L"Contacts" }, { /* 0x44 */ &FOLDERID_DeviceMetadataStore, @@ -1458,7 +1359,7 @@ static const CSIDL_DATA CSIDL_Data[] = &GUID_NULL, CSIDL_Type_User, NULL, - DocumentsW + L"Documents" }, { /* 0x46 */ &FOLDERID_DocumentsLibrary, @@ -1474,7 +1375,7 @@ static const CSIDL_DATA CSIDL_Data[] = CSIDL_Type_User, #endif NULL, - DownloadsW + L"Downloads" }, { /* 0x48 */ &FOLDERID_Games, @@ -1510,13 +1411,13 @@ static const CSIDL_DATA CSIDL_Data[] = &FOLDERID_Links, CSIDL_Type_User, NULL, - LinksW + L"Links" }, { /* 0x4e - CSIDL_APPDATA_LOCALLOW */ &FOLDERID_LocalAppDataLow, CSIDL_Type_User, NULL, - AppData_LocalLowW + L"AppData\\LocalLow" }, { /* 0x4f */ &FOLDERID_MusicLibrary, @@ -1534,7 +1435,7 @@ static const CSIDL_DATA CSIDL_Data[] = &FOLDERID_PhotoAlbums, CSIDL_Type_User, NULL, - Pictures_Slide_ShowsW + L"Pictures\\Slide Shows" }, { /* 0x52 */ &FOLDERID_PicturesLibrary, @@ -1546,7 +1447,7 @@ static const CSIDL_DATA CSIDL_Data[] = &FOLDERID_Playlists, CSIDL_Type_User, NULL, - Music_PlaylistsW + L"Music\\Playlists" }, { /* 0x54 */ &FOLDERID_ProgramFilesX64, @@ -1564,31 +1465,31 @@ static const CSIDL_DATA CSIDL_Data[] = &FOLDERID_Public, CSIDL_Type_CurrVer, /* FIXME */ NULL, - UsersPublicW + L"Users\\Public" }, { /* 0x57 */ &FOLDERID_PublicDownloads, CSIDL_Type_AllUsers, NULL, - DownloadsW + L"Downloads" }, { /* 0x58 */ &FOLDERID_PublicGameTasks, CSIDL_Type_AllUsers, NULL, - Microsoft_Windows_GameExplorerW + L"Microsoft\\Windows\\GameExplorer" }, { /* 0x59 */ &FOLDERID_PublicLibraries, CSIDL_Type_AllUsers, NULL, - Microsoft_Windows_LibrariesW + L"Microsoft\\Windows\\Libraries" }, { /* 0x5a */ &FOLDERID_PublicRingtones, CSIDL_Type_AllUsers, NULL, - Microsoft_Windows_RingtonesW + L"Microsoft\\Windows\\Ringtones" }, { /* 0x5b */ &FOLDERID_QuickLaunch, @@ -1612,37 +1513,37 @@ static const CSIDL_DATA CSIDL_Data[] = &FOLDERID_SampleMusic, CSIDL_Type_AllUsers, NULL, - Music_Sample_MusicW + L"Music\\Sample Music" }, { /* 0x5f */ &FOLDERID_SamplePictures, CSIDL_Type_AllUsers, NULL, - Pictures_Sample_PicturesW + L"Pictures\\Sample Pictures" }, { /* 0x60 */ &FOLDERID_SamplePlaylists, CSIDL_Type_AllUsers, NULL, - Music_Sample_PlaylistsW + L"Music\\Sample Playlists" }, { /* 0x61 */ &FOLDERID_SampleVideos, CSIDL_Type_AllUsers, NULL, - Videos_Sample_VideosW + L"Videos\\Sample Videos" }, { /* 0x62 - CSIDL_SAVED_GAMES */ &FOLDERID_SavedGames, CSIDL_Type_User, NULL, - Saved_GamesW + L"Saved Games" }, { /* 0x63 - CSIDL_SEARCHES */ &FOLDERID_SavedSearches, CSIDL_Type_User, NULL, - SearchesW + L"Searches" }, { /* 0x64 */ &FOLDERID_SEARCH_CSC, @@ -1701,8 +1602,8 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x6d */ &FOLDERID_UserProfiles, CSIDL_Type_CurrVer, - UsersW, - UsersW + L"Users", + L"Users" }, { /* 0x6e */ &FOLDERID_UserProgramFiles, @@ -1920,11 +1821,11 @@ static HRESULT _SHGetDefaultValue(HANDLE hToken, BYTE folder, LPWSTR pszPath) switch (CSIDL_Data[folder].type) { case CSIDL_Type_User: - strcpyW(pszPath, UserProfileW); + strcpyW(pszPath, L"%USERPROFILE%"); break; #ifdef __REACTOS__ case CSIDL_Type_InMyDocuments: - strcpyW(pszPath, UserProfileW); + strcpyW(pszPath, L"%USERPROFILE%"); if (DoGetProductType(&ProductType) && ProductType == NtProductWinNt) { if (IS_INTRESOURCE(CSIDL_Data[CSIDL_MYDOCUMENTS].szDefaultPath)) @@ -1944,13 +1845,13 @@ static HRESULT _SHGetDefaultValue(HANDLE hToken, BYTE folder, LPWSTR pszPath) #endif case CSIDL_Type_AllUsers: #ifndef __REACTOS__ - strcpyW(pszPath, PublicProfileW); + strcpyW(pszPath, L"%PUBLIC%"); #else - strcpyW(pszPath, AllUsersProfileW); + strcpyW(pszPath, L"%ALLUSERSPROFILE%"); #endif break; case CSIDL_Type_CurrVer: - strcpyW(pszPath, SystemDriveW); + strcpyW(pszPath, L"%SystemDrive%"); break; default: ; /* no corresponding env. var, do nothing */ @@ -1984,7 +1885,7 @@ static HRESULT _SHGetDefaultValue(HANDLE hToken, BYTE folder, LPWSTR pszPath) /* Gets the (unexpanded) value of the folder with index folder into pszPath. * The folder's type is assumed to be CSIDL_Type_CurrVer. Its default value - * can be overridden in the HKLM\\szCurrentVersion key. + * can be overridden in the HKLM\\Software\\Microsoft\\Windows\\CurrentVersion key. * If dwFlags has SHGFP_TYPE_DEFAULT set or if the value isn't overridden in * the registry, uses _SHGetDefaultValue to get the value. */ @@ -2012,7 +1913,7 @@ static HRESULT _SHGetCurrentVersionPath(DWORD dwFlags, BYTE folder, { HKEY hKey; - if (RegCreateKeyW(HKEY_LOCAL_MACHINE, szCurrentVersion, &hKey)) + if (RegCreateKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion", &hKey)) hr = E_FAIL; else { @@ -2131,6 +2032,7 @@ static HRESULT _SHGetUserProfilePath(HANDLE hToken, DWORD dwFlags, BYTE folder, } else { + static const WCHAR DefaultW[] = L".Default"; LPCWSTR userPrefix = NULL; HKEY hRootKey; @@ -2231,7 +2133,7 @@ static HRESULT _SHOpenProfilesKey(PHKEY pKey) LONG lRet; DWORD disp; - lRet = RegCreateKeyExW(HKEY_LOCAL_MACHINE, ProfileListW, 0, NULL, 0, + lRet = RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList", 0, NULL, 0, KEY_ALL_ACCESS, NULL, pKey, &disp); return HRESULT_FROM_WIN32(lRet); } @@ -2324,9 +2226,9 @@ static HRESULT _SHExpandEnvironmentStrings(HANDLE hToken, LPCWSTR szSrc, LPWSTR /* get the system drive */ GetSystemDirectoryW(def_val, MAX_PATH); - strcpyW( def_val + 3, szDefaultProfileDirW ); + strcpyW( def_val + 3, L"Users" ); - hr = _SHGetProfilesValue(key, ProfilesDirectoryW, szProfilesPrefix, def_val ); + hr = _SHGetProfilesValue(key, L"ProfilesDirectory", szProfilesPrefix, def_val ); } #else hr = S_OK; @@ -2336,36 +2238,35 @@ static HRESULT _SHExpandEnvironmentStrings(HANDLE hToken, LPCWSTR szSrc, LPWSTR strcpyW(szTemp, szSrc); while (SUCCEEDED(hr) && szTemp[0] == '%') { - if (!strncmpiW(szTemp, AllUsersProfileW, strlenW(AllUsersProfileW))) + if (!strncmpiW(szTemp, L"%ALLUSERSPROFILE%", ARRAY_SIZE(L"%ALLUSERSPROFILE%")-1)) { #ifndef __REACTOS__ WCHAR szAllUsers[MAX_PATH]; strcpyW(szDest, szProfilesPrefix); - hr = _SHGetProfilesValue(key, AllUsersProfileValueW, - szAllUsers, AllUsersW); + hr = _SHGetProfilesValue(key, L"AllUsersProfile", szAllUsers, L"Public"); PathAppendW(szDest, szAllUsers); #else DWORD cchSize = cchDest; if (!GetAllUsersProfileDirectoryW(szDest, &cchSize)) goto fallback_expand; #endif - PathAppendW(szDest, szTemp + strlenW(AllUsersProfileW)); + PathAppendW(szDest, szTemp + ARRAY_SIZE(L"%ALLUSERSPROFILE%")-1); } #ifndef __REACTOS__ - else if (!strncmpiW(szTemp, PublicProfileW, strlenW(PublicProfileW))) + else if (!strncmpiW(szTemp, L"%PUBLIC%", ARRAY_SIZE(L"%PUBLIC%")-1)) { WCHAR szAllUsers[MAX_PATH], def_val[MAX_PATH]; GetSystemDirectoryW(def_val, MAX_PATH); - strcpyW( def_val + 3, UsersPublicW ); + strcpyW( def_val + 3, L"Users\\Public" ); - hr = _SHGetProfilesValue(key, PublicW, szAllUsers, def_val); + hr = _SHGetProfilesValue(key, L"Public", szAllUsers, def_val); PathAppendW(szDest, szAllUsers); - PathAppendW(szDest, szTemp + strlenW(PublicProfileW)); + PathAppendW(szDest, szTemp + ARRAY_SIZE(L"%PUBLIC%")-1); } #endif - else if (!strncmpiW(szTemp, UserProfileW, strlenW(UserProfileW))) + else if (!strncmpiW(szTemp, L"%USERPROFILE%", ARRAY_SIZE(L"%USERPROFILE%")-1)) { #ifndef __REACTOS__ WCHAR userName[MAX_PATH]; @@ -2379,9 +2280,9 @@ static HRESULT _SHExpandEnvironmentStrings(HANDLE hToken, LPCWSTR szSrc, LPWSTR if (!_SHGetUserProfileDirectoryW(hToken, szDest, &cchSize)) goto fallback_expand; #endif - PathAppendW(szDest, szTemp + strlenW(UserProfileW)); + PathAppendW(szDest, szTemp + ARRAY_SIZE(L"%USERPROFILE%")-1); } - else if (!strncmpiW(szTemp, SystemDriveW, strlenW(SystemDriveW))) + else if (!strncmpiW(szTemp, L"%SystemDrive%", ARRAY_SIZE(L"%SystemDrive%")-1)) { #ifndef __REACTOS__ GetSystemDirectoryW(szDest, MAX_PATH); @@ -2389,7 +2290,7 @@ static HRESULT _SHExpandEnvironmentStrings(HANDLE hToken, LPCWSTR szSrc, LPWSTR if (!GetSystemDirectoryW(szDest, cchDest)) goto fallback_expand; #endif - strcpyW(szDest + 3, szTemp + strlenW(SystemDriveW) + 1); + strcpyW(szDest + 3, szTemp + ARRAY_SIZE(L"%SystemDrive%")-1 + 1); } else #ifdef __REACTOS__ @@ -2648,11 +2549,11 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW( TRACE("Created missing system directory %s\n", debugstr_w(szBuildPath)); end: +#ifdef __REACTOS__ /* create desktop.ini for custom icon */ if ((nFolder & CSIDL_FLAG_CREATE) && CSIDL_Data[folder].nShell32IconIndex) { - static const WCHAR s_szFormat[] = L"%%SystemRoot%%\\system32\\shell32.dll,%d"; WCHAR szIconLocation[MAX_PATH]; DWORD dwAttributes; @@ -2665,7 +2566,8 @@ end: PathAppendW(szBuildPath, L"desktop.ini"); /* build the icon location */ - StringCchPrintfW(szIconLocation, _countof(szIconLocation), s_szFormat, + StringCchPrintfW(szIconLocation, _countof(szIconLocation), + L"%%SystemRoot%%\\system32\\shell32.dll,%d", CSIDL_Data[folder].nShell32IconIndex); /* write desktop.ini */ @@ -2679,6 +2581,7 @@ end: dwAttributes |= FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN; SetFileAttributesW(szBuildPath, dwAttributes); } +#endif TRACE("returning 0x%08x (final path is %s)\n", hr, debugstr_w(szBuildPath)); return hr; @@ -2866,11 +2769,11 @@ static HRESULT _SHRegisterUserShellFolders(BOOL bDefault) { hToken = (HANDLE)-1; hRootKey = HKEY_USERS; - strcpyW(userShellFolderPath, DefaultW); + strcpyW(userShellFolderPath, L".Default"); PathAddBackslashW(userShellFolderPath); strcatW(userShellFolderPath, szSHUserFolders); pUserShellFolderPath = userShellFolderPath; - strcpyW(shellFolderPath, DefaultW); + strcpyW(shellFolderPath, L".Default"); PathAddBackslashW(shellFolderPath); strcatW(shellFolderPath, szSHFolders); pShellFolderPath = shellFolderPath; diff --git a/dll/win32/shell32/wine/shellstring.c b/dll/win32/shell32/wine/shellstring.c index 8796f3813c3..6099325559c 100644 --- a/dll/win32/shell32/wine/shellstring.c +++ b/dll/win32/shell32/wine/shellstring.c @@ -244,8 +244,6 @@ VOID WINAPI CheckEscapesA( LocalFree(wString); } -static const WCHAR strEscapedChars[] = {' ','"',',',';','^',0}; - /************************************************************************* * CheckEscapesW [SHELL32.@] * @@ -260,7 +258,7 @@ VOID WINAPI CheckEscapesW( TRACE("(%s %d) stub\n", debugstr_w(string), len); - if (StrPBrkW(string, strEscapedChars) && size + 2 <= len) + if (StrPBrkW(string, L" \",;^") && size + 2 <= len) { s = &string[size - 1]; d = &string[size + 2]; diff --git a/dll/win32/shell32/wine/shlmenu.c b/dll/win32/shell32/wine/shlmenu.c index a5e8e3ee007..281c63b41fd 100644 --- a/dll/win32/shell32/wine/shlmenu.c +++ b/dll/win32/shell32/wine/shlmenu.c @@ -231,8 +231,7 @@ static int FM_InitMenuPopup(HMENU hmenu, LPCITEMIDLIST pAlternatePidl) if ( GetMenuItemCount (hmenu) == 0 ) { - static const WCHAR szEmpty[] = { '(','e','m','p','t','y',')',0 }; - FileMenu_AppendItemW (hmenu, szEmpty, uID, FM_BLANK_ICON, 0, FM_DEFAULT_HEIGHT); + FileMenu_AppendItemW (hmenu, L"(empty)", uID, FM_BLANK_ICON, 0, FM_DEFAULT_HEIGHT); NumberOfItems++; } diff --git a/dll/win32/shell32/wine/shpolicy.c b/dll/win32/shell32/wine/shpolicy.c index 6f7a2a5b20e..84086318853 100644 --- a/dll/win32/shell32/wine/shpolicy.c +++ b/dll/win32/shell32/wine/shpolicy.c @@ -55,15 +55,6 @@ typedef struct tagPOLICYDAT DWORD cache; /* cached value or 0xffffffff for invalid */ } POLICYDATA, *LPPOLICYDATA; -/* registry strings */ -static const CHAR strRegistryPolicyA[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies"; -static const WCHAR strRegistryPolicyW[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o', - 's','o','f','t','\\','W','i','n','d','o','w','s','\\', - 'C','u','r','r','e','n','t','V','e','r','s','i','o','n', - '\\','P','o','l','i','c','i','e','s',0}; -static const CHAR strPolicyA[] = "Policy"; -static const WCHAR strPolicyW[] = {'P','o','l','i','c','y',0}; - /* application strings */ static const char strExplorer[] = {"Explorer"}; @@ -866,8 +857,7 @@ DWORD WINAPI SHRestricted (RESTRICTIONS policy) return p->cache; } - lstrcpyA(regstr, strRegistryPolicyA); - lstrcatA(regstr, "\\"); + lstrcpyA(regstr, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\"); lstrcatA(regstr, p->appstr); /* return 0 and don't set the cache if any registry errors occur */ @@ -922,15 +912,15 @@ BOOL WINAPI SHSettingsChanged(LPCVOID unused, LPCVOID inpRegKey) { if (SHELL_OsIsUnicode()) { - if (lstrcmpiW(inpRegKey, strRegistryPolicyW) && - lstrcmpiW(inpRegKey, strPolicyW)) + if (lstrcmpiW(inpRegKey, L"Software\\Microsoft\\Windows\\CurrentVersion\\Policies") && + lstrcmpiW(inpRegKey, L"Policy")) /* doesn't match, fail */ return FALSE; } else { - if (lstrcmpiA(inpRegKey, strRegistryPolicyA) && - lstrcmpiA(inpRegKey, strPolicyA)) + if (lstrcmpiA(inpRegKey, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies") && + lstrcmpiA(inpRegKey, "Policy")) /* doesn't match, fail */ return FALSE; }
2 years, 11 months
1
0
0
0
[reactos] 01/01: [SHELL32] recyclebin.h: Correctly balance the INTERFACE defines/undefs.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=59b3545603626f45626dc…
commit 59b3545603626f45626dcd538392750e472dcb43 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Jan 9 19:00:46 2022 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Jan 9 19:02:41 2022 +0100 [SHELL32] recyclebin.h: Correctly balance the INTERFACE defines/undefs. --- dll/win32/shell32/shellrecyclebin/recyclebin.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dll/win32/shell32/shellrecyclebin/recyclebin.h b/dll/win32/shell32/shellrecyclebin/recyclebin.h index 63e149e265c..2fa2d00139b 100644 --- a/dll/win32/shell32/shellrecyclebin/recyclebin.h +++ b/dll/win32/shell32/shellrecyclebin/recyclebin.h @@ -179,9 +179,7 @@ RestoreFile( /* COM interface */ -#undef INTERFACE #define INTERFACE IRecycleBinFile - DECLARE_INTERFACE_(IRecycleBinFile, IUnknown) { BEGIN_INTERFACE @@ -203,10 +201,9 @@ DECLARE_INTERFACE_(IRecycleBinFile, IUnknown) END_INTERFACE }; - #undef INTERFACE -#define INTERFACE IRecycleBinEnumList +#define INTERFACE IRecycleBinEnumList DECLARE_INTERFACE_(IRecycleBinEnumList, IUnknown) { BEGIN_INTERFACE @@ -223,10 +220,9 @@ DECLARE_INTERFACE_(IRecycleBinEnumList, IUnknown) END_INTERFACE }; - #undef INTERFACE -#define INTERFACE IRecycleBin +#define INTERFACE IRecycleBin DECLARE_INTERFACE_(IRecycleBin, IUnknown) { BEGIN_INTERFACE @@ -243,6 +239,7 @@ DECLARE_INTERFACE_(IRecycleBin, IUnknown) END_INTERFACE }; +#undef INTERFACE EXTERN_C const IID IID_IRecycleBinFile; EXTERN_C const IID IID_IRecycleBinEnumList;
2 years, 11 months
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
17
18
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Results per page:
10
25
50
100
200