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
June 2009
----- 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
21 participants
496 discussions
Start a n
N
ew thread
[cgutman] 41238: - Use DECLSPEC_SELECTANY so multiple definitions will not cause a problem
by cgutman@svn.reactos.org
Author: cgutman Date: Mon Jun 1 22:59:44 2009 New Revision: 41238 URL:
http://svn.reactos.org/svn/reactos?rev=41238&view=rev
Log: - Use DECLSPEC_SELECTANY so multiple definitions will not cause a problem Modified: trunk/reactos/include/psdk/guiddef.h Modified: trunk/reactos/include/psdk/guiddef.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/guiddef.h?rev…
============================================================================== --- trunk/reactos/include/psdk/guiddef.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/guiddef.h [iso-8859-1] Mon Jun 1 22:59:44 2009 @@ -48,11 +48,11 @@ #ifdef INITGUID #ifdef __cplusplus #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - EXTERN_C const GUID name = \ + EXTERN_C const GUID DECLSPEC_SELECTANY name = \ { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } #else #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - const GUID name = \ + const GUID DECLSPEC_SELECTANY name = \ { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } #endif #else
15 years, 6 months
1
0
0
0
[cgutman] 41237: - Add GUID_DEVINTERFACE_NET
by cgutman@svn.reactos.org
Author: cgutman Date: Mon Jun 1 21:40:57 2009 New Revision: 41237 URL:
http://svn.reactos.org/svn/reactos?rev=41237&view=rev
Log: - Add GUID_DEVINTERFACE_NET Modified: trunk/reactos/include/ddk/ndisguid.h Modified: trunk/reactos/include/ddk/ndisguid.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ndisguid.h?rev…
============================================================================== --- trunk/reactos/include/ddk/ndisguid.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ndisguid.h [iso-8859-1] Mon Jun 1 21:40:57 2009 @@ -27,6 +27,9 @@ extern "C" { #endif +DEFINE_GUID(GUID_DEVINTERFACE_NET, + 0xcac88484, 0x7515, 0x4c03, 0x82, 0xe6, 0x71, 0xa8, 0x7a, 0xba, 0xc3, 0x61); + DEFINE_GUID(GUID_NDIS_LAN_CLASS, 0xad498944, 0x762f, 0x11d0, 0x8d, 0xcb, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c);
15 years, 6 months
1
0
0
0
[mjmartin] 41236: eventlog.c: When manually creating RPC_UNICODE_STRING/RPC_STRING the Length member does not include the terminating null, but MaximumLength does. Fixes returning handle for Security and System event logs.
by mjmartin@svn.reactos.org
Author: mjmartin Date: Mon Jun 1 21:11:30 2009 New Revision: 41236 URL:
http://svn.reactos.org/svn/reactos?rev=41236&view=rev
Log: eventlog.c: When manually creating RPC_UNICODE_STRING/RPC_STRING the Length member does not include the terminating null, but MaximumLength does. Fixes returning handle for Security and System event logs. 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] Mon Jun 1 21:11:30 2009 @@ -154,6 +154,7 @@ BackupFileName.Buffer = (LPSTR)lpBackupFileName; BackupFileName.Length = BackupFileName.MaximumLength = lpBackupFileName ? strlen(lpBackupFileName) : 0; + BackupFileName.MaximumLength += sizeof(CHAR); RpcTryExcept { @@ -194,6 +195,7 @@ BackupFileName.Buffer = (LPWSTR)lpBackupFileName; BackupFileName.Length = BackupFileName.MaximumLength = lpBackupFileName ? wcslen(lpBackupFileName) * sizeof(WCHAR) : 0; + BackupFileName.MaximumLength += sizeof(WCHAR); RpcTryExcept { @@ -231,6 +233,7 @@ BackupFileName.Buffer = (LPSTR)lpBackupFileName; BackupFileName.Length = BackupFileName.MaximumLength = lpBackupFileName ? strlen(lpBackupFileName) : 0; + BackupFileName.MaximumLength += sizeof(CHAR); RpcTryExcept { @@ -268,6 +271,7 @@ BackupFileName.Buffer = (LPWSTR)lpBackupFileName; BackupFileName.Length = BackupFileName.MaximumLength = lpBackupFileName ? wcslen(lpBackupFileName) * sizeof(WCHAR) : 0; + BackupFileName.MaximumLength += sizeof(WCHAR); RpcTryExcept { @@ -508,6 +512,7 @@ FileName.Buffer = (LPWSTR)lpFileName; FileName.Length = FileName.MaximumLength = lpFileName ? wcslen(lpFileName) * sizeof(WCHAR) : 0; + FileName.MaximumLength += sizeof(WCHAR); RpcTryExcept { @@ -587,6 +592,7 @@ SourceName.Buffer = (LPWSTR)lpSourceName; SourceName.Length = SourceName.MaximumLength = lpSourceName ? wcslen(lpSourceName) * sizeof(WCHAR) : 0; + SourceName.MaximumLength += sizeof(WCHAR); RpcTryExcept { @@ -793,6 +799,7 @@ SourceName.Buffer = (LPWSTR)lpSourceName; SourceName.Length = SourceName.MaximumLength = lpSourceName ? wcslen(lpSourceName) * sizeof(WCHAR) : 0; + SourceName.MaximumLength += sizeof(WCHAR); RpcTryExcept {
15 years, 6 months
1
0
0
0
[hyperion] 41235: added tools/msc_helper added tools/msc_helper/msc_helper.cpp added tools/msc_helper/msc_helper.rbuild Build tool to invoke Microsoft tools, overriding the %PATH% variable and optionally filtering out the name of the file being compiled Will be used by the Visual C++ support for rbuild
by hyperion@svn.reactos.org
Author: hyperion Date: Mon Jun 1 19:17:41 2009 New Revision: 41235 URL:
http://svn.reactos.org/svn/reactos?rev=41235&view=rev
Log: added tools/msc_helper added tools/msc_helper/msc_helper.cpp added tools/msc_helper/msc_helper.rbuild Build tool to invoke Microsoft tools, overriding the %PATH% variable and optionally filtering out the name of the file being compiled Will be used by the Visual C++ support for rbuild Added: trunk/reactos/tools/msc_helper/ (with props) trunk/reactos/tools/msc_helper/msc_helper.cpp (with props) trunk/reactos/tools/msc_helper/msc_helper.rbuild (with props) Propchange: trunk/reactos/tools/msc_helper/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Mon Jun 1 19:17:41 2009 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/tools/msc_helper/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/tools/msc_helper/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/tools/msc_helper/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/tools/msc_helper/msc_helper.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/msc_helper/msc_helpe…
============================================================================== --- trunk/reactos/tools/msc_helper/msc_helper.cpp (added) +++ trunk/reactos/tools/msc_helper/msc_helper.cpp [iso-8859-1] Mon Jun 1 19:17:41 2009 @@ -1,0 +1,475 @@ +/* + Copyright (c) 2009 KJK::Hyperion + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include <functional> +#include <iterator> + +#include <tchar.h> +#include <limits.h> + +#include <stdio.h> + +#define WIN32_LEAN_AND_MEAN +#define STRICT +#include <windows.h> + +#undef RtlMoveMemory +extern "C" DECLSPEC_IMPORT void NTAPI RtlMoveMemory(void UNALIGNED *, const void UNALIGNED *, SIZE_T); + +#ifndef ARRAYSIZE +#define ARRAYSIZE(X_) (sizeof(X_) / sizeof((X_)[0])) +#endif + +#include <kjk/argv_parser.h> +#include <kjk/stringz_iterator.h> + +using namespace kjk; + +namespace +{ + bool WriteAll(HANDLE hFile, const void * p, size_t cb) + { + const char * pb = static_cast<const char *>(p); + bool ret = cb == 0; + + while(cb) + { + DWORD cbToWrite; + + if(cb > MAXLONG) + cbToWrite = MAXLONG; + else + cbToWrite = static_cast<DWORD>(cb); + + DWORD cbWritten; + ret = !!WriteFile(hFile, pb, cbToWrite, &cbWritten, NULL); + + if(!ret) + break; + + cb -= cbWritten; + pb += cbWritten; + } + + return ret; + } + + DECLSPEC_NORETURN + void Exit(DWORD dwExitCode) + { + for(;;) TerminateProcess(GetCurrentProcess(), dwExitCode); + } + + DECLSPEC_NORETURN + void Die(DWORD dwExitCode, const char * pszFunction, DWORD dwErrCode) + { + DWORD_PTR args[] = { (DWORD_PTR)pszFunction, dwErrCode }; + + char * pszMessage; + DWORD cchMessage = FormatMessageA + ( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_ARGUMENT_ARRAY | FORMAT_MESSAGE_FROM_STRING, + "msc_helper: %1!s!() failed: error %2!lu!\n", + 0, + 0, + (LPSTR)&pszMessage, + 0, + (va_list *)args + ); + + if(cchMessage) + { + (void)WriteAll(GetStdHandle(STD_ERROR_HANDLE), pszMessage, cchMessage); + LocalFree((HLOCAL)pszMessage); + } + + Exit(dwExitCode); + } + + DECLSPEC_NORETURN + void Die(const char * pszFunction) + { + Die(1, pszFunction, GetLastError()); + } + + DECLSPEC_NORETURN + void Die(const char * pszFunction, DWORD dwExitCode) + { + Die(1, pszFunction, dwExitCode); + } + + template<size_t N> + DECLSPEC_NORETURN + void DieMessage(const char (& msg)[N]) + { + (void)WriteAll(GetStdHandle(STD_ERROR_HANDLE), msg, (N) - 1); + Exit(1); + } + + DECLSPEC_NORETURN + void OutOfMemory() + { + DieMessage("msc_helper: out of memory\n"); + } + + class store_argument + { + private: + char * m_arg; + size_t m_argLen; + + public: + // Pretend we are an STL container + typedef TCHAR value_type; + typedef TCHAR * pointer; + typedef TCHAR& reference; + typedef const TCHAR * const_pointer; + typedef const TCHAR& const_reference; + + void push_back(TCHAR x) + { +#ifdef UNICODE + if(x > CHAR_MAX) + DieMessage("msc_helper: invalid character in command line\n"); +#endif + m_arg = static_cast<char *>(HeapReAlloc(GetProcessHeap(), 0, m_arg, m_argLen + 1)); + + if(m_arg == NULL) + OutOfMemory(); + + m_arg[m_argLen] = static_cast<char>(x); + ++ m_argLen; + } + + public: + store_argument(): m_arg(static_cast<char *>(HeapAlloc(GetProcessHeap(), 0, 1))), m_argLen(0) + { + if(m_arg == NULL) + OutOfMemory(); + } + + const char * get_arg() const { return m_arg; } + size_t get_arg_len() const { return m_argLen; } + }; + + class filter_output + { + private: + const char * m_pFilterLine; + size_t m_cbFilterLine; + HANDLE m_hOutput; + bool& m_fDone; + + static DWORD s_cbDummy; + static DWORD s_pipeId; + + char m_buffer[1024]; + LPTSTR m_pszPipeName; + HANDLE m_hReadFrom; + OVERLAPPED m_asyncRead; + char * m_pLineBuffer; + size_t m_cbLineBuffer; + + bool begin_read() + { + bool bRet = !!ReadFile(m_hReadFrom, m_buffer, sizeof(m_buffer), &s_cbDummy, &m_asyncRead); + + if(!bRet) + { + bRet = GetLastError() != ERROR_BROKEN_PIPE; + + if(bRet) + { + bRet = GetLastError() == ERROR_IO_PENDING; + + if(!bRet) + Die("ReadFile"); + } + } + + return bRet; + } + + void push_input(size_t cbBufferValid) + { + if(m_fDone) + { + if(!WriteAll(m_hOutput, m_buffer, cbBufferValid)) + Die("WriteFile"); + + return; + } + + // Add the data read from output to the line buffer + size_t cbLineBufferNew = m_cbLineBuffer + cbBufferValid; + + if(m_pLineBuffer) + m_pLineBuffer = static_cast<char *>(HeapReAlloc(GetProcessHeap(), 0, m_pLineBuffer, cbLineBufferNew)); + else + m_pLineBuffer = static_cast<char *>(HeapAlloc(GetProcessHeap(), 0, cbLineBufferNew)); + + if(m_pLineBuffer == NULL) + OutOfMemory(); + + RtlMoveMemory(m_pLineBuffer + m_cbLineBuffer, m_buffer, cbBufferValid); + + // Parse all complete lines in the line buffer + size_t cbLineStart = 0; + + for(size_t i = m_cbLineBuffer; i < cbLineBufferNew; ++ i) + { + // We have a complete line + if(m_pLineBuffer[i] == '\n' || m_pLineBuffer[i] == '\r') + { + size_t cbLine = i - cbLineStart; + + ++ i; + + if(i < cbLineBufferNew && m_pLineBuffer[i - 1] == '\r' && m_pLineBuffer[i] == '\n') + ++ i; + + size_t cbLineFull = i - cbLineStart; + + bool fMatched = cbLine == m_cbFilterLine && memcmp(m_pLineBuffer + cbLineStart, m_pFilterLine, m_cbFilterLine) == 0; + + // The line doesn't match: dump it + if(!fMatched) + { + if(!WriteAll(m_hOutput, m_pLineBuffer + cbLineStart, cbLineFull)) + Die("WriteFile"); + } + // The line matches: we are done + else + m_fDone = fMatched; + + cbLineStart = i; + } + + // Filtering is complete: from now on, just dump everything + if(m_fDone) + { + if(!WriteAll(m_hOutput, m_buffer + i, cbLineBufferNew - i)) + Die("WriteFile"); + + HeapFree(GetProcessHeap(), 0, m_pLineBuffer); + return; + } + } + + // Re-buffer what's left + m_cbLineBuffer = cbLineBufferNew - cbLineStart; + RtlMoveMemory(m_pLineBuffer, m_pLineBuffer + cbLineStart, m_cbLineBuffer); + } + + public: + filter_output(const char * pFilterLine, size_t cbFilterLine, HANDLE hOutput, bool * pfDone): + m_pFilterLine(pFilterLine), + m_cbFilterLine(cbFilterLine), + m_hOutput(hOutput), + m_fDone(*pfDone), + m_asyncRead(), + m_pLineBuffer(0), + m_cbLineBuffer(0) + { + for(;;) + { + DWORD_PTR args[] = { GetCurrentProcessId(), s_pipeId }; + + DWORD cchPipeName = FormatMessage + ( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_ARGUMENT_ARRAY | FORMAT_MESSAGE_FROM_STRING, + TEXT("\\\\.\\pipe\\msc_helper-%1!08X!-%2!08X!"), + 0, + 0, + (LPTSTR)&m_pszPipeName, + 0, + (va_list *)args + ); + + if(cchPipeName == 0) + Die("FormatMessage"); + + m_hReadFrom = CreateNamedPipe(m_pszPipeName, PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE, 1, 0, 0, 0, NULL); + + ++ s_pipeId; + + if(m_hReadFrom != INVALID_HANDLE_VALUE) + break; + + if(GetLastError() != ERROR_PIPE_BUSY) + Die("CreateNamedPipe"); + } + + // Just in case + bool fEmptyFilter = m_cbFilterLine == 0; + + if(fEmptyFilter) + m_fDone = fEmptyFilter; + } + + HANDLE open_write_end(LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) + { + HANDLE hWritePipe = CreateFile(m_pszPipeName, GENERIC_WRITE, FILE_SHARE_READ, lpSecurityAttributes, OPEN_EXISTING, dwFlagsAndAttributes, hTemplateFile); + + if(hWritePipe == INVALID_HANDLE_VALUE) + Die("CreateFile"); + + (void)begin_read(); + return hWritePipe; + } + + HANDLE get_read_completion() const + { + return m_hReadFrom; + } + + bool operator()() + { + DWORD cbBufferValid; + + if(!GetOverlappedResult(m_hReadFrom, &m_asyncRead, &cbBufferValid, TRUE)) + { + bool b = GetLastError() != ERROR_BROKEN_PIPE; + + if(!b) + return b; + + Die("ReadFile"); + } + + push_input(cbBufferValid); + return begin_read(); + } + }; + + DWORD filter_output::s_cbDummy = 0; + DWORD filter_output::s_pipeId = 0; +} + +int main() +{ + DWORD dwExitCode = 1; + + // Parse the command line + LPCTSTR pszCommandLine = GetCommandLine(); + + // Skip argv[0] + pszCommandLine = skip_argument(stringz_begin(pszCommandLine), stringz_end(pszCommandLine)).base(); + + // Get argv[1]: the line that should be filtered out of the output + // argv[2..N] will become argv[0..N-2] of the compiler + store_argument filterLine; + pszCommandLine = copy_argument(stringz_begin(pszCommandLine), stringz_end(pszCommandLine), std::back_inserter(filterLine)).base(); + + // Initialize the output filters + bool fDone = false; + filter_output filterStdOutput(filterLine.get_arg(), filterLine.get_arg_len(), GetStdHandle(STD_OUTPUT_HANDLE), &fDone); + filter_output filterStdError(filterLine.get_arg(), filterLine.get_arg_len(), GetStdHandle(STD_ERROR_HANDLE), &fDone); + + // A handle that will never be signaled + HANDLE hNever; + + if(!DuplicateHandle(GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(), &hNever, SYNCHRONIZE, FALSE, 0)) + Die("DuplicateHandle"); + + // Fix the environment + static TCHAR szPath[32768]; + DWORD cchPath = GetEnvironmentVariable(TEXT("MSC_HELPER_PATH"), szPath, ARRAYSIZE(szPath)); + + if(cchPath > ARRAYSIZE(szPath)) + DieMessage("msc_helper: %MSC_HELPER_PATH% variable too big\n"); + + if(cchPath > 0 && !SetEnvironmentVariable(TEXT("PATH"), szPath)) + Die("SetEnvironmentVariable"); + + // Run the sub-process + STARTUPINFO si; + GetStartupInfo(&si); + + si.dwFlags |= STARTF_USESTDHANDLES; + + si.hStdInput = GetStdHandle(STD_INPUT_HANDLE); + + SECURITY_ATTRIBUTES pipeAttributes = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE }; + si.hStdOutput = filterStdOutput.open_write_end(&pipeAttributes, 0, NULL); + si.hStdError = filterStdError.open_write_end(&pipeAttributes, 0, NULL); + + PROCESS_INFORMATION pi = {}; + + if(!CreateProcess(NULL, const_cast<LPTSTR>(pszCommandLine), NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) + Die("CreateProcess"); + + CloseHandle(pi.hThread); + CloseHandle(si.hStdOutput); + CloseHandle(si.hStdError); + + (void)SetProcessWorkingSetSize(GetCurrentProcess(), (SIZE_T)-1, (SIZE_T)-1); + + HANDLE waitHandles[3] = + { + pi.hProcess, + filterStdOutput.get_read_completion(), + filterStdError.get_read_completion() + }; + + unsigned done = 0; + + char * pLineBuffer = NULL; + size_t cbLineBuffer = 0; + + while(done < ARRAYSIZE(waitHandles)) + { + switch(WaitForMultipleObjects(ARRAYSIZE(waitHandles), waitHandles, FALSE, INFINITE)) + { + case WAIT_OBJECT_0: + GetExitCodeProcess(pi.hProcess, &dwExitCode); + waitHandles[WAIT_OBJECT_0] = hNever; + ++ done; + break; + + case WAIT_OBJECT_0 + 1: + if(!filterStdOutput()) + { + waitHandles[WAIT_OBJECT_0 + 1] = hNever; + ++ done; + } + + break; + + case WAIT_OBJECT_0 + 2: + if(!filterStdError()) + { + waitHandles[WAIT_OBJECT_0 + 2] = hNever; + ++ done; + } + + break; + + default: + Die("WaitForMultipleObjects"); + } + } + + Exit(dwExitCode); +} + +// EOF Propchange: trunk/reactos/tools/msc_helper/msc_helper.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/tools/msc_helper/msc_helper.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/msc_helper/msc_helpe…
============================================================================== --- trunk/reactos/tools/msc_helper/msc_helper.rbuild (added) +++ trunk/reactos/tools/msc_helper/msc_helper.rbuild [iso-8859-1] Mon Jun 1 19:17:41 2009 @@ -1,0 +1,6 @@ +<?xml version="1.0"?> +<module name="msc_helper" type="buildtool"> + <define name="UNICODE" /> + <define name="_UNICODE" /> + <file>msc_helper.cpp</file> +</module> Propchange: trunk/reactos/tools/msc_helper/msc_helper.rbuild ------------------------------------------------------------------------------ svn:eol-style = native
15 years, 6 months
1
0
0
0
[hyperion] 41234: added include/reactos/kjk added include/reactos/kjk/argv_parser.h added include/reactos/kjk/null_output_iterator.h added include/reactos/kjk/stringz_iterator.h Some internal libraries I use in code I haven't committed yet
by hyperion@svn.reactos.org
Author: hyperion Date: Mon Jun 1 19:14:37 2009 New Revision: 41234 URL:
http://svn.reactos.org/svn/reactos?rev=41234&view=rev
Log: added include/reactos/kjk added include/reactos/kjk/argv_parser.h added include/reactos/kjk/null_output_iterator.h added include/reactos/kjk/stringz_iterator.h Some internal libraries I use in code I haven't committed yet Added: trunk/reactos/include/reactos/kjk/ (with props) trunk/reactos/include/reactos/kjk/argv_parser.h (with props) trunk/reactos/include/reactos/kjk/null_output_iterator.h (with props) trunk/reactos/include/reactos/kjk/stringz_iterator.h (with props) Propchange: trunk/reactos/include/reactos/kjk/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Mon Jun 1 19:14:37 2009 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/include/reactos/kjk/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/include/reactos/kjk/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/include/reactos/kjk/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/include/reactos/kjk/argv_parser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/kjk/argv_p…
============================================================================== --- trunk/reactos/include/reactos/kjk/argv_parser.h (added) +++ trunk/reactos/include/reactos/kjk/argv_parser.h [iso-8859-1] Mon Jun 1 19:14:37 2009 @@ -1,0 +1,159 @@ +/* + Copyright (c) 2009 KJK::Hyperion + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#ifndef KJK_ARGV_PARSER_H_ +#define KJK_ARGV_PARSER_H_ + +#include <iterator> +#include <kjk/null_output_iterator.h> + +namespace kjk +{ + namespace details + { + template<class Traits> + bool is_separator(typename Traits::int_type c) + { + return Traits::eq_int_type(c, ' ') || Traits::eq_int_type(c, '\t'); + } + } + + template<class Elem, class Traits, class InIter, class OutIter> + InIter copy_argument(InIter cur, InIter end, OutIter arg) + { + typename Traits::int_type c; + bool quoting = false; + + while(cur != end) + { + c = Traits::to_int_type(*cur); + + if(!details::is_separator<Traits>(c)) + break; + + ++ cur; + } + + while(cur != end) + { + typedef typename std::iterator_traits<InIter>::difference_type difference_type; + difference_type backslashes(0); + + do + { + c = Traits::to_int_type(*cur); + ++ cur; + + if(Traits::eq_int_type(c, '\\')) + ++ backslashes; + else + break; + } + while(cur != end); + + if(Traits::eq_int_type(c, '"')) + { + // c == '"' + + if((backslashes % 2) == 0) + { + // 2N backslashes + "" in quote = N backslashes, literal " + if(quoting && cur != end && Traits::eq_int_type(Traits::to_int_type(*cur), '"')) + { + c = '"'; + ++ cur; + } + // 2N backslashes + " = N backslashes, toggle quoting + else + { + quoting = !quoting; + c = Traits::eof(); + } + + } + // 2N+1 backslashes + " = N backslashes, literal " + + backslashes /= 2; + } + + // Flush backslashes + for(difference_type i = 0; i < backslashes; ++ i) + *arg ++ = Traits::to_char_type('\\'); + + // Handle current character, unless it was a special quote + if(c != Traits::eof()) + { + if(details::is_separator<Traits>(c) && !quoting) + break; + else + *arg ++ = Traits::to_char_type(c); + } + } + + while(cur != end) + { + c = Traits::to_int_type(*cur); + + if(!details::is_separator<Traits>(c)) + break; + + ++ cur; + } + + return cur; + } + + template<class InIter, class OutIter> + InIter copy_argument(InIter cur, InIter end, OutIter arg) + { + return copy_argument + < + typename std::iterator_traits<InIter>::value_type, + typename std::char_traits<typename std::iterator_traits<InIter>::value_type>, + InIter, + OutIter + > + (cur, end, arg); + } + + template<class Elem, class Traits, class InIter> + InIter skip_argument(InIter cur, InIter end) + { + return copy_argument(cur, end, null_output_iterator<Elem>()); + } + + template<class InIter> + InIter skip_argument(InIter cur, InIter end) + { + return copy_argument + < + typename std::iterator_traits<InIter>::value_type, + typename std::char_traits<typename std::iterator_traits<InIter>::value_type>, + InIter + > + (cur, end, null_output_iterator<typename std::iterator_traits<InIter>::value_type>()); + } +} + +#endif + +// EOF Propchange: trunk/reactos/include/reactos/kjk/argv_parser.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/include/reactos/kjk/null_output_iterator.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/kjk/null_o…
============================================================================== --- trunk/reactos/include/reactos/kjk/null_output_iterator.h (added) +++ trunk/reactos/include/reactos/kjk/null_output_iterator.h [iso-8859-1] Mon Jun 1 19:14:37 2009 @@ -1,0 +1,51 @@ +/* + Copyright (c) 2009 KJK::Hyperion + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#ifndef KJK_NULL_OUTPUT_ITERATOR_H_ +#define KJK_NULL_OUTPUT_ITERATOR_H_ + +#include <cstddef> +#include <iterator> + +namespace kjk +{ + template<class Type> + struct null_output_reference + { + const Type& operator=(const Type& x) { return x; } + }; + + template<class Type, class Distance = std::ptrdiff_t, class Pointer = Type *> + struct null_output_iterator: public std::iterator<std::output_iterator_tag, Type, Distance, Pointer, null_output_reference<Type> > + { + null_output_iterator() {} + null_output_iterator(const null_output_iterator&) {} + const null_output_iterator& operator=(const null_output_iterator&) { return *this; } + const null_output_iterator& operator++() { return *this; } + null_output_iterator operator++(int) { return null_output_iterator(); } + null_output_reference<Type> operator*() { return null_output_reference<Type>(); } + }; +} + +#endif + +// EOF Propchange: trunk/reactos/include/reactos/kjk/null_output_iterator.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/include/reactos/kjk/stringz_iterator.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/kjk/string…
============================================================================== --- trunk/reactos/include/reactos/kjk/stringz_iterator.h (added) +++ trunk/reactos/include/reactos/kjk/stringz_iterator.h [iso-8859-1] Mon Jun 1 19:14:37 2009 @@ -1,0 +1,130 @@ +/* + Copyright (c) 2009 KJK::Hyperion + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#ifndef KJK_STRINGZ_ITERATOR_H_ +#define KJK_STRINGZ_ITERATOR_H_ + +#include <cstddef> +#include <iterator> + +namespace kjk +{ + template<class Type, class Traits = std::char_traits<Type> > class stringz_iterator; + + template<class CharT> stringz_iterator<CharT> stringz_begin(const CharT *); + template<class Traits, class CharT> stringz_iterator<CharT, Traits> stringz_begin(const CharT *); + + template<class CharT> stringz_iterator<CharT> stringz_end(const CharT *); + template<class Traits, class CharT> stringz_iterator<CharT, Traits> stringz_end(const CharT *); + + template<class Type, class Traits> + class stringz_iterator: public std::iterator<std::forward_iterator_tag, Type, std::ptrdiff_t, const Type *, const Type&> + { + private: + template<class CharT2> friend stringz_iterator<CharT2> stringz_begin(const CharT2 *); + template<class Traits2, class CharT2> friend stringz_iterator<CharT2, Traits2> stringz_begin(const CharT2 *); + + template<class CharT2> friend stringz_iterator<CharT2> stringz_end(const CharT2 *); + template<class Traits2, class CharT2> friend stringz_iterator<CharT2, Traits2> stringz_end(const CharT2 *); + + // FIXME: this sucks because GCC sucks + typedef const Type * pointer_; + typedef const Type& reference_; + + pointer_ m_p; + + static pointer_ set_pointer(pointer_ p) + { + if(p != 0 && Traits::eq_int_type(Traits::to_int_type(*p), 0)) + return 0; + else + return p; + } + + explicit stringz_iterator(pointer_ p): m_p(set_pointer(p)) { } + + public: + stringz_iterator(): m_p() {} + stringz_iterator(const stringz_iterator& That): m_p(set_pointer(That.m_p)) { } + + const stringz_iterator& operator=(const stringz_iterator& That) + { + m_p = set_pointer(That.m_p); + return *this; + } + + bool operator==(const stringz_iterator& That) const + { + return m_p == That.m_p; + } + + bool operator!=(const stringz_iterator& That) const + { + return m_p != That.m_p; + } + + reference_ operator*() const { return *m_p; } + + const stringz_iterator& operator++() + { + m_p = set_pointer(m_p + 1); + return *this; + } + + stringz_iterator operator++(int) + { + stringz_iterator oldValue(*this); + ++ (*this); + return oldValue; + } + + pointer_ base() const { return m_p; } + }; + + template<class CharT> + stringz_iterator<CharT> stringz_begin(const CharT * p) + { + return stringz_iterator<CharT>(p); + } + + template<class Traits, class CharT> + stringz_iterator<CharT> stringz_begin(const CharT * p) + { + return stringz_iterator<CharT, Traits>(p); + } + + template<class CharT> + stringz_iterator<CharT> stringz_end(const CharT *) + { + return stringz_iterator<CharT>(0); + } + + template<class Traits, class CharT> + stringz_iterator<CharT> stringz_end(const CharT *) + { + return stringz_iterator<CharT, Traits>(0); + } +} + +#endif + +// EOF Propchange: trunk/reactos/include/reactos/kjk/stringz_iterator.h ------------------------------------------------------------------------------ svn:eol-style = native
15 years, 6 months
1
0
0
0
[sginsberg] 41233: - Disable debugging traces for dbgk/io/lpc/ob/ps by default, removing mostly unused debug code from frequently used routines and decreasing image size by about 32 KB. Also fix the way some macros are defined so we don't end up with double semicolons after the preprocessor.
by sginsberg@svn.reactos.org
Author: sginsberg Date: Mon Jun 1 10:21:12 2009 New Revision: 41233 URL:
http://svn.reactos.org/svn/reactos?rev=41233&view=rev
Log: - Disable debugging traces for dbgk/io/lpc/ob/ps by default, removing mostly unused debug code from frequently used routines and decreasing image size by about 32 KB. Also fix the way some macros are defined so we don't end up with double semicolons after the preprocessor. Modified: trunk/reactos/ntoskrnl/include/internal/dbgk.h trunk/reactos/ntoskrnl/include/internal/io.h trunk/reactos/ntoskrnl/include/internal/lpc.h trunk/reactos/ntoskrnl/include/internal/ob.h trunk/reactos/ntoskrnl/include/internal/ps.h Modified: trunk/reactos/ntoskrnl/include/internal/dbgk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/dbgk.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/dbgk.h [iso-8859-1] Mon Jun 1 10:21:12 2009 @@ -9,7 +9,7 @@ // // Define this if you want debugging support // -#define _DBGK_DEBUG_ 0x01 +#define _DBGK_DEBUG_ 0x00 // // These define the Debug Masks Supported @@ -43,7 +43,7 @@ } #endif #else -#define DBGKTRACE(x, ...) DPRINT(__VA_ARGS__); +#define DBGKTRACE(x, ...) DPRINT(__VA_ARGS__) #endif VOID Modified: trunk/reactos/ntoskrnl/include/internal/io.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/io.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/io.h [iso-8859-1] Mon Jun 1 10:21:12 2009 @@ -10,7 +10,7 @@ // // Define this if you want debugging support // -#define _IO_DEBUG_ 0x01 +#define _IO_DEBUG_ 0x00 // // These define the Debug Masks Supported @@ -43,7 +43,7 @@ } #endif #else -#define IOTRACE(x, ...) DPRINT(__VA_ARGS__); +#define IOTRACE(x, ...) DPRINT(__VA_ARGS__) #endif // Modified: trunk/reactos/ntoskrnl/include/internal/lpc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/lpc.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/lpc.h [iso-8859-1] Mon Jun 1 10:21:12 2009 @@ -9,7 +9,7 @@ // // Define this if you want debugging support // -#define _LPC_DEBUG_ 0x01 +#define _LPC_DEBUG_ 0x00 // // These define the Debug Masks Supported @@ -45,6 +45,8 @@ DbgPrint(__VA_ARGS__); \ } #endif +#else +#define LPCTRACE(x, ...) DPRINT(__VA_ARGS__) #endif // Modified: trunk/reactos/ntoskrnl/include/internal/ob.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ob.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/ob.h [iso-8859-1] Mon Jun 1 10:21:12 2009 @@ -9,7 +9,7 @@ // // Define this if you want debugging support // -#define _OB_DEBUG_ 0x01 +#define _OB_DEBUG_ 0x00 // // These define the Debug Masks Supported Modified: trunk/reactos/ntoskrnl/include/internal/ps.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ps.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/ps.h [iso-8859-1] Mon Jun 1 10:21:12 2009 @@ -9,7 +9,7 @@ // // Define this if you want debugging support // -#define _PS_DEBUG_ 0x01 +#define _PS_DEBUG_ 0x00 // // These define the Debug Masks Supported @@ -52,9 +52,9 @@ "Pointer Count [%p] @%d: %lx\n", \ x, \ __LINE__, \ - OBJECT_TO_OBJECT_HEADER(x)->PointerCount); + OBJECT_TO_OBJECT_HEADER(x)->PointerCount) #else -#define PSTRACE(x, ...) DPRINT(__VA_ARGS__); +#define PSTRACE(x, ...) DPRINT(__VA_ARGS__) #define PSREFTRACE(x) #endif
15 years, 6 months
1
0
0
0
← Newer
1
...
47
48
49
50
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
Results per page:
10
25
50
100
200