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
December 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
22 participants
501 discussions
Start a n
N
ew thread
[sserapion] 44388: - Allow warnings in gdi32 - Fix ntdll build - Fix mysteriously broken (in last sync) obdc32
by sserapion@svn.reactos.org
Author: sserapion Date: Thu Dec 3 20:03:25 2009 New Revision: 44388 URL:
http://svn.reactos.org/svn/reactos?rev=44388&view=rev
Log: - Allow warnings in gdi32 - Fix ntdll build - Fix mysteriously broken (in last sync) obdc32 Modified: branches/ros-amd64-bringup/reactos/dll/ntdll/def/ntdll_amd64.def branches/ros-amd64-bringup/reactos/dll/ntdll/ldr/actctx.c branches/ros-amd64-bringup/reactos/dll/ntdll/ldr/utils.c branches/ros-amd64-bringup/reactos/dll/win32/gdi32/gdi32.rbuild branches/ros-amd64-bringup/reactos/dll/win32/odbc32/odbc32.rbuild Modified: branches/ros-amd64-bringup/reactos/dll/ntdll/def/ntdll_amd64.def URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/n…
============================================================================== --- branches/ros-amd64-bringup/reactos/dll/ntdll/def/ntdll_amd64.def [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/ntdll/def/ntdll_amd64.def [iso-8859-1] Thu Dec 3 20:03:25 2009 @@ -1015,7 +1015,7 @@ RtlQueryHeapInformation RtlQueryInformationAcl RtlQueryInformationActivationContext -RtlQueryInformationActiveActivationContext +;RtlQueryInformationActiveActivationContext ;RtlQueryInterfaceMemoryStream ;RtlQueryModuleInformation ;RtlQueryProcessBackTraceInformation Modified: branches/ros-amd64-bringup/reactos/dll/ntdll/ldr/actctx.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/n…
============================================================================== --- branches/ros-amd64-bringup/reactos/dll/ntdll/ldr/actctx.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/ntdll/ldr/actctx.c [iso-8859-1] Thu Dec 3 20:03:25 2009 @@ -15,8 +15,8 @@ LDR_RESOURCE_INFO info; IMAGE_RESOURCE_DATA_ENTRY *entry; - info.Type = (ULONG)RT_MANIFEST; - info.Name = (ULONG)ISOLATIONAWARE_MANIFEST_RESOURCE_ID; + info.Type = (ULONG_PTR)RT_MANIFEST; + info.Name = (ULONG_PTR)ISOLATIONAWARE_MANIFEST_RESOURCE_ID; info.Language = 0; if (!(status = LdrFindResource_U( module->DllBase, &info, 3, &entry ))) { Modified: branches/ros-amd64-bringup/reactos/dll/ntdll/ldr/utils.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/n…
============================================================================== --- branches/ros-amd64-bringup/reactos/dll/ntdll/ldr/utils.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/ntdll/ldr/utils.c [iso-8859-1] Thu Dec 3 20:03:25 2009 @@ -3477,7 +3477,7 @@ } /* FIXME: Cookie is based on part of the thread id */ - *Cookie = (ULONG)NtCurrentTeb()->RealClientId.UniqueThread; + *Cookie = (ULONG_PTR)NtCurrentTeb()->RealClientId.UniqueThread; return Status; } @@ -3489,7 +3489,7 @@ if (Flags != 0x01) return STATUS_INVALID_PARAMETER_1; - if (Cookie != (ULONG)NtCurrentTeb()->RealClientId.UniqueThread) + if (Cookie != (ULONG_PTR)NtCurrentTeb()->RealClientId.UniqueThread) return STATUS_INVALID_PARAMETER_2; RtlLeaveCriticalSection(NtCurrentPeb()->LoaderLock); Modified: branches/ros-amd64-bringup/reactos/dll/win32/gdi32/gdi32.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/w…
============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/gdi32/gdi32.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/gdi32/gdi32.rbuild [iso-8859-1] Thu Dec 3 20:03:25 2009 @@ -1,4 +1,4 @@ -<module name="gdi32" type="win32dll" baseaddress="${BASEADDRESS_GDI32}" installbase="system32" installname="gdi32.dll" unicode="yes" crt="dll"> +<module name="gdi32" type="win32dll" baseaddress="${BASEADDRESS_GDI32}" installbase="system32" installname="gdi32.dll" unicode="yes" crt="dll" allowwarnings=true> <importlibrary definition="gdi32.spec" /> <include base="gdi32">include</include> <define name="LANGPACK" /> Modified: branches/ros-amd64-bringup/reactos/dll/win32/odbc32/odbc32.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/w…
============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/odbc32/odbc32.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/odbc32/odbc32.rbuild [iso-8859-1] Thu Dec 3 20:03:25 2009 @@ -7,6 +7,7 @@ <include base="ReactOS">include/reactos/wine</include> <define name="__WINESRC__" /> <library>wine</library> + <library>advapi32</library> <file>proxyodbc.c</file> </module> </group>
15 years
1
0
0
0
[dgorbachev] 44387: [FORMATTING] SndRec32 patch by Marco Pagliaricci, bug #4978.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Thu Dec 3 20:00:41 2009 New Revision: 44387 URL:
http://svn.reactos.org/svn/reactos?rev=44387&view=rev
Log: [FORMATTING] SndRec32 patch by Marco Pagliaricci, bug #4978. Modified: trunk/reactos/base/applications/sndrec32/audio_def.hpp trunk/reactos/base/applications/sndrec32/audio_format.cpp trunk/reactos/base/applications/sndrec32/audio_format.hpp trunk/reactos/base/applications/sndrec32/audio_membuffer.cpp trunk/reactos/base/applications/sndrec32/audio_membuffer.hpp trunk/reactos/base/applications/sndrec32/audio_producer.hpp trunk/reactos/base/applications/sndrec32/audio_receiver.hpp trunk/reactos/base/applications/sndrec32/audio_resampler_acm.cpp trunk/reactos/base/applications/sndrec32/audio_resampler_acm.hpp trunk/reactos/base/applications/sndrec32/audio_wavein.cpp trunk/reactos/base/applications/sndrec32/audio_wavein.hpp trunk/reactos/base/applications/sndrec32/audio_waveout.cpp trunk/reactos/base/applications/sndrec32/audio_waveout.hpp trunk/reactos/base/applications/sndrec32/resource.h trunk/reactos/base/applications/sndrec32/sndrec32.cpp trunk/reactos/base/applications/sndrec32/sndrec32.h trunk/reactos/base/applications/sndrec32/sndrec32.rc trunk/reactos/base/applications/sndrec32/targetver.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/base/applications/sndrec32/audio_def.hpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/sndrec32/audio_format.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/sndrec32/audio_format.hpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/sndrec32/audio_membuffer.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/sndrec32/audio_membuffer.hpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/sndrec32/audio_producer.hpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/sndrec32/audio_receiver.hpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/sndrec32/audio_resampler_acm.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/sndrec32/audio_resampler_acm.hpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/sndrec32/audio_wavein.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/sndrec32/audio_wavein.hpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/sndrec32/audio_waveout.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/sndrec32/audio_waveout.hpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/sndrec32/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/sndrec32/sndrec32.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/sndrec32/sndrec32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/sndrec32/sndrec32.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/sndrec32/targetver.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
15 years
1
0
0
0
[gschneider] 44386: [kernel32] - Update FormatMessageA/W to current Wine sources, rename the file to better reflect the content - Fixes the failing kernel32 format_msg tests
by gschneider@svn.reactos.org
Author: gschneider Date: Thu Dec 3 19:57:57 2009 New Revision: 44386 URL:
http://svn.reactos.org/svn/reactos?rev=44386&view=rev
Log: [kernel32] - Update FormatMessageA/W to current Wine sources, rename the file to better reflect the content - Fixes the failing kernel32 format_msg tests Added: trunk/reactos/dll/win32/kernel32/misc/format_msg.c (with props) Removed: trunk/reactos/dll/win32/kernel32/misc/errormsg.c Modified: trunk/reactos/dll/win32/kernel32/kernel32.rbuild Modified: trunk/reactos/dll/win32/kernel32/kernel32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
============================================================================== --- trunk/reactos/dll/win32/kernel32/kernel32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/kernel32.rbuild [iso-8859-1] Thu Dec 3 19:57:57 2009 @@ -77,8 +77,8 @@ <file>dllmain.c</file> <file>env.c</file> <file>error.c</file> - <file>errormsg.c</file> <file>fold.c</file> + <file>format_msg.c</file> <file>handle.c</file> <file>lang.c</file> <file>ldr.c</file> Removed: trunk/reactos/dll/win32/kernel32/misc/errormsg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/er…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/errormsg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/errormsg.c (removed) @@ -1,668 +1,0 @@ -/* $Id$ - * - * reactos/lib/kernel32/misc/errormsg.c - * Wine calls this file now as kernel/format_msg.c - * - */ -/* - * FormatMessage implementation - * - * Copyright 1996 Marcus Meissner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include <k32.h> - -#define NDEBUG - -#include <debug.h> -#include "wine/unicode.h" - -#define TRACE DPRINT -#define FIXME DPRINT - -static const WCHAR PCNTFMTWSTR[] = { '%','%','%','s',0 }; -static const WCHAR FMTWSTR[] = { '%','s',0 }; -static const WCHAR kernel32W[] = {'k','e','r','n','e','l','3','2',0}; - -/* strdup macros */ -/* DO NOT USE IT!! it will go away soon */ - -__inline static LPSTR HEAP_strdupWtoA( HANDLE heap, DWORD flags, LPCWSTR str ) -{ - LPSTR ret; - INT len; - - if (!str) return NULL; - len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL ); - ret = RtlAllocateHeap(RtlGetProcessHeap(), flags, len ); - if(ret) WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL ); - return ret; -} - -/* Messages...used by FormatMessage32* (KERNEL32.something) - * - * They can be specified either directly or using a message ID and - * loading them from the resource. - * - * The resourcedata has following format: - * start: - * 0: DWORD nrofentries - * nrofentries * subentry: - * 0: DWORD firstentry - * 4: DWORD lastentry - * 8: DWORD offset from start to the stringentries - * - * (lastentry-firstentry) * stringentry: - * 0: WORD len (0 marks end) [ includes the 4 byte header length ] - * 2: WORD flags - * 4: CHAR[len-4] - * (stringentry i of a subentry refers to the ID 'firstentry+i') - * - * Yes, ANSI strings in win32 resources. Go figure. - */ - -/********************************************************************** - * load_messageW (internal) - */ -static LPWSTR load_messageW( HMODULE module, UINT id, WORD lang ) -{ - PRTL_MESSAGE_RESOURCE_ENTRY mre; - WCHAR *buffer; - NTSTATUS Status; - - TRACE("module = %p, id = %08x\n", module, id ); - - if (!module) module = GetModuleHandleW( NULL ); - Status = RtlFindMessage( module, (ULONG) RT_MESSAGETABLE, lang, id, &mre ); - if (!NT_SUCCESS(Status)) - { - SetLastError( RtlNtStatusToDosError(Status) ); - return NULL; - } - - if (mre->Flags & MESSAGE_RESOURCE_UNICODE) - { - int len = (strlenW( (const WCHAR *)mre->Text ) + 1) * sizeof(WCHAR); - if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len ))) return NULL; - memcpy( buffer, mre->Text, len ); - } - else - { - int len = MultiByteToWideChar( CP_ACP, 0, (const char *)mre->Text, -1, NULL, 0 ); - if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL; - MultiByteToWideChar( CP_ACP, 0, (const char*)mre->Text, -1, buffer, len ); - } - //TRACE("returning %s\n", wine_dbgstr_w(buffer)); - return buffer; -} - - -/********************************************************************** - * load_messageA (internal) - */ - -static LPSTR load_messageA( HMODULE module, UINT id, WORD lang ) -{ - PRTL_MESSAGE_RESOURCE_ENTRY mre; - char *buffer; - NTSTATUS Status; - - TRACE("module = %p, id = %08x\n", module, id ); - - if (!module) module = GetModuleHandleW( NULL ); - Status = RtlFindMessage( module, (ULONG) RT_MESSAGETABLE, lang, id, &mre ); - if (!NT_SUCCESS(Status)) - { - SetLastError( RtlNtStatusToDosError(Status) ); - return NULL; - } - - if (mre->Flags & MESSAGE_RESOURCE_UNICODE) - { - int len = WideCharToMultiByte( CP_ACP, 0, (const WCHAR *)mre->Text, -1, NULL, 0, NULL, NULL ); - if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len ))) return NULL; - WideCharToMultiByte( CP_ACP, 0, (const WCHAR *)mre->Text, -1, buffer, len, NULL, NULL ); - } - else - { - int len = strlen((const char*)mre->Text) + 1; - if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len ))) return NULL; - memcpy( buffer, mre->Text, len ); - } - //TRACE("returning %s\n", wine_dbgstr_a(buffer)); - return buffer; -} - - -/*********************************************************************** - * FormatMessageA (KERNEL32.@) - * FIXME: missing wrap, - * - * @implemented - */ -DWORD WINAPI FormatMessageA( - DWORD dwFlags, - LPCVOID lpSource, - DWORD dwMessageId, - DWORD dwLanguageId, - LPSTR lpBuffer, - DWORD nSize, - va_list* _args ) -{ - LPDWORD args=(LPDWORD)_args; - HMODULE kernel32_handle = GetModuleHandleW(kernel32W); - -#if defined(__i386__) || defined(__sparc__) -/* This implementation is completely dependent on the format of the va_list on x86 CPUs */ - LPSTR target,t; - DWORD talloced; - LPSTR from,f; - DWORD width = dwFlags & FORMAT_MESSAGE_MAX_WIDTH_MASK; - BOOL eos = FALSE; - CHAR ch; - - TRACE("(0x%lx,%p,%ld,0x%lx,%p,%ld,%p)\n", - dwFlags,lpSource,dwMessageId,dwLanguageId,lpBuffer,nSize,args); - if ((dwFlags & FORMAT_MESSAGE_FROM_STRING) - &&((dwFlags & FORMAT_MESSAGE_FROM_SYSTEM) - || (dwFlags & FORMAT_MESSAGE_FROM_HMODULE))) return 0; - - if (!lpBuffer) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return 0; - } - - if (width && width != FORMAT_MESSAGE_MAX_WIDTH_MASK) - FIXME("line wrapping (%lu) not supported.\n", width); - from = NULL; - if (dwFlags & FORMAT_MESSAGE_FROM_STRING) - { - from = HeapAlloc( GetProcessHeap(), 0, strlen((LPCSTR)lpSource)+1 ); - if (from == NULL) - { - return 0; - } - strcpy( from, (LPCSTR)lpSource ); - } - else { - from = NULL; - if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE) - from = load_messageA( (HMODULE)lpSource, dwMessageId, (WORD)dwLanguageId ); - if (!from && (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM)) - from = load_messageA( kernel32_handle, dwMessageId, (WORD)dwLanguageId ); - - if (!from) - { - return 0; - } - } - target = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 100); - if(target == NULL) - { - HeapFree(GetProcessHeap(),0,from); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return 0; - } - t = target; - talloced= 100; - -#define ADD_TO_T(c) do { \ - *t++=c;\ - if (t-target == talloced) {\ - target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,talloced*2);\ - t = target+talloced;\ - talloced*=2;\ - }\ -} while (0) - - if (from) { - f=from; - if (dwFlags & FORMAT_MESSAGE_IGNORE_INSERTS) { - while (*f && !eos) - ADD_TO_T(*f++); - } - else { - while (*f && !eos) { - if (*f=='%') { - int insertnr; - char *fmtstr,*x,*lastf; - DWORD *argliststart; - - fmtstr = NULL; - lastf = f; - f++; - if (!*f) { - ADD_TO_T('%'); - continue; - } - switch (*f) { - case '1':case '2':case '3':case '4':case '5': - case '6':case '7':case '8':case '9': - insertnr=*f-'0'; - switch (f[1]) { - case '0':case '1':case '2':case '3': - case '4':case '5':case '6':case '7': - case '8':case '9': - f++; - insertnr=insertnr*10+*f-'0'; - f++; - break; - default: - f++; - break; - } - if (*f=='!') { - f++; - if (NULL!=(x=strchr(f,'!'))) { - *x='\0'; - fmtstr=HeapAlloc(GetProcessHeap(),0,strlen(f)+2); - if(fmtstr == NULL) - { - HeapFree(GetProcessHeap(),0,from); - HeapFree(GetProcessHeap(),0,target); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return 0; - } - sprintf(fmtstr,"%%%s",f); - f=x+1; - } else { - fmtstr=HeapAlloc(GetProcessHeap(),0,strlen(f)+2); - if(fmtstr == NULL) - { - HeapFree(GetProcessHeap(),0,from); - HeapFree(GetProcessHeap(),0,target); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return 0; - } - sprintf(fmtstr,"%%%s",f); - f+=strlen(f); /*at \0*/ - } - } else { - if(!args) break; - fmtstr = HeapAlloc(GetProcessHeap(),0,3); - if(fmtstr == NULL) - { - HeapFree(GetProcessHeap(),0,from); - HeapFree(GetProcessHeap(),0,target); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return 0; - } - strcpy( fmtstr, "%s" ); - } - if (args) { - int sz; - LPSTR b; - - if (dwFlags & FORMAT_MESSAGE_ARGUMENT_ARRAY) - argliststart=args+insertnr-1; - else - argliststart=(*(DWORD**)args)+insertnr-1; - - b = NULL; - sz = 0; - do { - if (b) { - HeapFree(GetProcessHeap(), 0, b); - } - sz += 256; - b = HeapAlloc(GetProcessHeap(), 0, sz); - /* CMF - This makes a BIG assumption about va_list */ - } while (0 > _vsnprintf(b, sz, fmtstr, (va_list) argliststart)); - x=b; - while(*x) - ADD_TO_T(*x++); - - HeapFree(GetProcessHeap(),0,b); - } else { - /* NULL args - copy formatstr - * (probably wrong) - */ - while ((lastf<f)&&(*lastf)) { - ADD_TO_T(*lastf++); - } - } - HeapFree(GetProcessHeap(),0,fmtstr); - break; - case 'n': - ADD_TO_T('\r'); - ADD_TO_T('\n'); - f++; - break; - case '0': - eos = TRUE; - f++; - break; - default: - ADD_TO_T(*f++); - break; - } - } else { - ch = *f; - f++; - if (ch == '\r') { - if (*f == '\n') - f++; - if(width) - ADD_TO_T(' '); - else - { - ADD_TO_T('\r'); - ADD_TO_T('\n'); - } - } else { - if (ch == '\n') - { - if(width) - ADD_TO_T(' '); - else - { - ADD_TO_T('\r'); - ADD_TO_T('\n'); - } - } - else - ADD_TO_T(ch); - } - } - } - } - *t='\0'; - } - talloced = strlen(target)+1; - if (nSize && talloced<nSize) { - target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize); - } - //TRACE("-- %s\n",debugstr_a(target)); - if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) { - *((LPVOID*)lpBuffer) = (LPVOID)LocalAlloc(LMEM_ZEROINIT,max(nSize, talloced)); - memcpy(*(LPSTR*)lpBuffer,target,talloced); - } else { - lstrcpynA(lpBuffer,target,nSize); - } - HeapFree(GetProcessHeap(),0,target); - HeapFree(GetProcessHeap(),0,from); - TRACE("-- returning %d\n", (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ? strlen(*(LPSTR*)lpBuffer):strlen(lpBuffer)); - return (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ? - strlen(*(LPSTR*)lpBuffer): - strlen(lpBuffer); -#else - return 0; -#endif /* __i386__ */ -} -#undef ADD_TO_T - -/*********************************************************************** - * FormatMessageW (KERNEL32.@) - * - * @implemented - */ -DWORD WINAPI FormatMessageW( - DWORD dwFlags, - LPCVOID lpSource, - DWORD dwMessageId, - DWORD dwLanguageId, - LPWSTR lpBuffer, - DWORD nSize, - va_list* _args ) -{ - HMODULE kernel32_handle = GetModuleHandleW(kernel32W); - LPDWORD args=(LPDWORD)_args; -#if defined(__i386__) || defined(__sparc__) -/* This implementation is completely dependent on the format of the va_list on x86 CPUs */ - LPWSTR target,t; - DWORD talloced,len; - LPWSTR from,f; - DWORD width = dwFlags & FORMAT_MESSAGE_MAX_WIDTH_MASK; - BOOL eos = FALSE; - WCHAR ch; - - TRACE("(0x%lx,%p,%ld,0x%lx,%p,%ld,%p)\n", - dwFlags,lpSource,dwMessageId,dwLanguageId,lpBuffer,nSize,args); - if ((dwFlags & FORMAT_MESSAGE_FROM_STRING) - &&((dwFlags & FORMAT_MESSAGE_FROM_SYSTEM) - || (dwFlags & FORMAT_MESSAGE_FROM_HMODULE))) return 0; - - if (!lpBuffer) - { - SetLastError(ERROR_INVALID_PARAMETER); - return 0; - } - - if (width && width != FORMAT_MESSAGE_MAX_WIDTH_MASK) - FIXME("line wrapping not supported.\n"); - from = NULL; - if (dwFlags & FORMAT_MESSAGE_FROM_STRING) { - from = HeapAlloc( GetProcessHeap(), 0, (strlenW((LPCWSTR)lpSource) + 1) * - sizeof(WCHAR) ); - if(from == NULL) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return 0; - } - strcpyW( from, (LPCWSTR)lpSource ); - } - else { - from = NULL; - if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE) - from = load_messageW( (HMODULE)lpSource, dwMessageId, (WORD)dwLanguageId ); - if (!from && (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM)) - from = load_messageW( kernel32_handle, dwMessageId,(WORD)dwLanguageId ); - - if (!from) - { - return 0; - } - } - - target = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 100 * sizeof(WCHAR) ); - if(target == NULL) - { - HeapFree(GetProcessHeap(),0,from); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return 0; - } - t = target; - talloced= 100; - -#define ADD_TO_T(c) do {\ - *t++=c;\ - if (t-target == talloced) {\ - target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,talloced*2*sizeof(WCHAR));\ - t = target+talloced;\ - talloced*=2;\ - } \ -} while (0) - - if (from) { - f=from; - if (dwFlags & FORMAT_MESSAGE_IGNORE_INSERTS) { - while (*f && !eos) - ADD_TO_T(*f++); - } - else { - while (*f && !eos) { - if (*f=='%') { - int insertnr; - WCHAR *fmtstr,*sprintfbuf,*x,*lastf; - DWORD *argliststart; - - fmtstr = NULL; - lastf = f; - f++; - if (!*f) { - ADD_TO_T('%'); - continue; - } - - switch (*f) { - case '1':case '2':case '3':case '4':case '5': - case '6':case '7':case '8':case '9': - insertnr=*f-'0'; - switch (f[1]) { - case '0':case '1':case '2':case '3': - case '4':case '5':case '6':case '7': - case '8':case '9': - f++; - insertnr=insertnr*10+*f-'0'; - f++; - break; - default: - f++; - break; - } - if (*f=='!') { - f++; - if (NULL!=(x=strchrW(f,'!'))) { - *x='\0'; - fmtstr=HeapAlloc( GetProcessHeap(), 0,(strlenW(f)+2)*sizeof(WCHAR)); - if(fmtstr == NULL) - { - HeapFree(GetProcessHeap(),0,from); - HeapFree(GetProcessHeap(),0,target); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return 0; - } - sprintfW(fmtstr,PCNTFMTWSTR,f); - f=x+1; - } else { - fmtstr=HeapAlloc(GetProcessHeap(),0,(strlenW(f)+2)*sizeof(WCHAR)); - if(fmtstr == NULL) - { - HeapFree(GetProcessHeap(),0,from); - HeapFree(GetProcessHeap(),0,target); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return 0; - } - sprintfW(fmtstr,PCNTFMTWSTR,f); - f+=strlenW(f); /*at \0*/ - } - } else { - if(!args) break; - fmtstr = HeapAlloc( GetProcessHeap(),0,3*sizeof(WCHAR)); - if(fmtstr == NULL) - { - HeapFree(GetProcessHeap(),0,from); - HeapFree(GetProcessHeap(),0,target); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return 0; - } - strcpyW( fmtstr, FMTWSTR ); - } - - if (args) { - if (dwFlags & FORMAT_MESSAGE_ARGUMENT_ARRAY) - argliststart=args+insertnr-1; - else - argliststart=(*(DWORD**)args)+insertnr-1; - - len = 0; - sprintfbuf = NULL; - do { - if (sprintfbuf) { - HeapFree(GetProcessHeap(),0,sprintfbuf); - } - len += 256; - sprintfbuf=HeapAlloc(GetProcessHeap(),0,len*sizeof(WCHAR)); - /* CMF - This makes a BIG assumption about va_list */ - } while (0 > _vsnwprintf(sprintfbuf, len, fmtstr, (va_list) argliststart)); - x=sprintfbuf; - while (*x) { - ADD_TO_T(*x++); - } - HeapFree(GetProcessHeap(),0,sprintfbuf); - - } else { - /* NULL args - copy formatstr - * (probably wrong) - */ - while ((lastf<f)&&(*lastf)) { - ADD_TO_T(*lastf++); - } - } - - HeapFree(GetProcessHeap(),0,fmtstr); - break; - case 'n': - ADD_TO_T('\r'); - ADD_TO_T('\n'); - f++; - break; - case '0': - eos = TRUE; - f++; - break; - default: - ADD_TO_T(*f++); - break; - } - } else { - ch = *f; - f++; - if (ch == '\r') { - if (*f == '\n') - f++; - if(width) - ADD_TO_T(' '); - else - { - ADD_TO_T('\r'); - ADD_TO_T('\n'); - } - } else { - if (ch == '\n') - { - if(width) - ADD_TO_T(' '); - else - { - ADD_TO_T('\r'); - ADD_TO_T('\n'); - } - } - else - ADD_TO_T(ch); - } - } - } - } - *t='\0'; - } - talloced = strlenW(target)+1; - if (nSize && talloced<nSize) - target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize*sizeof(WCHAR)); - if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) { - /* nSize is the MINIMUM size */ - DWORD len = strlenW(target) + 1; - *((LPVOID*)lpBuffer) = LocalAlloc(LMEM_ZEROINIT,len*sizeof(WCHAR)); - strcpyW(*(LPWSTR*)lpBuffer, target); - } - else lstrcpynW(lpBuffer, target, nSize); - - HeapFree(GetProcessHeap(),0,target); - HeapFree(GetProcessHeap(),0,from); - //TRACE("ret=%s\n", wine_dbgstr_w((dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ? - // *(LPWSTR*)lpBuffer : lpBuffer)); - return (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ? - strlenW(*(LPWSTR*)lpBuffer): - strlenW(lpBuffer); -#else - return 0; -#endif /* __i386__ */ -} -#undef ADD_TO_T - Added: trunk/reactos/dll/win32/kernel32/misc/format_msg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/fo…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/format_msg.c (added) +++ trunk/reactos/dll/win32/kernel32/misc/format_msg.c [iso-8859-1] Thu Dec 3 19:57:57 2009 @@ -1,0 +1,757 @@ +/* + * FormatMessage implementation + * + * Copyright 1996 Marcus Meissner + * Copyright 2009 Alexandre Julliard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <k32.h> + +#define NDEBUG + +#include <debug.h> +#include "wine/unicode.h" + +struct format_args +{ + ULONG_PTR *args; + __ms_va_list *list; + int last; +}; + +static const WCHAR kernel32W[] = {'k','e','r','n','e','l','3','2',0}; + +/* Messages used by FormatMessage + * + * They can be specified either directly or using a message ID and + * loading them from the resource. + * + * The resourcedata has following format: + * start: + * 0: DWORD nrofentries + * nrofentries * subentry: + * 0: DWORD firstentry + * 4: DWORD lastentry + * 8: DWORD offset from start to the stringentries + * + * (lastentry-firstentry) * stringentry: + * 0: WORD len (0 marks end) [ includes the 4 byte header length ] + * 2: WORD flags + * 4: CHAR[len-4] + * (stringentry i of a subentry refers to the ID 'firstentry+i') + * + * Yes, ANSI strings in win32 resources. Go figure. + */ + +static const WCHAR PCNTFMTWSTR[] = { '%','%','%','s',0 }; +static const WCHAR FMTWSTR[] = { '%','s',0 }; + +/********************************************************************** + * load_messageW (internal) + */ +static LPWSTR load_messageW( HMODULE module, UINT id, WORD lang ) +{ + PRTL_MESSAGE_RESOURCE_ENTRY mre; + WCHAR *buffer; + NTSTATUS status; + + DPRINT("module = %p, id = %08x\n", module, id ); + + if (!module) module = GetModuleHandleW( NULL ); + if ((status = RtlFindMessage( module, (ULONG)RT_MESSAGETABLE, lang, id, &mre )) != STATUS_SUCCESS) + { + SetLastError( RtlNtStatusToDosError(status) ); + return NULL; + } + + if (mre->Flags & MESSAGE_RESOURCE_UNICODE) + { + int len = (strlenW( (const WCHAR *)mre->Text ) + 1) * sizeof(WCHAR); + if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len ))) return NULL; + memcpy( buffer, mre->Text, len ); + } + else + { + int len = MultiByteToWideChar( CP_ACP, 0, (const char *)mre->Text, -1, NULL, 0 ); + if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL; + MultiByteToWideChar( CP_ACP, 0, (const char*)mre->Text, -1, buffer, len ); + } + DPRINT("returning %S\n", buffer); + return buffer; +} + + +/********************************************************************** + * load_messageA (internal) + */ +static LPSTR load_messageA( HMODULE module, UINT id, WORD lang ) +{ + PRTL_MESSAGE_RESOURCE_ENTRY mre; + char *buffer; + NTSTATUS status; + + DPRINT("module = %p, id = %08x\n", module, id ); + + if (!module) module = GetModuleHandleW( NULL ); + if ((status = RtlFindMessage( module, (ULONG)RT_MESSAGETABLE, lang, id, &mre )) != STATUS_SUCCESS) + { + SetLastError( RtlNtStatusToDosError(status) ); + return NULL; + } + + if (mre->Flags & MESSAGE_RESOURCE_UNICODE) + { + int len = WideCharToMultiByte( CP_ACP, 0, (const WCHAR *)mre->Text, -1, NULL, 0, NULL, NULL ); + if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len ))) return NULL; + WideCharToMultiByte( CP_ACP, 0, (const WCHAR *)mre->Text, -1, buffer, len, NULL, NULL ); + } + else + { + int len = strlen((const char*)mre->Text) + 1; + if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len ))) return NULL; + memcpy( buffer, mre->Text, len ); + } + DPRINT("returning %s\n", buffer); + return buffer; +} + + +/********************************************************************** + * get_arg (internal) + */ +static ULONG_PTR get_arg( int nr, DWORD flags, struct format_args *args ) +{ + if (nr == -1) nr = args->last + 1; + if (args->list) + { + if (!args->args) args->args = HeapAlloc( GetProcessHeap(), 0, 99 * sizeof(ULONG_PTR) ); + while (nr > args->last) + args->args[args->last++] = va_arg( *args->list, ULONG_PTR ); + } + if (nr > args->last) args->last = nr; + return args->args[nr - 1]; +} + + +/********************************************************************** + * format_insertA (internal) + */ +static LPCSTR format_insertA( int insert, LPCSTR format, DWORD flags, + struct format_args *args, LPSTR *result ) +{ + char *astring = NULL, *p, fmt[256]; + ULONG_PTR arg; + int size; + + if (*format != '!') /* simple string */ + { + char *str = (char *)get_arg( insert, flags, args ); + *result = HeapAlloc( GetProcessHeap(), 0, strlen(str) + 1 ); + strcpy( *result, str ); + return format; + } + + format++; + p = fmt; + *p++ = '%'; + + while (*format == '0' || + *format == '+' || + *format == '-' || + *format == ' ' || + *format == '*' || + *format == '#') + { + if (*format == '*') + { + p += sprintf( p, "%lu", get_arg( insert, flags, args )); + insert = -1; + format++; + } + else *p++ = *format++; + } + while (isdigit(*format)) *p++ = *format++; + + if (*format == '.') + { + *p++ = *format++; + if (*format == '*') + { + p += sprintf( p, "%lu", get_arg( insert, flags, args )); + insert = -1; + format++; + } + else + while (isdigit(*format)) *p++ = *format++; + } + + /* replicate MS bug: drop an argument when using va_list with width/precision */ + if (insert == -1 && args->list) args->last--; + arg = get_arg( insert, flags, args ); + + /* check for wide string format */ + if ((format[0] == 'l' && format[1] == 's') || + (format[0] == 'l' && format[1] == 'S') || + (format[0] == 'w' && format[1] == 's') || + (format[0] == 'S')) + { + DWORD len = WideCharToMultiByte( CP_ACP, 0, (WCHAR *)arg, -1, /*FIXME*/ + NULL, 0, NULL, NULL ); + astring = HeapAlloc( GetProcessHeap(), 0, len ); + WideCharToMultiByte( CP_ACP, 0, (WCHAR *)arg, -1, astring, len, NULL, NULL ); + arg = (ULONG_PTR)astring; + *p++ = 's'; + } + /* check for wide character format */ + else if ((format[0] == 'l' && format[1] == 'c') || + (format[0] == 'l' && format[1] == 'C') || + (format[0] == 'w' && format[1] == 'c') || + (format[0] == 'C')) + { + WCHAR ch = arg; + DWORD len = WideCharToMultiByte( CP_ACP, 0, &ch, 1, NULL, 0, NULL, NULL ); + astring = HeapAlloc( GetProcessHeap(), 0, len + 1 ); + WideCharToMultiByte( CP_ACP, 0, &ch, 1, astring, len, NULL, NULL ); + astring[len] = 0; + arg = (ULONG_PTR)astring; + *p++ = 's'; + } + /* check for ascii string format */ + else if ((format[0] == 'h' && format[1] == 's') || + (format[0] == 'h' && format[1] == 'S')) + { + *p++ = 's'; + } + /* check for ascii character format */ + else if ((format[0] == 'h' && format[1] == 'c') || + (format[0] == 'h' && format[1] == 'C')) + { + *p++ = 'c'; + } + /* FIXME: handle I64 etc. */ + else while (*format && *format != '!') *p++ = *format++; + + *p = 0; + size = 256; + for (;;) + { + char *ret = HeapAlloc( GetProcessHeap(), 0, size ); + int needed = snprintf( ret, size, fmt, arg ); + if (needed == -1 || needed >= size) + { + HeapFree( GetProcessHeap(), 0, ret ); + size = max( needed + 1, size * 2 ); + } + else + { + *result = ret; + break; + } + } + + while (*format && *format != '!') format++; + if (*format == '!') format++; + + HeapFree( GetProcessHeap(), 0, astring ); + return format; +} + + +/********************************************************************** + * format_insertW (internal) + */ +static LPCWSTR format_insertW( int insert, LPCWSTR format, DWORD flags, + struct format_args *args, LPWSTR *result ) +{ + static const WCHAR fmt_lu[] = {'%','l','u',0}; + WCHAR *wstring = NULL, *p, fmt[256]; + ULONG_PTR arg; + int size; + + if (*format != '!') /* simple string */ + { + WCHAR *str = (WCHAR *)get_arg( insert, flags, args ); + *result = HeapAlloc( GetProcessHeap(), 0, (strlenW(str) + 1) * sizeof(WCHAR) ); + strcpyW( *result, str ); + return format; + } + + format++; + p = fmt; + *p++ = '%'; + + while (*format == '0' || + *format == '+' || + *format == '-' || + *format == ' ' || + *format == '*' || + *format == '#') + { + if (*format == '*') + { + p += sprintfW( p, fmt_lu, get_arg( insert, flags, args )); + insert = -1; + format++; + } + else *p++ = *format++; + } + while (isdigitW(*format)) *p++ = *format++; + + if (*format == '.') + { + *p++ = *format++; + if (*format == '*') + { + p += sprintfW( p, fmt_lu, get_arg( insert, flags, args )); + insert = -1; + format++; + } + else + while (isdigitW(*format)) *p++ = *format++; + } + + /* replicate MS bug: drop an argument when using va_list with width/precision */ + if (insert == -1 && args->list) args->last--; + arg = get_arg( insert, flags, args ); + + /* check for ascii string format */ + if ((format[0] == 'h' && format[1] == 's') || + (format[0] == 'h' && format[1] == 'S') || + (format[0] == 'S')) + { + DWORD len = MultiByteToWideChar( CP_ACP, 0, (char *)arg, -1, /*FIXME*/ NULL, 0 ); + wstring = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, (char *)arg, -1, wstring, len ); + arg = (ULONG_PTR)wstring; + *p++ = 's'; + } + /* check for ascii character format */ + else if ((format[0] == 'h' && format[1] == 'c') || + (format[0] == 'h' && format[1] == 'C') || + (format[0] == 'C')) + { + char ch = arg; + wstring = HeapAlloc( GetProcessHeap(), 0, 2 * sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, &ch, 1, wstring, 1 ); + wstring[1] = 0; + arg = (ULONG_PTR)wstring; + *p++ = 's'; + } + /* check for wide string format */ + else if ((format[0] == 'l' && format[1] == 's') || + (format[0] == 'l' && format[1] == 'S') || + (format[0] == 'w' && format[1] == 's')) + { + *p++ = 's'; + } + /* check for wide character format */ + else if ((format[0] == 'l' && format[1] == 'c') || + (format[0] == 'l' && format[1] == 'C') || + (format[0] == 'w' && format[1] == 'c')) + { + *p++ = 'c'; + } + /* FIXME: handle I64 etc. */ + else while (*format && *format != '!') *p++ = *format++; + + *p = 0; + size = 256; + for (;;) + { + WCHAR *ret = HeapAlloc( GetProcessHeap(), 0, size * sizeof(WCHAR) ); + int needed = snprintfW( ret, size, fmt, arg ); + if (needed == -1 || needed >= size) + { + HeapFree( GetProcessHeap(), 0, ret ); + size = max( needed + 1, size * 2 ); + } + else + { + *result = ret; + break; + } + } + + while (*format && *format != '!') format++; + if (*format == '!') format++; + + HeapFree( GetProcessHeap(), 0, wstring ); + return format; +} + + +/*********************************************************************** + * FormatMessageA (KERNEL32.@) + * FIXME: missing wrap, + */ +DWORD WINAPI FormatMessageA( + DWORD dwFlags, + LPCVOID lpSource, + DWORD dwMessageId, + DWORD dwLanguageId, + LPSTR lpBuffer, + DWORD nSize, + __ms_va_list* args ) +{ + struct format_args format_args; + DWORD ret = 0; + LPSTR target,t; + DWORD talloced; + LPSTR from; + LPCSTR f; + DWORD width = dwFlags & FORMAT_MESSAGE_MAX_WIDTH_MASK; + BOOL eos = FALSE; + CHAR ch; + HMODULE kernel32_handle = GetModuleHandleW(kernel32W); + + DPRINT("(0x%x,%p,%d,0x%x,%p,%d,%p)\n", + dwFlags,lpSource,dwMessageId,dwLanguageId,lpBuffer,nSize,args); + if ((dwFlags & FORMAT_MESSAGE_FROM_STRING) + &&((dwFlags & FORMAT_MESSAGE_FROM_SYSTEM) + || (dwFlags & FORMAT_MESSAGE_FROM_HMODULE))) return 0; + + if (!lpBuffer) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return 0; + } + + if (dwFlags & FORMAT_MESSAGE_ARGUMENT_ARRAY) + { + format_args.args = (ULONG_PTR *)args; + format_args.list = NULL; + format_args.last = 0; + } + else + { + format_args.args = NULL; + format_args.list = args; + format_args.last = 0; + } + + if (width && width != FORMAT_MESSAGE_MAX_WIDTH_MASK) + DPRINT1("FIXME: line wrapping (%u) not supported.\n", width); + from = NULL; + if (dwFlags & FORMAT_MESSAGE_FROM_STRING) + { + from = HeapAlloc( GetProcessHeap(), 0, strlen(lpSource) + 1 ); + strcpy( from, lpSource ); + } + else { + from = NULL; + if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE) + from = load_messageA( (HMODULE)lpSource, dwMessageId, dwLanguageId ); + if (!from && (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM)) + from = load_messageA( kernel32_handle, dwMessageId, dwLanguageId ); + if (!from) return 0; + } + target = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 100); + t = target; + talloced= 100; + +#define ADD_TO_T(c) do { \ + *t++=c;\ + if ((DWORD)(t-target) == talloced) {\ + target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,talloced*2);\ + t = target+talloced;\ + talloced*=2;\ + }\ +} while (0) + + if (from) { + f=from; + if (dwFlags & FORMAT_MESSAGE_IGNORE_INSERTS) { + while (*f && !eos) + ADD_TO_T(*f++); + } + else { + while (*f && !eos) { + if (*f=='%') { + int insertnr; + char *str,*x; + + f++; + if (!*f) { + ADD_TO_T('%'); + continue; + } + switch (*f) { + case '1':case '2':case '3':case '4':case '5': + case '6':case '7':case '8':case '9': + insertnr=*f-'0'; + switch (f[1]) { + case '0':case '1':case '2':case '3': + case '4':case '5':case '6':case '7': + case '8':case '9': + f++; + insertnr=insertnr*10+*f-'0'; + f++; + break; + default: + f++; + break; + } + f = format_insertA( insertnr, f, dwFlags, &format_args, &str ); + for (x = str; *x; x++) ADD_TO_T(*x); + HeapFree( GetProcessHeap(), 0, str ); + break; + case 'n': + ADD_TO_T('\r'); + ADD_TO_T('\n'); + f++; + break; + case '0': + eos = TRUE; + f++; + break; + default: + ADD_TO_T(*f++); + break; + } + } else { + ch = *f; + f++; + if (ch == '\r') { + if (*f == '\n') + f++; + if(width) + ADD_TO_T(' '); + else + { + ADD_TO_T('\r'); + ADD_TO_T('\n'); + } + } else { + if (ch == '\n') + { + if(width) + ADD_TO_T(' '); + else + { + ADD_TO_T('\r'); + ADD_TO_T('\n'); + } + } + else + ADD_TO_T(ch); + } + } + } + } + *t='\0'; + } + talloced = strlen(target)+1; + if (nSize && talloced<nSize) { + target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize); + } + DPRINT("-- %S\n", target); + if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) { + *((LPVOID*)lpBuffer) = LocalAlloc(LMEM_ZEROINIT,max(nSize, talloced)); + memcpy(*(LPSTR*)lpBuffer,target,talloced); + } else { + lstrcpynA(lpBuffer,target,nSize); + } + HeapFree(GetProcessHeap(),0,target); + HeapFree(GetProcessHeap(),0,from); + if (!(dwFlags & FORMAT_MESSAGE_ARGUMENT_ARRAY)) HeapFree( GetProcessHeap(), 0, format_args.args ); + ret = (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ? strlen(*(LPSTR*)lpBuffer) : strlen(lpBuffer); + DPRINT("-- returning %d\n", ret); + return ret; +} +#undef ADD_TO_T + + +/*********************************************************************** + * FormatMessageW (KERNEL32.@) + */ +DWORD WINAPI FormatMessageW( + DWORD dwFlags, + LPCVOID lpSource, + DWORD dwMessageId, + DWORD dwLanguageId, + LPWSTR lpBuffer, + DWORD nSize, + __ms_va_list* args ) +{ + struct format_args format_args; + LPWSTR target,t; + DWORD talloced; + LPWSTR from; + LPCWSTR f; + DWORD width = dwFlags & FORMAT_MESSAGE_MAX_WIDTH_MASK; + BOOL eos = FALSE; + WCHAR ch; + HMODULE kernel32_handle = GetModuleHandleW(kernel32W); + + DPRINT("(0x%x,%p,%d,0x%x,%p,%d,%p)\n", + dwFlags,lpSource,dwMessageId,dwLanguageId,lpBuffer,nSize,args); + if ((dwFlags & FORMAT_MESSAGE_FROM_STRING) + &&((dwFlags & FORMAT_MESSAGE_FROM_SYSTEM) + || (dwFlags & FORMAT_MESSAGE_FROM_HMODULE))) return 0; + + if (!lpBuffer) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + if (dwFlags & FORMAT_MESSAGE_ARGUMENT_ARRAY) + { + format_args.args = (ULONG_PTR *)args; + format_args.list = NULL; + format_args.last = 0; + } + else + { + format_args.args = NULL; + format_args.list = args; + format_args.last = 0; + } + + if (width && width != FORMAT_MESSAGE_MAX_WIDTH_MASK) + DPRINT1("FIXME: line wrapping not supported.\n"); + from = NULL; + if (dwFlags & FORMAT_MESSAGE_FROM_STRING) { + from = HeapAlloc( GetProcessHeap(), 0, (strlenW(lpSource) + 1) * + sizeof(WCHAR) ); + strcpyW( from, lpSource ); + } + else { + from = NULL; + if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE) + from = load_messageW( (HMODULE)lpSource, dwMessageId, dwLanguageId ); + if (!from && (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM)) + from = load_messageW( kernel32_handle, dwMessageId, dwLanguageId ); + if (!from) return 0; + } + target = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 100 * sizeof(WCHAR) ); + t = target; + talloced= 100; + +#define ADD_TO_T(c) do {\ + *t++=c;\ + if ((DWORD)(t-target) == talloced) {\ + target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,talloced*2*sizeof(WCHAR));\ + t = target+talloced;\ + talloced*=2;\ + } \ +} while (0) + + if (from) { + f=from; + if (dwFlags & FORMAT_MESSAGE_IGNORE_INSERTS) { + while (*f && !eos) + ADD_TO_T(*f++); + } + else { + while (*f && !eos) { + if (*f=='%') { + int insertnr; + WCHAR *str,*x; + + f++; + if (!*f) { + ADD_TO_T('%'); + continue; + } + + switch (*f) { + case '1':case '2':case '3':case '4':case '5': + case '6':case '7':case '8':case '9': + insertnr=*f-'0'; + switch (f[1]) { + case '0':case '1':case '2':case '3': + case '4':case '5':case '6':case '7': + case '8':case '9': + f++; + insertnr=insertnr*10+*f-'0'; + f++; + break; + default: + f++; + break; + } + f = format_insertW( insertnr, f, dwFlags, &format_args, &str ); + for (x = str; *x; x++) ADD_TO_T(*x); + HeapFree( GetProcessHeap(), 0, str ); + break; + case 'n': + ADD_TO_T('\r'); + ADD_TO_T('\n'); + f++; + break; + case '0': + eos = TRUE; + f++; + break; + default: + ADD_TO_T(*f++); + break; + } + } else { + ch = *f; + f++; + if (ch == '\r') { + if (*f == '\n') + f++; + if(width) + ADD_TO_T(' '); + else + { + ADD_TO_T('\r'); + ADD_TO_T('\n'); + } + } else { + if (ch == '\n') + { + if(width) + ADD_TO_T(' '); + else + { + ADD_TO_T('\r'); + ADD_TO_T('\n'); + } + } + else + ADD_TO_T(ch); + } + } + } + } + *t='\0'; + } + talloced = strlenW(target)+1; + if (nSize && talloced<nSize) + target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize*sizeof(WCHAR)); + if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) { + /* nSize is the MINIMUM size */ + DWORD len = strlenW(target) + 1; + *((LPVOID*)lpBuffer) = LocalAlloc(LMEM_ZEROINIT,len*sizeof(WCHAR)); + strcpyW(*(LPWSTR*)lpBuffer, target); + } + else lstrcpynW(lpBuffer, target, nSize); + + HeapFree(GetProcessHeap(),0,target); + HeapFree(GetProcessHeap(),0,from); + if (!(dwFlags & FORMAT_MESSAGE_ARGUMENT_ARRAY)) HeapFree( GetProcessHeap(), 0, format_args.args ); + DPRINT("ret=%S\n", (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ? + *(LPWSTR*)lpBuffer : lpBuffer); + return (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ? + strlenW(*(LPWSTR*)lpBuffer): + strlenW(lpBuffer); +} +#undef ADD_TO_T Propchange: trunk/reactos/dll/win32/kernel32/misc/format_msg.c ------------------------------------------------------------------------------ svn:eol-style = native
15 years
1
0
0
0
[sserapion] 44385: Fix midimap build.
by sserapion@svn.reactos.org
Author: sserapion Date: Thu Dec 3 19:46:04 2009 New Revision: 44385 URL:
http://svn.reactos.org/svn/reactos?rev=44385&view=rev
Log: Fix midimap build. Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/midimap/midimap.c Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/midimap/midimap.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/w…
============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/midimap/midimap.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/midimap/midimap.c [iso-8859-1] Thu Dec 3 19:46:04 2009 @@ -270,7 +270,7 @@ if (MIDIMAP_LoadSettings(mom)) { - *lpdwUser = (DWORD)mom; + *lpdwUser = (DWORD_PTR)mom; mom->self = mom; return MMSYSERR_NOERROR; @@ -451,8 +451,8 @@ /************************************************************************** * modMessage (MIDIMAP.@) */ -DWORD WINAPI MIDIMAP_modMessage(UINT wDevID, UINT wMsg, DWORD dwUser, - DWORD dwParam1, DWORD dwParam2) +DWORD WINAPI MIDIMAP_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, + DWORD_PTR dwParam1, DWORD_PTR dwParam2) { TRACE("(%u, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); @@ -541,8 +541,8 @@ /************************************************************************** * DriverProc (MIDIMAP.@) */ -LONG CALLBACK MIDIMAP_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, - DWORD dwParam1, DWORD dwParam2) +LRESULT CALLBACK MIDIMAP_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, + LPARAM dwParam1, LPARAM dwParam2) { /* EPP TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", */ /* EPP dwDevID, hDriv, wMsg, dwParam1, dwParam2); */
15 years
1
0
0
0
[dgorbachev] 44384: SndRec32 patch by Marco Pagliaricci, bug #4978.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Thu Dec 3 19:44:27 2009 New Revision: 44384 URL:
http://svn.reactos.org/svn/reactos?rev=44384&view=rev
Log: SndRec32 patch by Marco Pagliaricci, bug #4978. Added: trunk/reactos/base/applications/sndrec32/audio_api.hpp (with props) Modified: trunk/reactos/base/applications/sndrec32/audio_def.hpp trunk/reactos/base/applications/sndrec32/audio_format.hpp trunk/reactos/base/applications/sndrec32/audio_membuffer.cpp trunk/reactos/base/applications/sndrec32/audio_producer.cpp trunk/reactos/base/applications/sndrec32/audio_resampler_acm.cpp trunk/reactos/base/applications/sndrec32/audio_waveout.cpp trunk/reactos/base/applications/sndrec32/resource.h trunk/reactos/base/applications/sndrec32/sndrec32.cpp trunk/reactos/base/applications/sndrec32/sndrec32.h trunk/reactos/base/applications/sndrec32/sndrec32.rc trunk/reactos/base/applications/sndrec32/stdafx.h Added: trunk/reactos/base/applications/sndrec32/audio_api.hpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
============================================================================== --- trunk/reactos/base/applications/sndrec32/audio_api.hpp (added) +++ trunk/reactos/base/applications/sndrec32/audio_api.hpp [iso-8859-1] Thu Dec 3 19:44:27 2009 @@ -1,0 +1,15 @@ +#ifndef __AUDIO_API__ +#define __AUDIO_API__ + +#include "audio_def.hpp" + +#include "audio_format.hpp" +#include "audio_membuffer.hpp" +#include "audio_producer.hpp" +#include "audio_receiver.hpp" +#include "audio_resampler_acm.hpp" +#include "audio_wavein.hpp" +#include "audio_waveout.hpp" + + +#endif Propchange: trunk/reactos/base/applications/sndrec32/audio_api.hpp ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/sndrec32/audio_def.hpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
============================================================================== --- trunk/reactos/base/applications/sndrec32/audio_def.hpp [iso-8859-1] (original) +++ trunk/reactos/base/applications/sndrec32/audio_def.hpp [iso-8859-1] Thu Dec 3 19:44:27 2009 @@ -9,10 +9,13 @@ // #define _AUDIO_DEFAULT_FORMAT A44100_16BIT_STEREO + #define _AUDIO_DEFAULT_WAVEINBUFFERS 8 #define _AUDIO_DEFAULT_WAVEINBUFSECS 0.1f -#define _AUDIO_DEFAULT_WAVEOUTBUFFERS 8 -#define _AUDIO_DEFAULT_WAVEOUTBUFSECS 0.1f + +#define _AUDIO_DEFAULT_WAVEOUTBUFFERS 2 +#define _AUDIO_DEFAULT_WAVEOUTBUFSECS 1.0f + #define _AUDIO_DEFAULT_BUFSECS 1.0f @@ -29,6 +32,9 @@ #include <windows.h> #include <mmsystem.h> //Windows MultiMedia (WINMM) audio apis #include <mmreg.h> //codecs stuff -#include <Msacm.h> //codecs stuff +#include <msacm.h> //codecs stuff + +//#pragma comment(lib, "winmm.lib") +//#pragma comment(lib, "msacm32.lib") #endif //ifdef _AUDIO_DEF__H_ Modified: trunk/reactos/base/applications/sndrec32/audio_format.hpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
============================================================================== --- trunk/reactos/base/applications/sndrec32/audio_format.hpp [iso-8859-1] (original) +++ trunk/reactos/base/applications/sndrec32/audio_format.hpp [iso-8859-1] Thu Dec 3 19:44:27 2009 @@ -122,6 +122,13 @@ } + unsigned int bytes_in_samples( unsigned int samples ) const + { + + return (( samples * ( bits_psample / 8 )) * chan ); + + } + }; Modified: trunk/reactos/base/applications/sndrec32/audio_membuffer.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
============================================================================== --- trunk/reactos/base/applications/sndrec32/audio_membuffer.cpp [iso-8859-1] (original) +++ trunk/reactos/base/applications/sndrec32/audio_membuffer.cpp [iso-8859-1] Thu Dec 3 19:44:27 2009 @@ -12,6 +12,13 @@ _AUDIO_NAMESPACE_START_ + + +////////////////////////////////////// +/////// Protected Functions ///////// +////////////////////////////////////// + + void audio_membuffer::alloc_mem_( unsigned int bytes ) { Modified: trunk/reactos/base/applications/sndrec32/audio_producer.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
============================================================================== --- trunk/reactos/base/applications/sndrec32/audio_producer.cpp [iso-8859-1] (original) +++ trunk/reactos/base/applications/sndrec32/audio_producer.cpp [iso-8859-1] Thu Dec 3 19:44:27 2009 @@ -6,7 +6,6 @@ * PROGRAMMERS: Marco Pagliaricci <ms_blue (at) hotmail (dot) it> */ - -#include "StdAfx.h" +#include "stdafx.h" #include "audio_producer.hpp" Modified: trunk/reactos/base/applications/sndrec32/audio_resampler_acm.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
============================================================================== --- trunk/reactos/base/applications/sndrec32/audio_resampler_acm.cpp [iso-8859-1] (original) +++ trunk/reactos/base/applications/sndrec32/audio_resampler_acm.cpp [iso-8859-1] Thu Dec 3 19:44:27 2009 @@ -108,7 +108,7 @@ if ( err != MMSYSERR_NOERROR ) { //TODO: throw error - printf("acmOpen error: %i\n", err); + MessageBox( 0, _T("acmOpen error: %i"), _T("ERROR"), MB_ICONERROR ); } @@ -138,7 +138,8 @@ if ( err != MMSYSERR_NOERROR ) { //TODO: throw error - printf("acmSize error\n"); + MessageBox( 0, _T("acmStreamSize error"), _T("ERROR"), MB_ICONERROR ); + } @@ -178,7 +179,9 @@ if ( err != MMSYSERR_NOERROR ) { //TODO: throw error - printf("prep. header error\n"); + MessageBox( 0, _T("acmStreamPrepareHeader error"), _T("ERROR"), MB_ICONERROR ); + + } @@ -243,6 +246,8 @@ //TODO: throw error + MessageBox( 0, _T("acmStreamUnPrepareHeader error"), _T("ERROR"), MB_ICONERROR ); + } } @@ -280,6 +285,9 @@ //TODO: throw error! + + MessageBox( 0, _T("acmStreamClose error"), _T("ERROR"), MB_ICONERROR ); + } @@ -357,7 +365,8 @@ if ( err != MMSYSERR_NOERROR ) { //TODO: throw error - printf("acm convert error\n"); + MessageBox( 0, _T("acmStreamConvert error"), _T("ERROR"), MB_ICONERROR ); + } @@ -369,7 +378,7 @@ while(( ACMSTREAMHEADER_STATUSF_DONE & acm_header.fdwStatus ) == 0 ); - printf("Processed successfully %lu bytes of audio.\n", acm_header.cbDstLengthUsed ); + //printf("Processed successfully %i bytes of audio.\n", acm_header.cbDstLengthUsed ); Modified: trunk/reactos/base/applications/sndrec32/audio_waveout.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
============================================================================== --- trunk/reactos/base/applications/sndrec32/audio_waveout.cpp [iso-8859-1] (original) +++ trunk/reactos/base/applications/sndrec32/audio_waveout.cpp [iso-8859-1] Thu Dec 3 19:44:27 2009 @@ -531,7 +531,7 @@ // Reads the audio from the start. // - audio_buf.set_position_start(); + //audio_buf.set_position_start(); @@ -643,7 +643,7 @@ if ( err != MMSYSERR_NOERROR ) { - MessageBox(0, _T("err waveout reset.\n"),_T("ERROR"), 0); + MessageBox(0, _T("err WaveOutReset.\n"),_T("ERROR"), 0); //TODO: throw error } Modified: trunk/reactos/base/applications/sndrec32/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
============================================================================== --- trunk/reactos/base/applications/sndrec32/resource.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/sndrec32/resource.h [iso-8859-1] Thu Dec 3 19:44:27 2009 @@ -3,12 +3,14 @@ // Used by reactOS_sndrec32.rc // #define IDC_MYICON 2 +#define IDB_BITMAP2_STOP_DIS 8 #define IDD_REACTOS_SNDREC32_DIALOG 102 #define IDS_APP_TITLE 103 #define IDD_ABOUTBOX 103 #define IDM_ABOUT 104 #define IDI_REACTOS_SNDREC32 107 #define IDI_REACTOS_SNDREC32LL 107 +#define IDI_SNDREC32 107 #define IDI_SMALL 108 #define IDC_REACTOS_SNDREC32 109 #define IDR_MAINFRAME 128 @@ -21,6 +23,11 @@ #define IDB_BITMAP2_REC 137 #define IDI_ICON1 138 #define IDR_MENU1 139 +#define IDI_ICON2 140 +#define IDB_BITMAP2_END_DIS 141 +#define IDB_BITMAP2_PLAY_DIS 142 +#define IDB_BITMAP2_REC_DIS 143 +#define IDB_BITMAP2_START_DIS 144 #define ID_FILE_NEW 32771 #define ID_FILE_OPEN 32772 #define ID_FILE_SAVE 32773 @@ -36,7 +43,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 -#define _APS_NEXT_RESOURCE_VALUE 140 +#define _APS_NEXT_RESOURCE_VALUE 145 #define _APS_NEXT_COMMAND_VALUE 32779 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 110 Modified: trunk/reactos/base/applications/sndrec32/sndrec32.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
============================================================================== --- trunk/reactos/base/applications/sndrec32/sndrec32.cpp [iso-8859-1] (original) +++ trunk/reactos/base/applications/sndrec32/sndrec32.cpp [iso-8859-1] Thu Dec 3 19:44:27 2009 @@ -11,8 +11,10 @@ #include "stdafx.h" #include "sndrec32.h" -#include "kkaudio.hpp" - + + + +//#pragma comment(lib, "comctl32.lib") HINSTANCE hInst; @@ -31,6 +33,7 @@ HWND slider; HWND buttons[5]; HBITMAP butbmps[5]; +HBITMAP butbmps_dis[5]; WNDPROC buttons_std_proc; BOOL butdisabled[5]; @@ -42,19 +45,15 @@ WORD slider_min; WORD slider_max; -long long samples_max; +DWORD samples_max; OPENFILENAME ofn; TCHAR file_path[MAX_PATH]; BOOL path_set; -using snd::audio_membuffer; -using snd::audio_wavein; -using snd::audio_waveout; - -audio_membuffer * AUD_BUF; -audio_waveout * AUD_OUT; -audio_wavein * AUD_IN; +snd::audio_membuffer * AUD_BUF; +snd::audio_waveout * AUD_OUT; +snd::audio_wavein * AUD_IN; BOOL s_recording; @@ -88,9 +87,11 @@ butbmps[3] = LoadBitmap( hInstance, MAKEINTRESOURCE( IDB_BITMAP2_STOP )); butbmps[4] = LoadBitmap( hInstance, MAKEINTRESOURCE( IDB_BITMAP2_REC )); - - - + butbmps_dis[0] = LoadBitmap( hInstance, MAKEINTRESOURCE( IDB_BITMAP2_START_DIS )); + butbmps_dis[1] = LoadBitmap( hInstance, MAKEINTRESOURCE( IDB_BITMAP2_END_DIS )); + butbmps_dis[2] = LoadBitmap( hInstance, MAKEINTRESOURCE( IDB_BITMAP2_PLAY_DIS )); + butbmps_dis[3] = LoadBitmap( hInstance, MAKEINTRESOURCE( IDB_BITMAP2_STOP_DIS )); + butbmps_dis[4] = LoadBitmap( hInstance, MAKEINTRESOURCE( IDB_BITMAP2_REC_DIS )); snd::audio_membuffer AUD_buffer( snd::A44100_16BIT_STEREO ); @@ -123,10 +124,16 @@ samples_max = AUD_buffer.total_samples(); - - - LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); - LoadString(hInstance, IDC_REACTOS_SNDREC32, szWindowClass, MAX_LOADSTRING); + LoadString(hInstance, + IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + + + + LoadString(hInstance, + IDC_REACTOS_SNDREC32, szWindowClass, MAX_LOADSTRING); + + + MyRegisterClass(hInstance); @@ -136,7 +143,8 @@ return FALSE; } - hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_REACTOS_SNDREC32)); + hAccelTable = LoadAccelerators(hInstance, + MAKEINTRESOURCE( IDC_REACTOS_SNDREC32 )); @@ -188,12 +196,12 @@ wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; wcex.hInstance = hInstance; - wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_REACTOS_SNDREC32LL)); + wcex.hIcon = LoadIcon( hInstance, MAKEINTRESOURCE( IDI_SNDREC32 )); wcex.hCursor = LoadCursor(NULL, IDC_ARROW); wcex.hbrBackground = (HBRUSH)(16); wcex.lpszMenuName = MAKEINTRESOURCE(IDR_MENU1); wcex.lpszClassName = szWindowClass; - wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_REACTOS_SNDREC32LL)); + wcex.hIconSm = LoadIcon( wcex.hInstance, MAKEINTRESOURCE( IDI_SNDREC32 )); return RegisterClassEx(&wcex); @@ -284,9 +292,6 @@ } - butdisabled[ i ] = TRUE; - - // // Realize the button bmp image @@ -294,8 +299,9 @@ SendMessage(buttons[i], BM_SETIMAGE, ( WPARAM )IMAGE_BITMAP, ( LPARAM )butbmps[i]); - UpdateWindow( buttons[i] ); + + disable_but( i ); } @@ -325,8 +331,6 @@ // Sets slider limits // - //slider_min = 0; - //slider_max = 100; SendMessage( slider, @@ -338,12 +342,9 @@ UpdateWindow( slider ); - - // - // Enables REC button. - // - - butdisabled[ BUTREC_ID ] = FALSE; + enable_but( BUTREC_ID ); + + EnableWindow( slider, FALSE ); @@ -367,7 +368,24 @@ case SB_PAGERIGHT: case SB_PAGELEFT: case TB_THUMBTRACK: + + + // + // If the user touch the slider bar, + // set the audio start position properly + // + + slider_pos = SendMessage(slider, TBM_GETPOS, 0, 0); + + + AUD_BUF->set_position( + AUD_BUF->audinfo().bytes_in_samples( + (( slider_pos * samples_max ) / slider_max ) + ) + ); + + break; } @@ -407,16 +425,26 @@ AUD_BUF->reset(); - butdisabled[ BUTREC_ID ] = FALSE; - butdisabled[ BUTSTART_ID ] = TRUE; - butdisabled[ BUTEND_ID ] = TRUE; - butdisabled[ BUTSTOP_ID ] = TRUE; - butdisabled[ BUTPLAY_ID ] = TRUE; + enable_but( BUTREC_ID ); + disable_but( BUTSTART_ID ); + disable_but( BUTEND_ID ); + disable_but( BUTSTOP_ID ); + disable_but( BUTPLAY_ID ); + samples_max = AUD_BUF->total_samples(); slider_pos = 0; SendMessage(slider, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) slider_pos); + + EnableMenuItem( GetMenu( hWnd ), ID_FILE_SAVEAS, MF_GRAYED ); + EnableMenuItem( GetMenu( hWnd ), ID_FILE_SAVE, MF_GRAYED ); + + isnew = TRUE; + + ZeroMemory( file_path, MAX_PATH ); + + EnableWindow( slider, FALSE ); } @@ -442,6 +470,11 @@ if( GetOpenFileName( &ofn )) { open_wav( file_path ); + EnableMenuItem( GetMenu( hWnd ), ID_FILE_SAVE, MF_ENABLED ); + EnableMenuItem( GetMenu( hWnd ), ID_FILE_SAVEAS, MF_ENABLED ); + + EnableWindow( slider, TRUE ); + } break; @@ -471,9 +504,9 @@ if ( GetSaveFileName ( &ofn )) { - write_wav( file_path ); + EnableMenuItem( GetMenu( hWnd ), ID_FILE_SAVE, MF_ENABLED ); } break; @@ -488,22 +521,29 @@ // case BUTSTART_ID: - Beep(200,200); + + AUD_BUF->set_position_start(); + + slider_pos = 0; + + SendMessage( slider, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) slider_pos ); + break; case BUTEND_ID: - Beep(300,200); + //Beep(300,200); break; case BUTPLAY_ID: AUD_OUT->play(); - butdisabled[ BUTSTART_ID ] = TRUE; - butdisabled[ BUTEND_ID ] = TRUE; - butdisabled[ BUTREC_ID ] = TRUE; - butdisabled[ BUTPLAY_ID ] = TRUE; + disable_but( BUTSTART_ID ); + disable_but( BUTEND_ID ); + disable_but( BUTREC_ID ); + disable_but( BUTPLAY_ID ); + SetTimer( hWnd, 1, 250, 0 ); @@ -516,11 +556,6 @@ AUD_IN->stop_recording(); - butdisabled[ BUTSTART_ID ] = FALSE; - butdisabled[ BUTEND_ID ] = FALSE; - butdisabled[ BUTREC_ID ] = FALSE; - butdisabled[ BUTPLAY_ID ] = FALSE; - // @@ -535,14 +570,25 @@ EnableMenuItem((HMENU)IDR_MENU1, ID_FILE_SAVEAS, MF_ENABLED ); + + enable_but( BUTSTART_ID ); + enable_but( BUTEND_ID ); + enable_but( BUTREC_ID ); + enable_but( BUTPLAY_ID ); + + EnableMenuItem( GetMenu( hWnd ), ID_FILE_SAVEAS, MF_ENABLED ); + EnableWindow( slider, TRUE ); + + + } else { AUD_OUT->pause(); - butdisabled[ BUTSTART_ID ] = FALSE; - butdisabled[ BUTEND_ID ] = FALSE; - butdisabled[ BUTREC_ID ] = FALSE; - butdisabled[ BUTPLAY_ID ] = FALSE; + enable_but( BUTSTART_ID ); + enable_but( BUTEND_ID ); + enable_but( BUTREC_ID ); + enable_but( BUTPLAY_ID ); } @@ -558,15 +604,16 @@ AUD_IN->start_recording(); - butdisabled[ BUTSTOP_ID ] = FALSE; - butdisabled[ BUTSTART_ID ] = TRUE; - butdisabled[ BUTEND_ID ] = TRUE; - butdisabled[ BUTREC_ID ] = TRUE; - butdisabled[ BUTPLAY_ID ] = TRUE; - - isnew = FALSE; - - + enable_but( BUTSTOP_ID ); + + disable_but( BUTSTART_ID ); + disable_but( BUTEND_ID ); + disable_but( BUTREC_ID ); + disable_but( BUTPLAY_ID ); + + isnew = FALSE; + + EnableWindow( slider, FALSE ); SetTimer( hWnd, 1, 150, 0 ); @@ -586,7 +633,7 @@ KillTimer(hWnd, 1); slider_pos = 0; - butdisabled[ BUTPLAY_ID ] = FALSE; + enable_but( BUTPLAY_ID ); stopped_flag = FALSE; } @@ -613,6 +660,61 @@ return DefWindowProc(hWnd, message, wParam, lParam); } return 0; +} + + + + + +void l_play_finished ( void ) +{ + + stopped_flag = true; + + + enable_but( BUTSTART_ID ); + enable_but( BUTEND_ID ); + enable_but( BUTREC_ID ); + enable_but( BUTPLAY_ID ); + + + +} + +void l_audio_arrival ( unsigned int samples_arrival ) +{ + + + slider_pos += (DWORD) (( slider_max * samples_arrival ) / samples_max ); + + +} + +void l_buffer_resized ( unsigned int new_size ) +{ + + + + + +} + +VOID enable_but( DWORD id ) +{ + + butdisabled[ id ] = FALSE; + + SendMessage(buttons[ id ], BM_SETIMAGE, ( WPARAM )IMAGE_BITMAP, ( LPARAM )butbmps[ id ]); + + +} +VOID disable_but( DWORD id ) +{ + + butdisabled[ id ] = TRUE; + + SendMessage(buttons[ id ], BM_SETIMAGE, ( WPARAM )IMAGE_BITMAP, ( LPARAM )butbmps_dis[ id ]); + } @@ -663,14 +765,9 @@ if ( !b ) { - DWORD t = GetLastError(); - TCHAR p[100]; - wsprintf(p,TEXT("Errore n: %i"),t); - MessageBox( main_win, - //TEXT("Cannot read RIFF header."), - p, + TEXT("Cannot read RIFF header."), TEXT("ERROR"), MB_OK|MB_ICONERROR ); @@ -721,25 +818,8 @@ bytes_recorded_in_wav = r.chunksize - 36; - /* - unsigned char * gg = (unsigned char*)&bytes_recorded_in_wav; - - gg[0] = gg[3]; - gg[1] = gg[2]; - - bytes_recorded_in_wav = (DWORD) *gg; - - - - TCHAR p [100]; - wsprintf(p,TEXT("bytes: %i"),bytes_recorded_in_wav); - MessageBox(0,p,0,0); - - */ - if ( bytes_recorded_in_wav == 0 ) { - MessageBox( main_win, TEXT("Cannot read file. No audio data."), @@ -795,12 +875,11 @@ CloseHandle( file ); - butdisabled[ BUTPLAY_ID ] = FALSE; - butdisabled[ BUTSTOP_ID ] = FALSE; - butdisabled[ BUTEND_ID ] = FALSE; - butdisabled[ BUTSTART_ID ] = FALSE; - butdisabled[ BUTREC_ID ] = FALSE; - + enable_but( BUTPLAY_ID ); + enable_but( BUTSTOP_ID ); + enable_but( BUTSTART_ID ); + enable_but( BUTEND_ID ); + enable_but( BUTREC_ID ); samples_max = AUD_BUF->samples_received(); @@ -994,49 +1073,3 @@ return TRUE; } - - - -void l_play_finished ( void ) -{ - - stopped_flag = true; - - - -} - -void l_audio_arrival ( unsigned int samples_arrival ) -{ - - - slider_pos += (DWORD) (( slider_max * samples_arrival ) / samples_max ); - - -} - -void l_buffer_resized ( unsigned int new_size ) -{ - - - - - -} - -VOID enable_but( DWORD id ) -{ - - - - - -} -VOID disable_but( DWORD id ) -{ - - - -} - - Modified: trunk/reactos/base/applications/sndrec32/sndrec32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
============================================================================== --- trunk/reactos/base/applications/sndrec32/sndrec32.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/sndrec32/sndrec32.h [iso-8859-1] Thu Dec 3 19:44:27 2009 @@ -1,6 +1,7 @@ #pragma once #include "resource.h" +#include "audio_api.hpp" Modified: trunk/reactos/base/applications/sndrec32/sndrec32.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
============================================================================== --- trunk/reactos/base/applications/sndrec32/sndrec32.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/sndrec32/sndrec32.rc [iso-8859-1] Thu Dec 3 19:44:27 2009 @@ -33,8 +33,7 @@ // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_REACTOS_SNDREC32LL ICON "reactOS_sndrec32.ico" -IDI_SMALL ICON "small.ico" +IDI_SNDREC32 ICON "reactOS_sndrec32.ico" ///////////////////////////////////////////////////////////////////////////// // @@ -125,6 +124,11 @@ IDB_BITMAP2_PLAY BITMAP "but_play.bmp" IDB_BITMAP2_STOP BITMAP "but_stop.bmp" IDB_BITMAP2_REC BITMAP "but_rec.bmp" +IDB_BITMAP2_END_DIS BITMAP "but_end_dis.bmp" +IDB_BITMAP2_PLAY_DIS BITMAP "but_play_dis.bmp" +IDB_BITMAP2_REC_DIS BITMAP "but_rec_dis.bmp" +IDB_BITMAP2_START_DIS BITMAP "but_start_dis.bmp" +IDB_BITMAP2_STOP_DIS BITMAP "but_stop_dis.bmp" ///////////////////////////////////////////////////////////////////////////// // @@ -138,7 +142,7 @@ MENUITEM "New", ID_NEW MENUITEM "Open...", ID_FILE_OPEN MENUITEM "Save", ID_FILE_SAVE, GRAYED - MENUITEM "Save As...", ID_FILE_SAVEAS + MENUITEM "Save As...", ID_FILE_SAVEAS, GRAYED MENUITEM SEPARATOR MENUITEM "Exit", ID_EXIT END Modified: trunk/reactos/base/applications/sndrec32/stdafx.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
============================================================================== --- trunk/reactos/base/applications/sndrec32/stdafx.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/sndrec32/stdafx.h [iso-8859-1] Thu Dec 3 19:44:27 2009 @@ -11,7 +11,7 @@ // File di intestazione di Windows: #include <windows.h> #include <commctrl.h> -#include <Commdlg.h> +#include <commdlg.h> // File di intestazione Runtime C #include <stdlib.h>
15 years
1
0
0
0
[gschneider] 44383: [kernel32] - Jerome Gardou <jerome DOT gardou AT laposte DOT net>: Implement missing ReplaceFileW functionality - Fixes six kernel32 file winetests, bug #4827
by gschneider@svn.reactos.org
Author: gschneider Date: Thu Dec 3 19:41:53 2009 New Revision: 44383 URL:
http://svn.reactos.org/svn/reactos?rev=44383&view=rev
Log: [kernel32] - Jerome Gardou <jerome DOT gardou AT laposte DOT net>: Implement missing ReplaceFileW functionality - Fixes six kernel32 file winetests, bug #4827 Modified: trunk/reactos/dll/win32/kernel32/file/file.c Modified: trunk/reactos/dll/win32/kernel32/file/file.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/fi…
============================================================================== --- trunk/reactos/dll/win32/kernel32/file/file.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/file/file.c [iso-8859-1] Thu Dec 3 19:41:53 2009 @@ -1905,13 +1905,14 @@ LPVOID lpReserved ) { - HANDLE hReplaced = NULL, hReplacement = NULL, hBackup = NULL; + HANDLE hReplaced = NULL, hReplacement = NULL; UNICODE_STRING NtReplacedName, NtReplacementName; DWORD Error = ERROR_SUCCESS; NTSTATUS Status; BOOL Ret = FALSE; IO_STATUS_BLOCK IoStatusBlock; OBJECT_ATTRIBUTES ObjectAttributes; + PVOID Buffer = NULL ; if (dwReplaceFlags) FIXME("Ignoring flags %x\n", dwReplaceFlags); @@ -1921,6 +1922,16 @@ { SetLastError(ERROR_INVALID_PARAMETER); return FALSE; + } + + /* Back it up */ + if(lpBackupFileName) + { + if(!CopyFileW(lpReplacedFileName, lpBackupFileName, FALSE)) + { + Error = GetLastError(); + goto Cleanup ; + } } /* Open the "replaced" file for reading and writing */ @@ -1937,7 +1948,7 @@ NULL); Status = NtOpenFile(&hReplaced, - GENERIC_READ | GENERIC_WRITE | DELETE | SYNCHRONIZE, + GENERIC_READ | GENERIC_WRITE | DELETE | SYNCHRONIZE | WRITE_DAC, &ObjectAttributes, &IoStatusBlock, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, @@ -1952,9 +1963,12 @@ goto Cleanup; } + /* Blank it */ + SetEndOfFile(hReplaced) ; + /* * Open the replacement file for reading, writing, and deleting - * (writing and deleting are needed when finished) + * (deleting is needed when finished) */ if (!(RtlDosPathNameToNtPathName_U(lpReplacementFileName, &NtReplacementName, NULL, NULL))) { @@ -1969,11 +1983,11 @@ NULL); Status = NtOpenFile(&hReplacement, - GENERIC_READ | GENERIC_WRITE | DELETE | WRITE_DAC | SYNCHRONIZE, + GENERIC_READ | DELETE | SYNCHRONIZE, &ObjectAttributes, &IoStatusBlock, 0, - FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE); + FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE | FILE_DELETE_ON_CLOSE); if (!NT_SUCCESS(Status)) { @@ -1981,15 +1995,39 @@ goto Cleanup; } - /* Not success :( */ - FIXME("ReplaceFileW not implemented, but it is returned TRUE!\n"); + Buffer = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, 0x10000) ; + if (!Buffer) + { + Error = ERROR_NOT_ENOUGH_MEMORY; + goto Cleanup ; + } + while (Status != STATUS_END_OF_FILE) + { + Status = NtReadFile(hReplacement, NULL, NULL, NULL, &IoStatusBlock, Buffer, 0x10000, NULL, NULL) ; + if (NT_SUCCESS(Status)) + { + Status = NtWriteFile(hReplaced, NULL, NULL, NULL, &IoStatusBlock, Buffer, + IoStatusBlock.Information, NULL, NULL) ; + if (!NT_SUCCESS(Status)) + { + Error = RtlNtStatusToDosError(Status); + goto Cleanup; + } + } + else if (Status != STATUS_END_OF_FILE) + { + Error = RtlNtStatusToDosError(Status); + goto Cleanup; + } + } + Ret = TRUE; /* Perform resource cleanup */ Cleanup: - if (hBackup) NtClose(hBackup); if (hReplaced) NtClose(hReplaced); if (hReplacement) NtClose(hReplacement); + if (Buffer) RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer); RtlFreeUnicodeString(&NtReplacementName); RtlFreeUnicodeString(&NtReplacedName);
15 years
1
0
0
0
[sserapion] 44382: fix copy/paste mistake.
by sserapion@svn.reactos.org
Author: sserapion Date: Thu Dec 3 19:26:55 2009 New Revision: 44382 URL:
http://svn.reactos.org/svn/reactos?rev=44382&view=rev
Log: fix copy/paste mistake. Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dummy_mingwthrd.c Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dummy_mingwthrd.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3…
============================================================================== --- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dummy_mingwthrd.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dummy_mingwthrd.c [iso-8859-1] Thu Dec 3 19:26:55 2009 @@ -43,10 +43,11 @@ if (__mingwthr_cs_init == 0) return 0; new_key = (__mingwthr_key_t *)malloc(sizeof (__mingwthr_key_t)); - memset(new_key, 0,sizeof (__mingwthr_key_t)); + if (new_key == NULL) return -1; - + + memset(new_key, 0,sizeof (__mingwthr_key_t)); new_key->key = key; new_key->dtor = dtor;
15 years
1
0
0
0
[sserapion] 44381: Don't use calloc, fixes building even more modules.
by sserapion@svn.reactos.org
Author: sserapion Date: Thu Dec 3 19:10:08 2009 New Revision: 44381 URL:
http://svn.reactos.org/svn/reactos?rev=44381&view=rev
Log: Don't use calloc, fixes building even more modules. Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dummy_mingwthrd.c Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dummy_mingwthrd.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3…
============================================================================== --- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dummy_mingwthrd.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dummy_mingwthrd.c [iso-8859-1] Thu Dec 3 19:10:08 2009 @@ -42,7 +42,8 @@ if (__mingwthr_cs_init == 0) return 0; - new_key = (__mingwthr_key_t *) calloc (1, sizeof (__mingwthr_key_t)); + new_key = (__mingwthr_key_t *)malloc(sizeof (__mingwthr_key_t)); + memset(new_key, 0,sizeof (__mingwthr_key_t)); if (new_key == NULL) return -1;
15 years
1
0
0
0
[sserapion] 44380: Re-add old name hack, fixes building some modules
by sserapion@svn.reactos.org
Author: sserapion Date: Thu Dec 3 19:03:22 2009 New Revision: 44380 URL:
http://svn.reactos.org/svn/reactos?rev=44380&view=rev
Log: Re-add old name hack, fixes building some modules Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw.rbuild Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3…
============================================================================== --- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw.rbuild [iso-8859-1] Thu Dec 3 19:03:22 2009 @@ -3,6 +3,7 @@ <group> <module name="mingw_common" type="staticlibrary" isstartuplib="true" crt="dll"> <define name="_CRTBLD" /> + <importlibrary definition="moldname-msvcrt.def" dllname="msvcrt.dll" /> <include base="ReactOS">include/reactos/mingw-w64</include> <library>kernel32</library> <file>_newmode.c</file>
15 years
1
0
0
0
[spetreolle] 44379: msimtf: remove unneeded ntdll dependancy
by spetreolle@svn.reactos.org
Author: spetreolle Date: Thu Dec 3 18:36:15 2009 New Revision: 44379 URL:
http://svn.reactos.org/svn/reactos?rev=44379&view=rev
Log: msimtf: remove unneeded ntdll dependancy Modified: trunk/reactos/dll/win32/msimtf/msimtf.rbuild Modified: trunk/reactos/dll/win32/msimtf/msimtf.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msimtf/msimtf.rb…
============================================================================== --- trunk/reactos/dll/win32/msimtf/msimtf.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msimtf/msimtf.rbuild [iso-8859-1] Thu Dec 3 18:36:15 2009 @@ -11,5 +11,5 @@ <library>wine</library> <library>uuid</library> <library>imm32</library> - <library>ntdll</library> </module> +</group>
15 years
1
0
0
0
← Newer
1
...
43
44
45
46
47
48
49
50
51
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
Results per page:
10
25
50
100
200