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 2012
----- 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
19 participants
559 discussions
Start a n
N
ew thread
[ekohl] 54847: [EVENTLOG] - Implement LogfBackupFile. - Fix a typo.
by ekohl@svn.reactos.org
Author: ekohl Date: Thu Jan 5 23:03:40 2012 New Revision: 54847 URL:
http://svn.reactos.org/svn/reactos?rev=54847&view=rev
Log: [EVENTLOG] - Implement LogfBackupFile. - Fix a typo. Modified: trunk/reactos/base/services/eventlog/eventlog.c trunk/reactos/base/services/eventlog/eventlog.h trunk/reactos/base/services/eventlog/file.c trunk/reactos/base/services/eventlog/rpc.c Modified: trunk/reactos/base/services/eventlog/eventlog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/eve…
============================================================================== --- trunk/reactos/base/services/eventlog/eventlog.c [iso-8859-1] (original) +++ trunk/reactos/base/services/eventlog/eventlog.c [iso-8859-1] Thu Jan 5 23:03:40 2012 @@ -495,7 +495,7 @@ DPRINT("Flags: "); if (header->Flags & ELF_LOGFILE_HEADER_DIRTY) DPRINT("ELF_LOGFILE_HEADER_DIRTY"); if (header->Flags & ELF_LOGFILE_HEADER_WRAP) DPRINT("| ELF_LOGFILE_HEADER_WRAP "); - if (header->Flags & ELF_LOGGFILE_LOGFULL_WRITTEN) DPRINT("| ELF_LOGGFILE_LOGFULL_WRITTEN "); + if (header->Flags & ELF_LOGFILE_LOGFULL_WRITTEN) DPRINT("| ELF_LOGFILE_LOGFULL_WRITTEN "); if (header->Flags & ELF_LOGFILE_ARCHIVE_SET) DPRINT("| ELF_LOGFILE_ARCHIVE_SET "); DPRINT("\n"); } Modified: trunk/reactos/base/services/eventlog/eventlog.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/eve…
============================================================================== --- trunk/reactos/base/services/eventlog/eventlog.h [iso-8859-1] (original) +++ trunk/reactos/base/services/eventlog/eventlog.h [iso-8859-1] Thu Jan 5 23:03:40 2012 @@ -19,7 +19,7 @@ #include <lpcfuncs.h> #include <rtlfuncs.h> #include <obfuncs.h> -#include <iotypes.h> +#include <iofuncs.h> #include <debug.h> #include "eventlogrpc_s.h" @@ -42,7 +42,7 @@ */ #define ELF_LOGFILE_HEADER_DIRTY 1 #define ELF_LOGFILE_HEADER_WRAP 2 -#define ELF_LOGGFILE_LOGFULL_WRITTEN 4 +#define ELF_LOGFILE_LOGFULL_WRITTEN 4 #define ELF_LOGFILE_ARCHIVE_SET 8 /* FIXME: MSDN reads that the following two structs are in winnt.h. Are they? */ Modified: trunk/reactos/base/services/eventlog/file.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/fil…
============================================================================== --- trunk/reactos/base/services/eventlog/file.c [iso-8859-1] (original) +++ trunk/reactos/base/services/eventlog/file.c [iso-8859-1] Thu Jan 5 23:03:40 2012 @@ -1077,13 +1077,200 @@ LogfBackupFile(PLOGFILE LogFile, PUNICODE_STRING BackupFileName) { -// RtlAcquireResourceShared(&LogFile->Lock, TRUE); - - /* FIXME: Write a backup file */ - -// RtlReleaseResource(&LogFile->Lock); - - return STATUS_NOT_IMPLEMENTED; + OBJECT_ATTRIBUTES ObjectAttributes; + IO_STATUS_BLOCK IoStatusBlock; + EVENTLOGHEADER Header; + EVENTLOGEOF EofRec; + HANDLE FileHandle = NULL; + ULONG i; + LARGE_INTEGER FileOffset; + NTSTATUS Status; + PUCHAR Buffer = NULL; + + DWORD dwOffset, dwRead, dwRecSize; + + DPRINT("LogfBackupFile(%p, %wZ)\n", LogFile, BackupFileName); + + /* Lock the log file shared */ + RtlAcquireResourceShared(&LogFile->Lock, TRUE); + + InitializeObjectAttributes(&ObjectAttributes, + BackupFileName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + Status = NtCreateFile(&FileHandle, + GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, + &ObjectAttributes, + &IoStatusBlock, + NULL, + FILE_ATTRIBUTE_NORMAL, + FILE_SHARE_READ, + FILE_CREATE, + FILE_WRITE_THROUGH | FILE_SYNCHRONOUS_IO_NONALERT, + NULL, + 0); + if (!NT_SUCCESS(Status)) + { + DPRINT("Can't create backup file %wZ (Status: 0x%08lx)\n", BackupFileName, Status); + goto Done; + } + + /* Initialize the (dirty) log file header */ + Header.HeaderSize = sizeof(EVENTLOGHEADER); + Header.Signature = LOGFILE_SIGNATURE; + Header.MajorVersion = MAJORVER; + Header.MinorVersion = MINORVER; + Header.StartOffset = sizeof(EVENTLOGHEADER); + Header.EndOffset = sizeof(EVENTLOGHEADER); + Header.CurrentRecordNumber = 1; + Header.OldestRecordNumber = 1; + Header.MaxSize = 0; + Header.Flags = ELF_LOGFILE_HEADER_DIRTY; + Header.Retention = LogFile->Header.Retention; + Header.EndHeaderSize = sizeof(EVENTLOGHEADER); + + /* Write the (dirty) log file header */ + Status = NtWriteFile(FileHandle, + NULL, + NULL, + NULL, + &IoStatusBlock, + &Header, + sizeof(EVENTLOGHEADER), + NULL, + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to write the log file header (Status: 0x%08lx)\n", Status); + goto Done; + } + + for (i = LogFile->Header.OldestRecordNumber; i < LogFile->Header.CurrentRecordNumber; i++) + { + dwOffset = LogfOffsetByNumber(LogFile, i); + if (dwOffset == 0) + break; + + if (SetFilePointer(LogFile->hFile, dwOffset, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER) + { + DPRINT1("SetFilePointer() failed!\n"); + goto Done; + } + + if (!ReadFile(LogFile->hFile, &dwRecSize, sizeof(DWORD), &dwRead, NULL)) + { + DPRINT1("ReadFile() failed!\n"); + goto Done; + } + + if (SetFilePointer(LogFile->hFile, dwOffset, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER) + { + DPRINT1("SetFilePointer() failed!\n"); + goto Done; + } + + Buffer = HeapAlloc(MyHeap, 0, dwRecSize); + if (Buffer == NULL) + { + DPRINT1("HeapAlloc() failed!\n"); + goto Done; + } + + if (!ReadFile(LogFile->hFile, &Buffer, dwRecSize, &dwRead, NULL)) + { + DPRINT1("ReadFile() failed!\n"); + goto Done; + } + + /* Write the event record */ + Status = NtWriteFile(FileHandle, + NULL, + NULL, + NULL, + &IoStatusBlock, + Buffer, + dwRecSize, + NULL, + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtWriteFile() failed!\n"); + goto Done; + } + + /* Update the header information */ + Header.EndOffset += dwRecSize; + + /* Free the buffer */ + HeapFree(MyHeap, 0, Buffer); + Buffer = NULL; + } + + /* Initialize the EOF record */ + EofRec.RecordSizeBeginning = sizeof(EVENTLOGEOF); + EofRec.Ones = 0x11111111; + EofRec.Twos = 0x22222222; + EofRec.Threes = 0x33333333; + EofRec.Fours = 0x44444444; + EofRec.BeginRecord = sizeof(EVENTLOGHEADER); + EofRec.EndRecord = Header.EndOffset; + EofRec.CurrentRecordNumber = LogFile->Header.CurrentRecordNumber; + EofRec.OldestRecordNumber = LogFile->Header.OldestRecordNumber; + EofRec.RecordSizeEnd = sizeof(EVENTLOGEOF); + + /* Write the EOF record */ + Status = NtWriteFile(FileHandle, + NULL, + NULL, + NULL, + &IoStatusBlock, + &EofRec, + sizeof(EVENTLOGEOF), + NULL, + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtWriteFile() failed!\n"); + goto Done; + } + + /* Update the header information */ + Header.CurrentRecordNumber = LogFile->Header.CurrentRecordNumber; + Header.OldestRecordNumber = LogFile->Header.OldestRecordNumber; + Header.MaxSize = Header.EndOffset + sizeof(EVENTLOGEOF); + Header.Flags = 0; + + /* Write the (clean) log file header */ + FileOffset.QuadPart = 0; + Status = NtWriteFile(FileHandle, + NULL, + NULL, + NULL, + &IoStatusBlock, + &Header, + sizeof(EVENTLOGHEADER), + &FileOffset, + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtWriteFile() failed!\n"); + } + +Done: + /* Free the buffer */ + if (Buffer != NULL) + HeapFree(MyHeap, 0, Buffer); + + /* Close the backup file */ + if (FileHandle != NULL) + NtClose(FileHandle); + + /* Unlock the log file */ + RtlReleaseResource(&LogFile->Lock); + + return Status; } Modified: trunk/reactos/base/services/eventlog/rpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/rpc…
============================================================================== --- trunk/reactos/base/services/eventlog/rpc.c [iso-8859-1] (original) +++ trunk/reactos/base/services/eventlog/rpc.c [iso-8859-1] Thu Jan 5 23:03:40 2012 @@ -472,6 +472,14 @@ case EVENTLOG_INFORMATION_TYPE: DPRINT("Info: %wZ\n", Strings[i]); + break; + + case EVENTLOG_AUDIT_SUCCESS: + DPRINT("Audit Success: %wZ\n", Strings[i]); + break; + + case EVENTLOG_AUDIT_FAILURE: + DPRINT("Audit Failure: %wZ\n", Strings[i]); break; default:
12 years, 11 months
1
0
0
0
[ekohl] 54846: [ADVAPI32] Pass nt paths to ElfrBackupELFW and ElfrClearELFW.
by ekohl@svn.reactos.org
Author: ekohl Date: Thu Jan 5 22:07:33 2012 New Revision: 54846 URL:
http://svn.reactos.org/svn/reactos?rev=54846&view=rev
Log: [ADVAPI32] Pass nt paths to ElfrBackupELFW and ElfrClearELFW. Modified: trunk/reactos/dll/win32/advapi32/service/eventlog.c Modified: trunk/reactos/dll/win32/advapi32/service/eventlog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
============================================================================== --- trunk/reactos/dll/win32/advapi32/service/eventlog.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/service/eventlog.c [iso-8859-1] Thu Jan 5 22:07:33 2012 @@ -145,32 +145,38 @@ BackupEventLogA(IN HANDLE hEventLog, IN LPCSTR lpBackupFileName) { - ANSI_STRING BackupFileName; - NTSTATUS Status; + ANSI_STRING BackupFileNameA; + UNICODE_STRING BackupFileNameW; + NTSTATUS Status; + BOOL Result; TRACE("%p, %s\n", hEventLog, lpBackupFileName); - RtlInitAnsiString(&BackupFileName, lpBackupFileName); - - RpcTryExcept - { - Status = ElfrBackupELFA(hEventLog, - (PRPC_STRING)&BackupFileName); - } - RpcExcept(EXCEPTION_EXECUTE_HANDLER) - { - Status = I_RpcMapWin32Status(RpcExceptionCode()); - } - RpcEndExcept; - - if (!NT_SUCCESS(Status)) - { - SetLastError(RtlNtStatusToDosError(Status)); - return FALSE; - } - - return TRUE; -} + if (lpBackupFileName == NULL) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + RtlInitAnsiString(&BackupFileNameA, lpBackupFileName); + + Status = RtlAnsiStringToUnicodeString(&BackupFileNameW, + &BackupFileNameA, + TRUE); + if (!NT_SUCCESS(Status)) + { + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; + } + + Result = BackupEventLogW(hEventLog, + BackupFileNameW.Buffer); + + RtlFreeUnicodeString(&BackupFileNameW); + + return(Result); +} + /****************************************************************************** * BackupEventLogW [ADVAPI32.@] @@ -183,23 +189,36 @@ BackupEventLogW(IN HANDLE hEventLog, IN LPCWSTR lpBackupFileName) { - UNICODE_STRING BackupFileName; + UNICODE_STRING BackupFileNameW; NTSTATUS Status; TRACE("%p, %s\n", hEventLog, debugstr_w(lpBackupFileName)); - RtlInitUnicodeString(&BackupFileName, lpBackupFileName); + if (lpBackupFileName == NULL) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + if (!RtlDosPathNameToNtPathName_U(lpBackupFileName, &BackupFileNameW, + NULL, NULL)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } RpcTryExcept { Status = ElfrBackupELFW(hEventLog, - (PRPC_UNICODE_STRING)&BackupFileName); - } - RpcExcept(EXCEPTION_EXECUTE_HANDLER) - { - Status = I_RpcMapWin32Status(RpcExceptionCode()); - } - RpcEndExcept; + (PRPC_UNICODE_STRING)&BackupFileNameW); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + RtlFreeHeap(RtlGetProcessHeap(), 0, BackupFileNameW.Buffer); if (!NT_SUCCESS(Status)) { @@ -218,31 +237,37 @@ ClearEventLogA(IN HANDLE hEventLog, IN LPCSTR lpBackupFileName) { - ANSI_STRING BackupFileName; - NTSTATUS Status; + ANSI_STRING BackupFileNameA; + UNICODE_STRING BackupFileNameW; + NTSTATUS Status; + BOOL Result; TRACE("%p, %s\n", hEventLog, lpBackupFileName); - RtlInitAnsiString(&BackupFileName, lpBackupFileName); - - RpcTryExcept - { - Status = ElfrClearELFA(hEventLog, - (PRPC_STRING)&BackupFileName); - } - RpcExcept(EXCEPTION_EXECUTE_HANDLER) - { - Status = I_RpcMapWin32Status(RpcExceptionCode()); - } - RpcEndExcept; - - if (!NT_SUCCESS(Status)) - { - SetLastError(RtlNtStatusToDosError(Status)); - return FALSE; - } - - return TRUE; + if (lpBackupFileName == NULL) + { + RtlInitUnicodeString(&BackupFileNameW, NULL); + } + else + { + RtlInitAnsiString(&BackupFileNameA, lpBackupFileName); + + Status = RtlAnsiStringToUnicodeString(&BackupFileNameW, + &BackupFileNameA, + TRUE); + if (!NT_SUCCESS(Status)) + { + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; + } + } + + Result = ClearEventLogW(hEventLog, + BackupFileNameW.Buffer); + + RtlFreeUnicodeString(&BackupFileNameW); + + return Result; } @@ -253,23 +278,38 @@ ClearEventLogW(IN HANDLE hEventLog, IN LPCWSTR lpBackupFileName) { - UNICODE_STRING BackupFileName; + UNICODE_STRING BackupFileNameW; NTSTATUS Status; TRACE("%p, %s\n", hEventLog, debugstr_w(lpBackupFileName)); - RtlInitUnicodeString(&BackupFileName,lpBackupFileName); + if (lpBackupFileName == NULL) + { + RtlInitUnicodeString(&BackupFileNameW, NULL); + } + else + { + if (!RtlDosPathNameToNtPathName_U(lpBackupFileName, &BackupFileNameW, + NULL, NULL)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + } RpcTryExcept { Status = ElfrClearELFW(hEventLog, - (PRPC_UNICODE_STRING)&BackupFileName); - } - RpcExcept(EXCEPTION_EXECUTE_HANDLER) - { - Status = I_RpcMapWin32Status(RpcExceptionCode()); - } - RpcEndExcept; + (PRPC_UNICODE_STRING)&BackupFileNameW); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + if (lpBackupFileName != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, BackupFileNameW.Buffer); if (!NT_SUCCESS(Status)) {
12 years, 11 months
1
0
0
0
[rharabien] 54845: [SHELL32] - Formatting. No code changes.
by rharabien@svn.reactos.org
Author: rharabien Date: Thu Jan 5 18:34:35 2012 New Revision: 54845 URL:
http://svn.reactos.org/svn/reactos?rev=54845&view=rev
Log: [SHELL32] - Formatting. No code changes. Modified: trunk/reactos/dll/win32/shell32/control.cpp trunk/reactos/dll/win32/shell32/folders/cpanel.cpp trunk/reactos/dll/win32/shell32/newmenu.cpp trunk/reactos/dll/win32/shell32/shlexec.cpp Modified: trunk/reactos/dll/win32/shell32/control.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/control.…
============================================================================== --- trunk/reactos/dll/win32/shell32/control.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/control.cpp [iso-8859-1] Thu Jan 5 18:34:35 2012 @@ -247,7 +247,7 @@ return 0; } -static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg, +static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg, WPARAM lParam1, LPARAM lParam2) { CPanel* panel = (CPanel*)GetWindowLongPtrW(hWnd, 0); @@ -259,16 +259,15 @@ case WM_CREATE: Control_WndProc_Create(hWnd, (CREATESTRUCTW*)lParam2); return 0; - case WM_DESTROY: { - CPlApplet* applet = panel->first; + CPlApplet *applet = panel->first; while (applet) applet = Control_UnloadApplet(applet); PostQuitMessage(0); - }; break; - + break; + } case WM_PAINT: return Control_WndProc_Paint(panel, lParam1); case WM_LBUTTONUP: @@ -324,27 +323,26 @@ } } -static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst) -{ - HANDLE h; - WIN32_FIND_DATAW fd; - WCHAR buffer[MAX_PATH]; - static const WCHAR wszAllCpl[] = {'*','.','c','p','l',0}; - WCHAR *p; - - GetSystemDirectoryW( buffer, MAX_PATH ); - p = buffer + wcslen(buffer); - *p++ = '\\'; - wcscpy(p, wszAllCpl); - - if ((h = FindFirstFileW(buffer, &fd)) != INVALID_HANDLE_VALUE) +static void Control_DoWindow(CPanel *panel, HWND hWnd, HINSTANCE hInst) +{ + HANDLE hFind; + WIN32_FIND_DATAW wfd; + WCHAR wszPath[MAX_PATH]; + WCHAR *Ptr = wszPath; + + Ptr += GetSystemDirectoryW(wszPath, MAX_PATH); + *Ptr++ = '\\'; + wcscpy(Ptr, L"*.cpl"); + + hFind = FindFirstFileW(wszPath, &wfd); + if (hFind != INVALID_HANDLE_VALUE) { do { - wcscpy(p, fd.cFileName); - Control_LoadApplet(hWnd, buffer, panel); - } while (FindNextFileW(h, &fd)); - FindClose(h); + wcscpy(Ptr, wfd.cFileName); + Control_LoadApplet(hWnd, wszPath, panel); + } while (FindNextFileW(hFind, &wfd)); + FindClose(hFind); } Control_DoInterface(panel, hWnd, hInst); Modified: trunk/reactos/dll/win32/shell32/folders/cpanel.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/cpanel.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/cpanel.cpp [iso-8859-1] Thu Jan 5 18:34:35 2012 @@ -36,7 +36,6 @@ class CControlPanelEnum : public IEnumIDListImpl { - private: public: CControlPanelEnum(); ~CControlPanelEnum(); Modified: trunk/reactos/dll/win32/shell32/newmenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/newmenu.…
============================================================================== --- trunk/reactos/dll/win32/shell32/newmenu.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/newmenu.cpp [iso-8859-1] Thu Jan 5 18:34:35 2012 @@ -73,305 +73,289 @@ BOOL GetKeyDescription(LPWSTR szKeyName, LPWSTR szResult) { - HKEY hKey; - DWORD dwDesc, dwError; - WCHAR szDesc[100]; - - static const WCHAR szFriendlyTypeName[] = { '\\','F','r','i','e','n','d','l','y','T','y','p','e','N','a','m','e',0 }; - - TRACE("GetKeyDescription: keyname %s\n", debugstr_w(szKeyName)); - - if (RegOpenKeyExW(HKEY_CLASSES_ROOT,szKeyName,0, KEY_READ | KEY_QUERY_VALUE,&hKey) != ERROR_SUCCESS) - return FALSE; - - if (RegLoadMUIStringW(hKey,szFriendlyTypeName,szResult,MAX_PATH,&dwDesc,0,NULL) == ERROR_SUCCESS) - { - TRACE("result %s\n", debugstr_w(szResult)); - RegCloseKey(hKey); - return TRUE; - } - /* fetch default value */ - dwDesc = sizeof(szDesc); - dwError = RegGetValueW(hKey,NULL,NULL, RRF_RT_REG_SZ,NULL,szDesc,&dwDesc); - if(dwError == ERROR_SUCCESS) - { - if (wcsncmp(szKeyName, szDesc, dwDesc / sizeof(WCHAR))) - { - /* recurse for to a linked key */ - if (!GetKeyDescription(szDesc, szResult)) - { - /* use description */ - wcscpy(szResult, szDesc); - } - } - else - { - /* use default value as description */ - wcscpy(szResult, szDesc); - } - } - else - { - /* registry key w/o default key?? */ - TRACE("RegGetValue failed with %x\n", dwError); - wcscpy(szResult, szKeyName); - } - - RegCloseKey(hKey); - return TRUE; + HKEY hKey; + DWORD dwDesc, dwError; + WCHAR szDesc[100]; + + TRACE("GetKeyDescription: keyname %s\n", debugstr_w(szKeyName)); + + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szKeyName, 0, KEY_READ | KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS) + return FALSE; + + if (RegLoadMUIStringW(hKey, L"\\FriendlyTypeName", szResult, MAX_PATH, &dwDesc, 0, NULL) == ERROR_SUCCESS) + { + TRACE("result %s\n", debugstr_w(szResult)); + RegCloseKey(hKey); + return TRUE; + } + /* fetch default value */ + dwDesc = sizeof(szDesc); + dwError = RegGetValueW(hKey, NULL, NULL, RRF_RT_REG_SZ, NULL, szDesc, &dwDesc); + if(dwError == ERROR_SUCCESS) + { + if (wcsncmp(szKeyName, szDesc, dwDesc / sizeof(WCHAR))) + { + /* recurse for to a linked key */ + if (!GetKeyDescription(szDesc, szResult)) + { + /* use description */ + wcscpy(szResult, szDesc); + } + } + else + { + /* use default value as description */ + wcscpy(szResult, szDesc); + } + } + else + { + /* registry key w/o default key?? */ + TRACE("RegGetValue failed with %x\n", dwError); + wcscpy(szResult, szKeyName); + } + + RegCloseKey(hKey); + return TRUE; } CNewMenu::SHELLNEW_ITEM *CNewMenu::LoadItem(LPWSTR szKeyName) { - HKEY hKey; - DWORD dwIndex; - WCHAR szName[MAX_PATH]; - WCHAR szCommand[MAX_PATH]; - WCHAR szDesc[MAX_PATH] = {0}; - WCHAR szIcon[MAX_PATH] = {0}; - DWORD dwName, dwCommand; - LONG result; - SHELLNEW_ITEM *pNewItem; - - static const WCHAR szShellNew[] = { '\\','S','h','e','l','l','N','e','w',0 }; - static const WCHAR szCmd[] = { 'C','o','m','m','a','n','d',0 }; - static const WCHAR szData[] = { 'D','a','t','a',0 }; - static const WCHAR szFileName[] = { 'F','i','l','e','N','a','m','e', 0 }; - static const WCHAR szNullFile[] = { 'N','u','l','l','F','i','l','e', 0 }; - - - wcscpy(szName, szKeyName); - GetKeyDescription(szKeyName, szDesc); - wcscat(szName, szShellNew); - result = RegOpenKeyExW(HKEY_CLASSES_ROOT,szName,0,KEY_READ,&hKey); - - //TRACE("LoadItem dwName %d keyname %s szName %s szDesc %s szIcon %s\n", dwName, debugstr_w(szKeyName), debugstr_w(szName), debugstr_w(szDesc), debugstr_w(szIcon)); - - if (result != ERROR_SUCCESS) - { - return NULL; - } - - dwIndex = 0; - pNewItem = NULL; - - do - { - dwName = MAX_PATH; - dwCommand = MAX_PATH; - result = RegEnumValueW(hKey,dwIndex,szName,&dwName,NULL,NULL,(LPBYTE)szCommand, &dwCommand); - if (result == ERROR_SUCCESS) - { - SHELLNEW_TYPE type = SHELLNEW_TYPE_INVALID; - LPWSTR szTarget = szCommand; - //TRACE("szName %s szCommand %s\n", debugstr_w(szName), debugstr_w(szCommand)); - if (!wcsicmp(szName, szCmd)) - { - type = SHELLNEW_TYPE_COMMAND; - }else if (!wcsicmp(szName, szData)) - { - type = SHELLNEW_TYPE_DATA; - } - else if (!wcsicmp(szName, szFileName)) - { - type = SHELLNEW_TYPE_FILENAME; - } - else if (!wcsicmp(szName, szNullFile)) - { - type = SHELLNEW_TYPE_NULLFILE; - szTarget = NULL; - } - if (type != SHELLNEW_TYPE_INVALID) - { - pNewItem = (SHELLNEW_ITEM *)HeapAlloc(GetProcessHeap(), 0, sizeof(SHELLNEW_ITEM)); - pNewItem->Type = type; - if (szTarget) - pNewItem->szTarget = _wcsdup(szTarget); - else - pNewItem->szTarget = NULL; - - pNewItem->szDesc = _wcsdup(szDesc); - pNewItem->szIcon = _wcsdup(szIcon); - pNewItem->szExt = _wcsdup(szKeyName); - pNewItem->Next = NULL; - break; - } - } - dwIndex++; - }while(result != ERROR_NO_MORE_ITEMS); - RegCloseKey(hKey); - return pNewItem; -} - + HKEY hKey; + DWORD dwIndex = 0; + WCHAR szName[MAX_PATH]; + WCHAR szCommand[MAX_PATH]; + WCHAR szDesc[MAX_PATH] = L""; + WCHAR szIcon[MAX_PATH] = L""; + DWORD dwName, dwCommand; + LONG result; + SHELLNEW_ITEM *pNewItem = NULL; + + wcscpy(szName, szKeyName); + GetKeyDescription(szKeyName, szDesc); + wcscat(szName, L"\\ShellNew"); + result = RegOpenKeyExW(HKEY_CLASSES_ROOT, szName, 0, KEY_READ, &hKey); + + TRACE("LoadItem dwName %d keyname %s szName %s szDesc %s szIcon %s\n", dwName, debugstr_w(szKeyName), debugstr_w(szName), debugstr_w(szDesc), debugstr_w(szIcon)); + + if (result != ERROR_SUCCESS) + { + TRACE("Failed to open key\n"); + return NULL; + } + + do + { + dwName = MAX_PATH; + dwCommand = MAX_PATH; + result = RegEnumValueW(hKey, dwIndex, szName, &dwName, NULL, NULL, (LPBYTE)szCommand, &dwCommand); + if (result == ERROR_SUCCESS) + { + SHELLNEW_TYPE type = SHELLNEW_TYPE_INVALID; + LPWSTR szTarget = szCommand; + + TRACE("szName %s szCommand %s\n", debugstr_w(szName), debugstr_w(szCommand)); + + if (!wcsicmp(szName, L"Command")) + type = SHELLNEW_TYPE_COMMAND; + else if (!wcsicmp(szName, L"Data")) + type = SHELLNEW_TYPE_DATA; + else if (!wcsicmp(szName, L"FileName")) + type = SHELLNEW_TYPE_FILENAME; + else if (!wcsicmp(szName, L"NullFile")) + { + type = SHELLNEW_TYPE_NULLFILE; + szTarget = NULL; + } + + if (type != SHELLNEW_TYPE_INVALID) + { + pNewItem = (SHELLNEW_ITEM *)HeapAlloc(GetProcessHeap(), 0, sizeof(SHELLNEW_ITEM)); + if (!pNewItem) + break; + + pNewItem->Type = type; + if (szTarget) + pNewItem->szTarget = _wcsdup(szTarget); + else + pNewItem->szTarget = NULL; + + pNewItem->szDesc = _wcsdup(szDesc); + pNewItem->szIcon = _wcsdup(szIcon); + pNewItem->szExt = _wcsdup(szKeyName); + pNewItem->Next = NULL; + break; + } + } + dwIndex++; + } while(result != ERROR_NO_MORE_ITEMS); + RegCloseKey(hKey); + return pNewItem; +} BOOL CNewMenu::LoadShellNewItems() { - DWORD dwIndex; - WCHAR szName[MAX_PATH]; - LONG result; - SHELLNEW_ITEM *pNewItem; - SHELLNEW_ITEM *pCurItem = NULL; - static WCHAR szLnk[] = { '.','l','n','k',0 }; - - /* insert do new folder action */ - if (!LoadStringW(shell32_hInstance, FCIDM_SHVIEW_NEW, szNew, sizeof(szNew) / sizeof(WCHAR))) - szNew[0] = 0; - szNew[MAX_PATH-1] = 0; - - UnloadShellItems(); - - dwIndex = 0; - do - { - result = RegEnumKeyW(HKEY_CLASSES_ROOT,dwIndex,szName,MAX_PATH); - if (result == ERROR_SUCCESS) - { - pNewItem = LoadItem(szName); - if (pNewItem) - { - if (!wcsicmp(pNewItem->szExt, szLnk)) - { - if (s_SnHead) + DWORD dwIndex; + WCHAR szName[MAX_PATH]; + LONG result; + SHELLNEW_ITEM *pNewItem; + SHELLNEW_ITEM *pCurItem = NULL; + + /* insert do new folder action */ + if (!LoadStringW(shell32_hInstance, FCIDM_SHVIEW_NEW, szNew, sizeof(szNew) / sizeof(WCHAR))) + szNew[0] = 0; + + UnloadShellItems(); + + dwIndex = 0; + do + { + result = RegEnumKeyW(HKEY_CLASSES_ROOT, dwIndex, szName, MAX_PATH); + if (result == ERROR_SUCCESS) + { + pNewItem = LoadItem(szName); + if (pNewItem) + { + if (!wcsicmp(pNewItem->szExt, L".lnk")) { - pNewItem->Next = s_SnHead; - s_SnHead = pNewItem; + if (s_SnHead) + { + pNewItem->Next = s_SnHead; + s_SnHead = pNewItem; + } + else + { + s_SnHead = pCurItem = pNewItem; + } } else { - s_SnHead = pCurItem = pNewItem; + if (pCurItem) + { + pCurItem->Next = pNewItem; + pCurItem = pNewItem; + } + else + { + pCurItem = s_SnHead = pNewItem; + } } } - else - { - if (pCurItem) - { - pCurItem->Next = pNewItem; - pCurItem = pNewItem; - } - else - { - pCurItem = s_SnHead = pNewItem; - } - } - } - } - dwIndex++; - }while(result != ERROR_NO_MORE_ITEMS); - - if (s_SnHead == NULL) - return FALSE; - else - return TRUE; + } + dwIndex++; + } while(result != ERROR_NO_MORE_ITEMS); + + if (s_SnHead == NULL) + return FALSE; + else + return TRUE; } UINT CNewMenu::InsertShellNewItems(HMENU hMenu, UINT idFirst, UINT idMenu) { - MENUITEMINFOW mii; - SHELLNEW_ITEM *pCurItem; - UINT i; - WCHAR szBuffer[MAX_PATH]; - - if (s_SnHead == NULL) - { - if (!LoadShellNewItems()) - return 0; - } - - ZeroMemory(&mii, sizeof(mii)); - mii.cbSize = sizeof(mii); - - /* insert do new shortcut action */ - if (!LoadStringW(shell32_hInstance, FCIDM_SHVIEW_NEWFOLDER, szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0]))) - szBuffer[0] = 0; - szBuffer[MAX_PATH-1] = 0; - mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_DATA; - mii.fType = MFT_STRING; - mii.dwTypeData = szBuffer; - mii.cch = wcslen(mii.dwTypeData); - mii.wID = idFirst++; - InsertMenuItemW(hMenu, idMenu++, TRUE, &mii); - - /* insert do new shortcut action */ - if (!LoadStringW(shell32_hInstance, FCIDM_SHVIEW_NEWLINK, szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0]))) - szBuffer[0] = 0; - szBuffer[MAX_PATH-1] = 0; - mii.dwTypeData = szBuffer; - mii.cch = wcslen(mii.dwTypeData); - mii.wID = idFirst++; - InsertMenuItemW(hMenu, idMenu++, TRUE, &mii); - - /* insert seperator for custom new action */ - mii.fMask = MIIM_TYPE | MIIM_ID; - mii.fType = MFT_SEPARATOR; - mii.wID = -1; - InsertMenuItemW(hMenu, idMenu++, TRUE, &mii); - - mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_DATA; - /* - * FIXME - * implement loading of icons - * and using MFT_OWNERDRAWN - */ - mii.fType = MFT_STRING; - mii.fState = MFS_ENABLED; - - pCurItem = s_SnHead; - i = 0; - - while(pCurItem) - { - if (i >= 1) - { - TRACE("szDesc %s\n", debugstr_w(pCurItem->szDesc)); - mii.dwTypeData = pCurItem->szDesc; - mii.cch = wcslen(mii.dwTypeData); - mii.wID = idFirst++; - InsertMenuItemW(hMenu, idMenu++, TRUE, &mii); - } - pCurItem = pCurItem->Next; - i++; - } - return (i+2); + MENUITEMINFOW mii; + SHELLNEW_ITEM *pCurItem; + UINT i; + WCHAR szBuffer[MAX_PATH]; + + if (s_SnHead == NULL) + { + if (!LoadShellNewItems()) + return 0; + } + + ZeroMemory(&mii, sizeof(mii)); + mii.cbSize = sizeof(mii); + + /* insert do new shortcut action */ + if (!LoadStringW(shell32_hInstance, FCIDM_SHVIEW_NEWFOLDER, szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0]))) + szBuffer[0] = 0; + szBuffer[MAX_PATH-1] = 0; + mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_DATA; + mii.fType = MFT_STRING; + mii.dwTypeData = szBuffer; + mii.cch = wcslen(mii.dwTypeData); + mii.wID = idFirst++; + InsertMenuItemW(hMenu, idMenu++, TRUE, &mii); + + /* insert do new shortcut action */ + if (!LoadStringW(shell32_hInstance, FCIDM_SHVIEW_NEWLINK, szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0]))) + szBuffer[0] = 0; + szBuffer[MAX_PATH-1] = 0; + mii.dwTypeData = szBuffer; + mii.cch = wcslen(mii.dwTypeData); + mii.wID = idFirst++; + InsertMenuItemW(hMenu, idMenu++, TRUE, &mii); + + /* insert seperator for custom new action */ + mii.fMask = MIIM_TYPE | MIIM_ID; + mii.fType = MFT_SEPARATOR; + mii.wID = -1; + InsertMenuItemW(hMenu, idMenu++, TRUE, &mii); + + mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_DATA; + /* + * FIXME + * implement loading of icons + * and using MFT_OWNERDRAWN + */ + mii.fType = MFT_STRING; + mii.fState = MFS_ENABLED; + + pCurItem = s_SnHead; + i = 0; + + while(pCurItem) + { + if (i >= 1) + { + TRACE("szDesc %s\n", debugstr_w(pCurItem->szDesc)); + mii.dwTypeData = pCurItem->szDesc; + mii.cch = wcslen(mii.dwTypeData); + mii.wID = idFirst++; + InsertMenuItemW(hMenu, idMenu++, TRUE, &mii); + } + pCurItem = pCurItem->Next; + i++; + } + return (i + 2); } HRESULT CNewMenu::DoShellNewCmd(LPCMINVOKECOMMANDINFO lpcmi, IShellView *psv) { - SHELLNEW_ITEM *pCurItem = s_SnHead; - IPersistFolder3 * psf; - LPITEMIDLIST pidl; - STRRET strTemp; - WCHAR szTemp[MAX_PATH]; - WCHAR szBuffer[MAX_PATH]; - WCHAR szPath[MAX_PATH]; - STARTUPINFOW sInfo; - PROCESS_INFORMATION pi; - UINT i, target; - HANDLE hFile; - DWORD dwWritten, dwError; - CComPtr<IFolderView> folderView; - CComPtr<IShellFolder> parentFolder; - HRESULT hResult; - - static const WCHAR szP1[] = { '%', '1', 0 }; - static const WCHAR szFormat[] = {'%','s',' ','(','%','d',')','%','s',0 }; - - i = 1; - target = LOWORD(lpcmi->lpVerb); - - while(pCurItem) - { - if (i == target) - break; - - pCurItem = pCurItem->Next; - i++; - } - - if (!pCurItem) - return E_UNEXPECTED; + SHELLNEW_ITEM *pCurItem = s_SnHead; + IPersistFolder3 * psf; + LPITEMIDLIST pidl; + STRRET strTemp; + WCHAR szTemp[MAX_PATH]; + WCHAR szBuffer[MAX_PATH]; + WCHAR szPath[MAX_PATH]; + STARTUPINFOW sInfo; + PROCESS_INFORMATION pi; + UINT i, target; + HANDLE hFile; + DWORD dwWritten, dwError; + CComPtr<IFolderView> folderView; + CComPtr<IShellFolder> parentFolder; + HRESULT hResult; + + i = 1; + target = LOWORD(lpcmi->lpVerb); + + while(pCurItem) + { + if (i == target) + break; + + pCurItem = pCurItem->Next; + i++; + } + + if (!pCurItem) + return E_UNEXPECTED; //if (fSite == NULL) // return E_FAIL; @@ -382,111 +366,111 @@ if (FAILED(hResult)) return hResult; - if (parentFolder->QueryInterface(IID_IPersistFolder2, (LPVOID*)&psf) != S_OK) - { - ERR("Failed to get interface IID_IPersistFolder2\n"); - return E_FAIL; - } - if (psf->GetCurFolder(&pidl) != S_OK) - { - ERR("IPersistFolder2_GetCurFolder failed\n"); - return E_FAIL; - } - - if (parentFolder == NULL || parentFolder->GetDisplayNameOf(pidl, SHGDN_FORPARSING, &strTemp) != S_OK) - { - ERR("IShellFolder_GetDisplayNameOf failed\n"); - return E_FAIL; - } - StrRetToBufW(&strTemp, pidl, szPath, MAX_PATH); - - switch(pCurItem->Type) - { - case SHELLNEW_TYPE_COMMAND: - { - LPWSTR ptr; - LPWSTR szCmd; - - if (!ExpandEnvironmentStringsW(pCurItem->szTarget, szBuffer, MAX_PATH)) - { - TRACE("ExpandEnvironmentStrings failed\n"); - break; - } - - ptr = wcsstr(szBuffer, szP1); - if (ptr) - { - ptr[1] = 's'; - swprintf(szTemp, szBuffer, szPath); - ptr = szTemp; - } - else - { - ptr = szBuffer; - } - - ZeroMemory(&sInfo, sizeof(sInfo)); - sInfo.cb = sizeof(sInfo); - szCmd = _wcsdup(ptr); - if (!szCmd) - break; - if (CreateProcessW(NULL, szCmd, NULL, NULL,FALSE,0,NULL,NULL,&sInfo, &pi)) - { - CloseHandle( pi.hProcess ); - CloseHandle( pi.hThread ); - } - free(szCmd); - break; - } - case SHELLNEW_TYPE_DATA: - case SHELLNEW_TYPE_FILENAME: - case SHELLNEW_TYPE_NULLFILE: - { - i = 2; - - PathAddBackslashW(szPath); - wcscat(szPath, szNew); - wcscat(szPath, L" "); - wcscat(szPath, pCurItem->szDesc); - wcscpy(szBuffer, szPath); - wcscat(szBuffer, pCurItem->szExt); - do - { - hFile = CreateFileW(szBuffer, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); - if (hFile != INVALID_HANDLE_VALUE) + if (parentFolder->QueryInterface(IID_IPersistFolder2, (LPVOID*)&psf) != S_OK) + { + ERR("Failed to get interface IID_IPersistFolder2\n"); + return E_FAIL; + } + if (psf->GetCurFolder(&pidl) != S_OK) + { + ERR("IPersistFolder2_GetCurFolder failed\n"); + return E_FAIL; + } + + if (parentFolder == NULL || parentFolder->GetDisplayNameOf(pidl, SHGDN_FORPARSING, &strTemp) != S_OK) + { + ERR("IShellFolder_GetDisplayNameOf failed\n"); + return E_FAIL; + } + StrRetToBufW(&strTemp, pidl, szPath, MAX_PATH); + + switch(pCurItem->Type) + { + case SHELLNEW_TYPE_COMMAND: + { + LPWSTR ptr; + LPWSTR szCmd; + + if (!ExpandEnvironmentStringsW(pCurItem->szTarget, szBuffer, MAX_PATH)) + { + TRACE("ExpandEnvironmentStrings failed\n"); break; - dwError = GetLastError(); - - TRACE("FileName %s szBuffer %s i %u error %x\n", debugstr_w(szBuffer), debugstr_w(szPath), i, dwError); - swprintf(szBuffer, szFormat, szPath, i, pCurItem->szExt); - i++; - }while(hFile == INVALID_HANDLE_VALUE && dwError == ERROR_FILE_EXISTS); - - if (hFile == INVALID_HANDLE_VALUE) - return E_FAIL; - - if (pCurItem->Type == SHELLNEW_TYPE_DATA) - { - i = WideCharToMultiByte(CP_ACP, 0, pCurItem->szTarget, -1, (LPSTR)szTemp, MAX_PATH*2, NULL, NULL); - if (i) - { - WriteFile(hFile, (LPCVOID)szTemp, i, &dwWritten, NULL); - } - } - CloseHandle(hFile); - if (pCurItem->Type == SHELLNEW_TYPE_FILENAME) - { - if (!CopyFileW(pCurItem->szTarget, szBuffer, FALSE)) + } + + ptr = wcsstr(szBuffer, L"%1"); + if (ptr) + { + ptr[1] = 's'; + swprintf(szTemp, szBuffer, szPath); + ptr = szTemp; + } + else + { + ptr = szBuffer; + } + + ZeroMemory(&sInfo, sizeof(sInfo)); + sInfo.cb = sizeof(sInfo); + szCmd = _wcsdup(ptr); + if (!szCmd) break; - } - TRACE("Notifying fs %s\n", debugstr_w(szBuffer)); - SHChangeNotify(SHCNE_CREATE, SHCNF_PATHW, (LPCVOID)szBuffer, NULL); - break; - case SHELLNEW_TYPE_INVALID: - break; - } - } - return S_OK; + if (CreateProcessW(NULL, szCmd, NULL, NULL, FALSE, 0, NULL, NULL, &sInfo, &pi)) + { + CloseHandle( pi.hProcess ); + CloseHandle( pi.hThread ); + } + free(szCmd); + break; + } + case SHELLNEW_TYPE_DATA: + case SHELLNEW_TYPE_FILENAME: + case SHELLNEW_TYPE_NULLFILE: + { + i = 2; + + PathAddBackslashW(szPath); + wcscat(szPath, szNew); + wcscat(szPath, L" "); + wcscat(szPath, pCurItem->szDesc); + wcscpy(szBuffer, szPath); + wcscat(szBuffer, pCurItem->szExt); + do + { + hFile = CreateFileW(szBuffer, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); + if (hFile != INVALID_HANDLE_VALUE) + break; + dwError = GetLastError(); + + TRACE("FileName %s szBuffer %s i %u error %x\n", debugstr_w(szBuffer), debugstr_w(szPath), i, dwError); + swprintf(szBuffer, L"%s (%d)%s", szPath, i, pCurItem->szExt); + i++; + } while(hFile == INVALID_HANDLE_VALUE && dwError == ERROR_FILE_EXISTS); + + if (hFile == INVALID_HANDLE_VALUE) + return E_FAIL; + + if (pCurItem->Type == SHELLNEW_TYPE_DATA) + { + i = WideCharToMultiByte(CP_ACP, 0, pCurItem->szTarget, -1, (LPSTR)szTemp, MAX_PATH * 2, NULL, NULL); + if (i) + { + WriteFile(hFile, (LPCVOID)szTemp, i, &dwWritten, NULL); + } + } + CloseHandle(hFile); + if (pCurItem->Type == SHELLNEW_TYPE_FILENAME) + { + if (!CopyFileW(pCurItem->szTarget, szBuffer, FALSE)) + break; + } + TRACE("Notifying fs %s\n", debugstr_w(szBuffer)); + SHChangeNotify(SHCNE_CREATE, SHCNF_PATHW, (LPCVOID)szBuffer, NULL); + break; + case SHELLNEW_TYPE_INVALID: + break; + } + } + return S_OK; } /************************************************************************** * DoMeasureItem @@ -494,40 +478,40 @@ HRESULT CNewMenu::DoMeasureItem(HWND hWnd, MEASUREITEMSTRUCT * lpmis) { - SHELLNEW_ITEM *pCurItem; - SHELLNEW_ITEM *pItem; - UINT i; - HDC hDC; - SIZE size; - - TRACE("DoMeasureItem entered with id %x\n", lpmis->itemID); - - pCurItem = s_SnHead; - - i = 1; - pItem = NULL; - while(pCurItem) - { - if (i == lpmis->itemID) - { - pItem = pCurItem; - break; - } - pCurItem = pCurItem->Next; - i++; - } - - if (!pItem) - { - TRACE("DoMeasureItem no item found\n"); - return E_FAIL; - } - hDC = GetDC(hWnd); - GetTextExtentPoint32W(hDC, pCurItem->szDesc, wcslen(pCurItem->szDesc), &size); - lpmis->itemWidth = size.cx + 32; - lpmis->itemHeight = max(size.cy, 20); - ReleaseDC (hWnd, hDC); - return S_OK; + SHELLNEW_ITEM *pCurItem; + SHELLNEW_ITEM *pItem; + UINT i; + HDC hDC; + SIZE size; + + TRACE("DoMeasureItem entered with id %x\n", lpmis->itemID); + + pCurItem = s_SnHead; + + i = 1; + pItem = NULL; + while(pCurItem) + { + if (i == lpmis->itemID) + { + pItem = pCurItem; + break; + } + pCurItem = pCurItem->Next; + i++; + } + + if (!pItem) + { + TRACE("DoMeasureItem no item found\n"); + return E_FAIL; + } + hDC = GetDC(hWnd); + GetTextExtentPoint32W(hDC, pCurItem->szDesc, wcslen(pCurItem->szDesc), &size); + lpmis->itemWidth = size.cx + 32; + lpmis->itemHeight = max(size.cy, 20); + ReleaseDC (hWnd, hDC); + return S_OK; } /************************************************************************** * DoDrawItem @@ -535,33 +519,33 @@ HRESULT CNewMenu::DoDrawItem(HWND hWnd, DRAWITEMSTRUCT * drawItem) { - SHELLNEW_ITEM *pCurItem; - SHELLNEW_ITEM *pItem; - UINT i; - pCurItem = s_SnHead; - - TRACE("DoDrawItem entered with id %x\n", drawItem->itemID); - - i = 1; - pItem = NULL; - while(pCurItem) - { - if (i == drawItem->itemID) - { - pItem = pCurItem; - break; - } - pCurItem = pCurItem->Next; - i++; - } - - if (!pItem) - return E_FAIL; - - drawItem->rcItem.left += 20; - - DrawTextW(drawItem->hDC, pCurItem->szDesc, wcslen(pCurItem->szDesc), &drawItem->rcItem, 0); - return S_OK; + SHELLNEW_ITEM *pCurItem; + SHELLNEW_ITEM *pItem; + UINT i; + pCurItem = s_SnHead; + + TRACE("DoDrawItem entered with id %x\n", drawItem->itemID); + + i = 1; + pItem = NULL; + while(pCurItem) + { + if (i == drawItem->itemID) + { + pItem = pCurItem; + break; + } + pCurItem = pCurItem->Next; + i++; + } + + if (!pItem) + return E_FAIL; + + drawItem->rcItem.left += 20; + + DrawTextW(drawItem->hDC, pCurItem->szDesc, wcslen(pCurItem->szDesc), &drawItem->rcItem, 0); + return S_OK; } /************************************************************************** @@ -570,11 +554,11 @@ void CNewMenu::DoNewFolder( IShellView *psv) { - ISFHelper * psfhlp; + ISFHelper *psfhlp; WCHAR wszName[MAX_PATH]; - CComPtr<IFolderView> folderView; - CComPtr<IShellFolder> parentFolder; - HRESULT hResult; + CComPtr<IFolderView> folderView; + CComPtr<IShellFolder> parentFolder; + HRESULT hResult; //if (fSite == NULL) // return; @@ -588,25 +572,25 @@ parentFolder->QueryInterface(IID_ISFHelper, (LPVOID*)&psfhlp); if (psfhlp) { - LPITEMIDLIST pidl; - - if (psfhlp->GetUniqueName(wszName, MAX_PATH) != S_OK) - return; - if (psfhlp->AddFolder(0, wszName, &pidl) != S_OK) - return; - - if(psv) - { - psv->Refresh(); - /* if we are in a shellview do labeledit */ - psv->SelectItem( - pidl,(SVSI_DESELECTOTHERS | SVSI_EDIT | SVSI_ENSUREVISIBLE - |SVSI_FOCUSED|SVSI_SELECT)); - psv->Refresh(); - } - SHFree(pidl); - - psfhlp->Release(); + LPITEMIDLIST pidl; + + if (psfhlp->GetUniqueName(wszName, MAX_PATH) != S_OK) + return; + if (psfhlp->AddFolder(0, wszName, &pidl) != S_OK) + return; + + if(psv) + { + psv->Refresh(); + /* if we are in a shellview do labeledit */ + psv->SelectItem( + pidl, (SVSI_DESELECTOTHERS | SVSI_EDIT | SVSI_ENSUREVISIBLE + | SVSI_FOCUSED | SVSI_SELECT)); + psv->Refresh(); + } + SHFree(pidl); + + psfhlp->Release(); } } @@ -629,10 +613,10 @@ HRESULT WINAPI CNewMenu::QueryContextMenu(HMENU hmenu, - UINT indexMenu, - UINT idCmdFirst, - UINT idCmdLast, - UINT uFlags) + UINT indexMenu, + UINT idCmdFirst, + UINT idCmdLast, + UINT uFlags) { WCHAR szBuffer[200]; MENUITEMINFOW mii; @@ -642,11 +626,8 @@ TRACE("%p %p %u %u %u %u\n", this, hmenu, indexMenu, idCmdFirst, idCmdLast, uFlags ); - if (!LoadStringW(shell32_hInstance, FCIDM_SHVIEW_NEW, szBuffer, 200)) - { + if (!LoadStringW(shell32_hInstance, FCIDM_SHVIEW_NEW, szBuffer, _countof(szBuffer))) szBuffer[0] = 0; - } - szBuffer[199] = 0; hSubMenu = CreateMenu(); memset( &mii, 0, sizeof(mii) ); @@ -655,34 +636,33 @@ mii.fType = MFT_STRING; mii.wID = idCmdFirst + id++; mii.dwTypeData = szBuffer; - mii.cch = wcslen( mii.dwTypeData ); + mii.cch = wcslen(mii.dwTypeData); mii.fState = MFS_ENABLED; if (hSubMenu) { - id += InsertShellNewItems( hSubMenu, idCmdFirst, 0); + id += InsertShellNewItems(hSubMenu, idCmdFirst, 0); mii.fMask |= MIIM_SUBMENU; mii.hSubMenu = hSubMenu; } - - if (!InsertMenuItemW( hmenu, indexMenu, TRUE, &mii )) + if (!InsertMenuItemW(hmenu, indexMenu, TRUE, &mii)) return E_FAIL; - return MAKE_HRESULT( SEVERITY_SUCCESS, 0, id ); + return MAKE_HRESULT(SEVERITY_SUCCESS, 0, id); } HRESULT WINAPI CNewMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpici) { - LPSHELLBROWSER lpSB; + LPSHELLBROWSER lpSB; LPSHELLVIEW lpSV = NULL; HRESULT hr; - if((lpSB = (LPSHELLBROWSER)SendMessageA(lpici->hwnd, CWM_GETISHELLBROWSER,0,0))) - { - lpSB->QueryActiveShellView(&lpSV); + if((lpSB = (LPSHELLBROWSER)SendMessageA(lpici->hwnd, CWM_GETISHELLBROWSER, 0, 0))) + { + lpSB->QueryActiveShellView(&lpSV); } if (LOWORD(lpici->lpVerb) == 0) @@ -704,10 +684,10 @@ HRESULT WINAPI CNewMenu::GetCommandString(UINT_PTR idCmd, - UINT uType, - UINT* pwReserved, - LPSTR pszName, - UINT cchMax) + UINT uType, + UINT* pwReserved, + LPSTR pszName, + UINT cchMax) { FIXME("%p %lu %u %p %p %u\n", this, idCmd, uType, pwReserved, pszName, cchMax ); @@ -715,26 +695,25 @@ return E_NOTIMPL; } -HRESULT -WINAPI +HRESULT +WINAPI CNewMenu::HandleMenuMsg(UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - DRAWITEMSTRUCT * lpids = (DRAWITEMSTRUCT*) lParam; + WPARAM wParam, + LPARAM lParam) +{ + DRAWITEMSTRUCT *lpids = (DRAWITEMSTRUCT*) lParam; MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*) lParam; - TRACE("INewItem_IContextMenu_fnHandleMenuMsg (%p)->(msg=%x wp=%lx lp=%lx)\n",this, uMsg, wParam, lParam); - + TRACE("INewItem_IContextMenu_fnHandleMenuMsg (%p)->(msg=%x wp=%lx lp=%lx)\n", this, uMsg, wParam, lParam); switch(uMsg) { - case WM_MEASUREITEM: - return DoMeasureItem((HWND)wParam, lpmis); - break; - case WM_DRAWITEM: - return DoDrawItem((HWND)wParam, lpids); - break; + case WM_MEASUREITEM: + return DoMeasureItem((HWND)wParam, lpmis); + break; + case WM_DRAWITEM: + return DoDrawItem((HWND)wParam, lpids); + break; } return S_OK; @@ -743,7 +722,7 @@ HRESULT WINAPI CNewMenu::Initialize(LPCITEMIDLIST pidlFolder, - IDataObject *pdtobj, HKEY hkeyProgID ) + IDataObject *pdtobj, HKEY hkeyProgID ) { return S_OK; Modified: trunk/reactos/dll/win32/shell32/shlexec.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlexec.…
============================================================================== --- trunk/reactos/dll/win32/shell32/shlexec.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shlexec.cpp [iso-8859-1] Thu Jan 5 18:34:35 2012 @@ -24,12 +24,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(exec); -static const WCHAR wszOpen[] = {'o','p','e','n',0}; -static const WCHAR wszExe[] = {'.','e','x','e',0}; -static const WCHAR wszILPtr[] = {':','%','p',0}; -static const WCHAR wszShell[] = {'\\','s','h','e','l','l','\\',0}; -static const WCHAR wszFolder[] = {'F','o','l','d','e','r',0}; -static const WCHAR wszEmpty[] = {0}; +static const WCHAR wszOpen[] = L"open"; +static const WCHAR wszExe[] = L".exe"; +static const WCHAR wszShell[] = L"\\shell\\"; +static const WCHAR wszFolder[] = L"Folder"; #define SEE_MASK_CLASSALL (SEE_MASK_CLASSNAME | SEE_MASK_CLASSKEY) @@ -39,7 +37,7 @@ bool quotes_opened = false; bool backslash_encountered = false; - for (int curArg=0; curArg<=argNum && *args; ++curArg) + for (int curArg = 0; curArg <= argNum && *args; ++curArg) { firstCharQuote = false; if (*args == '"') @@ -60,7 +58,7 @@ { if (quotes_opened) { - if (*(args+1) != '"') + if (*(args + 1) != '"') { quotes_opened = false; args++; @@ -68,7 +66,7 @@ } else { - args++; + args++; } } else @@ -105,7 +103,7 @@ bool quotes_opened = false; bool backslash_encountered = false; - for (int curArg=0; curArg<=argNum && *args; ++curArg) + for (int curArg = 0; curArg <= argNum && *args; ++curArg) { while(*args) { @@ -118,13 +116,13 @@ { if (quotes_opened) { - if (*(args+1) != '"') + if (*(args + 1) != '"') { quotes_opened = false; } else { - args++; + args++; } } else @@ -137,7 +135,7 @@ else { backslash_encountered = false; - if (*args == ' ' && !quotes_opened && curArg!=argNum) + if (*args == ' ' && !quotes_opened && curArg != argNum) break; } @@ -205,7 +203,8 @@ used++; if (used < len) *res++ = '%'; - }; break; + }; + break; case '*': { @@ -226,7 +225,8 @@ break; } } - }; break; + }; + break; case '~': @@ -238,7 +238,7 @@ case '7': case '8': case '9': - //case '0': + //case '0': { if (*fmt == '~') { @@ -258,13 +258,14 @@ ParseNoTildeEffect(res, args, len, used, *fmt - '2'); } } - }; break; + }; + break; case '1': if (!done || (*fmt == '1')) { /*FIXME Is the call to SearchPathW() really needed? We already have separated out the parameter string in args. */ - if (SearchPathW(NULL, lpFile, wszExe, sizeof(xlpFile)/sizeof(WCHAR), xlpFile, NULL)) + if (SearchPathW(NULL, lpFile, wszExe, sizeof(xlpFile) / sizeof(WCHAR), xlpFile, NULL)) cmd = xlpFile; else cmd = lpFile; @@ -279,11 +280,11 @@ found_p1 = TRUE; break; - /* - * IE uses this a lot for activating things such as windows media - * player. This is not verified to be fully correct but it appears - * to work just fine. - */ + /* + * IE uses this a lot for activating things such as windows media + * player. This is not verified to be fully correct but it appears + * to work just fine. + */ case 'l': case 'L': if (lpFile) @@ -309,16 +310,16 @@ LPVOID pv; HGLOBAL hmem = SHAllocShared(pidl, ILGetSize(pidl), 0); pv = SHLockShared(hmem, 0); - chars = swprintf(buf, wszILPtr, pv); - - if (chars >= sizeof(buf)/sizeof(WCHAR)) + chars = swprintf(buf, L":%p", pv); + + if (chars >= sizeof(buf) / sizeof(WCHAR)) ERR("pidl format buffer too small!\n"); used += chars; if (used < len) { - wcscpy(res,buf); + wcscpy(res, buf); res += chars; } SHUnlockShared(pv); @@ -385,7 +386,7 @@ } *res = '\0'; - TRACE("used %i of %i space\n",used,len); + TRACE("used %i of %i space\n", used, len); if (out_len) *out_len = used; @@ -398,7 +399,7 @@ static HRESULT SHELL_GetPathFromIDListForExecuteW(LPCITEMIDLIST pidl, LPWSTR pszPath, UINT uOutSize) { STRRET strret; - IShellFolder* desktop; + IShellFolder *desktop; HRESULT hr = SHGetDesktopFolder(&desktop); @@ -420,7 +421,7 @@ * */ static UINT_PTR SHELL_ExecuteW(const WCHAR *lpCmd, WCHAR *env, BOOL shWait, - const SHELLEXECUTEINFOW *psei, LPSHELLEXECUTEINFOW psei_out) + const SHELLEXECUTEINFOW *psei, LPSHELLEXECUTEINFOW psei_out) { STARTUPINFOW startup; PROCESS_INFORMATION info; @@ -443,12 +444,12 @@ /* ShellExecute specifies the command from psei->lpDirectory * if present. Not from the current dir as CreateProcess does */ - if ( lpDirectory ) - if ( ( gcdret = GetCurrentDirectoryW( MAX_PATH, curdir))) - if ( !SetCurrentDirectoryW( lpDirectory)) + if (lpDirectory) + if ((gcdret = GetCurrentDirectoryW( MAX_PATH, curdir))) + if (!SetCurrentDirectoryW( lpDirectory)) ERR("cannot set directory %s\n", debugstr_w(lpDirectory)); - ZeroMemory(&startup,sizeof(STARTUPINFOW)); + ZeroMemory(&startup, sizeof(STARTUPINFOW)); startup.cb = sizeof(STARTUPINFOW); startup.dwFlags = STARTF_USESHOWWINDOW; startup.wShowWindow = psei->nShow; @@ -463,7 +464,7 @@ /* Give 30 seconds to the app to come up, if desired. Probably only needed when starting app immediately before making a DDE connection. */ if (shWait) - if (WaitForInputIdle( info.hProcess, 30000 ) == WAIT_FAILED) + if (WaitForInputIdle(info.hProcess, 30000) == WAIT_FAILED) WARN("WaitForInputIdle failed: Error %d\n", GetLastError() ); retval = 33; @@ -483,8 +484,8 @@ psei_out->hInstApp = (HINSTANCE)retval; - if( gcdret ) - if( !SetCurrentDirectoryW( curdir)) + if (gcdret) + if (!SetCurrentDirectoryW(curdir)) ERR("cannot return to directory %s\n", debugstr_w(curdir)); return retval; @@ -499,7 +500,7 @@ */ static LPWSTR SHELL_BuildEnvW( const WCHAR *path ) { - static const WCHAR wPath[] = {'P','A','T','H','=',0}; + static const WCHAR wPath[] = L"PATH="; WCHAR *strings, *new_env; WCHAR *p, *p2; int total = wcslen(path) + 1; @@ -517,9 +518,9 @@ if (!got_path) total += 5; /* we need to create PATH */ total++; /* terminating null */ - if (!(new_env = (LPWSTR)HeapAlloc( GetProcessHeap(), 0, total * sizeof(WCHAR) ))) - { - FreeEnvironmentStringsW( strings ); + if (!(new_env = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, total * sizeof(WCHAR)))) + { + FreeEnvironmentStringsW(strings); return NULL; } p = strings; @@ -527,7 +528,7 @@ while (*p) { int len = wcslen(p) + 1; - memcpy( p2, p, len * sizeof(WCHAR) ); + memcpy(p2, p, len * sizeof(WCHAR)); if (!_wcsnicmp( p, wPath, 5 )) { p2[len - 1] = ';'; @@ -539,12 +540,12 @@ } if (!got_path) { - wcscpy( p2, wPath ); - wcscat( p2, path ); + wcscpy(p2, wPath); + wcscat(p2, path); p2 += wcslen(p2) + 1; } *p2 = 0; - FreeEnvironmentStringsW( strings ); + FreeEnvironmentStringsW(strings); return new_env; } @@ -559,9 +560,6 @@ */ static BOOL SHELL_TryAppPathW( LPCWSTR szName, LPWSTR lpResult, WCHAR **env) { - static const WCHAR wszKeyAppPaths[] = {'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','\\','A','p','p',' ','P','a','t','h','s','\\',0}; - static const WCHAR wPath[] = {'P','a','t','h',0}; HKEY hkApp = 0; WCHAR buffer[1024]; LONG len; @@ -569,12 +567,12 @@ BOOL found = FALSE; if (env) *env = NULL; - wcscpy(buffer, wszKeyAppPaths); + wcscpy(buffer, L"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\"); wcscat(buffer, szName); res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, buffer, 0, KEY_READ, &hkApp); if (res) goto end; - len = MAX_PATH*sizeof(WCHAR); + len = MAX_PATH * sizeof(WCHAR); res = RegQueryValueW(hkApp, NULL, lpResult, &len); if (res) goto end; found = TRUE; @@ -582,8 +580,8 @@ if (env) { DWORD count = sizeof(buffer); - if (!RegQueryValueExW(hkApp, wPath, NULL, NULL, (LPBYTE)buffer, &count) && buffer[0]) - *env = SHELL_BuildEnvW( buffer ); + if (!RegQueryValueExW(hkApp, L"Path", NULL, NULL, (LPBYTE)buffer, &count) && buffer[0]) + *env = SHELL_BuildEnvW(buffer); } end: @@ -593,13 +591,13 @@ static UINT SHELL_FindExecutableByOperation(LPCWSTR lpOperation, LPWSTR key, LPWSTR filetype, LPWSTR command, LONG commandlen) { - static const WCHAR wCommand[] = {'\\','c','o','m','m','a','n','d',0}; + static const WCHAR wCommand[] = L"\\command"; HKEY hkeyClass; WCHAR verb[MAX_PATH]; if (RegOpenKeyExW(HKEY_CLASSES_ROOT, filetype, 0, 0x02000000, &hkeyClass)) return SE_ERR_NOASSOC; - if (!HCR_GetDefaultVerbW(hkeyClass, lpOperation, verb, sizeof(verb)/sizeof(verb[0]))) + if (!HCR_GetDefaultVerbW(hkeyClass, lpOperation, verb, sizeof(verb) / sizeof(verb[0]))) return SE_ERR_NOASSOC; RegCloseKey(hkeyClass); @@ -617,7 +615,7 @@ LPWSTR tmp; WCHAR param[256]; LONG paramlen = sizeof(param); - static const WCHAR wSpace[] = {' ',0}; + 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 @@ -662,11 +660,8 @@ * on the operation) */ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation, - LPWSTR lpResult, DWORD resultLen, LPWSTR key, WCHAR **env,LPITEMIDLIST pidl, LPCWSTR args) -{ - static const WCHAR wWindows[] = {'w','i','n','d','o','w','s',0}; - static const WCHAR wPrograms[] = {'p','r','o','g','r','a','m','s',0}; - static const WCHAR wExtensions[] = {'e','x','e',' ','p','i','f',' ','b','a','t',' ','c','m','d',' ','c','o','m',0}; + LPWSTR lpResult, DWORD resultLen, LPWSTR key, WCHAR **env, LPITEMIDLIST pidl, LPCWSTR args) +{ WCHAR *extension = NULL; /* pointer to file extension */ WCHAR filetype[256]; /* registry name for this filetype */ LONG filetypelen = sizeof(filetype); /* length of above */ @@ -700,7 +695,7 @@ return 33; } - if (SearchPathW(lpPath, lpFile, wszExe, sizeof(xlpFile)/sizeof(WCHAR), xlpFile, NULL)) + if (SearchPathW(lpPath, lpFile, wszExe, sizeof(xlpFile) / sizeof(WCHAR), xlpFile, NULL)) { TRACE("SearchPathW returned non-zero\n"); lpFile = xlpFile; @@ -708,15 +703,15 @@ } attribs = GetFileAttributesW(lpFile); - if (attribs!=INVALID_FILE_ATTRIBUTES && (attribs&FILE_ATTRIBUTE_DIRECTORY)) - { - wcscpy(filetype, wszFolder); - filetypelen = 6; /* strlen("Folder") */ + if (attribs != INVALID_FILE_ATTRIBUTES && (attribs & FILE_ATTRIBUTE_DIRECTORY)) + { + wcscpy(filetype, wszFolder); + filetypelen = 6; /* strlen("Folder") */ } else { /* Did we get something? Anything? */ - if (xlpFile[0]==0) + if (xlpFile[0] == 0) { TRACE("Returning SE_ERR_FNF\n"); return SE_ERR_FNF; @@ -727,7 +722,7 @@ /* .\FILE.EXE :( */ TRACE("xlpFile=%s,extension=%s\n", debugstr_w(xlpFile), debugstr_w(extension)); - if (extension == NULL || extension[1]==0) + if (extension == NULL || extension[1] == 0) { WARN("Returning SE_ERR_NOASSOC\n"); return SE_ERR_NOASSOC; @@ -744,7 +739,7 @@ /* 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(wWindows, wPrograms, wExtensions, wBuffer, sizeof(wBuffer)/sizeof(WCHAR)) > 0) + if (GetProfileStringW(L"windows", L"programs", L"exe pif bat cmd com", wBuffer, sizeof(wBuffer) / sizeof(WCHAR)) > 0) { CharLowerW(wBuffer); tok = wBuffer; @@ -776,7 +771,7 @@ &filetypelen) == ERROR_SUCCESS) { filetypelen /= sizeof(WCHAR); - if (filetypelen == sizeof(filetype)/sizeof(WCHAR)) + if (filetypelen == sizeof(filetype) / sizeof(WCHAR)) filetypelen--; filetype[filetypelen] = '\0'; @@ -818,17 +813,15 @@ WCHAR *p = lpResult; while (*p != ' ' && *p != '\0') p++; - *p='\0'; + *p = '\0'; } } } else /* Check win.ini */ { - static const WCHAR wExtensions[] = {'e','x','t','e','n','s','i','o','n','s',0}; - /* Toss the leading dot */ extension++; - if (GetProfileStringW(wExtensions, extension, wszEmpty, command, sizeof(command)/sizeof(WCHAR)) > 0) + if (GetProfileStringW(L"extesions", extension, L"", command, sizeof(command) / sizeof(WCHAR)) > 0) { if (wcslen(command) != 0) { @@ -839,7 +832,7 @@ tok[0] = '\0'; wcscat(lpResult, xlpFile); /* what if no dir in xlpFile? */ tok = wcschr(command, '^'); /* see above */ - if ((tok != NULL) && (wcslen(tok)>5)) + if ((tok != NULL) && (wcslen(tok) > 5)) { wcscat(lpResult, &tok[5]); } @@ -863,7 +856,7 @@ ULONG_PTR dwData1, ULONG_PTR dwData2) { TRACE("dde_cb: %04x, %04x, %p, %p, %p, %p, %08lx, %08lx\n", - uType, uFmt, hConv, hsz1, hsz2, hData, dwData1, dwData2); + uType, uFmt, hConv, hsz1, hsz2, hData, dwData1, dwData2); return NULL; } @@ -881,8 +874,6 @@ LPCWSTR szCommandline, LPITEMIDLIST pidl, SHELL_ExecuteW32 execfunc, const SHELLEXECUTEINFOW *psei, LPSHELLEXECUTEINFOW psei_out) { - static const WCHAR wApplication[] = {'\\','a','p','p','l','i','c','a','t','i','o','n',0}; - static const WCHAR wTopic[] = {'\\','t','o','p','i','c',0}; WCHAR regkey[256]; WCHAR * endkey = regkey + wcslen(key); WCHAR app[256], topic[256], ifexec[256], res[256]; @@ -898,37 +889,37 @@ BOOL unicode = !(GetVersion() & 0x80000000); wcscpy(regkey, key); - 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[] = { '.','s','o',0 }; - DWORD sizeSo = sizeof(wSo)/sizeof(WCHAR); + 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 == '"') { - wcscpy(command, start+1); + wcscpy(command, start + 1); if ((ptr = wcschr(command, '"'))) - *ptr = 0; - ret = SearchPathW(NULL, command, wszExe, sizeof(fullpath)/sizeof(WCHAR), fullpath, &ptr); + * ptr = 0; + ret = SearchPathW(NULL, command, wszExe, sizeof(fullpath) / sizeof(WCHAR), fullpath, &ptr); } else { - LPWSTR p,space; - for (p=(LPWSTR)start; (space= const_cast<LPWSTR>(strchrW(p, ' '))); p=space+1) + LPWSTR p, space; + for (p = (LPWSTR)start; (space = const_cast<LPWSTR>(strchrW(p, ' '))); p = space + 1) { - int idx = space-start; - memcpy(command, start, idx*sizeof(WCHAR)); + 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, wszExe, sizeof(fullpath) / sizeof(WCHAR), fullpath, &ptr))) break; } if (!ret) - ret = SearchPathW(NULL, start, wszExe, sizeof(fullpath)/sizeof(WCHAR), fullpath, &ptr); + ret = SearchPathW(NULL, start, wszExe, sizeof(fullpath) / sizeof(WCHAR), fullpath, &ptr); } if (!ret) @@ -939,9 +930,9 @@ wcscpy(app, ptr); /* Remove extensions (including .so) */ - ptr = app + wcslen(app) - (sizeSo-1); + ptr = app + wcslen(app) - (sizeSo - 1); if (wcslen(app) >= sizeSo && - !wcscmp(ptr, wSo)) + !wcscmp(ptr, wSo)) *ptr = 0; ptr = const_cast<LPWSTR>(strrchrW(app, '.')); @@ -949,12 +940,11 @@ *ptr = 0; } - wcscpy(endkey, wTopic); + wcscpy(endkey, L"\\topic"); topiclen = sizeof(topic); if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, topic, &topiclen) != ERROR_SUCCESS) { - static const WCHAR wSystem[] = {'S','y','s','t','e','m',0}; - wcscpy(topic, wSystem); + wcscpy(topic, L"System"); } if (unicode) @@ -975,7 +965,6 @@ exec = ddeexec; if (!hConv) { - static const WCHAR wIfexec[] = {'\\','i','f','e','x','e','c',0}; TRACE("Launching %s\n", debugstr_w(start)); ret = execfunc(start, env, TRUE, psei, psei_out); if (ret <= 32) @@ -991,7 +980,7 @@ SetLastError(ERROR_DDE_FAIL); return 30; /* whatever */ } - strcpyW(endkey, wIfexec); + strcpyW(endkey, L"\\ifexec"); ifexeclen = sizeof(ifexec); if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, ifexec, &ifexeclen) == ERROR_SUCCESS) { @@ -999,8 +988,8 @@ } } - SHELL_ArgifyW(res, sizeof(res)/sizeof(WCHAR), exec, lpFile, pidl, szCommandline, &resultLen); - if (resultLen > sizeof(res)/sizeof(WCHAR)) + SHELL_ArgifyW(res, sizeof(res) / sizeof(WCHAR), exec, lpFile, pidl, szCommandline, &resultLen); + if (resultLen > sizeof(res) / sizeof(WCHAR)) ERR("Argify buffer not large enough, truncated\n"); TRACE("%s %s => %s\n", debugstr_w(exec), debugstr_w(lpFile), debugstr_w(res)); @@ -1026,7 +1015,7 @@ DdeDisconnect(hConv); - error: +error: DdeUninitialize(ddeInst); return ret; @@ -1040,8 +1029,6 @@ SHELL_ExecuteW32 execfunc, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out) { - static const WCHAR wCommand[] = {'c','o','m','m','a','n','d',0}; - static const WCHAR wDdeexec[] = {'d','d','e','e','x','e','c',0}; WCHAR cmd[256], param[1024], ddeexec[256]; DWORD cmdlen = sizeof(cmd), ddeexeclen = sizeof(ddeexec); UINT_PTR retval = SE_ERR_NOASSOC; @@ -1049,7 +1036,7 @@ LPWSTR tmp; TRACE("%s %s %s %s %s\n", debugstr_w(key), debugstr_w(lpFile), debugstr_w(env), - debugstr_w(szCommandline), debugstr_w(executable_name)); + debugstr_w(szCommandline), debugstr_w(executable_name)); cmd[0] = '\0'; param[0] = '\0'; @@ -1061,19 +1048,19 @@ /* Is there a replace() function anywhere? */ cmdlen /= sizeof(WCHAR); - if (cmdlen >= sizeof(cmd)/sizeof(WCHAR)) - cmdlen = sizeof(cmd)/sizeof(WCHAR)-1; + if (cmdlen >= sizeof(cmd) / sizeof(WCHAR)) + cmdlen = sizeof(cmd) / sizeof(WCHAR) - 1; cmd[cmdlen] = '\0'; - SHELL_ArgifyW(param, sizeof(param)/sizeof(WCHAR), cmd, lpFile, (LPITEMIDLIST)psei->lpIDList, szCommandline, &resultLen); - if (resultLen > sizeof(param)/sizeof(WCHAR)) + SHELL_ArgifyW(param, sizeof(param) / sizeof(WCHAR), cmd, lpFile, (LPITEMIDLIST)psei->lpIDList, szCommandline, &resultLen); + if (resultLen > sizeof(param) / sizeof(WCHAR)) ERR("Argify buffer not large enough, truncating\n"); } /* Get the parameters needed by the application from the associated ddeexec key */ - tmp = const_cast<LPWSTR>(strstrW(key, wCommand)); + tmp = const_cast<LPWSTR>(strstrW(key, L"command")); assert(tmp); - wcscpy(tmp, wDdeexec); + wcscpy(tmp, L"ddeexec"); if (RegQueryValueW(HKEY_CLASSES_ROOT, key, ddeexec, (LONG *)&ddeexeclen) == ERROR_SUCCESS) { @@ -1106,8 +1093,8 @@ retval = FindExecutableW(wFile, wDirectory, wResult); WideCharToMultiByte(CP_ACP, 0, wResult, -1, lpResult, MAX_PATH, NULL, NULL); - SHFree( wFile ); - SHFree( wDirectory ); + SHFree(wFile); + SHFree(wDirectory); TRACE("returning %s\n", lpResult); return retval; @@ -1151,7 +1138,7 @@ if (lpDirectory) { - GetCurrentDirectoryW(sizeof(old_dir)/sizeof(WCHAR), old_dir); + GetCurrentDirectoryW(sizeof(old_dir) / sizeof(WCHAR), old_dir); SetCurrentDirectoryW(lpDirectory); } @@ -1164,7 +1151,7 @@ } /* FIXME: is this already implemented somewhere else? */ -static HKEY ShellExecute_GetClassKey( const SHELLEXECUTEINFOW *sei ) +static HKEY ShellExecute_GetClassKey(const SHELLEXECUTEINFOW *sei) { LPCWSTR ext = NULL, lpClass = NULL; LPWSTR cls = NULL; @@ -1179,35 +1166,35 @@ lpClass = sei->lpClass; else { - ext = PathFindExtensionW( sei->lpFile ); - TRACE("ext = %s\n", debugstr_w( ext ) ); + ext = PathFindExtensionW(sei->lpFile); + TRACE("ext = %s\n", debugstr_w(ext)); if (!ext) return hkey; - r = RegOpenKeyW( HKEY_CLASSES_ROOT, ext, &hkey ); - if (r != ERROR_SUCCESS ) + r = RegOpenKeyW(HKEY_CLASSES_ROOT, ext, &hkey); + if (r != ERROR_SUCCESS) return hkey; - r = RegQueryValueExW( hkey, NULL, 0, &type, NULL, &sz ); - if ( r == ERROR_SUCCESS && type == REG_SZ ) + r = RegQueryValueExW(hkey, NULL, 0, &type, NULL, &sz); + if (r == ERROR_SUCCESS && type == REG_SZ) { sz += sizeof (WCHAR); - cls = (LPWSTR)HeapAlloc( GetProcessHeap(), 0, sz ); + cls = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, sz); cls[0] = 0; - RegQueryValueExW( hkey, NULL, 0, &type, (LPBYTE) cls, &sz ); + RegQueryValueExW(hkey, NULL, 0, &type, (LPBYTE) cls, &sz); } RegCloseKey( hkey ); lpClass = cls; } - TRACE("class = %s\n", debugstr_w(lpClass) ); + TRACE("class = %s\n", debugstr_w(lpClass)); hkey = 0; - if ( lpClass ) - RegOpenKeyW( HKEY_CLASSES_ROOT, lpClass, &hkey ); - - HeapFree( GetProcessHeap(), 0, cls ); + if (lpClass) + RegOpenKeyW( HKEY_CLASSES_ROOT, lpClass, &hkey); + + HeapFree(GetProcessHeap(), 0, cls); return hkey; } @@ -1228,30 +1215,30 @@ BOOL ret; fullpath[0] = 0; - ret = GetFullPathNameW( sei->lpFile, MAX_PATH, fullpath, NULL ); + ret = GetFullPathNameW(sei->lpFile, MAX_PATH, fullpath, NULL); if (!ret) goto end; - pidl = ILCreateFromPathW( fullpath ); - } - - r = SHBindToParent( pidl, IID_IShellFolder, (LPVOID*)&shf, &pidllast ); - if ( FAILED( r ) ) + pidl = ILCreateFromPathW(fullpath); + } + + r = SHBindToParent(pidl, IID_IShellFolder, (LPVOID*)&shf, &pidllast); + if (FAILED(r)) goto end; shf->GetUIObjectOf(NULL, 1, &pidllast, - IID_IDataObject, NULL, (LPVOID*) &dataobj ); + IID_IDataObject, NULL, (LPVOID*) &dataobj); end: - if ( pidl != sei->lpIDList ) - ILFree( pidl ); - if ( shf ) + if (pidl != sei->lpIDList) + ILFree(pidl); + if (shf) shf->Release(); return dataobj; } -static HRESULT shellex_run_context_menu_default( IShellExtInit *obj, - LPSHELLEXECUTEINFOW sei ) +static HRESULT shellex_run_context_menu_default(IShellExtInit *obj, + LPSHELLEXECUTEINFOW sei) { IContextMenu *cm = NULL; CMINVOKECOMMANDINFOEX ici; @@ -1261,36 +1248,36 @@ HMENU hmenu = 0; HRESULT r; - TRACE("%p %p\n", obj, sei ); - - r = obj->QueryInterface(IID_IContextMenu, (LPVOID*) &cm ); - if ( FAILED( r ) ) + TRACE("%p %p\n", obj, sei); + + r = obj->QueryInterface(IID_IContextMenu, (LPVOID*) &cm); + if (FAILED(r)) return r; hmenu = CreateMenu(); - if ( !hmenu ) + if (!hmenu) goto end; /* the number of the last menu added is returned in r */ - r = cm->QueryContextMenu(hmenu, 0, 0x20, 0x7fff, CMF_DEFAULTONLY ); - if ( FAILED( r ) ) + r = cm->QueryContextMenu(hmenu, 0, 0x20, 0x7fff, CMF_DEFAULTONLY); + if (FAILED(r)) goto end; - n = GetMenuItemCount( hmenu ); - for ( i = 0; i < n; i++ ) - { - memset( &info, 0, sizeof info ); + n = GetMenuItemCount(hmenu); + for (i = 0; i < n; i++) + { + memset(&info, 0, sizeof(info)); info.cbSize = sizeof info; info.fMask = MIIM_FTYPE | MIIM_STRING | MIIM_STATE | MIIM_DATA | MIIM_ID; info.dwTypeData = string; info.cch = sizeof string; string[0] = 0; - GetMenuItemInfoW( hmenu, i, TRUE, &info ); + GetMenuItemInfoW(hmenu, i, TRUE, &info); TRACE("menu %d %s %08x %08lx %08x %08x\n", i, debugstr_w(string), - info.fState, info.dwItemData, info.fType, info.wID ); - if ( ( !sei->lpVerb && (info.fState & MFS_DEFAULT) ) || - ( sei->lpVerb && !lstrcmpiW( sei->lpVerb, string ) ) ) + info.fState, info.dwItemData, info.fType, info.wID); + if ((!sei->lpVerb && (info.fState & MFS_DEFAULT)) || + (sei->lpVerb && !lstrcmpiW(sei->lpVerb, string))) { def = i; break; @@ -1298,75 +1285,75 @@ } r = E_FAIL; - if ( def == -1 ) + if (def == -1) goto end; - memset( &ici, 0, sizeof ici ); + memset(&ici, 0, sizeof ici); ici.cbSize = sizeof ici; - ici.fMask = CMIC_MASK_UNICODE | (sei->fMask & (SEE_MASK_NOASYNC|SEE_MASK_ASYNCOK|SEE_MASK_FLAG_NO_UI)); + ici.fMask = CMIC_MASK_UNICODE | (sei->fMask & (SEE_MASK_NOASYNC | SEE_MASK_ASYNCOK | SEE_MASK_FLAG_NO_UI)); ici.nShow = sei->nShow; - ici.lpVerb = MAKEINTRESOURCEA( def ); + ici.lpVerb = MAKEINTRESOURCEA(def); ici.hwnd = sei->hwnd; ici.lpParametersW = sei->lpParameters; - r = cm->InvokeCommand((LPCMINVOKECOMMANDINFO) &ici ); - - TRACE("invoke command returned %08x\n", r ); + r = cm->InvokeCommand((LPCMINVOKECOMMANDINFO)&ici); + + TRACE("invoke command returned %08x\n", r); end: - if ( hmenu ) + if (hmenu) DestroyMenu( hmenu ); - if ( cm ) + if (cm) cm->Release(); return r; } -static HRESULT shellex_load_object_and_run( HKEY hkey, LPCGUID guid, LPSHELLEXECUTEINFOW sei ) +static HRESULT shellex_load_object_and_run(HKEY hkey, LPCGUID guid, LPSHELLEXECUTEINFOW sei) { IDataObject *dataobj = NULL; IObjectWithSite *ows = NULL; IShellExtInit *obj = NULL; HRESULT r; - TRACE("%p %s %p\n", hkey, debugstr_guid( guid ), sei ); - - r = CoInitialize( NULL ); - if ( FAILED( r ) ) + TRACE("%p %s %p\n", hkey, debugstr_guid(guid), sei); + + r = CoInitialize(NULL); + if (FAILED(r)) goto end; r = CoCreateInstance(*guid, NULL, CLSCTX_INPROC_SERVER, - IID_IShellExtInit, (LPVOID*)&obj ); - if ( FAILED( r ) ) - { - ERR("failed %08x\n", r ); + IID_IShellExtInit, (LPVOID*)&obj); + if (FAILED(r)) + { + ERR("failed %08x\n", r); goto end; } - dataobj = shellex_get_dataobj( sei ); - if ( !dataobj ) + dataobj = shellex_get_dataobj(sei); + if (!dataobj) { ERR("failed to get data object\n"); goto end; } - r = obj->Initialize(NULL, dataobj, hkey ); - if ( FAILED( r ) ) + r = obj->Initialize(NULL, dataobj, hkey); + if (FAILED(r)) goto end; - r = obj->QueryInterface(IID_IObjectWithSite, (LPVOID*) &ows ); - if ( FAILED( r ) ) + r = obj->QueryInterface(IID_IObjectWithSite, (LPVOID*) &ows); + if (FAILED(r)) goto end; - ows->SetSite(NULL ); - - r = shellex_run_context_menu_default( obj, sei ); + ows->SetSite(NULL); + + r = shellex_run_context_menu_default(obj, sei); end: - if ( ows ) + if (ows) ows->Release(); - if ( dataobj ) + if (dataobj) dataobj->Release(); - if ( obj ) + if (obj) obj->Release(); CoUninitialize(); return r; @@ -1378,8 +1365,6 @@ */ static LONG ShellExecute_FromContextMenu( LPSHELLEXECUTEINFOW sei ) { - static const WCHAR szcm[] = { 's','h','e','l','l','e','x','\\', - 'C','o','n','t','e','x','t','M','e','n','u','H','a','n','d','l','e','r','s',0 }; HKEY hkey, hkeycm = 0; WCHAR szguid[39]; HRESULT hr; @@ -1387,52 +1372,51 @@ DWORD i; LONG r; - TRACE("%s\n", debugstr_w(sei->lpFile) ); - - hkey = ShellExecute_GetClassKey( sei ); - if ( !hkey ) + TRACE("%s\n", debugstr_w(sei->lpFile)); + + hkey = ShellExecute_GetClassKey(sei); + if (!hkey) return ERROR_FUNCTION_FAILED; - r = RegOpenKeyW( hkey, szcm, &hkeycm ); - if ( r == ERROR_SUCCESS ) + r = RegOpenKeyW(hkey, L"shellex\\ContextMenuHandlers", &hkeycm); + if (r == ERROR_SUCCESS) { i = 0; - while ( 1 ) - { - r = RegEnumKeyW( hkeycm, i++, szguid, sizeof(szguid)/sizeof(szguid[0]) ); - if ( r != ERROR_SUCCESS ) + while (1) + { + r = RegEnumKeyW(hkeycm, i++, szguid, sizeof(szguid) / sizeof(szguid[0])); + if (r != ERROR_SUCCESS) break; - hr = CLSIDFromString( szguid, &guid ); + hr = CLSIDFromString(szguid, &guid); if (SUCCEEDED(hr)) { /* stop at the first one that succeeds in running */ - hr = shellex_load_object_and_run( hkey, &guid, sei ); - if ( SUCCEEDED( hr ) ) + hr = shellex_load_object_and_run(hkey, &guid, sei); + if (SUCCEEDED(hr)) break; } } - RegCloseKey( hkeycm ); - } - - if ( hkey != sei->hkeyClass ) - RegCloseKey( hkey ); + RegCloseKey(hkeycm); + } + + if (hkey != sei->hkeyClass) + RegCloseKey(hkey); return r; } -static UINT_PTR SHELL_execute_class( LPCWSTR wszApplicationName, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc ) -{ - static const WCHAR wSpace[] = {' ',0}; +static UINT_PTR SHELL_execute_class(LPCWSTR wszApplicationName, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc) +{ WCHAR execCmd[1024], wcmd[1024]; /* launch a document by fileclass like 'WordPad.Document.1' */ /* the Commandline contains 'c:\Path\wordpad.exe "%1"' */ /* FIXME: wcmd should not be of a fixed size. Fixed to 1024, MAX_PATH is way too short! */ - ULONG cmask=(psei->fMask & SEE_MASK_CLASSALL); + ULONG cmask = (psei->fMask & SEE_MASK_CLASSALL); DWORD resultLen; BOOL done; HCR_GetExecuteCommandW((cmask == SEE_MASK_CLASSKEY) ? psei->hkeyClass : NULL, - (cmask == SEE_MASK_CLASSNAME) ? psei->lpClass: NULL, + (cmask == SEE_MASK_CLASSNAME) ? psei->lpClass : NULL, psei->lpVerb, execCmd, sizeof(execCmd)); @@ -1440,26 +1424,26 @@ 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, sizeof(wcmd) / sizeof(WCHAR), execCmd, wszApplicationName, (LPITEMIDLIST)psei->lpIDList, NULL, &resultLen); if (!done && wszApplicationName[0]) { - strcatW(wcmd, wSpace); + strcatW(wcmd, L" "); strcatW(wcmd, wszApplicationName); } - if (resultLen > sizeof(wcmd)/sizeof(WCHAR)) + if (resultLen > sizeof(wcmd) / sizeof(WCHAR)) ERR("Argify buffer not large enough... truncating\n"); return execfunc(wcmd, NULL, FALSE, psei, psei_out); } -static BOOL SHELL_translate_idlist( LPSHELLEXECUTEINFOW sei, LPWSTR wszParameters, DWORD parametersLen, LPWSTR wszApplicationName, DWORD dwApplicationNameLen ) -{ - static const WCHAR wExplorer[] = {'e','x','p','l','o','r','e','r','.','e','x','e',0}; +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)))) { - if (buffer[0]==':' && buffer[1]==':') { + 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", @@ -1481,10 +1465,10 @@ strcpyW(target, buffer); attribs = GetFileAttributesW(buffer); if (attribs != INVALID_FILE_ATTRIBUTES && - (attribs & FILE_ATTRIBUTE_DIRECTORY) && - HCR_GetExecuteCommandW(0, wszFolder, - sei->lpVerb, - buffer, sizeof(buffer))) { + (attribs & FILE_ATTRIBUTE_DIRECTORY) && + HCR_GetExecuteCommandW(0, wszFolder, + sei->lpVerb, + buffer, sizeof(buffer))) { SHELL_ArgifyW(wszApplicationName, dwApplicationNameLen, buffer, target, (LPITEMIDLIST)sei->lpIDList, NULL, &resultLen); if (resultLen > dwApplicationNameLen) @@ -1497,10 +1481,8 @@ return appKnownSingular; } -static UINT_PTR SHELL_quote_and_execute( LPCWSTR wcmd, LPCWSTR wszParameters, LPCWSTR lpstrProtocol, LPCWSTR wszApplicationName, LPWSTR env, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc ) -{ - static const WCHAR wQuote[] = {'"',0}; - static const WCHAR wSpace[] = {' ',0}; +static UINT_PTR SHELL_quote_and_execute(LPCWSTR wcmd, LPCWSTR wszParameters, LPCWSTR lpstrProtocol, LPCWSTR wszApplicationName, LPWSTR env, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc) +{ UINT_PTR retval; DWORD len; WCHAR *wszQuotedCmd; @@ -1516,12 +1498,12 @@ /* Must quote to handle case where cmd contains spaces, * else security hole if malicious user creates executable file "C:\\Program" */ - strcpyW(wszQuotedCmd, wQuote); + strcpyW(wszQuotedCmd, L"\""); strcatW(wszQuotedCmd, wcmd); - strcatW(wszQuotedCmd, wQuote); + strcatW(wszQuotedCmd, L"\""); if (wszParameters[0]) { - strcatW(wszQuotedCmd, wSpace); + strcatW(wszQuotedCmd, " "); strcatW(wszQuotedCmd, wszParameters); } @@ -1535,10 +1517,10 @@ return retval; } -static UINT_PTR SHELL_execute_url( LPCWSTR lpFile, LPCWSTR wFile, LPCWSTR wcmd, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc ) -{ - static const WCHAR wShell[] = {'\\','s','h','e','l','l','\\',0}; - static const WCHAR wCommand[] = {'\\','c','o','m','m','a','n','d',0}; +static UINT_PTR SHELL_execute_url(LPCWSTR lpFile, LPCWSTR wFile, 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; @@ -1559,10 +1541,10 @@ else len += lstrlenW(wszOpen); lpstrProtocol = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - memcpy(lpstrProtocol, lpFile, iSize*sizeof(WCHAR)); + memcpy(lpstrProtocol, lpFile, iSize * sizeof(WCHAR)); lpstrProtocol[iSize] = '\0'; strcatW(lpstrProtocol, wShell); - strcatW(lpstrProtocol, psei->lpVerb? psei->lpVerb: wszOpen); + strcatW(lpstrProtocol, psei->lpVerb ? psei->lpVerb : wszOpen); strcatW(lpstrProtocol, wCommand); /* Remove File Protocol from lpFile */ @@ -1578,7 +1560,7 @@ return retval; } -void do_error_dialog( UINT_PTR retval, HWND hwnd, WCHAR* filename) +void do_error_dialog(UINT_PTR retval, HWND hwnd, WCHAR* filename) { WCHAR msg[2048]; DWORD_PTR msgArguments[3] = { (DWORD_PTR)filename, 0, 0 }; @@ -1587,14 +1569,14 @@ 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, sizeof(msg) / sizeof(WCHAR)); else FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY, NULL, error_code, LANG_USER_DEFAULT, msg, - sizeof(msg)/sizeof(WCHAR), + sizeof(msg) / sizeof(WCHAR), (va_list*)msgArguments); MessageBoxW(hwnd, msg, NULL, MB_ICONERROR); @@ -1603,12 +1585,8 @@ /************************************************************************* * SHELL_execute [Internal] */ -BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) -{ - static const WCHAR wSpace[] = {' ',0}; - static const WCHAR wWww[] = {'w','w','w',0}; - static const WCHAR wFile[] = {'f','i','l','e',0}; - static const WCHAR wHttp[] = {'h','t','t','p',':','/','/',0}; +BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) +{ static const DWORD unsupportedFlags = SEE_MASK_INVOKEIDLIST | SEE_MASK_ICON | SEE_MASK_HOTKEY | SEE_MASK_CONNECTNETDRV | SEE_MASK_FLAG_DDEWAIT | @@ -1616,7 +1594,7 @@ WCHAR parametersBuffer[1024], dirBuffer[MAX_PATH], wcmdBuffer[1024]; WCHAR *wszApplicationName, *wszParameters, *wszDir, *wcmd; - DWORD dwApplicationNameLen = MAX_PATH+2; + DWORD dwApplicationNameLen = MAX_PATH + 2; DWORD parametersLen = sizeof(parametersBuffer) / sizeof(WCHAR); DWORD dirLen = sizeof(dirBuffer) / sizeof(WCHAR); DWORD wcmdLen = sizeof(wcmdBuffer) / sizeof(WCHAR); @@ -1633,41 +1611,41 @@ sei_tmp = *sei; TRACE("mask=0x%08x hwnd=%p verb=%s file=%s parm=%s dir=%s show=0x%08x class=%s\n", - sei_tmp.fMask, sei_tmp.hwnd, debugstr_w(sei_tmp.lpVerb), - debugstr_w(sei_tmp.lpFile), debugstr_w(sei_tmp.lpParameters), - debugstr_w(sei_tmp.lpDirectory), sei_tmp.nShow, - ((sei_tmp.fMask & SEE_MASK_CLASSALL) == SEE_MASK_CLASSNAME) ? - debugstr_w(sei_tmp.lpClass) : "not used"); + sei_tmp.fMask, sei_tmp.hwnd, debugstr_w(sei_tmp.lpVerb), + debugstr_w(sei_tmp.lpFile), debugstr_w(sei_tmp.lpParameters), + debugstr_w(sei_tmp.lpDirectory), sei_tmp.nShow, + ((sei_tmp.fMask & SEE_MASK_CLASSALL) == SEE_MASK_CLASSNAME) ? + debugstr_w(sei_tmp.lpClass) : "not used"); sei->hProcess = NULL; /* make copies of all path/command strings */ if (!sei_tmp.lpFile) { - wszApplicationName = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, dwApplicationNameLen*sizeof(WCHAR)); + wszApplicationName = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, dwApplicationNameLen * sizeof(WCHAR)); *wszApplicationName = '\0'; } else if (*sei_tmp.lpFile == '\"') { - DWORD l = strlenW(sei_tmp.lpFile+1); + DWORD l = strlenW(sei_tmp.lpFile + 1); if(l >= dwApplicationNameLen) - dwApplicationNameLen = l+1; - - wszApplicationName = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, dwApplicationNameLen*sizeof(WCHAR)); - memcpy(wszApplicationName, sei_tmp.lpFile+1, (l+1)*sizeof(WCHAR)); - - if (wszApplicationName[l-1] == '\"') - wszApplicationName[l-1] = '\0'; + dwApplicationNameLen = l + 1; + + wszApplicationName = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, dwApplicationNameLen * sizeof(WCHAR)); + memcpy(wszApplicationName, sei_tmp.lpFile + 1, (l + 1)*sizeof(WCHAR)); + + if (wszApplicationName[l-1] == L'\"') + wszApplicationName[l-1] = L'\0'; appKnownSingular = TRUE; - TRACE("wszApplicationName=%s\n",debugstr_w(wszApplicationName)); + TRACE("wszApplicationName=%s\n", debugstr_w(wszApplicationName)); } else { - DWORD l = strlenW(sei_tmp.lpFile)+1; - if(l > dwApplicationNameLen) dwApplicationNameLen = l+1; - wszApplicationName = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, dwApplicationNameLen*sizeof(WCHAR)); - memcpy(wszApplicationName, sei_tmp.lpFile, l*sizeof(WCHAR)); + DWORD l = strlenW(sei_tmp.lpFile) + 1; + if(l > dwApplicationNameLen) dwApplicationNameLen = l + 1; + wszApplicationName = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, dwApplicationNameLen * sizeof(WCHAR)); + memcpy(wszApplicationName, sei_tmp.lpFile, l * sizeof(WCHAR)); } wszParameters = parametersBuffer; @@ -1682,7 +1660,7 @@ strcpyW(wszParameters, sei_tmp.lpParameters); } else - *wszParameters = '\0'; + *wszParameters = L'\0'; wszDir = dirBuffer; if (sei_tmp.lpDirectory) @@ -1696,7 +1674,7 @@ strcpyW(wszDir, sei_tmp.lpDirectory); } else - *wszDir = '\0'; + *wszDir = L'\0'; /* adjust string pointers to point to the new buffers */ sei_tmp.lpFile = wszApplicationName; @@ -1737,7 +1715,7 @@ TRACE("-- idlist=%p (%s)\n", sei_tmp.lpIDList, debugstr_w(wszApplicationName)); } - if ( ERROR_SUCCESS == ShellExecute_FromContextMenu( &sei_tmp ) ) + if (ERROR_SUCCESS == ShellExecute_FromContextMenu(&sei_tmp)) { sei->hInstApp = (HINSTANCE) 33; HeapFree(GetProcessHeap(), 0, wszApplicationName); @@ -1750,8 +1728,7 @@ if (sei_tmp.fMask & SEE_MASK_CLASSALL) { - retval = SHELL_execute_class( wszApplicationName, &sei_tmp, sei, - execfunc ); + retval = SHELL_execute_class(wszApplicationName, &sei_tmp, sei, execfunc); if (retval <= 32 && !(sei_tmp.fMask & SEE_MASK_FLAG_NO_UI)) { OPENASINFO Info; @@ -1764,7 +1741,7 @@ Info.oaifInFlags = OAIF_ALLOW_REGISTRATION | OAIF_EXEC; //if (SHOpenWithDialog(sei_tmp.hwnd, &Info) != S_OK) - do_error_dialog(retval, sei_tmp.hwnd, wszApplicationName); + do_error_dialog(retval, sei_tmp.hwnd, wszApplicationName); } HeapFree(GetProcessHeap(), 0, wszApplicationName); if (wszParameters != parametersBuffer) @@ -1778,21 +1755,21 @@ if (sei_tmp.fMask & SEE_MASK_IDLIST) { appKnownSingular = SHELL_translate_idlist( &sei_tmp, wszParameters, - parametersLen, - wszApplicationName, - dwApplicationNameLen ); + parametersLen, + wszApplicationName, + dwApplicationNameLen ); } /* expand environment strings */ len = ExpandEnvironmentStringsW(sei_tmp.lpFile, NULL, 0); - if (len>0) + if (len > 0) { LPWSTR buf; - buf = (LPWSTR)HeapAlloc(GetProcessHeap(),0,(len+1)*sizeof(WCHAR)); - - ExpandEnvironmentStringsW(sei_tmp.lpFile, buf, len+1); + buf = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR)); + + ExpandEnvironmentStringsW(sei_tmp.lpFile, buf, len + 1); HeapFree(GetProcessHeap(), 0, wszApplicationName); - dwApplicationNameLen = len+1; + dwApplicationNameLen = len + 1; wszApplicationName = buf; /* appKnownSingular unmodified */ @@ -1806,7 +1783,7 @@ { LPWSTR buf; len++; - buf = (LPWSTR)HeapAlloc(GetProcessHeap(),0,len*sizeof(WCHAR)); + buf = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); ExpandEnvironmentStringsW(sei_tmp.lpParameters, buf, len); if (wszParameters != parametersBuffer) HeapFree(GetProcessHeap(), 0, wszParameters); @@ -1823,7 +1800,7 @@ { LPWSTR buf; len++; - buf = (LPWSTR)HeapAlloc(GetProcessHeap(),0,len*sizeof(WCHAR)); + buf = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); ExpandEnvironmentStringsW(sei_tmp.lpDirectory, buf, len); if (wszDir != dirBuffer) HeapFree(GetProcessHeap(), 0, wszDir); @@ -1833,25 +1810,25 @@ } /* Else, try to execute the filename */ - TRACE("execute:%s,%s,%s\n", debugstr_w(wszApplicationName), debugstr_w(wszParameters), debugstr_w(wszDir)); + TRACE("execute: %s,%s,%s\n", debugstr_w(wszApplicationName), debugstr_w(wszParameters), debugstr_w(wszDir)); /* separate out command line arguments from executable file name */ if (!*sei_tmp.lpParameters && !appKnownSingular) { /* If the executable path is quoted, handle the rest of the command line as parameters. */ - if (sei_tmp.lpFile[0] == '"') + if (sei_tmp.lpFile[0] == L'"') { LPWSTR src = wszApplicationName/*sei_tmp.lpFile*/ + 1; LPWSTR dst = wfileName; LPWSTR end; /* copy the unquoted executable path to 'wfileName' */ - while(*src && *src!='"') - *dst++ = *src++; - - *dst = '\0'; - - if (*src == '"') + while(*src && *src != L'"') + *dst++ = *src++; + + *dst = L'\0'; + + if (*src == L'"') { end = ++src; @@ -1865,7 +1842,7 @@ strcpyW(wszParameters, src); /* terminate previous command string after the quote character */ - *end = '\0'; + *end = L'\0'; } else { @@ -1875,14 +1852,14 @@ LPWSTR space, s; LPWSTR beg = wszApplicationName/*sei_tmp.lpFile*/; - for(s=beg; (space= const_cast<LPWSTR>(strchrW(s, ' '))); s=space+1) + for(s = beg; (space = const_cast<LPWSTR>(strchrW(s, L' '))); s = space + 1) { - int idx = space-sei_tmp.lpFile; + int idx = space - sei_tmp.lpFile; memcpy(buffer, sei_tmp.lpFile, idx * sizeof(WCHAR)); buffer[idx] = '\0'; /*FIXME This finds directory paths if the targeted file name contains spaces. */ - if (SearchPathW(*sei_tmp.lpDirectory? sei_tmp.lpDirectory: NULL, buffer, wszExe, sizeof(xlpFile)/sizeof(xlpFile[0]), xlpFile, NULL)) + if (SearchPathW(*sei_tmp.lpDirectory ? sei_tmp.lpDirectory : NULL, buffer, wszExe, sizeof(xlpFile) / sizeof(xlpFile[0]), xlpFile, NULL)) { /* separate out command from parameter string */ LPCWSTR p = space + 1; @@ -1891,17 +1868,17 @@ ++p; strcpyW(wszParameters, p); - *space = '\0'; + *space = L'\0'; break; } } - lstrcpynW(wfileName, sei_tmp.lpFile,sizeof(wfileName)/sizeof(WCHAR)); + lstrcpynW(wfileName, sei_tmp.lpFile, sizeof(wfileName) / sizeof(WCHAR)); } } else - lstrcpynW(wfileName, sei_tmp.lpFile,sizeof(wfileName)/sizeof(WCHAR)); + lstrcpynW(wfileName, sei_tmp.lpFile, sizeof(wfileName) / sizeof(WCHAR)); lpFile = wfileName; @@ -1917,7 +1894,7 @@ swprintf(wcmd, L"\"%s\"", wszApplicationName); if (sei_tmp.lpParameters[0]) { - strcatW(wcmd, wSpace); + strcatW(wcmd, L" "); strcatW(wcmd, wszParameters); } @@ -1935,53 +1912,49 @@ } /* Else, try to find the executable */ - wcmd[0] = '\0'; + wcmd[0] = L'\0'; retval = SHELL_FindExecutable(sei_tmp.lpDirectory, lpFile, sei_tmp.lpVerb, wcmd, wcmdLen, lpstrProtocol, &env, (LPITEMIDLIST)sei_tmp.lpIDList, sei_tmp.lpParameters); if (retval > 32) /* Found */ { - retval = SHELL_quote_and_execute( wcmd, wszParameters, lpstrProtocol, - wszApplicationName, env, &sei_tmp, - sei, execfunc ); - HeapFree( GetProcessHeap(), 0, env ); + retval = SHELL_quote_and_execute(wcmd, wszParameters, lpstrProtocol, + wszApplicationName, env, &sei_tmp, + sei, execfunc); + HeapFree(GetProcessHeap(), 0, env); } else if (PathIsDirectoryW(lpFile)) { - static const WCHAR wExplorer[] = {'e','x','p','l','o','r','e','r',0}; - static const WCHAR wQuote[] = {'"',0}; WCHAR wExec[MAX_PATH]; - WCHAR * lpQuotedFile = (LPWSTR)HeapAlloc( GetProcessHeap(), 0, sizeof(WCHAR) * (strlenW(lpFile) + 3) ); + WCHAR * lpQuotedFile = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * (strlenW(lpFile) + 3)); if (lpQuotedFile) { - retval = SHELL_FindExecutable( sei_tmp.lpDirectory, wExplorer, - wszOpen, wExec, MAX_PATH, - NULL, &env, NULL, NULL ); + retval = SHELL_FindExecutable(sei_tmp.lpDirectory, L"explorer", + wszOpen, wExec, MAX_PATH, + NULL, &env, NULL, NULL); if (retval > 32) { - strcpyW(lpQuotedFile, wQuote); - strcatW(lpQuotedFile, lpFile); - strcatW(lpQuotedFile, wQuote); - retval = SHELL_quote_and_execute( wExec, lpQuotedFile, - lpstrProtocol, - wszApplicationName, env, - &sei_tmp, sei, execfunc ); - HeapFree( GetProcessHeap(), 0, env ); + swprintf(lpQuotedFile, L"\"%s\"", lpFile); + retval = SHELL_quote_and_execute(wExec, lpQuotedFile, + lpstrProtocol, + wszApplicationName, env, + &sei_tmp, sei, execfunc); + HeapFree(GetProcessHeap(), 0, env); } - HeapFree( GetProcessHeap(), 0, lpQuotedFile ); + HeapFree(GetProcessHeap(), 0, lpQuotedFile); } else retval = 0; /* Out of memory */ } else if (PathIsURLW(lpFile)) /* File not found, check for URL */ { - retval = SHELL_execute_url( lpFile, wFile, wcmd, &sei_tmp, sei, execfunc ); + retval = SHELL_execute_url(lpFile, L"file", wcmd, &sei_tmp, sei, execfunc ); } /* Check if file specified is in the form
www.??????.***
*/ - else if (!strncmpiW(lpFile, wWww, 3)) + else if (!strncmpiW(lpFile, L"www", 3)) { /* if so, append lpFile http:// and call ShellExecute */ WCHAR lpstrTmpFile[256]; - strcpyW(lpstrTmpFile, wHttp); + strcpyW(lpstrTmpFile, L"http://"); strcatW(lpstrTmpFile, lpFile); retval = (UINT_PTR)ShellExecuteW(sei_tmp.hwnd, sei_tmp.lpVerb, lpstrTmpFile, NULL, NULL, 0); } @@ -2000,7 +1973,7 @@ Info.oaifInFlags = OAIF_ALLOW_REGISTRATION | OAIF_EXEC; //if (SHOpenWithDialog(sei_tmp.hwnd, &Info) != S_OK) - do_error_dialog(retval, sei_tmp.hwnd, wszApplicationName); + do_error_dialog(retval, sei_tmp.hwnd, wszApplicationName); } HeapFree(GetProcessHeap(), 0, wszApplicationName); @@ -2019,8 +1992,8 @@ /************************************************************************* * ShellExecuteA [SHELL32.290] */ -HINSTANCE WINAPI ShellExecuteA(HWND hWnd, LPCSTR lpOperation,LPCSTR lpFile, - LPCSTR lpParameters,LPCSTR lpDirectory, INT iShowCmd) +HINSTANCE WINAPI ShellExecuteA(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, + LPCSTR lpParameters, LPCSTR lpDirectory, INT iShowCmd) { SHELLEXECUTEINFOA sei; @@ -2042,7 +2015,7 @@ sei.dwHotKey = 0; sei.hProcess = 0; - ShellExecuteExA (&sei); + ShellExecuteExA(&sei); return sei.hInstApp; } @@ -2050,7 +2023,7 @@ * ShellExecuteExA [SHELL32.292] * */ -BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei) +BOOL WINAPI ShellExecuteExA(LPSHELLEXECUTEINFOA sei) { SHELLEXECUTEINFOW seiW; BOOL ret; @@ -2077,7 +2050,7 @@ else seiW.lpClass = NULL; - ret = SHELL_execute( &seiW, SHELL_ExecuteW ); + ret = SHELL_execute(&seiW, SHELL_ExecuteW); sei->hInstApp = seiW.hInstApp; @@ -2097,9 +2070,9 @@ * ShellExecuteExW [SHELL32.293] * */ -BOOL WINAPI ShellExecuteExW (LPSHELLEXECUTEINFOW sei) -{ - return SHELL_execute( sei, SHELL_ExecuteW ); +BOOL WINAPI ShellExecuteExW(LPSHELLEXECUTEINFOW sei) +{ + return SHELL_execute(sei, SHELL_ExecuteW); } /************************************************************************* @@ -2128,7 +2101,7 @@ sei.dwHotKey = 0; sei.hProcess = 0; - SHELL_execute( &sei, SHELL_ExecuteW ); + SHELL_execute(&sei, SHELL_ExecuteW); return sei.hInstApp; } @@ -2137,8 +2110,8 @@ * * FIXME: the callback function most likely doesn't work the same way on Windows. */ -EXTERN_C HINSTANCE WINAPI WOWShellExecute(HWND hWnd, LPCSTR lpOperation,LPCSTR lpFile, - LPCSTR lpParameters,LPCSTR lpDirectory, INT iShowCmd, void *callback) +EXTERN_C HINSTANCE WINAPI WOWShellExecute(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, + LPCSTR lpParameters, LPCSTR lpDirectory, INT iShowCmd, void *callback) { SHELLEXECUTEINFOW seiW; WCHAR *wVerb = NULL, *wFile = NULL, *wParameters = NULL, *wDirectory = NULL; @@ -2159,7 +2132,7 @@ seiW.dwHotKey = 0; seiW.hProcess = hProcess; - SHELL_execute( &seiW, (SHELL_ExecuteW32)callback ); + SHELL_execute(&seiW, (SHELL_ExecuteW32)callback); SHFree(wVerb); SHFree(wFile);
12 years, 11 months
1
0
0
0
[rharabien] 54844: [SHELL32] - Rewrite Open With menu and dialog - Load all applications - Use treeview with Recommended and Other programs - Don't allow duplicates - Load registry keys in proper way
by rharabien@svn.reactos.org
Author: rharabien Date: Thu Jan 5 18:31:18 2012 New Revision: 54844 URL:
http://svn.reactos.org/svn/reactos?rev=54844&view=rev
Log: [SHELL32] - Rewrite Open With menu and dialog - Load all applications - Use treeview with Recommended and Other programs - Don't allow duplicates - Load registry keys in proper way Modified: trunk/reactos/dll/win32/shell32/lang/bg-BG.rc trunk/reactos/dll/win32/shell32/lang/ca-ES.rc trunk/reactos/dll/win32/shell32/lang/cs-CZ.rc trunk/reactos/dll/win32/shell32/lang/da-DK.rc trunk/reactos/dll/win32/shell32/lang/de-DE.rc trunk/reactos/dll/win32/shell32/lang/el-GR.rc trunk/reactos/dll/win32/shell32/lang/en-GB.rc trunk/reactos/dll/win32/shell32/lang/en-US.rc trunk/reactos/dll/win32/shell32/lang/es-ES.rc trunk/reactos/dll/win32/shell32/lang/fi-FI.rc trunk/reactos/dll/win32/shell32/lang/fr-FR.rc trunk/reactos/dll/win32/shell32/lang/hu-HU.rc trunk/reactos/dll/win32/shell32/lang/it-IT.rc trunk/reactos/dll/win32/shell32/lang/ja-JP.rc trunk/reactos/dll/win32/shell32/lang/ko-KR.rc trunk/reactos/dll/win32/shell32/lang/nl-NL.rc trunk/reactos/dll/win32/shell32/lang/no-NO.rc trunk/reactos/dll/win32/shell32/lang/pl-PL.rc trunk/reactos/dll/win32/shell32/lang/pt-BR.rc trunk/reactos/dll/win32/shell32/lang/pt-PT.rc trunk/reactos/dll/win32/shell32/lang/ro-RO.rc trunk/reactos/dll/win32/shell32/lang/ru-RU.rc trunk/reactos/dll/win32/shell32/lang/sk-SK.rc trunk/reactos/dll/win32/shell32/lang/sl-SI.rc trunk/reactos/dll/win32/shell32/lang/sv-SE.rc trunk/reactos/dll/win32/shell32/lang/tr-TR.rc trunk/reactos/dll/win32/shell32/lang/uk-UA.rc trunk/reactos/dll/win32/shell32/lang/zh-CN.rc trunk/reactos/dll/win32/shell32/lang/zh-TW.rc trunk/reactos/dll/win32/shell32/openwithmenu.cpp trunk/reactos/dll/win32/shell32/openwithmenu.h trunk/reactos/dll/win32/shell32/shresdef.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/shell32/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/bg-…
Modified: trunk/reactos/dll/win32/shell32/lang/ca-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ca-…
Modified: trunk/reactos/dll/win32/shell32/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/cs-…
Modified: trunk/reactos/dll/win32/shell32/lang/da-DK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/da-…
Modified: trunk/reactos/dll/win32/shell32/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/de-…
Modified: trunk/reactos/dll/win32/shell32/lang/el-GR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/el-…
Modified: trunk/reactos/dll/win32/shell32/lang/en-GB.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/en-…
Modified: trunk/reactos/dll/win32/shell32/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/en-…
Modified: trunk/reactos/dll/win32/shell32/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/es-…
Modified: trunk/reactos/dll/win32/shell32/lang/fi-FI.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/fi-…
Modified: trunk/reactos/dll/win32/shell32/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/fr-…
Modified: trunk/reactos/dll/win32/shell32/lang/hu-HU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/hu-…
Modified: trunk/reactos/dll/win32/shell32/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/it-…
Modified: trunk/reactos/dll/win32/shell32/lang/ja-JP.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ja-…
Modified: trunk/reactos/dll/win32/shell32/lang/ko-KR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ko-…
Modified: trunk/reactos/dll/win32/shell32/lang/nl-NL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/nl-…
Modified: trunk/reactos/dll/win32/shell32/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/no-…
Modified: trunk/reactos/dll/win32/shell32/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/pl-…
Modified: trunk/reactos/dll/win32/shell32/lang/pt-BR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/pt-…
Modified: trunk/reactos/dll/win32/shell32/lang/pt-PT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/pt-…
Modified: trunk/reactos/dll/win32/shell32/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ro-…
Modified: trunk/reactos/dll/win32/shell32/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ru-…
Modified: trunk/reactos/dll/win32/shell32/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/sk-…
Modified: trunk/reactos/dll/win32/shell32/lang/sl-SI.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/sl-…
Modified: trunk/reactos/dll/win32/shell32/lang/sv-SE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/sv-…
Modified: trunk/reactos/dll/win32/shell32/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/tr-…
Modified: trunk/reactos/dll/win32/shell32/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/uk-…
Modified: trunk/reactos/dll/win32/shell32/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/zh-…
Modified: trunk/reactos/dll/win32/shell32/lang/zh-TW.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/zh-…
Modified: trunk/reactos/dll/win32/shell32/openwithmenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/openwith…
Modified: trunk/reactos/dll/win32/shell32/openwithmenu.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/openwith…
Modified: trunk/reactos/dll/win32/shell32/shresdef.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shresdef…
12 years, 11 months
1
0
0
0
[janderwald] 54843: [HID] - Implement quering compatible ids - Fix result status for quering instance id - Fix bug in msmouse.inf
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Jan 5 18:22:48 2012 New Revision: 54843 URL:
http://svn.reactos.org/svn/reactos?rev=54843&view=rev
Log: [HID] - Implement quering compatible ids - Fix result status for quering instance id - Fix bug in msmouse.inf Modified: branches/usb-bringup/drivers/hid/hidclass/pdo.c branches/usb-bringup/media/inf/input.inf branches/usb-bringup/media/inf/msmouse.inf Modified: branches/usb-bringup/drivers/hid/hidclass/pdo.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/hid/hidclas…
============================================================================== --- branches/usb-bringup/drivers/hid/hidclass/pdo.c [iso-8859-1] (original) +++ branches/usb-bringup/drivers/hid/hidclass/pdo.c [iso-8859-1] Thu Jan 5 18:22:48 2012 @@ -131,6 +131,8 @@ // // store result // + DPRINT1("NewBuffer %S\n", NewBuffer); + ASSERT(FALSE); Irp->IoStatus.Information = (ULONG_PTR)NewBuffer; return STATUS_SUCCESS; } @@ -183,8 +185,8 @@ // // single tlc device // - Offset = swprintf(&Buffer[Offset], L"HID\\Vid_%04x&Pid_%04x&Rev_%04x", PDODeviceExtension->Common.Attributes.VendorID, PDODeviceExtension->Common.Attributes.ProductID, PDODeviceExtension->Common.Attributes.VersionNumber) + 1; - Offset += swprintf(&Buffer[Offset], L"HID\\Vid_%04x&Pid_%04x", PDODeviceExtension->Common.Attributes.VendorID, PDODeviceExtension->Common.Attributes.ProductID) + 1; + Offset = swprintf(&Buffer[Offset], L"HID\\Vix_%04x&Pid_%04x&Rev_%04x", PDODeviceExtension->Common.Attributes.VendorID, PDODeviceExtension->Common.Attributes.ProductID, PDODeviceExtension->Common.Attributes.VersionNumber) + 1; + Offset += swprintf(&Buffer[Offset], L"HID\\Vix_%04x&Pid_%04x", PDODeviceExtension->Common.Attributes.VendorID, PDODeviceExtension->Common.Attributes.ProductID) + 1; } // @@ -270,6 +272,7 @@ // // store result // + ASSERT(FALSE); Irp->IoStatus.Information = (ULONG_PTR)Ptr; return STATUS_SUCCESS; } @@ -298,11 +301,7 @@ return Status; } DPRINT1("HidClassPDO_HandleQueryInstanceId Buffer %S\n", Irp->IoStatus.Information); - // - //TODO implement instance id - // example: - // HID\VID_045E&PID_0047\8&1A0700BC&0&0000 - return STATUS_NOT_IMPLEMENTED; + return Status; } NTSTATUS @@ -310,29 +309,28 @@ IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { - NTSTATUS Status; - - // - // copy current stack location - // - IoCopyCurrentIrpStackLocationToNext(Irp); - - // - // call mini-driver - // - Status = HidClassFDO_DispatchRequestSynchronous(DeviceObject, Irp); - if (!NT_SUCCESS(Status)) - { - // - // failed - // - return Status; - } - - // - // FIXME: implement me - // - return STATUS_NOT_IMPLEMENTED; + LPWSTR Buffer; + + Buffer = (LPWSTR)ExAllocatePool(NonPagedPool, 2 * sizeof(WCHAR)); + if (!Buffer) + { + // + // no memory + // + return STATUS_INSUFFICIENT_RESOURCES; + } + + // + // zero buffer + // + Buffer[0] = 0; + Buffer[1] = 0; + + // + // store result + // + Irp->IoStatus.Information = (ULONG_PTR)Buffer; + return STATUS_SUCCESS; } Modified: branches/usb-bringup/media/inf/input.inf URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/media/inf/input.inf…
============================================================================== --- branches/usb-bringup/media/inf/input.inf [iso-8859-1] (original) +++ branches/usb-bringup/media/inf/input.inf [iso-8859-1] Thu Jan 5 18:22:48 2012 @@ -59,7 +59,7 @@ StartType = 3 ErrorControl = 1 ServiceBinary = %12%\hidusb.sys -LoadOrderGroup = Pointer Port +LoadOrderGroup = extended base [strings] MSFT = "ReactOS" Modified: branches/usb-bringup/media/inf/msmouse.inf URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/media/inf/msmouse.i…
============================================================================== Binary files - no diff available.
12 years, 11 months
1
0
0
0
[rharabien] 54842: [NOTEPAD][WORDPAD] - Add version information [BOOTDATA] - Add Notepad, Wordpad and Paint to Applications registry key
by rharabien@svn.reactos.org
Author: rharabien Date: Thu Jan 5 17:59:19 2012 New Revision: 54842 URL:
http://svn.reactos.org/svn/reactos?rev=54842&view=rev
Log: [NOTEPAD][WORDPAD] - Add version information [BOOTDATA] - Add Notepad, Wordpad and Paint to Applications registry key Modified: trunk/reactos/base/applications/mspaint/rsrc.rc trunk/reactos/base/applications/wordpad/rsrc.rc trunk/reactos/boot/bootdata/hivecls_i386.inf Modified: trunk/reactos/base/applications/mspaint/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/rsrc.rc [iso-8859-1] Thu Jan 5 17:59:19 2012 @@ -10,6 +10,12 @@ #include <windows.h> #include "definitions.h" + +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Paint\0" +#define REACTOS_STR_INTERNAL_NAME "mspaint\0" +#define REACTOS_STR_ORIGINAL_FILENAME "mspaint.exe\0" + +#include <reactos/version.rc> #include "icons.rc" Modified: trunk/reactos/base/applications/wordpad/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/rsrc.rc [iso-8859-1] Thu Jan 5 17:59:19 2012 @@ -18,6 +18,12 @@ */ #include "wordpad.h" + +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS WordPad\0" +#define REACTOS_STR_INTERNAL_NAME "wordpad\0" +#define REACTOS_STR_ORIGINAL_FILENAME "wordpad.exe\0" + +#include <reactos/version.rc> MAINACCELTABLE ACCELERATORS BEGIN Modified: trunk/reactos/boot/bootdata/hivecls_i386.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivecls_i386…
============================================================================== --- trunk/reactos/boot/bootdata/hivecls_i386.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/hivecls_i386.inf [iso-8859-1] Thu Jan 5 17:59:19 2012 @@ -316,6 +316,10 @@ HKCR,"WinNT\Clsid","",0x00000002,"{8b20cd60-0f29-11cf-abc4-02608c9e7553}" +; Applications +HKCR,"Applications\notepad.exe\shell\open\command","",0x00000002,"notepad.exe %1" +HKCR,"Applications\mspaint.exe\shell\open\command","",0x00000002,"mspaint.exe %1" +HKCR,"Applications\wordpad.exe\shell\open\command","",0x00000002,"wordpad.exe %1" ; For language support:
12 years, 11 months
1
0
0
0
[tkreuzer] 54841: [CMAKE] Add an option to compile with PREFAST enabled, when using MSVC
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Jan 5 17:19:15 2012 New Revision: 54841 URL:
http://svn.reactos.org/svn/reactos?rev=54841&view=rev
Log: [CMAKE] Add an option to compile with PREFAST enabled, when using MSVC Modified: trunk/reactos/cmake/config.cmake trunk/reactos/cmake/msvc.cmake Modified: trunk/reactos/cmake/config.cmake URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/config.cmake?rev=548…
============================================================================== --- trunk/reactos/cmake/config.cmake [iso-8859-1] (original) +++ trunk/reactos/cmake/config.cmake [iso-8859-1] Thu Jan 5 17:19:15 2012 @@ -55,3 +55,8 @@ set(GENERATE_DEPENDENCY_GRAPH FALSE CACHE BOOL "Whether to create a graphml dependency of dlls.") + +if(MSVC) +set(_PREFAST_ FALSE CACHE BOOL +"Whether to enable PREFAST while compiling.") +endif() Modified: trunk/reactos/cmake/msvc.cmake URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/msvc.cmake?rev=54841…
============================================================================== --- trunk/reactos/cmake/msvc.cmake [iso-8859-1] (original) +++ trunk/reactos/cmake/msvc.cmake [iso-8859-1] Thu Jan 5 17:19:15 2012 @@ -43,13 +43,19 @@ # We may temporarily use just the global defines, but this is not a solution as some modules (minihal for example) apply additional definitions to source files, so we get an incorrect build of such targets. get_directory_property(definitions DEFINITIONS) set(CMAKE_ASM_COMPILE_OBJECT - "<CMAKE_C_COMPILER> /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm <FLAGS> ${definitions} /D__ASM__ /D_USE_ML /EP /c <SOURCE> > <OBJECT>.tmp" + "cl /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm <FLAGS> ${definitions} /D__ASM__ /D_USE_ML /EP /c <SOURCE> > <OBJECT>.tmp" "<CMAKE_ASM_COMPILER> /nologo /Cp /Fo<OBJECT> /c /Ta <OBJECT>.tmp") else() # NMake Makefiles set(CMAKE_ASM_COMPILE_OBJECT - "<CMAKE_C_COMPILER> /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm <FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE> > <OBJECT>.tmp" + "cl /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm <FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE> > <OBJECT>.tmp" "<CMAKE_ASM_COMPILER> /nologo /Cp /Fo<OBJECT> /c /Ta <OBJECT>.tmp") +endif() + +if(_PREFAST_) +message("PREFAST enabled!") +set(CMAKE_C_COMPILER "prefast cl") +set(CMAKE_CXX_COMPILER "prefast cl") endif() set(CMAKE_RC_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_LIBRARY})
12 years, 11 months
1
0
0
0
[tkreuzer] 54840: [SAL.H] Add macros and types for attribute based SAL
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Jan 5 17:06:10 2012 New Revision: 54840 URL:
http://svn.reactos.org/svn/reactos?rev=54840&view=rev
Log: [SAL.H] Add macros and types for attribute based SAL Modified: trunk/reactos/include/psdk/sal.h trunk/reactos/include/psdk/sal_old.h Modified: trunk/reactos/include/psdk/sal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/sal.h?rev=548…
============================================================================== --- trunk/reactos/include/psdk/sal.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/sal.h [iso-8859-1] Thu Jan 5 17:06:10 2012 @@ -31,7 +31,7 @@ #ifdef _PREFAST_ #ifndef _USE_DECLSPECS_FOR_SAL -#define _USE_DECLSPECS_FOR_SAL 1 +#define _USE_DECLSPECS_FOR_SAL 0 #endif #if !defined(_USE_ATTRIBUTES_FOR_SAL) || _USE_DECLSPECS_FOR_SAL @@ -64,7 +64,7 @@ #define _USE_ATTRIBUTES_FOR_SAL 0 #endif -#if !defined(_MSC_EXTENSIONS) +#if !defined(_MSC_EXTENSIONS) || defined(_M_CEE_SAFE) #undef _USE_ATTRIBUTES_FOR_SAL #define _USE_ATTRIBUTES_FOR_SAL 0 #endif @@ -72,14 +72,863 @@ #if _USE_ATTRIBUTES_FOR_SAL || _USE_DECLSPECS_FOR_SAL +#if _USE_ATTRIBUTES_FOR_SAL + +#if (_MSC_VER < 1400) +#error attribute sal only works with _MSC_VER >= 1400 +#endif + +#if !defined(_W64) +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif + +#ifndef _SIZE_T_DEFINED +# ifdef _WIN64 +typedef unsigned __int64 size_t; +# else +typedef _W64 unsigned int size_t; +# endif +# define _SIZE_T_DEFINED +#endif + +#ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +# define _WCHAR_T_DEFINED +#endif + +#ifdef __cplusplus +# define SA(id) id +# define REPEATABLE [repeatable] +# define CONSTRUCTOR(name) name(); +namespace vc_attributes { +#else +# define SA(id) SA_##id +# define REPEATABLE +# define CONSTRUCTOR(name) +#endif +#define ATTR_SA_ALL [source_annotation_attribute(SA(All))] + +typedef enum SA(YesNoMaybe) +{ + SA(No) = 0x0fff0001, + SA(Maybe) = 0x0fff0010, + SA(Yes) = 0x0fff0100 +} SA(YesNoMaybe); + +typedef enum SA(AccessType) +{ + SA(NoAccess) = 0, + SA(Read) = 1, + SA(Write) = 2, + SA(ReadWrite) = 3 +} SA(AccessType); + +#define DECLARE_ATTR(Name, ...) \ + ATTR_SA_ALL \ + typedef struct Name \ + { \ + CONSTRUCTOR(Name) \ + __VA_ARGS__ \ + } Name, + +REPEATABLE DECLARE_ATTR(PreAttribute, unsigned int Deref;SA(YesNoMaybe) Valid;SA(YesNoMaybe) Null;SA(YesNoMaybe) Tainted;SA(AccessType) Access;unsigned int Notref; + size_t ValidElementsConst;size_t ValidBytesConst;const wchar_t* ValidElements;const wchar_t* ValidBytes;const wchar_t* ValidElementsLength;const wchar_t* ValidBytesLength; + size_t WritableElementsConst;size_t WritableBytesConst;const wchar_t* WritableElements;const wchar_t* WritableBytes;const wchar_t* WritableElementsLength; + const wchar_t* WritableBytesLength;size_t ElementSizeConst;const wchar_t* ElementSize;SA(YesNoMaybe) NullTerminated;const wchar_t* Condition;) SA_Pre; +REPEATABLE DECLARE_ATTR(PostAttribute, unsigned int Deref;SA(YesNoMaybe) Valid;SA(YesNoMaybe) Null;SA(YesNoMaybe) Tainted;SA(AccessType) Access; + unsigned int Notref;size_t ValidElementsConst;size_t ValidBytesConst;const wchar_t* ValidElements;const wchar_t* ValidBytes; + const wchar_t* ValidElementsLength;const wchar_t* ValidBytesLength;size_t WritableElementsConst;size_t WritableBytesConst; + const wchar_t* WritableElements;const wchar_t* WritableBytes;const wchar_t* WritableElementsLength;const wchar_t* WritableBytesLength; + size_t ElementSizeConst;const wchar_t* ElementSize;SA(YesNoMaybe) NullTerminated;SA(YesNoMaybe) MustCheck;const wchar_t* Condition;) SA_Post; +DECLARE_ATTR(FormatStringAttribute, const wchar_t* Style; const wchar_t* UnformattedAlternative;) SA_FormatString; +REPEATABLE DECLARE_ATTR(PreBoundAttribute, unsigned int Deref;) SA_PreBound; +REPEATABLE DECLARE_ATTR(PostBoundAttribute, unsigned int Deref;) SA_PostBound; +REPEATABLE DECLARE_ATTR(PreRangeAttribute, unsigned int Deref;const char* MinVal;const char* MaxVal;) SA_PreRange; +REPEATABLE DECLARE_ATTR(PostRangeAttribute, unsigned int Deref;const char* MinVal;const char* MaxVal;) SA_PostRange; +REPEATABLE DECLARE_ATTR(DerefAttribute, int unused;) SAL_deref; +REPEATABLE DECLARE_ATTR(NotrefAttribute, int unused;) SAL_notref; +REPEATABLE DECLARE_ATTR(AnnotesAttribute, wchar_t *Name;wchar_t *p1;wchar_t *p2;wchar_t *p3;wchar_t *p4;wchar_t *p5;wchar_t *p6;wchar_t *p7;wchar_t *p8;wchar_t *p9;) SAL_annotes; +REPEATABLE DECLARE_ATTR(AtAttribute, wchar_t *p1;) SAL_at; +REPEATABLE DECLARE_ATTR(AtBufferAttribute, wchar_t *p1;wchar_t *p2;wchar_t *p3;) SAL_at_buffer; +REPEATABLE DECLARE_ATTR(WhenAttribute, wchar_t *p1;) SAL_when; +REPEATABLE DECLARE_ATTR(TypefixAttribute, wchar_t *p1;) SAL_typefix; +REPEATABLE DECLARE_ATTR(ContextAttribute, wchar_t *p1;) SAL_context; +REPEATABLE DECLARE_ATTR(ExceptAttribute, int unused;) SAL_except; +REPEATABLE DECLARE_ATTR(PreOpAttribute, int unused;) SAL_pre; +REPEATABLE DECLARE_ATTR(PostOpAttribute, int unused;) SAL_post; +REPEATABLE DECLARE_ATTR(BeginAttribute, int unused;) SAL_begin; +REPEATABLE DECLARE_ATTR(EndAttribute, int unused;) SAL_end; + +#ifdef __cplusplus +}; +#endif + +#undef REPEATABLE +#undef SA +#undef DECLARE_ATTR + + +#if (_MSC_VER >= 1610) +#define NL_(size) "\n"#size +#else +#define NL_(size) #size +#endif + +#define __bytecap_c_impl(size) WritableBytesConst=size +#define __bytecap_impl(size) WritableBytes=NL_(size) +#define __bytecap_x_impl(size) WritableBytes="\n@"#size +#define __bytecount_c_impl(size) ValidBytesConst=size +#define __bytecount_impl(size) ValidBytes=NL_(size) +#define __bytecount_x_impl(size) ValidBytes="\n@"#size +#define __cap_c_impl(size) WritableElementsConst=size +#define __cap_c_one_notref_impl WritableElementsConst=1,Notref=1 +#define __cap_for_impl(param) WritableElementsLength=#param +#define __cap_impl(size) WritableElements=NL_(size) +#define __cap_x_impl(size) WritableElements="\n@"#size +#define __count_c_impl(size) ValidElementsConst=size +#define __count_impl(size) ValidElements=NL_(size) +#define __count_x_impl(size) ValidElements="\n@"#size +#define __maybenull_impl Null=SA_Maybe +#define __maybenull_impl_notref Null=SA_Maybe,Notref=1 +#define __maybevalid_impl Valid=SA_Maybe +#define __maybezterm_impl NullTerminated=SA_Maybe +#define __maybzterm_impl NullTerminated=SA_Maybe +#define __mult_impl(mult,size) __cap_impl((mult)*(size)) +#define __notnull_impl Null=SA_No +#define __notnull_impl_notref Null=SA_No,Notref=1 +#define __notvalid_impl Valid=SA_No +#define __null_impl Null=SA_Yes +#define __null_impl_notref Null=SA_Yes,Notref=1 +#define __notzterm_impl NullTerminated=SA_No +#define __readaccess_impl Access=SA_Read +#define __readaccess_impl_notref Access=SA_Read,Notref=1 +#define __valid_impl Valid=SA_Yes +#define __writeaccess_impl Access=SA_Write +#define __writeaccess_impl_notref Access=SA_Write,Notref=1 +#define __zterm_impl NullTerminated=SA_Yes + +#define __inner_exceptthat [SAL_except] +#define __inner_typefix(ctype) [SAL_typefix(p1=_SA_SPECSTRIZE(ctype))] +#define _Check_return_impl_ [returnvalue:SA_Post(MustCheck=SA_Yes)] +#define _Deref_in_bound_impl_ [SA_PreBound(Deref=1)] +#define _Deref_in_range_impl_(min,max) [SA_PreRange(Deref=1,MinVal=#min,MaxVal=#max)] +#define _Deref_out_bound_impl_ [SA_PostBound(Deref=1)] +#define _Deref_out_range_impl_(min,max) [SA_PostRange(Deref=1,MinVal=#min,MaxVal=#max)] +#define _Deref_post1_impl_(p1) [SA_Post(Deref=1,p1)] +#define _Deref_post2_impl_(p1,p2) [SA_Post(Deref=1,p1,p2)] +#define _Deref_post3_impl_(p1,p2,p3) [SA_Post(Deref=1,p1,p2,p3)] +#define _Deref_pre1_impl_(p1) [SA_Pre(Deref=1,p1)] +#define _Deref_pre2_impl_(p1,p2) [SA_Pre(Deref=1,p1,p2)] +#define _Deref_pre3_impl_(p1,p2,p3) [SA_Pre(Deref=1,p1,p2,p3)] +#define _Deref_ret_bound_impl_ [returnvalue:SA_PostBound(Deref=1)] +#define _Deref_ret_range_impl_(min,max) [returnvalue:SA_PostRange(Deref=1,MinVal=#min,MaxVal=#max)] +#define _Deref_ret1_impl_(p1) [returnvalue:SA_Post(Deref=1,p1)] +#define _Deref_ret2_impl_(p1,p2) [returnvalue:SA_Post(Deref=1,p1,p2)] +#define _Deref_ret3_impl_(p1,p2,p3) [returnvalue:SA_Post(Deref=1,p1,p2,p3)] +#define _Deref2_post1_impl_(p1) [SA_Post(Deref=2,Notref=1,p1)] +#define _Deref2_pre1_impl_(p1) [SA_Pre(Deref=2,Notref=1,p1)] +#define _Deref2_ret1_impl_(p1) [returnvalue:SA_Post(Deref=2,Notref=1,p1)] +#define _In_bound_impl_ [SA_PreBound(Deref=0)] +#define _In_range_impl_(min,max) [SA_PreRange(MinVal=#min,MaxVal=#max)] +#define _Out_bound_impl_ [SA_PostBound(Deref=0)] +#define _Out_range_impl_(min,max) [SA_PostRange(MinVal=#min,MaxVal=#max)] +#define _Post1_impl_(p1) [SA_Post(p1)] +#define _Post2_impl_(p1,p2) [SA_Post(p1,p2)] +#define _Post3_impl_(p1,p2,p3) [SA_Post(p1,p2,p3)] +#define _Pre1_impl_(p1) [SA_Pre(p1)] +#define _Pre2_impl_(p1,p2) [SA_Pre(p1,p2)] +#define _Pre3_impl_(p1,p2,p3) [SA_Pre(p1,p2,p3)] +#define _Printf_format_string_impl_ [SA_FormatString(Style="printf")] +#define _Ret_bound_impl_ [returnvalue:SA_PostBound(Deref=0)] +#define _Ret_range_impl_(min,max) [returnvalue:SA_PostRange(MinVal=#min,MaxVal=#max)] +#define _Ret1_impl_(p1) [returnvalue:SA_Post(p1)] +#define _Ret2_impl_(p1,p2) [returnvalue:SA_Post(p1,p2)] +#define _Ret3_impl_(p1,p2,p3) [returnvalue:SA_Post(p1,p2,p3)] +#define _SA_annotes0(n) [SAL_annotes(Name=#n)] +#define _SA_annotes1(n,pp1) [SAL_annotes(Name=#n, p1=_SA_SPECSTRIZE(pp1))] +#define _SA_annotes2(n,pp1,pp2) [SAL_annotes(Name=#n, p1=_SA_SPECSTRIZE(pp1), p2=_SA_SPECSTRIZE(pp2))] +#define _SA_annotes3(n,pp1,pp2,pp3) [SAL_annotes(Name=#n, p1=_SA_SPECSTRIZE(pp1), p2=_SA_SPECSTRIZE(pp2), p3=_SA_SPECSTRIZE(pp3))] +#define _Scanf_format_string_impl_ [SA_FormatString(Style="scanf")] +#define _Scanf_s_format_string_impl_ [SA_FormatString(Style="scanf_s")] +#define _Use_decl_anno_impl_ _SA_annotes0(SAL_useHeader) + +#else /* #if _USE_DECLSPECS_FOR_SAL */ + #error unimplemented -#if _USE_ATTRIBUTES_FOR_SAL - -#else /* #if _USE_DECLSPECS_FOR_SAL */ - #endif +/* Common definitions */ +#define _At_(target, annos) _At_impl_(target, annos _SAL_nop_impl_) +#define _Group_(annos) _Group_impl_(annos _SAL_nop_impl_) + +#define _Always_impl_(annos) _Group_(annos _SAL_nop_impl_) _On_failure_impl_(annos _SAL_nop_impl_) +#define _At_buffer_impl_(target, iter, bound, annos) _SA_annotes3(SAL_at_buffer, target, iter, bound) _Group_(annos) +#define _At_impl_(target, annos) _SA_annotes0(SAL_at(target)) _Group_(annos) +#define _Bound_impl_ _SA_annotes0(SAL_bound) +#define _Deref_impl_ _SA_annotes0(SAL_deref) +#define _Field_range_impl_(min,max) _Range_impl_(min,max) +#define _Group_impl_(annos) _SA_annotes0(SAL_begin) annos _SA_annotes0(SAL_end) +#define _Literal_impl_ _SA_annotes1(SAL_constant, __yes) +#define _Maybenull_impl_ _SA_annotes1(SAL_null, __maybe) +#define _Maybevalid_impl_ _SA_annotes1(SAL_valid, __maybe) +#define _Must_inspect_impl_ _Post_impl_ _SA_annotes0(SAL_mustInspect) +#define _Notliteral_impl_ _SA_annotes1(SAL_constant, __no) +#define _Notnull_impl_ _SA_annotes1(SAL_null, __no) +#define _Notref_impl_ _SA_annotes0(SAL_notref) +#define _Notvalid_impl_ _SA_annotes1(SAL_valid, __no) +#define _Null_impl_ _SA_annotes1(SAL_null, __yes) +#define _Null_terminated_impl_ _SA_annotes1(SAL_nullTerminated, __yes) +#define _NullNull_terminated_impl_ _Group_(_SA_annotes1(SAL_nullTerminated, __yes) _SA_annotes1(SAL_readableTo,inexpressibleCount("NullNull terminated string"))) +#define _On_failure_impl_(annos) _SA_annotes1(SAL_context, SAL_failed) _Group_(_Post_impl_ _Group_(_SAL_nop_impl_ annos)) +#define _Points_to_data_impl_ _At_(*_Curr_, _SA_annotes1(SAL_mayBePointer, __no)) +#define _Post_impl_ _SA_annotes0(SAL_post) +#define _Post_satisfies_impl_(cond) _Post_impl_ _Satisfies_impl_(cond) +#define _Post_valid_impl_ _Post1_impl_(__valid_impl) +#define _Pre_impl_ _SA_annotes0(SAL_pre) +#define _Pre_satisfies_impl_(cond) _Pre_impl_ _Satisfies_impl_(cond) +#define _Pre_valid_impl_ _Pre1_impl_(__valid_impl) +#define _Range_impl_(min,max) _SA_annotes2(SAL_range, min, max) +#define _Readable_bytes_impl_(size) _SA_annotes1(SAL_readableTo, byteCount(size)) +#define _Readable_elements_impl_(size) _SA_annotes1(SAL_readableTo, elementCount(size)) +#define _Ret_valid_impl_ _Ret1_impl_(__valid_impl) +#define _SAL_nop_impl_ +#define _Satisfies_impl_(cond) _SA_annotes1(SAL_satisfies, cond) +#define _Success_impl_(expr) _SA_annotes1(SAL_success, expr) +#define _Valid_impl_ _SA_annotes1(SAL_valid, __yes) +#define _When_impl_(expr, annos) _SA_annotes0(SAL_when(expr)) _Group_(annos) +#define _Writable_bytes_impl_(size) _SA_annotes1(SAL_writableTo, byteCount(size)) +#define _Writable_elements_impl_(size) _SA_annotes1(SAL_writableTo, elementCount(size)) + +#define _Always_(annos) _Always_impl_(annos _SAL_nop_impl_) +#define _At_(target, annos) _At_impl_(target, annos _SAL_nop_impl_) +#define _At_buffer_(target, iter, bound, annos) _At_buffer_impl_(target, iter, bound, annos _SAL_nop_impl_) +#define _Check_return_ _Check_return_impl_ +#define _COM_Outptr_ _Outptr_ _On_failure_(_Deref_post_null_) +#define _COM_Outptr_opt_ _Outptr_opt_ _On_failure_(_Deref_post_null_) +#define _COM_Outptr_opt_result_maybenull_ _Outptr_opt_result_maybenull_ _On_failure_(_Deref_post_null_) +#define _COM_Outptr_result_maybenull_ _Outptr_result_maybenull_ _On_failure_(_Deref_post_null_) +#define _Const_ _Pre1_impl_(__readaccess_impl_notref) +#define _Deref_in_bound_ _Deref_in_bound_impl_ +#define _Deref_in_range_(lb,ub) _Deref_in_range_impl_(lb,ub) +#define _Deref_inout_bound_ _Deref_in_bound_ _Deref_out_bound_ +#define _Deref_inout_z_ _Deref_prepost_z_ +#define _Deref_inout_z_bytecap_c_(size) _Deref_pre_z_bytecap_c_(size) _Deref_post_z_ +#define _Deref_inout_z_cap_c_(size) _Deref_pre_z_cap_c_(size) _Deref_post_z_ +#define _Deref_opt_out_ _Out_opt_ _Deref_post_valid_ +#define _Deref_opt_out_opt_ _Out_opt_ _Deref_post_opt_valid_ +#define _Deref_opt_out_opt_z_ _Out_opt_ _Deref_post_opt_z_ +#define _Deref_opt_out_z_ _Out_opt_ _Deref_post_z_ +#define _Deref_out_ _Out_ _Deref_post_valid_ +#define _Deref_out_bound_ _Deref_out_bound_impl_ +#define _Deref_out_opt_ _Out_ _Deref_post_opt_valid_ +#define _Deref_out_opt_z_ _Out_ _Deref_post_opt_z_ +#define _Deref_out_range_(lb,ub) _Deref_out_range_impl_(lb,ub) +#define _Deref_out_z_ _Out_ _Deref_post_z_ +#define _Deref_out_z_bytecap_c_(size) _Deref_pre_bytecap_c_(size) _Deref_post_z_ +#define _Deref_out_z_cap_c_(size) _Deref_pre_cap_c_(size) _Deref_post_z_ +#define _Deref_post_bytecap_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__bytecap_impl(size)) +#define _Deref_post_bytecap_c_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__bytecap_c_impl(size)) +#define _Deref_post_bytecap_x_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__bytecap_x_impl(size)) +#define _Deref_post_bytecount_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__bytecount_impl(size)) _Post_valid_impl_ +#define _Deref_post_bytecount_c_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__bytecount_c_impl(size)) _Post_valid_impl_ +#define _Deref_post_bytecount_x_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__bytecount_x_impl(size)) _Post_valid_impl_ +#define _Deref_post_cap_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__cap_impl(size)) +#define _Deref_post_cap_c_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__cap_c_impl(size)) +#define _Deref_post_cap_x_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__cap_x_impl(size)) +#define _Deref_post_count_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__count_impl(size)) _Post_valid_impl_ +#define _Deref_post_count_c_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__count_c_impl(size)) _Post_valid_impl_ +#define _Deref_post_count_x_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__count_x_impl(size)) _Post_valid_impl_ +#define _Deref_post_maybenull_ _Deref_post1_impl_(__maybenull_impl_notref) +#define _Deref_post_notnull_ _Deref_post1_impl_(__notnull_impl_notref) +#define _Deref_post_null_ _Deref_post1_impl_(__null_impl_notref) +#define _Deref_post_opt_bytecap_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__bytecap_impl(size)) +#define _Deref_post_opt_bytecap_c_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__bytecap_c_impl(size)) +#define _Deref_post_opt_bytecap_x_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__bytecap_x_impl(size)) +#define _Deref_post_opt_bytecount_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__bytecount_impl(size)) _Post_valid_impl_ +#define _Deref_post_opt_bytecount_c_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__bytecount_c_impl(size)) _Post_valid_impl_ +#define _Deref_post_opt_bytecount_x_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__bytecount_x_impl(size)) _Post_valid_impl_ +#define _Deref_post_opt_cap_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__cap_impl(size)) +#define _Deref_post_opt_cap_c_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__cap_c_impl(size)) +#define _Deref_post_opt_cap_x_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__cap_x_impl(size)) +#define _Deref_post_opt_count_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__count_impl(size)) _Post_valid_impl_ +#define _Deref_post_opt_count_c_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__count_c_impl(size)) _Post_valid_impl_ +#define _Deref_post_opt_count_x_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__count_x_impl(size)) _Post_valid_impl_ +#define _Deref_post_opt_valid_ _Deref_post1_impl_(__maybenull_impl_notref) _Post_valid_impl_ +#define _Deref_post_opt_valid_bytecap_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__bytecap_impl(size)) _Post_valid_impl_ +#define _Deref_post_opt_valid_bytecap_c_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__bytecap_c_impl(size)) _Post_valid_impl_ +#define _Deref_post_opt_valid_bytecap_x_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__bytecap_x_impl(size)) _Post_valid_impl_ +#define _Deref_post_opt_valid_cap_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__cap_impl(size)) _Post_valid_impl_ +#define _Deref_post_opt_valid_cap_c_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__cap_c_impl(size)) _Post_valid_impl_ +#define _Deref_post_opt_valid_cap_x_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__cap_x_impl(size)) _Post_valid_impl_ +#define _Deref_post_opt_z_ _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__zterm_impl) _Post_valid_impl_ +#define _Deref_post_opt_z_bytecap_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post2_impl_(__zterm_impl,__bytecap_impl(size)) _Post_valid_impl_ +#define _Deref_post_opt_z_bytecap_c_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post2_impl_(__zterm_impl,__bytecap_c_impl(size)) _Post_valid_impl_ +#define _Deref_post_opt_z_bytecap_x_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post2_impl_(__zterm_impl,__bytecap_x_impl(size)) _Post_valid_impl_ +#define _Deref_post_opt_z_cap_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post2_impl_(__zterm_impl,__cap_impl(size)) _Post_valid_impl_ +#define _Deref_post_opt_z_cap_c_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post2_impl_(__zterm_impl,__cap_c_impl(size)) _Post_valid_impl_ +#define _Deref_post_opt_z_cap_x_(size) _Deref_post1_impl_(__maybenull_impl_notref) _Deref_post2_impl_(__zterm_impl,__cap_x_impl(size)) _Post_valid_impl_ +#define _Deref_post_valid_ _Deref_post1_impl_(__notnull_impl_notref) _Post_valid_impl_ +#define _Deref_post_valid_bytecap_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__bytecap_impl(size)) _Post_valid_impl_ +#define _Deref_post_valid_bytecap_c_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__bytecap_c_impl(size)) _Post_valid_impl_ +#define _Deref_post_valid_bytecap_x_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__bytecap_x_impl(size)) _Post_valid_impl_ +#define _Deref_post_valid_cap_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__cap_impl(size)) _Post_valid_impl_ +#define _Deref_post_valid_cap_c_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__cap_c_impl(size)) _Post_valid_impl_ +#define _Deref_post_valid_cap_x_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__cap_x_impl(size)) _Post_valid_impl_ +#define _Deref_post_z_ _Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__zterm_impl) _Post_valid_impl_ +#define _Deref_post_z_bytecap_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post2_impl_(__zterm_impl,__bytecap_impl(size)) _Post_valid_impl_ +#define _Deref_post_z_bytecap_c_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post2_impl_(__zterm_impl,__bytecap_c_impl(size)) _Post_valid_impl_ +#define _Deref_post_z_bytecap_x_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post2_impl_(__zterm_impl,__bytecap_x_impl(size)) _Post_valid_impl_ +#define _Deref_post_z_cap_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post2_impl_(__zterm_impl,__cap_impl(size)) _Post_valid_impl_ +#define _Deref_post_z_cap_c_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post2_impl_(__zterm_impl,__cap_c_impl(size)) _Post_valid_impl_ +#define _Deref_post_z_cap_x_(size) _Deref_post1_impl_(__notnull_impl_notref) _Deref_post2_impl_(__zterm_impl,__cap_x_impl(size)) _Post_valid_impl_ +#define _Deref_pre_bytecap_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__bytecap_impl(size)) +#define _Deref_pre_bytecap_c_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__bytecap_c_impl(size)) +#define _Deref_pre_bytecap_x_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__bytecap_x_impl(size)) +#define _Deref_pre_bytecount_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__bytecount_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_bytecount_c_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__bytecount_c_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_bytecount_x_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__bytecount_x_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_cap_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__cap_impl(size)) +#define _Deref_pre_cap_c_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__cap_c_impl(size)) +#define _Deref_pre_cap_x_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__cap_x_impl(size)) +#define _Deref_pre_count_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__count_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_count_c_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__count_c_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_count_x_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__count_x_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_invalid_ _Deref_pre1_impl_(__notvalid_impl) +#define _Deref_pre_maybenull_ _Deref_pre1_impl_(__maybenull_impl_notref) +#define _Deref_pre_notnull_ _Deref_pre1_impl_(__notnull_impl_notref) +#define _Deref_pre_null_ _Deref_pre1_impl_(__null_impl_notref) +#define _Deref_pre_opt_bytecap_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__bytecap_impl(size)) +#define _Deref_pre_opt_bytecap_c_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__bytecap_c_impl(size)) +#define _Deref_pre_opt_bytecap_x_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__bytecap_x_impl(size)) +#define _Deref_pre_opt_bytecount_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__bytecount_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_opt_bytecount_c_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__bytecount_c_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_opt_bytecount_x_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__bytecount_x_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_opt_cap_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__cap_impl(size)) +#define _Deref_pre_opt_cap_c_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__cap_c_impl(size)) +#define _Deref_pre_opt_cap_x_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__cap_x_impl(size)) +#define _Deref_pre_opt_count_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__count_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_opt_count_c_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__count_c_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_opt_count_x_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__count_x_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_opt_valid_ _Deref_pre1_impl_(__maybenull_impl_notref) _Pre_valid_impl_ +#define _Deref_pre_opt_valid_bytecap_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__bytecap_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_opt_valid_bytecap_c_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__bytecap_c_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_opt_valid_bytecap_x_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__bytecap_x_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_opt_valid_cap_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__cap_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_opt_valid_cap_c_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__cap_c_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_opt_valid_cap_x_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__cap_x_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_opt_z_ _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__zterm_impl) _Pre_valid_impl_ +#define _Deref_pre_opt_z_bytecap_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre2_impl_(__zterm_impl,__bytecap_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_opt_z_bytecap_c_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre2_impl_(__zterm_impl,__bytecap_c_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_opt_z_bytecap_x_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre2_impl_(__zterm_impl,__bytecap_x_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_opt_z_cap_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre2_impl_(__zterm_impl,__cap_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_opt_z_cap_c_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre2_impl_(__zterm_impl,__cap_c_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_opt_z_cap_x_(size) _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre2_impl_(__zterm_impl,__cap_x_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_readonly_ _Deref_pre1_impl_(__readaccess_impl_notref) +#define _Deref_pre_valid_ _Deref_pre1_impl_(__notnull_impl_notref) _Pre_valid_impl_ +#define _Deref_pre_valid_bytecap_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__bytecap_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_valid_bytecap_c_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__bytecap_c_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_valid_bytecap_x_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__bytecap_x_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_valid_cap_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__cap_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_valid_cap_c_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__cap_c_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_valid_cap_x_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__cap_x_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_writeonly_ _Deref_pre1_impl_(__writeaccess_impl_notref) +#define _Deref_pre_z_ _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__zterm_impl) _Pre_valid_impl_ +#define _Deref_pre_z_bytecap_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre2_impl_(__zterm_impl,__bytecap_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_z_bytecap_c_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre2_impl_(__zterm_impl,__bytecap_c_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_z_bytecap_x_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre2_impl_(__zterm_impl,__bytecap_x_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_z_cap_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre2_impl_(__zterm_impl,__cap_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_z_cap_c_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre2_impl_(__zterm_impl,__cap_c_impl(size)) _Pre_valid_impl_ +#define _Deref_pre_z_cap_x_(size) _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre2_impl_(__zterm_impl,__cap_x_impl(size)) _Pre_valid_impl_ +#define _Deref_prepost_bytecap_(size) _Deref_pre_bytecap_(size) _Deref_post_bytecap_(size) +#define _Deref_prepost_bytecap_x_(size) _Deref_pre_bytecap_x_(size) _Deref_post_bytecap_x_(size) +#define _Deref_prepost_bytecount_(size) _Deref_pre_bytecount_(size) _Deref_post_bytecount_(size) +#define _Deref_prepost_bytecount_x_(size) _Deref_pre_bytecount_x_(size) _Deref_post_bytecount_x_(size) +#define _Deref_prepost_cap_(size) _Deref_pre_cap_(size) _Deref_post_cap_(size) +#define _Deref_prepost_cap_x_(size) _Deref_pre_cap_x_(size) _Deref_post_cap_x_(size) +#define _Deref_prepost_count_(size) _Deref_pre_count_(size) _Deref_post_count_(size) +#define _Deref_prepost_count_x_(size) _Deref_pre_count_x_(size) _Deref_post_count_x_(size) +#define _Deref_prepost_opt_bytecap_(size) _Deref_pre_opt_bytecap_(size) _Deref_post_opt_bytecap_(size) +#define _Deref_prepost_opt_bytecap_x_(size) _Deref_pre_opt_bytecap_x_(size) _Deref_post_opt_bytecap_x_(size) +#define _Deref_prepost_opt_bytecount_(size) _Deref_pre_opt_bytecount_(size) _Deref_post_opt_bytecount_(size) +#define _Deref_prepost_opt_bytecount_x_(size) _Deref_pre_opt_bytecount_x_(size) _Deref_post_opt_bytecount_x_(size) +#define _Deref_prepost_opt_cap_(size) _Deref_pre_opt_cap_(size) _Deref_post_opt_cap_(size) +#define _Deref_prepost_opt_cap_x_(size) _Deref_pre_opt_cap_x_(size) _Deref_post_opt_cap_x_(size) +#define _Deref_prepost_opt_count_(size) _Deref_pre_opt_count_(size) _Deref_post_opt_count_(size) +#define _Deref_prepost_opt_count_x_(size) _Deref_pre_opt_count_x_(size) _Deref_post_opt_count_x_(size) +#define _Deref_prepost_opt_valid_ _Deref_pre_opt_valid_ _Deref_post_opt_valid_ +#define _Deref_prepost_opt_valid_bytecap_(size) _Deref_pre_opt_valid_bytecap_(size) _Deref_post_opt_valid_bytecap_(size) +#define _Deref_prepost_opt_valid_bytecap_x_(size) _Deref_pre_opt_valid_bytecap_x_(size) _Deref_post_opt_valid_bytecap_x_(size) +#define _Deref_prepost_opt_valid_cap_(size) _Deref_pre_opt_valid_cap_(size) _Deref_post_opt_valid_cap_(size) +#define _Deref_prepost_opt_valid_cap_x_(size) _Deref_pre_opt_valid_cap_x_(size) _Deref_post_opt_valid_cap_x_(size) +#define _Deref_prepost_opt_z_ _Deref_pre_opt_z_ _Deref_post_opt_z_ +#define _Deref_prepost_opt_z_bytecap_(size) _Deref_pre_opt_z_bytecap_(size) _Deref_post_opt_z_bytecap_(size) +#define _Deref_prepost_opt_z_cap_(size) _Deref_pre_opt_z_cap_(size) _Deref_post_opt_z_cap_(size) +#define _Deref_prepost_valid_ _Deref_pre_valid_ _Deref_post_valid_ +#define _Deref_prepost_valid_bytecap_(size) _Deref_pre_valid_bytecap_(size) _Deref_post_valid_bytecap_(size) +#define _Deref_prepost_valid_bytecap_x_(size) _Deref_pre_valid_bytecap_x_(size) _Deref_post_valid_bytecap_x_(size) +#define _Deref_prepost_valid_cap_(size) _Deref_pre_valid_cap_(size) _Deref_post_valid_cap_(size) +#define _Deref_prepost_valid_cap_x_(size) _Deref_pre_valid_cap_x_(size) _Deref_post_valid_cap_x_(size) +#define _Deref_prepost_z_ _Deref_pre_z_ _Deref_post_z_ +#define _Deref_prepost_z_bytecap_(size) _Deref_pre_z_bytecap_(size) _Deref_post_z_bytecap_(size) +#define _Deref_prepost_z_cap_(size) _Deref_pre_z_cap_(size) _Deref_post_z_cap_(size) +#define _Deref_ret_bound_ _Deref_ret_bound_impl_ +#define _Deref_ret_opt_z_ _Deref_ret1_impl_(__maybenull_impl_notref) _Ret1_impl_(__zterm_impl) +#define _Deref_ret_range_(lb,ub) _Deref_ret_range_impl_(lb,ub) +#define _Deref_ret_z_ _Deref_ret1_impl_(__notnull_impl_notref) _Deref_ret1_impl_(__zterm_impl) +#define _Deref2_pre_readonly_ _Deref2_pre1_impl_(__readaccess_impl_notref) +#define _Field_range_(min,max) _Field_range_impl_(min,max) +#define _Field_size_(size) _Notnull_ _Writable_elements_(size) +#define _Field_size_bytes_(size) _Notnull_ _Writable_bytes_(size) +#define _Field_size_bytes_full_(size) _Field_size_bytes_part_(size, size) +#define _Field_size_bytes_full_opt_(size) _Field_size_bytes_part_opt_(size, size) +#define _Field_size_bytes_opt_(size) _Maybenull_ _Writable_bytes_(size) +#define _Field_size_bytes_part_(size, count) _Notnull_ _Writable_bytes_(size) _Readable_bytes_(count) +#define _Field_size_bytes_part_opt_(size, count) _Maybenull_ _Writable_bytes_(size) _Readable_bytes_(count) +#define _Field_size_full_(size) _Field_size_part_(size, size) +#define _Field_size_full_opt_(size) _Field_size_part_opt_(size, size) +#define _Field_size_opt_(size) _Maybenull_ _Writable_elements_(size) +#define _Field_size_part_(size, count) _Notnull_ _Writable_elements_(size) _Readable_elements_(count) +#define _Field_size_part_opt_(size, count) _Maybenull_ _Writable_elements_(size) _Readable_elements_(count) +#define _Field_z_ _Null_terminated_ +#define _Group_(annos) _Group_impl_(annos _SAL_nop_impl_) +#define _In_ _Pre1_impl_(__notnull_impl_notref) _Pre_valid_impl_ _Deref_pre1_impl_(__readaccess_impl_notref) +#define _In_bound_ _In_bound_impl_ +#define _In_bytecount_(size) _Pre_bytecount_(size) _Deref_pre_readonly_ +#define _In_bytecount_c_(size) _Pre_bytecount_c_(size) _Deref_pre_readonly_ +#define _In_bytecount_x_(size) _Pre_bytecount_x_(size) _Deref_pre_readonly_ +#define _In_count_(size) _Pre_count_(size) _Deref_pre_readonly_ +#define _In_count_c_(size) _Pre_count_c_(size) _Deref_pre_readonly_ +#define _In_count_x_(size) _Pre_count_x_(size) _Deref_pre_readonly_ +#define _In_defensive_(annotes) _Pre_defensive_ _Group_(annotes) +#define _In_opt_ _Pre_opt_valid_ _Deref_pre_readonly_ +#define _In_opt_bytecount_(size) _Pre_opt_bytecount_(size) _Deref_pre_readonly_ +#define _In_opt_bytecount_c_(size) _Pre_opt_bytecount_c_(size) _Deref_pre_readonly_ +#define _In_opt_bytecount_x_(size) _Pre_opt_bytecount_x_(size) _Deref_pre_readonly_ +#define _In_opt_count_(size) _Pre_opt_count_(size) _Deref_pre_readonly_ +#define _In_opt_count_c_(size) _Pre_opt_count_c_(size) _Deref_pre_readonly_ +#define _In_opt_count_x_(size) _Pre_opt_count_x_(size) _Deref_pre_readonly_ +#define _In_opt_ptrdiff_count_(size) _Pre_opt_ptrdiff_count_(size) _Deref_pre_readonly_ +#define _In_opt_z_ _Pre_opt_z_ _Deref_pre_readonly_ +#define _In_opt_z_bytecount_(size) _Pre_opt_z_ _Pre_opt_bytecount_(size) _Deref_pre_readonly_ +#define _In_opt_z_bytecount_c_(size) _Pre_opt_z_ _Pre_opt_bytecount_c_(size) _Deref_pre_readonly_ +#define _In_opt_z_count_(size) _Pre_opt_z_ _Pre_opt_count_(size) _Deref_pre_readonly_ +#define _In_opt_z_count_c_(size) _Pre_opt_z_ _Pre_opt_count_c_(size) _Deref_pre_readonly_ +#define _In_ptrdiff_count_(size) _Pre_ptrdiff_count_(size) _Deref_pre_readonly_ +#define _In_range_(lb, ub) _In_range_impl_(lb,ub) +#define _In_reads_(size) _Pre_count_(size) _Deref_pre_readonly_ +#define _In_reads_bytes_(size) _Pre_bytecount_(size) _Deref_pre_readonly_ +#define _In_reads_bytes_opt_(size) _Pre_opt_bytecount_(size) _Deref_pre_readonly_ +#define _In_reads_opt_(size) _Pre_opt_count_(size) _Deref_pre_readonly_ +#define _In_reads_opt_z_(size) _Pre_opt_count_(size) _Deref_pre_readonly_ _Pre_opt_z_ +#define _In_reads_or_z_(size) _When_(_String_length_(_Curr_) < (size), _In_z_) _When_(_String_length_(_Curr_) >= (size), _In_reads_(size)) +#define _In_reads_to_ptr_(ptr) _Pre_ptrdiff_count_(ptr) _Deref_pre_readonly_ +#define _In_reads_to_ptr_opt_(ptr) _Pre_opt_ptrdiff_count_(ptr) _Deref_pre_readonly_ +#define _In_reads_to_ptr_opt_z_(ptr) _Pre_opt_ptrdiff_count_(ptr) _Deref_pre_readonly_ _Pre_opt_z_ +#define _In_reads_to_ptr_z_(ptr) _Pre_ptrdiff_count_(ptr) _Deref_pre_readonly_ _Pre_z_ +#define _In_reads_z_(size) _Pre_count_(size) _Deref_pre_readonly_ _Pre_z_ +#define _In_z_ _Pre_z_ _Deref_pre_readonly_ +#define _In_z_bytecount_(size) _Pre_z_ _Pre_bytecount_(size) _Deref_pre_readonly_ +#define _In_z_bytecount_c_(size) _Pre_z_ _Pre_bytecount_c_(size) _Deref_pre_readonly_ +#define _In_z_count_(size) _Pre_z_ _Pre_count_(size) _Deref_pre_readonly_ +#define _In_z_count_c_(size) _Pre_z_ _Pre_count_c_(size) _Deref_pre_readonly_ +#define _Inout_ _Prepost_valid_ +#define _Inout_bytecap_(size) _Pre_valid_bytecap_(size) _Post_valid_ +#define _Inout_bytecap_c_(size) _Pre_valid_bytecap_c_(size) _Post_valid_ +#define _Inout_bytecap_x_(size) _Pre_valid_bytecap_x_(size) _Post_valid_ +#define _Inout_bytecount_(size) _Prepost_bytecount_(size) +#define _Inout_bytecount_c_(size) _Prepost_bytecount_c_(size) +#define _Inout_bytecount_x_(size) _Prepost_bytecount_x_(size) +#define _Inout_cap_(size) _Pre_valid_cap_(size) _Post_valid_ +#define _Inout_cap_c_(size) _Pre_valid_cap_c_(size) _Post_valid_ +#define _Inout_cap_x_(size) _Pre_valid_cap_x_(size) _Post_valid_ +#define _Inout_count_(size) _Prepost_count_(size) +#define _Inout_count_c_(size) _Prepost_count_c_(size) +#define _Inout_count_x_(size) _Prepost_count_x_(size) +#define _Inout_defensive_(annotes) _Pre_defensive_ _Post_defensive_ _Group_(annotes) +#define _Inout_opt_ _Prepost_opt_valid_ +#define _Inout_opt_bytecap_(size) _Pre_opt_valid_bytecap_(size) _Post_valid_ +#define _Inout_opt_bytecap_c_(size) _Pre_opt_valid_bytecap_c_(size) _Post_valid_ +#define _Inout_opt_bytecap_x_(size) _Pre_opt_valid_bytecap_x_(size) _Post_valid_ +#define _Inout_opt_bytecount_(size) _Prepost_opt_bytecount_(size) +#define _Inout_opt_bytecount_c_(size) _Prepost_opt_bytecount_c_(size) +#define _Inout_opt_bytecount_x_(size) _Prepost_opt_bytecount_x_(size) +#define _Inout_opt_cap_(size) _Pre_opt_valid_cap_(size) _Post_valid_ +#define _Inout_opt_cap_c_(size) _Pre_opt_valid_cap_c_(size) _Post_valid_ +#define _Inout_opt_cap_x_(size) _Pre_opt_valid_cap_x_(size) _Post_valid_ +#define _Inout_opt_count_(size) _Prepost_opt_count_(size) +#define _Inout_opt_count_c_(size) _Prepost_opt_count_c_(size) +#define _Inout_opt_count_x_(size) _Prepost_opt_count_x_(size) +#define _Inout_opt_ptrdiff_count_(size) _Pre_opt_ptrdiff_count_(size) +#define _Inout_opt_z_ _Prepost_opt_z_ +#define _Inout_opt_z_bytecap_(size) _Pre_opt_z_bytecap_(size) _Post_z_ +#define _Inout_opt_z_bytecap_c_(size) _Pre_opt_z_bytecap_c_(size) _Post_z_ +#define _Inout_opt_z_bytecap_x_(size) _Pre_opt_z_bytecap_x_(size) _Post_z_ +#define _Inout_opt_z_bytecount_(size) _Prepost_z_ _Prepost_opt_bytecount_(size) +#define _Inout_opt_z_bytecount_c_(size) _Prepost_z_ _Prepost_opt_bytecount_c_(size) +#define _Inout_opt_z_cap_(size) _Pre_opt_z_cap_(size) _Post_z_ +#define _Inout_opt_z_cap_c_(size) _Pre_opt_z_cap_c_(size) _Post_z_ +#define _Inout_opt_z_cap_x_(size) _Pre_opt_z_cap_x_(size) _Post_z_ +#define _Inout_opt_z_count_(size) _Prepost_z_ _Prepost_opt_count_(size) +#define _Inout_opt_z_count_c_(size) _Prepost_z_ _Prepost_opt_count_c_(size) +#define _Inout_ptrdiff_count_(size) _Pre_ptrdiff_count_(size) +#define _Inout_updates_(size) _Pre_cap_(size) _Pre_valid_impl_ _Post_valid_impl_ +#define _Inout_updates_all_(size) _Inout_updates_to_(_Old_(size), _Old_(size)) +#define _Inout_updates_all_opt_(size) _Inout_updates_to_opt_(_Old_(size), _Old_(size)) +#define _Inout_updates_bytes_(size) _Pre_bytecap_(size) _Pre_valid_impl_ _Post_valid_impl_ +#define _Inout_updates_bytes_all_(size) _Inout_updates_bytes_to_(_Old_(size), _Old_(size)) +#define _Inout_updates_bytes_all_opt_(size) _Inout_updates_bytes_to_opt_(_Old_(size), _Old_(size)) +#define _Inout_updates_bytes_opt_(size) _Pre_opt_bytecap_(size) _Pre_valid_impl_ _Post_valid_impl_ +#define _Inout_updates_bytes_to_(size,count) _Out_writes_bytes_to_(size,count) _Pre_valid_impl_ _Pre1_impl_(__bytecount_impl(count)) +#define _Inout_updates_bytes_to_opt_(size,count) _Out_writes_bytes_to_opt_(size,count) _Pre_valid_impl_ _Pre1_impl_(__bytecount_impl(count)) +#define _Inout_updates_opt_(size) _Pre_opt_cap_(size) _Pre_valid_impl_ _Post_valid_impl_ +#define _Inout_updates_opt_z_(size) _Pre_opt_cap_(size) _Pre_valid_impl_ _Post_valid_impl_ _Pre1_impl_(__zterm_impl) _Post1_impl_(__zterm_impl) +#define _Inout_updates_to_(size,count) _Out_writes_to_(size,count) _Pre_valid_impl_ _Pre1_impl_(__count_impl(count)) +#define _Inout_updates_to_opt_(size,count) _Out_writes_to_opt_(size,count) _Pre_valid_impl_ _Pre1_impl_(__count_impl(count)) +#define _Inout_updates_z_(size) _Pre_cap_(size) _Pre_valid_impl_ _Post_valid_impl_ _Pre1_impl_(__zterm_impl) _Post1_impl_(__zterm_impl) +#define _Inout_z_ _Prepost_z_ +#define _Inout_z_bytecap_(size) _Pre_z_bytecap_(size) _Post_z_ +#define _Inout_z_bytecap_c_(size) _Pre_z_bytecap_c_(size) _Post_z_ +#define _Inout_z_bytecap_x_(size) _Pre_z_bytecap_x_(size) _Post_z_ +#define _Inout_z_bytecount_(size) _Prepost_z_ _Prepost_bytecount_(size) +#define _Inout_z_bytecount_c_(size) _Prepost_z_ _Prepost_bytecount_c_(size) +#define _Inout_z_cap_(size) _Pre_z_cap_(size) _Post_z_ +#define _Inout_z_cap_c_(size) _Pre_z_cap_c_(size) _Post_z_ +#define _Inout_z_cap_x_(size) _Pre_z_cap_x_(size) _Post_z_ +#define _Inout_z_count_(size) _Prepost_z_ _Prepost_count_(size) +#define _Inout_z_count_c_(size) _Prepost_z_ _Prepost_count_c_(size) +#define _Literal_ _Pre_ _Literal_impl_ +#define _Maybenull_ _Maybenull_impl_ +#define _Maybevalid_ _Maybevalid_impl_ +#define _Must_inspect_result_ _Must_inspect_impl_ _Check_return_impl_ +#define _Notliteral_ _Pre_ _Notliteral_impl_ +#define _Notnull_ _Notnull_impl_ +#define _Notref_ _Notref_impl_ +#define _Notvalid_ _Notvalid_impl_ +#define _Null_ _Null_impl_ +#define _Null_terminated_ _Null_terminated_impl_ +#define _NullNull_terminated_ _NullNull_terminated_impl_ +#define _On_failure_(annos) _On_failure_impl_(annos _SAL_nop_impl_) +#define _Out_ _Pre_cap_c_one_ _Post_valid_impl_ +#define _Out_bound_ _Out_bound_impl_ +#define _Out_bytecap_(size) _Pre_bytecap_(size) _Post_valid_impl_ +#define _Out_bytecap_c_(size) _Pre_bytecap_c_(size) _Post_valid_impl_ +#define _Out_bytecap_post_bytecount_(cap,count) _Pre_bytecap_(cap) _Post_valid_impl_ _Post_bytecount_(count) +#define _Out_bytecap_x_(size) _Pre_bytecap_x_(size) _Post_valid_impl_ +#define _Out_bytecapcount_(capcount) _Pre_bytecap_(capcount) _Post_valid_impl_ _Post_bytecount_(capcount) +#define _Out_bytecapcount_x_(capcount) _Pre_bytecap_x_(capcount) _Post_valid_impl_ _Post_bytecount_x_(capcount) +#define _Out_cap_(size) _Pre_cap_(size) _Post_valid_impl_ +#define _Out_cap_c_(size) _Pre_cap_c_(size) _Post_valid_impl_ +#define _Out_cap_m_(mult,size) _Pre_cap_m_(mult,size) _Post_valid_impl_ +#define _Out_cap_post_count_(cap,count) _Pre_cap_(cap) _Post_valid_impl_ _Post_count_(count) +#define _Out_cap_x_(size) _Pre_cap_x_(size) _Post_valid_impl_ +#define _Out_capcount_(capcount) _Pre_cap_(capcount) _Post_valid_impl_ _Post_count_(capcount) +#define _Out_capcount_x_(capcount) _Pre_cap_x_(capcount) _Post_valid_impl_ _Post_count_x_(capcount) +#define _Out_defensive_(annotes) _Post_defensive_ _Group_(annotes) +#define _Out_opt_ _Pre_opt_cap_c_one_ _Post_valid_impl_ +#define _Out_opt_bytecap_(size) _Pre_opt_bytecap_(size) _Post_valid_impl_ +#define _Out_opt_bytecap_c_(size) _Pre_opt_bytecap_c_(size) _Post_valid_impl_ +#define _Out_opt_bytecap_post_bytecount_(cap,count) _Pre_opt_bytecap_(cap) _Post_valid_impl_ _Post_bytecount_(count) +#define _Out_opt_bytecap_x_(size) _Pre_opt_bytecap_x_(size) _Post_valid_impl_ +#define _Out_opt_bytecapcount_(capcount) _Pre_opt_bytecap_(capcount) _Post_valid_impl_ _Post_bytecount_(capcount) +#define _Out_opt_bytecapcount_x_(capcount) _Pre_opt_bytecap_x_(capcount) _Post_valid_impl_ _Post_bytecount_x_(capcount) +#define _Out_opt_cap_(size) _Pre_opt_cap_(size) _Post_valid_impl_ +#define _Out_opt_cap_c_(size) _Pre_opt_cap_c_(size) _Post_valid_impl_ +#define _Out_opt_cap_m_(mult,size) _Pre_opt_cap_m_(mult,size) _Post_valid_impl_ +#define _Out_opt_cap_post_count_(cap,count) _Pre_opt_cap_(cap) _Post_valid_impl_ _Post_count_(count) +#define _Out_opt_cap_x_(size) _Pre_opt_cap_x_(size) _Post_valid_impl_ +#define _Out_opt_capcount_(capcount) _Pre_opt_cap_(capcount) _Post_valid_impl_ _Post_count_(capcount) +#define _Out_opt_capcount_x_(capcount) _Pre_opt_cap_x_(capcount) _Post_valid_impl_ _Post_count_x_(capcount) +#define _Out_opt_ptrdiff_cap_(size) _Pre_opt_ptrdiff_cap_(size) _Post_valid_impl_ +#define _Out_opt_z_bytecap_(size) _Pre_opt_bytecap_(size) _Post_valid_impl_ _Post_z_ +#define _Out_opt_z_bytecap_c_(size) _Pre_opt_bytecap_c_(size) _Post_valid_impl_ _Post_z_ +#define _Out_opt_z_bytecap_post_bytecount_(cap,count) _Pre_opt_bytecap_(cap) _Post_valid_impl_ _Post_z_bytecount_(count) +#define _Out_opt_z_bytecap_x_(size) _Pre_opt_bytecap_x_(size) _Post_valid_impl_ _Post_z_ +#define _Out_opt_z_bytecapcount_(capcount) _Pre_opt_bytecap_(capcount) _Post_valid_impl_ _Post_z_bytecount_(capcount) +#define _Out_opt_z_cap_(size) _Pre_opt_cap_(size) _Post_valid_impl_ _Post_z_ +#define _Out_opt_z_cap_c_(size) _Pre_opt_cap_c_(size) _Post_valid_impl_ _Post_z_ +#define _Out_opt_z_cap_m_(mult,size) _Pre_opt_cap_m_(mult,size) _Post_valid_impl_ _Post_z_ +#define _Out_opt_z_cap_post_count_(cap,count) _Pre_opt_cap_(cap) _Post_valid_impl_ _Post_z_count_(count) +#define _Out_opt_z_cap_x_(size) _Pre_opt_cap_x_(size) _Post_valid_impl_ _Post_z_ +#define _Out_opt_z_capcount_(capcount) _Pre_opt_cap_(capcount) _Post_valid_impl_ _Post_z_count_(capcount) +#define _Out_ptrdiff_cap_(size) _Pre_ptrdiff_cap_(size) _Post_valid_impl_ +#define _Out_range_(lb,ub) _Out_range_impl_(lb,ub) +#define _Out_writes_(size) _Pre_cap_(size) _Post_valid_impl_ +#define _Out_writes_all_(size) _Out_writes_to_(_Old_(size), _Old_(size)) +#define _Out_writes_all_opt_(size) _Out_writes_to_opt_(_Old_(size), _Old_(size)) +#define _Out_writes_bytes_(size) _Pre_bytecap_(size) _Post_valid_impl_ +#define _Out_writes_bytes_all_(size) _Out_writes_bytes_to_(_Old_(size), _Old_(size)) +#define _Out_writes_bytes_all_opt_(size) _Out_writes_bytes_to_opt_(_Old_(size), _Old_(size)) +#define _Out_writes_bytes_opt_(size) _Pre_opt_bytecap_(size) _Post_valid_impl_ +#define _Out_writes_bytes_to_(size,count) _Pre_bytecap_(size) _Post_valid_impl_ _Post_bytecount_(count) +#define _Out_writes_bytes_to_opt_(size,count) _Pre_opt_bytecap_(size) _Post_valid_impl_ _Post_bytecount_(count) +#define _Out_writes_opt_(size) _Pre_opt_cap_(size) _Post_valid_impl_ +#define _Out_writes_opt_z_(size) _Pre_opt_cap_(size) _Post_valid_impl_ _Post_z_ +#define _Out_writes_to_(size,count) _Pre_cap_(size) _Post_valid_impl_ _Post_count_(count) +#define _Out_writes_to_opt_(size,count) _Pre_opt_cap_(size) _Post_valid_impl_ _Post_count_(count) +#define _Out_writes_to_ptr_(ptr) _Pre_ptrdiff_cap_(ptr) _Post_valid_impl_ +#define _Out_writes_to_ptr_opt_(ptr) _Pre_opt_ptrdiff_cap_(ptr) _Post_valid_impl_ +#define _Out_writes_to_ptr_opt_z_(ptr) _Pre_opt_ptrdiff_cap_(ptr) _Post_valid_impl_ Post_z_ +#define _Out_writes_to_ptr_z_(ptr) _Pre_ptrdiff_cap_(ptr) _Post_valid_impl_ Post_z_ +#define _Out_writes_z_(size) _Pre_cap_(size) _Post_valid_impl_ _Post_z_ +#define _Out_z_bytecap_(size) _Pre_bytecap_(size) _Post_valid_impl_ _Post_z_ +#define _Out_z_bytecap_c_(size) _Pre_bytecap_c_(size) _Post_valid_impl_ _Post_z_ +#define _Out_z_bytecap_post_bytecount_(cap,count) _Pre_bytecap_(cap) _Post_valid_impl_ _Post_z_bytecount_(count) +#define _Out_z_bytecap_x_(size) _Pre_bytecap_x_(size) _Post_valid_impl_ _Post_z_ +#define _Out_z_bytecapcount_(capcount) _Pre_bytecap_(capcount) _Post_valid_impl_ _Post_z_bytecount_(capcount) +#define _Out_z_cap_(size) _Pre_cap_(size) _Post_valid_impl_ _Post_z_ +#define _Out_z_cap_c_(size) _Pre_cap_c_(size) _Post_valid_impl_ _Post_z_ +#define _Out_z_cap_m_(mult,size) _Pre_cap_m_(mult,size) _Post_valid_impl_ _Post_z_ +#define _Out_z_cap_post_count_(cap,count) _Pre_cap_(cap) _Post_valid_impl_ _Post_z_count_(count) +#define _Out_z_cap_x_(size) _Pre_cap_x_(size) _Post_valid_impl_ _Post_z_ +#define _Out_z_capcount_(capcount) _Pre_cap_(capcount) _Post_valid_impl_ _Post_z_count_(capcount) +#define _Outptr_ _Out_ _Deref_post2_impl_(__notnull_impl_notref, __count_impl(1)) _Post_valid_impl_ +#define _Outptr_opt_ _Out_opt_ _Deref_post2_impl_(__notnull_impl_notref, __count_impl(1)) _Post_valid_impl_ +#define _Outptr_opt_result_buffer_(size) _Out_opt_ _Deref_post2_impl_(__notnull_impl_notref, __cap_impl(size)) _Post_valid_impl_ +#define _Outptr_opt_result_buffer_all_(size) _Out_opt_ _Deref_post2_impl_(__notnull_impl_notref, __count_impl(size)) _Post_valid_impl_ +#define _Outptr_opt_result_buffer_all_maybenull_(size) _Out_opt_ _Deref_post2_impl_(__maybenull_impl_notref, __count_impl(size)) _Post_valid_impl_ +#define _Outptr_opt_result_buffer_maybenull_(size) _Out_opt_ _Deref_post2_impl_(__maybenull_impl_notref, __cap_impl(size)) _Post_valid_impl_ +#define _Outptr_opt_result_buffer_to_(size, count) _Out_opt_ _Deref_post3_impl_(__notnull_impl_notref, __cap_impl(size), __count_impl(count)) _Post_valid_impl_ +#define _Outptr_opt_result_buffer_to_maybenull_(size, count) _Out_opt_ _Deref_post3_impl_(__maybenull_impl_notref, __cap_impl(size), __count_impl(count)) _Post_valid_impl_ +#define _Outptr_opt_result_bytebuffer_(size) _Out_opt_ _Deref_post2_impl_(__notnull_impl_notref, __bytecap_impl(size)) _Post_valid_impl_ +#define _Outptr_opt_result_bytebuffer_all_(size) _Out_opt_ _Deref_post2_impl_(__notnull_impl_notref, __bytecount_impl(size)) _Post_valid_impl_ +#define _Outptr_opt_result_bytebuffer_all_maybenull_(size) _Out_opt_ _Deref_post2_impl_(__maybenull_impl_notref, __bytecount_impl(size)) _Post_valid_impl_ +#define _Outptr_opt_result_bytebuffer_maybenull_(size) _Out_opt_ _Deref_post2_impl_(__maybenull_impl_notref, __bytecap_impl(size)) _Post_valid_impl_ +#define _Outptr_opt_result_bytebuffer_to_(size, count) _Out_opt_ _Deref_post3_impl_(__notnull_impl_notref, __bytecap_impl(size), __bytecount_impl(count)) _Post_valid_impl_ +#define _Outptr_opt_result_bytebuffer_to_maybenull_(size, count) _Out_opt_ _Deref_post3_impl_(__maybenull_impl_notref, __bytecap_impl(size), __bytecount_impl(count)) _Post_valid_impl_ +#define _Outptr_opt_result_maybenull_ _Out_opt_ _Deref_post2_impl_(__maybenull_impl_notref, __count_impl(1)) _Post_valid_impl_ +#define _Outptr_opt_result_maybenull_z_ _Out_opt_ _Deref_post_opt_z_ +#define _Outptr_opt_result_nullonfailure_ _Outptr_opt_ _On_failure_(_Deref_post_null_) +#define _Outptr_opt_result_z_ _Out_opt_ _Deref_post_z_ +#define _Outptr_result_buffer_(size) _Out_ _Deref_post2_impl_(__notnull_impl_notref, __cap_impl(size)) _Post_valid_impl_ +#define _Outptr_result_buffer_all_(size) _Out_ _Deref_post2_impl_(__notnull_impl_notref, __count_impl(size)) _Post_valid_impl_ +#define _Outptr_result_buffer_all_maybenull_(size) _Out_ _Deref_post2_impl_(__maybenull_impl_notref, __count_impl(size)) _Post_valid_impl_ +#define _Outptr_result_buffer_maybenull_(size) _Out_ _Deref_post2_impl_(__maybenull_impl_notref, __cap_impl(size)) _Post_valid_impl_ +#define _Outptr_result_buffer_to_(size, count) _Out_ _Deref_post3_impl_(__notnull_impl_notref, __cap_impl(size), __count_impl(count)) _Post_valid_impl_ +#define _Outptr_result_buffer_to_maybenull_(size, count) _Out_ _Deref_post3_impl_(__maybenull_impl_notref, __cap_impl(size), __count_impl(count)) _Post_valid_impl_ +#define _Outptr_result_bytebuffer_(size) _Out_ _Deref_post2_impl_(__notnull_impl_notref, __bytecap_impl(size)) _Post_valid_impl_ +#define _Outptr_result_bytebuffer_all_(size) _Out_ _Deref_post2_impl_(__notnull_impl_notref, __bytecount_impl(size)) _Post_valid_impl_ +#define _Outptr_result_bytebuffer_all_maybenull_(size) _Out_ _Deref_post2_impl_(__maybenull_impl_notref, __bytecount_impl(size)) _Post_valid_impl_ +#define _Outptr_result_bytebuffer_maybenull_(size) _Out_ _Deref_post2_impl_(__maybenull_impl_notref, __bytecap_impl(size)) _Post_valid_impl_ +#define _Outptr_result_bytebuffer_to_(size, count) _Out_ _Deref_post3_impl_(__notnull_impl_notref, __bytecap_impl(size), __bytecount_impl(count)) _Post_valid_impl_ +#define _Outptr_result_bytebuffer_to_maybenull_(size, count) _Out_ _Deref_post3_impl_(__maybenull_impl_notref, __bytecap_impl(size), __bytecount_impl(count)) _Post_valid_impl_ +#define _Outptr_result_maybenull_ _Out_ _Deref_post2_impl_(__maybenull_impl_notref, __count_impl(1)) _Post_valid_impl_ +#define _Outptr_result_maybenull_z_ _Out_ _Deref_post_opt_z_ +#define _Outptr_result_nullonfailure_ _Outptr_ _On_failure_(_Deref_post_null_) +#define _Outptr_result_z_ _Out_ _Deref_post_z_ +#define _Outref_ _Group_(_Out_) +#define _Outref_result_buffer_(size) _Post1_impl_(__cap_impl(size)) _Post_valid_impl_ +#define _Outref_result_buffer_all_(size) _Post1_impl_(__count_impl(size)) +#define _Outref_result_buffer_all_maybenull_(size) _Post2_impl_(__count_impl(size), __maybenull_impl) +#define _Outref_result_buffer_maybenull_(size) _Post2_impl_(__cap_impl(size), __maybenull_impl) _Post_valid_impl_ +#define _Outref_result_buffer_to_(size, count) _Post2_impl_(__cap_impl(size), __count_impl(count)) +#define _Outref_result_buffer_to_maybenull_(size, count) _Post3_impl_(__cap_impl(size), __count_impl(count), __maybenull_impl) +#define _Outref_result_bytebuffer_(size) _Post1_impl_(__bytecap_impl(size)) _Post_valid_impl_ +#define _Outref_result_bytebuffer_all_(size) _Post1_impl_(__bytecount_impl(size)) +#define _Outref_result_bytebuffer_all_maybenull_(size) _Post2_impl_(__bytecount_impl(size), __maybenull_impl) +#define _Outref_result_bytebuffer_maybenull_(size) _Post2_impl_(__bytecap_impl(size), __maybenull_impl) _Post_valid_impl_ +#define _Outref_result_bytebuffer_to_(size, count) _Post2_impl_(__bytecap_impl(size), __bytecount_impl(count)) +#define _Outref_result_bytebuffer_to_maybenull_(size, count) _Post3_impl_(__bytecap_impl(size), __bytecount_impl(count), __maybenull_impl) +#define _Outref_result_maybenull_ _Group_(_Pre_cap_c_one_ _Post_valid_impl_ __maybenull_impl) +#define _Outref_result_nullonfailure_ _Group_(_Out_) _On_failure_(_Post_null_) +#define _Points_to_data_ _Pre_ _Points_to_data_impl_ +#define _Post_ _Post_impl_ +#define _Post_bytecap_(size) _Post1_impl_(__bytecap_impl(size)) +#define _Post_bytecount_(size) _Post1_impl_(__bytecount_impl(size)) _Post_valid_impl_ +#define _Post_bytecount_c_(size) _Post1_impl_(__bytecount_c_impl(size)) _Post_valid_impl_ +#define _Post_bytecount_x_(size) _Post1_impl_(__bytecount_x_impl(size)) _Post_valid_impl_ +#define _Post_cap_(size) _Post1_impl_(__cap_impl(size)) +#define _Post_count_(size) _Post1_impl_(__count_impl(size)) _Post_valid_impl_ +#define _Post_count_c_(size) _Post1_impl_(__count_c_impl(size)) _Post_valid_impl_ +#define _Post_count_x_(size) _Post1_impl_(__count_x_impl(size)) _Post_valid_impl_ +#define _Post_defensive_ _SA_annotes0(SAL_post_defensive) +#define _Post_equal_to_(expr) _Out_range_(==, expr) +#define _Post_invalid_ _Deref_post1_impl_(__notvalid_impl) +#define _Post_maybenull_ _Post1_impl_(__maybenull_impl_notref) +#define _Post_maybez_ _Post1_impl_(__maybzterm_impl) +#define _Post_notnull_ _Post1_impl_(__notnull_impl_notref) +#define _Post_null_ _Post1_impl_(__null_impl_notref) +#define _Post_ptr_invalid_ _Post1_impl_(__notvalid_impl) +#define _Post_readable_byte_size_(size) _Post1_impl_(__bytecount_impl(size)) _Post_valid_impl_ +#define _Post_readable_size_(size) _Post1_impl_(__count_impl(size)) _Post_valid_impl_ +#define _Post_satisfies_(cond) _Post_satisfies_impl_(cond) +#define _Post_valid_ _Post_valid_impl_ +#define _Post_writable_byte_size_(size) _Post1_impl_(__bytecap_impl(size)) +#define _Post_writable_size_(size) _Post1_impl_(__cap_impl(size)) +#define _Post_z_ _Post1_impl_(__zterm_impl) _Post_valid_impl_ +#define _Post_z_bytecount_(size) _Post2_impl_(__zterm_impl,__bytecount_impl(size)) _Post_valid_impl_ +#define _Post_z_bytecount_c_(size) _Post2_impl_(__zterm_impl,__bytecount_c_impl(size)) _Post_valid_impl_ +#define _Post_z_bytecount_x_(size) _Post2_impl_(__zterm_impl,__bytecount_x_impl(size)) _Post_valid_impl_ +#define _Post_z_count_(size) _Post2_impl_(__zterm_impl,__count_impl(size)) _Post_valid_impl_ +#define _Post_z_count_c_(size) _Post2_impl_(__zterm_impl,__count_c_impl(size)) _Post_valid_impl_ +#define _Post_z_count_x_(size) _Post2_impl_(__zterm_impl,__count_x_impl(size)) _Post_valid_impl_ +#define _Pre_ _Pre_impl_ +#define _Pre_bytecap_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__bytecap_impl(size)) +#define _Pre_bytecap_c_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__bytecap_c_impl(size)) +#define _Pre_bytecap_x_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__bytecap_x_impl(size)) +#define _Pre_bytecount_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__bytecount_impl(size)) _Pre_valid_impl_ +#define _Pre_bytecount_c_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__bytecount_c_impl(size)) _Pre_valid_impl_ +#define _Pre_bytecount_x_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__bytecount_x_impl(size)) _Pre_valid_impl_ +#define _Pre_cap_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__cap_impl(size)) +#define _Pre_cap_c_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__cap_c_impl(size)) +#define _Pre_cap_c_one_ _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__cap_c_one_notref_impl) +#define _Pre_cap_for_(param) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__cap_for_impl(param)) +#define _Pre_cap_m_(mult,size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__mult_impl(mult,size)) +#define _Pre_cap_x_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__cap_x_impl(size)) +#define _Pre_count_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__count_impl(size)) _Pre_valid_impl_ +#define _Pre_count_c_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__count_c_impl(size)) _Pre_valid_impl_ +#define _Pre_count_x_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__count_x_impl(size)) _Pre_valid_impl_ +#define _Pre_defensive_ _SA_annotes0(SAL_pre_defensive) +#define _Pre_equal_to_(expr) _In_range_(==, expr) +#define _Pre_invalid_ _Deref_pre1_impl_(__notvalid_impl) +#define _Pre_maybenull_ _Pre1_impl_(__maybenull_impl_notref) +#define _Pre_notnull_ _Pre1_impl_(__notnull_impl_notref) +#define _Pre_null_ _Pre1_impl_(__null_impl_notref) +#define _Pre_opt_bytecap_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__bytecap_impl(size)) +#define _Pre_opt_bytecap_c_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__bytecap_c_impl(size)) +#define _Pre_opt_bytecap_x_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__bytecap_x_impl(size)) +#define _Pre_opt_bytecount_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__bytecount_impl(size)) _Pre_valid_impl_ +#define _Pre_opt_bytecount_c_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__bytecount_c_impl(size)) _Pre_valid_impl_ +#define _Pre_opt_bytecount_x_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__bytecount_x_impl(size)) _Pre_valid_impl_ +#define _Pre_opt_cap_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__cap_impl(size)) +#define _Pre_opt_cap_c_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__cap_c_impl(size)) +#define _Pre_opt_cap_c_one_ _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__cap_c_one_notref_impl) +#define _Pre_opt_cap_for_(param) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__cap_for_impl(param)) +#define _Pre_opt_cap_m_(mult,size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__mult_impl(mult,size)) +#define _Pre_opt_cap_x_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__cap_x_impl(size)) +#define _Pre_opt_count_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__count_impl(size)) _Pre_valid_impl_ +#define _Pre_opt_count_c_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__count_c_impl(size)) _Pre_valid_impl_ +#define _Pre_opt_count_x_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__count_x_impl(size)) _Pre_valid_impl_ +#define _Pre_opt_ptrdiff_cap_(ptr) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__cap_x_impl(__ptrdiff(ptr))) +#define _Pre_opt_ptrdiff_count_(ptr) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__count_x_impl(__ptrdiff(ptr))) _Pre_valid_impl_ +#define _Pre_opt_valid_ _Pre1_impl_(__maybenull_impl_notref) _Pre_valid_impl_ +#define _Pre_opt_valid_bytecap_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__bytecap_impl(size)) _Pre_valid_impl_ +#define _Pre_opt_valid_bytecap_c_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__bytecap_c_impl(size)) _Pre_valid_impl_ +#define _Pre_opt_valid_bytecap_x_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__bytecap_x_impl(size)) _Pre_valid_impl_ +#define _Pre_opt_valid_cap_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__cap_impl(size)) _Pre_valid_impl_ +#define _Pre_opt_valid_cap_c_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__cap_c_impl(size)) _Pre_valid_impl_ +#define _Pre_opt_valid_cap_x_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__cap_x_impl(size)) _Pre_valid_impl_ +#define _Pre_opt_z_ _Pre1_impl_(__maybenull_impl_notref) _Pre1_impl_(__zterm_impl) _Pre_valid_impl_ +#define _Pre_opt_z_bytecap_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre2_impl_(__zterm_impl,__bytecap_impl(size)) _Pre_valid_impl_ +#define _Pre_opt_z_bytecap_c_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre2_impl_(__zterm_impl,__bytecap_c_impl(size)) _Pre_valid_impl_ +#define _Pre_opt_z_bytecap_x_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre2_impl_(__zterm_impl,__bytecap_x_impl(size)) _Pre_valid_impl_ +#define _Pre_opt_z_cap_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre2_impl_(__zterm_impl,__cap_impl(size)) _Pre_valid_impl_ +#define _Pre_opt_z_cap_c_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre2_impl_(__zterm_impl,__cap_c_impl(size)) _Pre_valid_impl_ +#define _Pre_opt_z_cap_x_(size) _Pre1_impl_(__maybenull_impl_notref) _Pre2_impl_(__zterm_impl,__cap_x_impl(size)) _Pre_valid_impl_ +#define _Pre_ptrdiff_cap_(ptr) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__cap_x_impl(__ptrdiff(ptr))) +#define _Pre_ptrdiff_count_(ptr) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__count_x_impl(__ptrdiff(ptr))) _Pre_valid_impl_ +#define _Pre_readable_byte_size_(size) _Pre1_impl_(__bytecount_impl(size)) _Pre_valid_impl_ +#define _Pre_readable_size_(size) _Pre1_impl_(__count_impl(size)) _Pre_valid_impl_ +#define _Pre_readonly_ _Pre1_impl_(__readaccess_impl_notref) +#define _Pre_satisfies_(cond) _Pre_satisfies_impl_(cond) +#define _Pre_valid_ _Pre1_impl_(__notnull_impl_notref) _Pre_valid_impl_ +#define _Pre_valid_bytecap_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__bytecap_impl(size)) _Pre_valid_impl_ +#define _Pre_valid_bytecap_c_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__bytecap_c_impl(size)) _Pre_valid_impl_ +#define _Pre_valid_bytecap_x_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__bytecap_x_impl(size)) _Pre_valid_impl_ +#define _Pre_valid_cap_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__cap_impl(size)) _Pre_valid_impl_ +#define _Pre_valid_cap_c_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__cap_c_impl(size)) _Pre_valid_impl_ +#define _Pre_valid_cap_x_(size) _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__cap_x_impl(size)) _Pre_valid_impl_ +#define _Pre_writable_byte_size_(size) _Pre1_impl_(__bytecap_impl(size)) +#define _Pre_writable_size_(size) _Pre1_impl_(__cap_impl(size)) +#define _Pre_writeonly_ _Pre1_impl_(__writeaccess_impl_notref) +#define _Pre_z_ _Pre1_impl_(__notnull_impl_notref) _Pre1_impl_(__zterm_impl) _Pre_valid_impl_ +#define _Pre_z_bytecap_(size) _Pre1_impl_(__notnull_impl_notref) _Pre2_impl_(__zterm_impl,__bytecap_impl(size)) _Pre_valid_impl_ +#define _Pre_z_bytecap_c_(size) _Pre1_impl_(__notnull_impl_notref) _Pre2_impl_(__zterm_impl,__bytecap_c_impl(size)) _Pre_valid_impl_ +#define _Pre_z_bytecap_x_(size) _Pre1_impl_(__notnull_impl_notref) _Pre2_impl_(__zterm_impl,__bytecap_x_impl(size)) _Pre_valid_impl_ +#define _Pre_z_cap_(size) _Pre1_impl_(__notnull_impl_notref) _Pre2_impl_(__zterm_impl,__cap_impl(size)) _Pre_valid_impl_ +#define _Pre_z_cap_c_(size) _Pre1_impl_(__notnull_impl_notref) _Pre2_impl_(__zterm_impl,__cap_c_impl(size)) _Pre_valid_impl_ +#define _Pre_z_cap_x_(size) _Pre1_impl_(__notnull_impl_notref) _Pre2_impl_(__zterm_impl,__cap_x_impl(size)) _Pre_valid_impl_ +#define _Prepost_bytecount_(size) _Pre_bytecount_(size) _Post_bytecount_(size) +#define _Prepost_bytecount_c_(size) _Pre_bytecount_c_(size) _Post_bytecount_c_(size) +#define _Prepost_bytecount_x_(size) _Pre_bytecount_x_(size) _Post_bytecount_x_(size) +#define _Prepost_count_(size) _Pre_count_(size) _Post_count_(size) +#define _Prepost_count_c_(size) _Pre_count_c_(size) _Post_count_c_(size) +#define _Prepost_count_x_(size) _Pre_count_x_(size) _Post_count_x_(size) +#define _Prepost_opt_bytecount_(size) _Pre_opt_bytecount_(size) _Post_bytecount_(size) +#define _Prepost_opt_bytecount_c_(size) _Pre_opt_bytecount_c_(size) _Post_bytecount_c_(size) +#define _Prepost_opt_bytecount_x_(size) _Pre_opt_bytecount_x_(size) _Post_bytecount_x_(size) +#define _Prepost_opt_count_(size) _Pre_opt_count_(size) _Post_count_(size) +#define _Prepost_opt_count_c_(size) _Pre_opt_count_c_(size) _Post_count_c_(size) +#define _Prepost_opt_count_x_(size) _Pre_opt_count_x_(size) _Post_count_x_(size) +#define _Prepost_opt_valid_ _Pre_opt_valid_ _Post_valid_ +#define _Prepost_opt_z_ _Pre_opt_z_ _Post_z_ +#define _Prepost_valid_ _Pre_valid_ _Post_valid_ +#define _Prepost_z_ _Pre_z_ _Post_z_ +#define _Printf_format_string_ _Printf_format_string_impl_ +#define _Readable_bytes_(size) _Readable_bytes_impl_(size) +#define _Readable_elements_(size) _Readable_elements_impl_(size) +#define _Reserved_ _Pre1_impl_(__null_impl) +#define _Result_nullonfailure_ _On_failure_(_Notref_impl_ _Deref_impl_ _Post_null_) +#define _Result_zeroonfailure_ _On_failure_(_Notref_impl_ _Deref_impl_ _Out_range_(==, 0)) +#define _Ret_ _Ret_valid_ +#define _Ret_bound_ _Ret_bound_impl_ +#define _Ret_bytecap_(size) _Ret1_impl_(__notnull_impl_notref) _Ret1_impl_(__bytecap_impl(size)) +#define _Ret_bytecap_c_(size) _Ret1_impl_(__notnull_impl_notref) _Ret1_impl_(__bytecap_c_impl(size)) +#define _Ret_bytecap_x_(size) _Ret1_impl_(__notnull_impl_notref) _Ret1_impl_(__bytecap_x_impl(size)) +#define _Ret_bytecount_(size) _Ret1_impl_(__notnull_impl_notref) _Ret1_impl_(__bytecount_impl(size)) _Ret_valid_impl_ +#define _Ret_bytecount_c_(size) _Ret1_impl_(__notnull_impl_notref) _Ret1_impl_(__bytecount_c_impl(size)) _Ret_valid_impl_ +#define _Ret_bytecount_x_(size) _Ret1_impl_(__notnull_impl_notref) _Ret1_impl_(__bytecount_x_impl(size)) _Ret_valid_impl_ +#define _Ret_cap_(size) _Ret1_impl_(__notnull_impl_notref) _Ret1_impl_(__cap_impl(size)) +#define _Ret_cap_c_(size) _Ret1_impl_(__notnull_impl_notref) _Ret1_impl_(__cap_c_impl(size)) +#define _Ret_cap_x_(size) _Ret1_impl_(__notnull_impl_notref) _Ret1_impl_(__cap_x_impl(size)) +#define _Ret_count_(size) _Ret1_impl_(__notnull_impl_notref) _Ret1_impl_(__count_impl(size)) _Ret_valid_impl_ +#define _Ret_count_c_(size) _Ret1_impl_(__notnull_impl_notref) _Ret1_impl_(__count_c_impl(size)) _Ret_valid_impl_ +#define _Ret_count_x_(size) _Ret1_impl_(__notnull_impl_notref) _Ret1_impl_(__count_x_impl(size)) _Ret_valid_impl_ +#define _Ret_maybenull_ _Ret1_impl_(__maybenull_impl) +#define _Ret_maybenull_z_ _Ret2_impl_(__maybenull_impl,__zterm_impl) _Ret_valid_impl_ +#define _Ret_notnull_ _Ret1_impl_(__notnull_impl) +#define _Ret_null_ _Ret1_impl_(__null_impl) +#define _Ret_opt_ _Ret_opt_valid_ +#define _Ret_opt_bytecap_(size) _Ret1_impl_(__maybenull_impl_notref) _Ret1_impl_(__bytecap_impl(size)) +#define _Ret_opt_bytecap_c_(size) _Ret1_impl_(__maybenull_impl_notref) _Ret1_impl_(__bytecap_c_impl(size)) +#define _Ret_opt_bytecap_x_(size) _Ret1_impl_(__maybenull_impl_notref) _Ret1_impl_(__bytecap_x_impl(size)) +#define _Ret_opt_bytecount_(size) _Ret1_impl_(__maybenull_impl_notref) _Ret1_impl_(__bytecount_impl(size)) _Ret_valid_impl_ +#define _Ret_opt_bytecount_c_(size) _Ret1_impl_(__maybenull_impl_notref) _Ret1_impl_(__bytecount_c_impl(size)) _Ret_valid_impl_ +#define _Ret_opt_bytecount_x_(size) _Ret1_impl_(__maybenull_impl_notref) _Ret1_impl_(__bytecount_x_impl(size)) _Ret_valid_impl_ +#define _Ret_opt_cap_(size) _Ret1_impl_(__maybenull_impl_notref) _Ret1_impl_(__cap_impl(size)) +#define _Ret_opt_cap_c_(size) _Ret1_impl_(__maybenull_impl_notref) _Ret1_impl_(__cap_c_impl(size)) +#define _Ret_opt_cap_x_(size) _Ret1_impl_(__maybenull_impl_notref) _Ret1_impl_(__cap_x_impl(size)) +#define _Ret_opt_count_(size) _Ret1_impl_(__maybenull_impl_notref) _Ret1_impl_(__count_impl(size)) _Ret_valid_impl_ +#define _Ret_opt_count_c_(size) _Ret1_impl_(__maybenull_impl_notref) _Ret1_impl_(__count_c_impl(size)) _Ret_valid_impl_ +#define _Ret_opt_count_x_(size) _Ret1_impl_(__maybenull_impl_notref) _Ret1_impl_(__count_x_impl(size)) _Ret_valid_impl_ +#define _Ret_opt_valid_ _Ret1_impl_(__maybenull_impl_notref) _Ret_valid_impl_ +#define _Ret_opt_z_ _Ret2_impl_(__maybenull_impl,__zterm_impl) _Ret_valid_impl_ +#define _Ret_opt_z_bytecap_(size) _Ret1_impl_(__maybenull_impl_notref) _Ret2_impl_(__zterm_impl,__bytecap_impl(size)) _Ret_valid_impl_ +#define _Ret_opt_z_bytecount_(size) _Ret1_impl_(__maybenull_impl_notref) _Ret2_impl_(__zterm_impl,__bytecount_impl(size)) _Ret_valid_impl_ +#define _Ret_opt_z_cap_(size) _Ret1_impl_(__maybenull_impl_notref) _Ret2_impl_(__zterm_impl,__cap_impl(size)) _Ret_valid_impl_ +#define _Ret_opt_z_count_(size) _Ret1_impl_(__maybenull_impl_notref) _Ret2_impl_(__zterm_impl,__count_impl(size)) _Ret_valid_impl_ +#define _Ret_range_(lb,ub) _Ret_range_impl_(lb,ub) +#define _Ret_valid_ _Ret1_impl_(__notnull_impl_notref) _Ret_valid_impl_ +#define _Ret_writes_(size) _Ret2_impl_(__notnull_impl, __count_impl(size)) _Ret_valid_impl_ +#define _Ret_writes_bytes_(size) _Ret2_impl_(__notnull_impl, __bytecount_impl(size)) _Ret_valid_impl_ +#define _Ret_writes_bytes_maybenull_(size) _Ret2_impl_(__maybenull_impl,__bytecount_impl(size)) _Ret_valid_impl_ +#define _Ret_writes_bytes_to_(size,count) _Ret3_impl_(__notnull_impl, __bytecap_impl(size), __bytecount_impl(count)) _Ret_valid_impl_ +#define _Ret_writes_bytes_to_maybenull_(size,count) _Ret3_impl_(__maybenull_impl, __bytecap_impl(size), __bytecount_impl(count)) _Ret_valid_impl_ +#define _Ret_writes_maybenull_(size) _Ret2_impl_(__maybenull_impl,__count_impl(size)) _Ret_valid_impl_ +#define _Ret_writes_maybenull_z_(size) _Ret3_impl_(__maybenull_impl,__count_impl(size),__zterm_impl) _Ret_valid_impl_ +#define _Ret_writes_to_(size,count) _Ret3_impl_(__notnull_impl, __cap_impl(size), __count_impl(count)) _Ret_valid_impl_ +#define _Ret_writes_to_maybenull_(size,count) _Ret3_impl_(__maybenull_impl, __cap_impl(size), __count_impl(count)) _Ret_valid_impl_ +#define _Ret_writes_z_(size) _Ret3_impl_(__notnull_impl, __count_impl(size), __zterm_impl) _Ret_valid_impl_ +#define _Ret_z_ _Ret2_impl_(__notnull_impl, __zterm_impl) _Ret_valid_impl_ +#define _Ret_z_bytecap_(size) _Ret1_impl_(__notnull_impl_notref) _Ret2_impl_(__zterm_impl,__bytecap_impl(size)) _Ret_valid_impl_ +#define _Ret_z_bytecount_(size) _Ret1_impl_(__notnull_impl_notref) _Ret2_impl_(__zterm_impl,__bytecount_impl(size)) _Ret_valid_impl_ +#define _Ret_z_cap_(size) _Ret1_impl_(__notnull_impl_notref) _Ret2_impl_(__zterm_impl,__cap_impl(size)) _Ret_valid_impl_ +#define _Ret_z_count_(size) _Ret1_impl_(__notnull_impl_notref) _Ret2_impl_(__zterm_impl,__count_impl(size)) _Ret_valid_impl_ +#define _Return_type_success_(expr) _Success_impl_(expr) +#define _Scanf_format_string_ _Scanf_format_string_impl_ +#define _Scanf_s_format_string_ _Scanf_s_format_string_impl_ +#define _Struct_size_bytes_(size) _Writable_bytes_(size) +#define _Success_(expr) _Success_impl_(expr) +#define _Unchanged_(e) _At_(e, _Post_equal_to_(_Old_(e)) _Const_) +#define _Use_decl_annotations_ _Use_decl_anno_impl_ +#define _Valid_ _Valid_impl_ +#define _When_(expr, annos) _When_impl_(expr, annos _SAL_nop_impl_) +#define _Writable_bytes_(size) _Writable_bytes_impl_(size) +#define _Writable_elements_(size) _Writable_elements_impl_(size) #else /* _USE_ATTRIBUTES_FOR_SAL || _USE_DECLSPECS_FOR_SAL */ Modified: trunk/reactos/include/psdk/sal_old.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/sal_old.h?rev…
============================================================================== --- trunk/reactos/include/psdk/sal_old.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/sal_old.h [iso-8859-1] Thu Jan 5 17:06:10 2012 @@ -1,5 +1,5 @@ /* - * sal_dep.h + * sal_old.h * * Old style Standard Annotation Language (SAL) definitions *
12 years, 11 months
1
0
0
0
[tkreuzer] 54839: [PSDK/DDK/XDK] - Add new style SAL definitions (only dummys for now) - Move old style SAL definitions to sal_old.h - Convert annotations in sspi.h to new style - Allow new style a...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Jan 5 11:20:28 2012 New Revision: 54839 URL:
http://svn.reactos.org/svn/reactos?rev=54839&view=rev
Log: [PSDK/DDK/XDK] - Add new style SAL definitions (only dummys for now) - Move old style SAL definitions to sal_old.h - Convert annotations in sspi.h to new style - Allow new style annotations for C++ again, old style annotations are not possible with C++ and gcc headers Added: trunk/reactos/include/psdk/sal_old.h (with props) Modified: trunk/reactos/include/crt/crtdefs.h trunk/reactos/include/ddk/ntifs.h trunk/reactos/include/psdk/sal.h trunk/reactos/include/psdk/specstrings.h trunk/reactos/include/xdk/sspi.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/include/crt/crtdefs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/crtdefs.h?rev=…
Modified: trunk/reactos/include/ddk/ntifs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntifs.h?rev=54…
Modified: trunk/reactos/include/psdk/sal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/sal.h?rev=548…
Added: trunk/reactos/include/psdk/sal_old.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/sal_old.h?rev…
Modified: trunk/reactos/include/psdk/specstrings.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/specstrings.h…
Modified: trunk/reactos/include/xdk/sspi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/sspi.h?rev=548…
12 years, 11 months
1
0
0
0
[janderwald] 54838: [USB-BRINGUP] - Add a ReactOS hack to let the hid stack initialize - Add input.inf - HID Mouse initializes and starts, now win32k needs some work to open the mice
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Jan 5 04:05:10 2012 New Revision: 54838 URL:
http://svn.reactos.org/svn/reactos?rev=54838&view=rev
Log: [USB-BRINGUP] - Add a ReactOS hack to let the hid stack initialize - Add input.inf - HID Mouse initializes and starts, now win32k needs some work to open the mice Added: branches/usb-bringup/media/inf/input.inf (with props) Modified: branches/usb-bringup/drivers/hid/hidclass/hidclass.c branches/usb-bringup/drivers/usb/usbhub_new/fdo.c branches/usb-bringup/media/inf/CMakeLists.txt branches/usb-bringup/media/inf/syssetup.inf.tpl Modified: branches/usb-bringup/drivers/hid/hidclass/hidclass.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/hid/hidclas…
============================================================================== --- branches/usb-bringup/drivers/hid/hidclass/hidclass.c [iso-8859-1] (original) +++ branches/usb-bringup/drivers/hid/hidclass/hidclass.c [iso-8859-1] Thu Jan 5 04:05:10 2012 @@ -137,12 +137,23 @@ CommonDeviceExtension = (PHIDCLASS_COMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension; if (CommonDeviceExtension->IsFDO) { +#ifndef __REACTOS__ + // // only supported for PDO // Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_UNSUCCESSFUL; +#else + // + // ReactOS PnP manager [...] + // + DPRINT1("[HIDCLASS] PnP HACK\n"); + Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; +#endif } // Modified: branches/usb-bringup/drivers/usb/usbhub_new/fdo.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbhub_…
============================================================================== --- branches/usb-bringup/drivers/usb/usbhub_new/fdo.c [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbhub_new/fdo.c [iso-8859-1] Thu Jan 5 04:05:10 2012 @@ -971,7 +971,7 @@ // // copy instance id // - RtlCopyMemory(UsbChildExtension->usInstanceId.Buffer, Buffer, wcslen(Buffer) * sizeof(WCHAR)); + RtlCopyMemory(UsbChildExtension->usInstanceId.Buffer, Buffer, Index * sizeof(WCHAR)); UsbChildExtension->usInstanceId.Length = UsbChildExtension->usDeviceId.MaximumLength = Index * sizeof(WCHAR); DPRINT1("usDeviceId %wZ\n", &UsbChildExtension->usInstanceId); Modified: branches/usb-bringup/media/inf/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/media/inf/CMakeList…
============================================================================== --- branches/usb-bringup/media/inf/CMakeLists.txt [iso-8859-1] (original) +++ branches/usb-bringup/media/inf/CMakeLists.txt [iso-8859-1] Thu Jan 5 04:05:10 2012 @@ -9,6 +9,7 @@ fdc.inf font.inf hdc.inf + input.inf intl.inf keyboard.inf ks.inf Added: branches/usb-bringup/media/inf/input.inf URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/media/inf/input.inf…
============================================================================== --- branches/usb-bringup/media/inf/input.inf (added) +++ branches/usb-bringup/media/inf/input.inf [iso-8859-1] Thu Jan 5 04:05:10 2012 @@ -1,0 +1,73 @@ +[Version] +Signature="$WINDOWS NT$" +Class=HIDClass +ClassGuid={745a17a0-74d3-11d0-b6fe-00a0c90f57da} +Provider=%MSFT% +LayoutFile=layout.inf +DriverVer=07/01/2001,5.1.2600.5512 + +[DestinationDirs] +DefaultDestDir = 12 +HID_Inst.CopyFilesDLL.NT = 11 +SPI_Files_DLL = 11 + +[ClassInstall] +Addreg=HIDClassReg + +[HIDClassReg] +HKR,,,,%HID.ClassName% +HKR,,Icon,,-24 +HKR,,NoInstallClass,,1 + +[ClassInstall32] +Addreg=HIDClassReg + +[MSMice] +%USB\VID_045E&PID_0009.DeviceDesc%=HID_Inst,, USB\VID_045E&PID_0009 +%USB\VID_045E&PID_001E.DeviceDesc%=HID_Inst,, USB\VID_045E&PID_001E +%USB\VID_045E&PID_0023.DeviceDesc%=HID_Inst,, USB\VID_045E&PID_0023 +%USB\VID_045E&PID_0024.DeviceDesc%=HID_Inst,, USB\VID_045E&PID_0024 +%USB\VID_045E&PID_0025.DeviceDesc%=HID_Inst,, USB\VID_045E&PID_0025 +%USB\VID_045E&PID_0029.DeviceDesc%=HID_Inst,, USB\VID_045E&PID_0029 +%USB\VID_045E&PID_0039.DeviceDesc%=HID_Inst,, USB\VID_045E&PID_0039 +%USB\VID_045E&PID_0040.DeviceDesc%=HID_Inst,, USB\VID_045E&PID_0040 +%USB\VID_045E&PID_0047.DeviceDesc%=HID_Inst,, USB\VID_045E&PID_0047 + + +[Standard] +%HID_DEVICE_SYSTEM_GAME%=HID_Raw_Inst,, HID_DEVICE_SYSTEM_GAME +%HID_DEVICE%=HID_Raw_Inst,, HID_DEVICE +%HID.DeviceDesc% = HID_Inst,,GENERIC_HID_DEVICE,USB\Class_03&SubClass_01,USB\Class_03 + + +[HID_Inst.NT] +Copyfiles = HID_Inst.CopyFiles.NT, HID_Inst.CopyFilesDLL.NT + +[HID_Inst.CopyFiles.NT] +hidusb.sys +hidclass.sys +hidparse.sys + +[HID_INST.CopyFilesDLL.NT] +hid.dll + +[HID_Inst.NT.Services] +AddService = hidusb, 0x00000002, HID_Service_Inst + +[HID_Service_Inst] +ServiceType = 1 +StartType = 3 +ErrorControl = 1 +ServiceBinary = %12%\hidusb.sys +LoadOrderGroup = Pointer Port + +[strings] +MSFT = "ReactOS" +HID.DeviceDesc = "USB-HID (Human Interface Device)" +HID.DefaultDevice = "HID-Standardgerät" +HID.ClassName = "Eingabegeräte (Human Interface Devices)" +HID.SvcDesc = "ReactOS HID Class-Treiber" + + + + Propchange: branches/usb-bringup/media/inf/input.inf ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/usb-bringup/media/inf/syssetup.inf.tpl URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/media/inf/syssetup.…
============================================================================== Binary files - no diff available.
12 years, 11 months
1
0
0
0
← Newer
1
...
49
50
51
52
53
54
55
56
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Results per page:
10
25
50
100
200