ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2010
----- 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
26 participants
522 discussions
Start a n
N
ew thread
[tkreuzer] 44934: [HAL] Implement HalInitializeBios, x86BiosAllocateBuffer, x86BiosFreeBuffer, x86BiosReadMemory and x86BiosWriteMemory Halfplement x86BiosCall (We don't have the necessary emulator yet)
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Jan 4 23:12:18 2010 New Revision: 44934 URL:
http://svn.reactos.org/svn/reactos?rev=44934&view=rev
Log: [HAL] Implement HalInitializeBios, x86BiosAllocateBuffer, x86BiosFreeBuffer, x86BiosReadMemory and x86BiosWriteMemory Halfplement x86BiosCall (We don't have the necessary emulator yet) Modified: branches/ros-amd64-bringup/reactos/hal/halx86/generic/x86bios.c Modified: branches/ros-amd64-bringup/reactos/hal/halx86/generic/x86bios.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/generic/x86bios.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/generic/x86bios.c [iso-8859-1] Mon Jan 4 23:12:18 2010 @@ -3,7 +3,7 @@ * LICENSE: See COPYING in the top level directory * FILE: hal/halamd64/generic/x86bios.c * PURPOSE: - * PROGRAMMERS: + * PROGRAMMERS: Timo Kreuzer (timo.kreuzer(a)reactos.org) */ /* INCLUDES ******************************************************************/ @@ -11,6 +11,78 @@ #include <hal.h> //#define NDEBUG #include <debug.h> + +/* This page serves as fallback for pages used by Mm */ +#define DEFAULT_PAGE 0x21 + +/* GLOBALS *******************************************************************/ + +BOOLEAN x86BiosIsInitialized; +LONG x86BiosBufferIsAllocated = 0; +PUCHAR x86BiosMemoryMapping; + +VOID +NTAPI +HalInitializeBios(ULONG Unknown, PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + PPFN_NUMBER PfnArray; + PFN_NUMBER Pfn, Last; + PMEMORY_ALLOCATION_DESCRIPTOR Descriptor; + PLIST_ENTRY ListEntry; + PMDL Mdl; + + /* Allocate an MDL for 1MB */ + Mdl = IoAllocateMdl(NULL, 0x100000, FALSE, FALSE, NULL); + if (!Mdl) + { + ASSERT(FALSE); + } + + /* Get pointer to the pfn array */ + PfnArray = MmGetMdlPfnArray(Mdl); + + /* Fill the array with low memory PFNs */ + for (Pfn = 0; Pfn < 0x100; Pfn++) + { + PfnArray[Pfn] = Pfn; + } + + /* Loop the memory descriptors */ + for (ListEntry = LoaderBlock->MemoryDescriptorListHead.Flink; + ListEntry != &LoaderBlock->MemoryDescriptorListHead; + ListEntry = ListEntry->Flink) + { + /* Get the memory descriptor */ + Descriptor = CONTAINING_RECORD(ListEntry, + MEMORY_ALLOCATION_DESCRIPTOR, + ListEntry); + + /* Check if the memory is in the low range */ + if (Descriptor->BasePage < 0x100) + { + /* Check if the memory type is firmware */ + if (Descriptor->MemoryType != LoaderFirmwarePermanent && + Descriptor->MemoryType != LoaderFirmwarePermanent) + { + /* It's something else, so don't use it! */ + Last = min(Descriptor->BasePage + Descriptor->PageCount, 0x100); + for (Pfn = Descriptor->BasePage; Pfn < Last; Pfn++) + { + /* Set each page to the default page */ + PfnArray[Pfn] = DEFAULT_PAGE; + } + } + } + } + + /* Map the MDL to system space */ + x86BiosMemoryMapping = MmGetSystemAddressForMdlSafe(Mdl, HighPagePriority); + ASSERT(x86BiosMemoryMapping); + + DPRINT1("memory: %p, %p\n", *(PVOID*)x86BiosMemoryMapping, *(PVOID*)(x86BiosMemoryMapping + 8)); + + x86BiosIsInitialized = TRUE; +} NTSTATUS NTAPI @@ -19,19 +91,26 @@ USHORT *Segment, USHORT *Offset) { - UNIMPLEMENTED; - return STATUS_UNSUCCESSFUL;; - -} - -BOOLEAN -NTAPI -x86BiosCall ( - ULONG InterruptNumber, - X86_BIOS_REGISTERS *Registers) -{ - UNIMPLEMENTED; - return FALSE; + /* Check if the system is initialized and the buffer is large enough */ + if (!x86BiosIsInitialized || *Size > PAGE_SIZE) + { + /* Something was wrong, fail! */ + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* Check if the buffer is already allocated */ + if (InterlockedBitTestAndSet(&x86BiosBufferIsAllocated, 0)) + { + /* Buffer was already allocated, fail */ + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* The buffer is sufficient, return hardcoded address and size */ + *Size = PAGE_SIZE; + *Segment = 0x2000; + *Offset = 0; + + return STATUS_SUCCESS;; } NTSTATUS @@ -40,19 +119,49 @@ USHORT Segment, USHORT Offset) { - UNIMPLEMENTED; - return STATUS_UNSUCCESSFUL;; + /* Check if the system is initialized and if the address matches */ + if (!x86BiosIsInitialized || Segment != 0x2000 || Offset != 0) + { + /* Something was wrong, fail */ + return STATUS_INVALID_PARAMETER; + } + + /* Check if the buffer was allocated */ + if (!InterlockedBitTestAndReset(&x86BiosBufferIsAllocated, 0)) + { + /* It was not, fail */ + return STATUS_INVALID_PARAMETER; + } + + /* Buffer is freed, nothing more to do */ + return STATUS_SUCCESS;; } NTSTATUS +NTAPI x86BiosReadMemory ( USHORT Segment, USHORT Offset, PVOID Buffer, ULONG Size) { - UNIMPLEMENTED; - return STATUS_UNSUCCESSFUL;; + ULONG_PTR Address; + + /* Calculate the physical address */ + Address = (Segment << 4) + Offset; + + /* Check if it's valid */ + if (!x86BiosIsInitialized || Address + Size > 0x100000) + { + /* Invalid */ + return STATUS_INVALID_PARAMETER; + } + + /* Copy the memory to the buffer */ + RtlCopyMemory(Buffer, x86BiosMemoryMapping + Address, Size); + + /* Return success */ + return STATUS_SUCCESS; } NTSTATUS @@ -63,7 +172,146 @@ PVOID Buffer, ULONG Size) { + ULONG_PTR Address; + + /* Calculate the physical address */ + Address = (Segment << 4) + Offset; + + /* Check if it's valid */ + if (!x86BiosIsInitialized || Address + Size > 0x100000) + { + /* Invalid */ + return STATUS_INVALID_PARAMETER; + } + + /* Copy the memory from the buffer */ + RtlCopyMemory(x86BiosMemoryMapping + Address, Buffer, Size); + + /* Return success */ + return STATUS_SUCCESS; +} + +typedef struct +{ + union + { + ULONG Eax; + USHORT Ax; + struct + { + UCHAR Al; + UCHAR Ah; + }; + }; + union + { + ULONG Ecx; + USHORT Cx; + struct + { + UCHAR Cl; + UCHAR Ch; + }; + }; + union + { + ULONG Edx; + USHORT Dx; + struct + { + UCHAR Dl; + UCHAR Dh; + }; + }; + union + { + ULONG Ebx; + USHORT Bx; + struct + { + UCHAR Bl; + UCHAR Bh; + }; + }; + ULONG Ebp; + ULONG Esi; + ULONG Edi; + USHORT SegDs; + USHORT SegEs; + + /* Extended */ + union + { + ULONG Eip; + USHORT Ip; + }; + + union + { + ULONG Esp; + USHORT Sp; + }; + +} X86_REGISTERS, *PX86_REGISTERS; + +enum +{ + X86_VMFLAGS_RETURN_ON_IRET = 1, +}; + +typedef struct +{ + union + { + X86_BIOS_REGISTERS BiosRegisters; + X86_REGISTERS Registers; + }; + + struct + { + ULONG ReturnOnIret:1; + } Flags; + + PVOID MemBuffer; +} X86_VM_STATE, *PX86_VM_STATE; + +BOOLEAN +NTAPI +x86BiosCall ( + ULONG InterruptNumber, + X86_BIOS_REGISTERS *Registers) +{ + X86_VM_STATE VmState; + + /* Zero the VmState */ + RtlZeroMemory(&VmState, sizeof(VmState)); + + /* Copy the registers */ + VmState.BiosRegisters = *Registers; + + /* Set the physical memory buffer */ + VmState.MemBuffer = x86BiosMemoryMapping; + + /* Initialize IP from the interrupt vector table */ + VmState.Registers.Ip = ((PUSHORT)x86BiosMemoryMapping)[InterruptNumber]; + + /* Make the function return on IRET */ + VmState.Flags.ReturnOnIret = 1; + + /* Call the x86 emulator */ +// x86Emulator(&VmState); + + /* Copy registers back to caller */ + *Registers = VmState.BiosRegisters; + + return TRUE; +} + +BOOLEAN +NTAPI +HalpBiosDisplayReset(VOID) +{ UNIMPLEMENTED; - return STATUS_UNSUCCESSFUL;; -} - + return TRUE; +} +
14 years, 11 months
1
0
0
0
[jimtabor] 44933: - Revert changes in font.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Jan 4 21:48:31 2010 New Revision: 44933 URL:
http://svn.reactos.org/svn/reactos?rev=44933&view=rev
Log: - Revert changes in font. Modified: trunk/reactos/subsystems/win32/win32k/objects/font.c Modified: trunk/reactos/subsystems/win32/win32k/objects/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/font.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/font.c [iso-8859-1] Mon Jan 4 21:48:31 2010 @@ -75,19 +75,7 @@ return Count; } -/* - - It is recommended that an application use the GetFontLanguageInfo function - to determine whether the GCP_DIACRITIC, GCP_DBCS, GCP_USEKERNING, GCP_LIGATE, - GCP_REORDER, GCP_GLYPHSHAPE, and GCP_KASHIDA values are valid for the - currently selected font. If not valid, GetCharacterPlacement ignores the - value. - - M$ must use a preset "compiled in" support for each language based releases. - ReactOS uses FreeType, this will need to be supported. ATM this is hard coded - for GCPCLASS_LATIN! - - */ + DWORD FASTCALL GreGetCharacterPlacementW( @@ -98,14 +86,7 @@ LPGCP_RESULTSW pgcpw, DWORD dwFlags) { - GCP_RESULTSW gcpwSave; - UINT i, nSet, cSet; -// INT *lpDx, *tmpDxCaretPos; - INT *tmpDxCaretPos; - LONG Cx; SIZE Size = {0,0}; - - DPRINT1("GreGCPW Start\n"); if (!pgcpw) { @@ -113,170 +94,8 @@ return MAKELONG(Size.cx, Size.cy); return 0; } - - RtlCopyMemory(&gcpwSave, pgcpw, sizeof(GCP_RESULTSW)); - - cSet = nSet = nCount; - - if ( nCount > gcpwSave.nGlyphs ) cSet = gcpwSave.nGlyphs; - - /* GCP_JUSTIFY may only be used in conjunction with GCP_MAXEXTENT. */ - if ( dwFlags & GCP_JUSTIFY) dwFlags |= GCP_MAXEXTENT; - - if ( !gcpwSave.lpDx && gcpwSave.lpCaretPos ) - tmpDxCaretPos = gcpwSave.lpCaretPos; - else - tmpDxCaretPos = gcpwSave.lpDx; - - if ( !GreGetTextExtentExW( hdc, - pwsz, - cSet, - nMaxExtent, - ((dwFlags & GCP_MAXEXTENT) ? (PULONG) &cSet : NULL), - (PULONG) tmpDxCaretPos, - &Size, - 0) ) - { - return 0; - } - - nSet = cSet; - - if ( tmpDxCaretPos && nSet > 0) - { -// lpDx = tmpDxCaretPos + 4 * nSet - 4; -// lpDx = tmpDxCaretPos[nSet - 1]; -/* while ( lpDx > tmpDxCaretPos ) - { - *lpDx -= *lpDx - 4; - lpDx -= 4; - }*/ - for (i = (nSet - 1); i > 0; i--) - { - tmpDxCaretPos[i] -= tmpDxCaretPos[i - 1]; - } - } - - if ( !(dwFlags & GCP_MAXEXTENT) || nSet ) - { - if ( (dwFlags & GCP_USEKERNING) && - ( gcpwSave.lpDx || - gcpwSave.lpCaretPos ) && - nSet >= 2 ) - { - DWORD Count; - LPKERNINGPAIR pKP; - - Count = GreGetKerningPairs( hdc, 0, NULL); - if (Count) - { - pKP = ExAllocatePoolWithTag(PagedPool, Count * sizeof(KERNINGPAIR), GDITAG_TEXT); - if (pKP) - { - if ( GreGetKerningPairs( hdc, Count, pKP) != Count) - { - ExFreePoolWithTag( pKP, GDITAG_TEXT); - return 0; - } - - if ( (ULONG_PTR)(pKP) < ((ULONG_PTR)(pKP) + (ULONG_PTR)(Count * sizeof(KERNINGPAIR))) ) - { - DPRINT1("We Need to Do Something HERE!\n"); - } - - ExFreePoolWithTag( pKP, GDITAG_TEXT); - - if ( dwFlags & GCP_MAXEXTENT ) - { -// Cx = Size.cx; - if ( Size.cx > nMaxExtent ) - { -// lpDx = tmpDxCaretPos + 4 * nSet - 4; -// lpDx = tmpDxCaretPos[nSet - 1]; -/* - while ( 1 ) - { - if ( !nSet ) break; - - Cx -= *lpDx; - --nSet; - lpDx -= 4; - - Size.cx = Cx; - - if ( Cx <= nMaxExtent ) break; - }*/ - for (Cx = Size.cx; nSet > 0; nSet--) - { - Cx -= tmpDxCaretPos[nSet - 1]; - Size.cx = Cx; - if ( Cx <= nMaxExtent ) break; - } - } - if ( !nSet ) - { - pgcpw->nGlyphs = 0; - pgcpw->nMaxFit = 0; - return 0; - } - } - } - } - } - - if ( (dwFlags & GCP_JUSTIFY) && - ( gcpwSave.lpDx || - gcpwSave.lpCaretPos ) && - nSet ) - { - DPRINT1("We Need to Do Something HERE 2!\n"); - } - - if ( gcpwSave.lpDx && gcpwSave.lpCaretPos ) - RtlCopyMemory( gcpwSave.lpCaretPos, gcpwSave.lpDx, nSet * sizeof(LONG)); - - if ( gcpwSave.lpCaretPos ) - { - int pos = 0; - i = 0; - if ( nSet > 0 ) - { - do - { - Cx = gcpwSave.lpCaretPos[i]; - gcpwSave.lpCaretPos[i] = pos; - pos += Cx; - ++i; - } - while ( i < nSet ); - } - } - - if ( gcpwSave.lpOutString ) - RtlCopyMemory(gcpwSave.lpOutString, pwsz, nSet * sizeof(WCHAR)); - - if ( gcpwSave.lpClass ) - RtlFillMemory(gcpwSave.lpClass, nSet, GCPCLASS_LATIN); - - if ( gcpwSave.lpOrder ) - { - for (i = 0; i < nSet; i++) - gcpwSave.lpOrder[i] = i; - } - - if ( gcpwSave.lpGlyphs ) - { - if ( GreGetGlyphIndicesW( hdc, pwsz, nSet, gcpwSave.lpGlyphs, 0, 0) == GDI_ERROR ) - { - nSet = 0; - Size.cx = 0; - Size.cy = 0; - } - } - pgcpw->nGlyphs = nSet; - pgcpw->nMaxFit = nSet; - } - return MAKELONG(Size.cx, Size.cy); + UNIMPLEMENTED; + return 0; } INT @@ -494,12 +313,8 @@ IN OUT LPGCP_RESULTSW pgcpw, IN DWORD dwFlags) { - return GreGetCharacterPlacementW( hdc, - pwsz, - nCount, - nMaxExtent, - pgcpw, - dwFlags); + UNIMPLEMENTED; + return 0; } DWORD
14 years, 11 months
1
0
0
0
[jimtabor] 44932: - Sorry I thought I turn the debug off.region.c
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Jan 4 21:44:48 2010 New Revision: 44932 URL:
http://svn.reactos.org/svn/reactos?rev=44932&view=rev
Log: - Sorry I thought I turn the debug off.region.c Modified: trunk/reactos/subsystems/win32/win32k/objects/font.c trunk/reactos/subsystems/win32/win32k/objects/region.c Modified: trunk/reactos/subsystems/win32/win32k/objects/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/font.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/font.c [iso-8859-1] Mon Jan 4 21:44:48 2010 @@ -75,7 +75,19 @@ return Count; } - +/* + + It is recommended that an application use the GetFontLanguageInfo function + to determine whether the GCP_DIACRITIC, GCP_DBCS, GCP_USEKERNING, GCP_LIGATE, + GCP_REORDER, GCP_GLYPHSHAPE, and GCP_KASHIDA values are valid for the + currently selected font. If not valid, GetCharacterPlacement ignores the + value. + + M$ must use a preset "compiled in" support for each language based releases. + ReactOS uses FreeType, this will need to be supported. ATM this is hard coded + for GCPCLASS_LATIN! + + */ DWORD FASTCALL GreGetCharacterPlacementW( @@ -86,7 +98,14 @@ LPGCP_RESULTSW pgcpw, DWORD dwFlags) { + GCP_RESULTSW gcpwSave; + UINT i, nSet, cSet; +// INT *lpDx, *tmpDxCaretPos; + INT *tmpDxCaretPos; + LONG Cx; SIZE Size = {0,0}; + + DPRINT1("GreGCPW Start\n"); if (!pgcpw) { @@ -94,8 +113,170 @@ return MAKELONG(Size.cx, Size.cy); return 0; } - UNIMPLEMENTED; - return 0; + + RtlCopyMemory(&gcpwSave, pgcpw, sizeof(GCP_RESULTSW)); + + cSet = nSet = nCount; + + if ( nCount > gcpwSave.nGlyphs ) cSet = gcpwSave.nGlyphs; + + /* GCP_JUSTIFY may only be used in conjunction with GCP_MAXEXTENT. */ + if ( dwFlags & GCP_JUSTIFY) dwFlags |= GCP_MAXEXTENT; + + if ( !gcpwSave.lpDx && gcpwSave.lpCaretPos ) + tmpDxCaretPos = gcpwSave.lpCaretPos; + else + tmpDxCaretPos = gcpwSave.lpDx; + + if ( !GreGetTextExtentExW( hdc, + pwsz, + cSet, + nMaxExtent, + ((dwFlags & GCP_MAXEXTENT) ? (PULONG) &cSet : NULL), + (PULONG) tmpDxCaretPos, + &Size, + 0) ) + { + return 0; + } + + nSet = cSet; + + if ( tmpDxCaretPos && nSet > 0) + { +// lpDx = tmpDxCaretPos + 4 * nSet - 4; +// lpDx = tmpDxCaretPos[nSet - 1]; +/* while ( lpDx > tmpDxCaretPos ) + { + *lpDx -= *lpDx - 4; + lpDx -= 4; + }*/ + for (i = (nSet - 1); i > 0; i--) + { + tmpDxCaretPos[i] -= tmpDxCaretPos[i - 1]; + } + } + + if ( !(dwFlags & GCP_MAXEXTENT) || nSet ) + { + if ( (dwFlags & GCP_USEKERNING) && + ( gcpwSave.lpDx || + gcpwSave.lpCaretPos ) && + nSet >= 2 ) + { + DWORD Count; + LPKERNINGPAIR pKP; + + Count = GreGetKerningPairs( hdc, 0, NULL); + if (Count) + { + pKP = ExAllocatePoolWithTag(PagedPool, Count * sizeof(KERNINGPAIR), GDITAG_TEXT); + if (pKP) + { + if ( GreGetKerningPairs( hdc, Count, pKP) != Count) + { + ExFreePoolWithTag( pKP, GDITAG_TEXT); + return 0; + } + + if ( (ULONG_PTR)(pKP) < ((ULONG_PTR)(pKP) + (ULONG_PTR)(Count * sizeof(KERNINGPAIR))) ) + { + DPRINT1("We Need to Do Something HERE!\n"); + } + + ExFreePoolWithTag( pKP, GDITAG_TEXT); + + if ( dwFlags & GCP_MAXEXTENT ) + { +// Cx = Size.cx; + if ( Size.cx > nMaxExtent ) + { +// lpDx = tmpDxCaretPos + 4 * nSet - 4; +// lpDx = tmpDxCaretPos[nSet - 1]; +/* + while ( 1 ) + { + if ( !nSet ) break; + + Cx -= *lpDx; + --nSet; + lpDx -= 4; + + Size.cx = Cx; + + if ( Cx <= nMaxExtent ) break; + }*/ + for (Cx = Size.cx; nSet > 0; nSet--) + { + Cx -= tmpDxCaretPos[nSet - 1]; + Size.cx = Cx; + if ( Cx <= nMaxExtent ) break; + } + } + if ( !nSet ) + { + pgcpw->nGlyphs = 0; + pgcpw->nMaxFit = 0; + return 0; + } + } + } + } + } + + if ( (dwFlags & GCP_JUSTIFY) && + ( gcpwSave.lpDx || + gcpwSave.lpCaretPos ) && + nSet ) + { + DPRINT1("We Need to Do Something HERE 2!\n"); + } + + if ( gcpwSave.lpDx && gcpwSave.lpCaretPos ) + RtlCopyMemory( gcpwSave.lpCaretPos, gcpwSave.lpDx, nSet * sizeof(LONG)); + + if ( gcpwSave.lpCaretPos ) + { + int pos = 0; + i = 0; + if ( nSet > 0 ) + { + do + { + Cx = gcpwSave.lpCaretPos[i]; + gcpwSave.lpCaretPos[i] = pos; + pos += Cx; + ++i; + } + while ( i < nSet ); + } + } + + if ( gcpwSave.lpOutString ) + RtlCopyMemory(gcpwSave.lpOutString, pwsz, nSet * sizeof(WCHAR)); + + if ( gcpwSave.lpClass ) + RtlFillMemory(gcpwSave.lpClass, nSet, GCPCLASS_LATIN); + + if ( gcpwSave.lpOrder ) + { + for (i = 0; i < nSet; i++) + gcpwSave.lpOrder[i] = i; + } + + if ( gcpwSave.lpGlyphs ) + { + if ( GreGetGlyphIndicesW( hdc, pwsz, nSet, gcpwSave.lpGlyphs, 0, 0) == GDI_ERROR ) + { + nSet = 0; + Size.cx = 0; + Size.cy = 0; + } + } + pgcpw->nGlyphs = nSet; + pgcpw->nMaxFit = nSet; + } + return MAKELONG(Size.cx, Size.cy); } INT @@ -313,8 +494,12 @@ IN OUT LPGCP_RESULTSW pgcpw, IN DWORD dwFlags) { - UNIMPLEMENTED; - return 0; + return GreGetCharacterPlacementW( hdc, + pwsz, + nCount, + nMaxExtent, + pgcpw, + dwFlags); } DWORD Modified: trunk/reactos/subsystems/win32/win32k/objects/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] Mon Jan 4 21:44:48 2010 @@ -2525,7 +2525,7 @@ } else { - DPRINT1("SetRectRgn NULL Count: %d \n", rgn->rdh.nCount); + DPRINT("SetRectRgn NULL Count: %d \n", rgn->rdh.nCount); EMPTY_REGION(rgn); } }
14 years, 11 months
1
0
0
0
[spetreolle] 44931: Hackfix wdmaud.drv for now (Johannes Anderwald)
by spetreolle@svn.reactos.org
Author: spetreolle Date: Mon Jan 4 19:07:27 2010 New Revision: 44931 URL:
http://svn.reactos.org/svn/reactos?rev=44931&view=rev
Log: Hackfix wdmaud.drv for now (Johannes Anderwald) Modified: trunk/reactos/dll/win32/wdmaud.drv/legacy.c trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c Modified: trunk/reactos/dll/win32/wdmaud.drv/legacy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/legac…
============================================================================== --- trunk/reactos/dll/win32/wdmaud.drv/legacy.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wdmaud.drv/legacy.c [iso-8859-1] Mon Jan 4 19:07:27 2010 @@ -17,7 +17,7 @@ #define KERNEL_DEVICE_NAME L"\\\\.\\wdmaud" extern HANDLE KernelHandle; -DWORD OpenCount = 0; +extern DWORD OpenCount; DWORD WINAPI @@ -559,6 +559,7 @@ return MMSYSERR_NOERROR; } + MMRESULT Modified: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/wdmau…
============================================================================== --- trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c [iso-8859-1] Mon Jan 4 19:07:27 2010 @@ -14,7 +14,307 @@ #include "wdmaud.h" + +#define KERNEL_DEVICE_NAME L"\\\\.\\wdmaud" + +PWSTR UnknownWaveIn = L"Wave Input"; +PWSTR UnknownWaveOut = L"Wave Output"; +PWSTR UnknownMidiIn = L"Midi Input"; +PWSTR UnknownMidiOut = L"Midi Output"; + + HANDLE KernelHandle = INVALID_HANDLE_VALUE; +DWORD OpenCount = 0; + +MMRESULT +WriteFileEx_Remixer( + IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, + IN PVOID OffsetPtr, + IN DWORD Length, + IN PSOUND_OVERLAPPED Overlap, + IN LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine); + + + +MMRESULT +GetNumWdmDevs( + IN HANDLE Handle, + IN MMDEVICE_TYPE DeviceType, + OUT DWORD* DeviceCount) +{ +#ifdef USE_MMIXER_LIB + + switch(DeviceType) + { + case MIXER_DEVICE_TYPE: + *DeviceCount = WdmAudGetMixerCount(); + break; + case WAVE_OUT_DEVICE_TYPE: + *DeviceCount = WdmAudGetWaveOutCount(); + break; + case WAVE_IN_DEVICE_TYPE: + *DeviceCount = WdmAudGetWaveInCount(); + break; + default: + *DeviceCount = 0; + } + return MMSYSERR_NOERROR; +#else + + MMRESULT Result; + WDMAUD_DEVICE_INFO DeviceInfo; + + VALIDATE_MMSYS_PARAMETER( Handle != INVALID_HANDLE_VALUE ); + VALIDATE_MMSYS_PARAMETER( IS_VALID_SOUND_DEVICE_TYPE(DeviceType) ); + VALIDATE_MMSYS_PARAMETER( DeviceCount ); + + ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO)); + DeviceInfo.DeviceType = DeviceType; + + Result = SyncOverlappedDeviceIoControl(Handle, + IOCTL_GETNUMDEVS_TYPE, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + + if ( ! MMSUCCESS( Result ) ) + { + SND_ERR(L"Call to IOCTL_GETNUMDEVS_TYPE failed\n"); + *DeviceCount = 0; + return TranslateInternalMmResult(Result); + } + + *DeviceCount = DeviceInfo.DeviceCount; + + return MMSYSERR_NOERROR; +#endif +} + +MMRESULT +GetWdmDeviceCapabilities( + IN PSOUND_DEVICE SoundDevice, + IN DWORD DeviceId, + OUT PVOID Capabilities, + IN DWORD CapabilitiesSize) +{ + /* NOTE - At this time, WDMAUD does not support this properly */ + + MMRESULT Result; + MMDEVICE_TYPE DeviceType; + WDMAUD_DEVICE_INFO DeviceInfo; + + SND_ASSERT( SoundDevice ); + SND_ASSERT( Capabilities ); + + Result = GetSoundDeviceType(SoundDevice, &DeviceType); + SND_ASSERT( Result == MMSYSERR_NOERROR ); + + if ( ! MMSUCCESS(Result) ) + return Result; + + SND_TRACE(L"WDMAUD - GetWdmDeviceCapabilities DeviceType %u DeviceId %u\n", DeviceType, DeviceId); + +#ifdef USE_MMIXER_LIB + if (DeviceType == MIXER_DEVICE_TYPE) + { + return WdmAudGetMixerCapabilities(DeviceId, (LPMIXERCAPSW)Capabilities); + } + else if (DeviceType == WAVE_OUT_DEVICE_TYPE) + { + return WdmAudGetWaveOutCapabilities(DeviceId, (LPWAVEOUTCAPSW)Capabilities); + } + else if (DeviceType == WAVE_IN_DEVICE_TYPE) + { + return WdmAudGetWaveInCapabilities(DeviceId, (LPWAVEINCAPSW)Capabilities); + } + +#endif + + + ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO)); + DeviceInfo.DeviceType = DeviceType; + DeviceInfo.DeviceIndex = DeviceId; + + Result = SyncOverlappedDeviceIoControl(KernelHandle, + IOCTL_GETCAPABILITIES, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + + if ( ! MMSUCCESS(Result) ) + { + return TranslateInternalMmResult(Result); + } + + /* This is pretty much a big hack right now */ + switch ( DeviceType ) + { + case MIXER_DEVICE_TYPE: + { + LPMIXERCAPS MixerCaps = (LPMIXERCAPS) Capabilities; + + DeviceInfo.u.MixCaps.szPname[MAXPNAMELEN-1] = L'\0'; + CopyWideString(MixerCaps->szPname, DeviceInfo.u.MixCaps.szPname); + + MixerCaps->cDestinations = DeviceInfo.u.MixCaps.cDestinations; + MixerCaps->fdwSupport = DeviceInfo.u.MixCaps.fdwSupport; + MixerCaps->vDriverVersion = DeviceInfo.u.MixCaps.vDriverVersion; + MixerCaps->wMid = DeviceInfo.u.MixCaps.wMid; + MixerCaps->wPid = DeviceInfo.u.MixCaps.wPid; + break; + } + case WAVE_OUT_DEVICE_TYPE : + { + LPWAVEOUTCAPS WaveOutCaps = (LPWAVEOUTCAPS) Capabilities; + + DeviceInfo.u.WaveOutCaps.szPname[MAXPNAMELEN-1] = L'\0'; + WaveOutCaps->wMid = DeviceInfo.u.WaveOutCaps.wMid; + WaveOutCaps->wPid = DeviceInfo.u.WaveOutCaps.wPid; + + WaveOutCaps->vDriverVersion = 0x0001; + CopyWideString(WaveOutCaps->szPname, DeviceInfo.u.WaveOutCaps.szPname); + + WaveOutCaps->dwFormats = DeviceInfo.u.WaveOutCaps.dwFormats; + WaveOutCaps->wChannels = DeviceInfo.u.WaveOutCaps.wChannels; + WaveOutCaps->dwSupport = DeviceInfo.u.WaveOutCaps.dwSupport; + break; + } + case WAVE_IN_DEVICE_TYPE : + { + LPWAVEINCAPSW WaveInCaps = (LPWAVEINCAPSW) Capabilities; + + DeviceInfo.u.WaveInCaps.szPname[MAXPNAMELEN-1] = L'\0'; + + WaveInCaps->wMid = DeviceInfo.u.WaveInCaps.wMid; + WaveInCaps->wPid = DeviceInfo.u.WaveInCaps.wPid; + + WaveInCaps->vDriverVersion = 0x0001; + CopyWideString(WaveInCaps->szPname, DeviceInfo.u.WaveInCaps.szPname); + + WaveInCaps->dwFormats = DeviceInfo.u.WaveInCaps.dwFormats; + WaveInCaps->wChannels = DeviceInfo.u.WaveInCaps.wChannels; + WaveInCaps->wReserved1 = 0; + break; + } + } + + return MMSYSERR_NOERROR; +} + + +MMRESULT +OpenWdmSoundDevice( + IN struct _SOUND_DEVICE* SoundDevice, /* NOT USED */ + OUT PVOID* Handle) +{ + /* Only open this if it's not already open */ + if ( KernelHandle == INVALID_HANDLE_VALUE ) + { + SND_TRACE(L"Opening wdmaud device\n"); + KernelHandle = CreateFileW(KERNEL_DEVICE_NAME, + GENERIC_READ | GENERIC_WRITE, + 0, + NULL, + OPEN_EXISTING, + FILE_FLAG_OVERLAPPED, + NULL); + } + + if ( KernelHandle == INVALID_HANDLE_VALUE ) + return MMSYSERR_ERROR; + + SND_ASSERT( Handle ); + + *Handle = KernelHandle; + ++ OpenCount; + + return MMSYSERR_NOERROR; +} + +MMRESULT +CloseWdmSoundDevice( + IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance, + IN PVOID Handle) +{ + WDMAUD_DEVICE_INFO DeviceInfo; + MMRESULT Result; + MMDEVICE_TYPE DeviceType; + PSOUND_DEVICE SoundDevice; + + Result = GetSoundDeviceFromInstance(SoundDeviceInstance, &SoundDevice); + + if ( ! MMSUCCESS(Result) ) + { + return TranslateInternalMmResult(Result); + } + + if ( OpenCount == 0 ) + { + return MMSYSERR_NOERROR; + } + + SND_ASSERT( KernelHandle != INVALID_HANDLE_VALUE ); + + Result = GetSoundDeviceType(SoundDevice, &DeviceType); + SND_ASSERT( Result == MMSYSERR_NOERROR ); + + if (SoundDeviceInstance->Handle != (PVOID)KernelHandle) + { + ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO)); + + DeviceInfo.DeviceType = DeviceType; + DeviceInfo.hDevice = SoundDeviceInstance->Handle; + + /* First stop the stream */ + if (DeviceType != MIXER_DEVICE_TYPE) + { + DeviceInfo.u.State = KSSTATE_STOP; + SyncOverlappedDeviceIoControl(KernelHandle, + IOCTL_SETDEVICE_STATE, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + } +#ifdef USE_MMIXER_LIB + if (DeviceType == MIXER_DEVICE_TYPE) + { + return WdmAudCloseMixer(SoundDeviceInstance->Handle, SoundDeviceInstance->hNotifyEvent); + } +#endif + + SyncOverlappedDeviceIoControl(KernelHandle, + IOCTL_CLOSE_WDMAUD, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + } + + if (DeviceType == MIXER_DEVICE_TYPE) + { + SetEvent(SoundDeviceInstance->hStopEvent); + CloseHandle(SoundDeviceInstance->hStopEvent); + CloseHandle(SoundDeviceInstance->hNotifyEvent); + } + + --OpenCount; + + if ( OpenCount < 1 ) + { + CloseHandle(KernelHandle); + KernelHandle = INVALID_HANDLE_VALUE; + } + + return MMSYSERR_NOERROR; +} + MMRESULT QueryWdmWaveDeviceFormatSupport( @@ -27,8 +327,483 @@ } + + + +MMRESULT +SetWdmMixerDeviceFormat( + IN PSOUND_DEVICE_INSTANCE Instance, + IN DWORD DeviceId, + IN PWAVEFORMATEX WaveFormat, + IN DWORD WaveFormatSize) +{ + MMRESULT Result; + WDMAUD_DEVICE_INFO DeviceInfo; + HANDLE hThread; + + + Instance->hNotifyEvent = CreateEventW(NULL, FALSE, FALSE, NULL); + if ( ! Instance->hNotifyEvent ) + return MMSYSERR_NOMEM; + +#ifdef USE_MMIXER_LIB + return WdmAudOpenMixer(&Instance->Handle, DeviceId, Instance->hNotifyEvent); +#endif + + if (Instance->Handle != KernelHandle) + { + /* device is already open */ + return MMSYSERR_NOERROR; + } + + Instance->hStopEvent = CreateEventW(NULL, FALSE, FALSE, NULL); + if ( ! Instance->hStopEvent ) + return MMSYSERR_NOMEM; + + ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO)); + DeviceInfo.DeviceType = MIXER_DEVICE_TYPE; + DeviceInfo.DeviceIndex = DeviceId; + DeviceInfo.u.hNotifyEvent = Instance->hNotifyEvent; + + Result = SyncOverlappedDeviceIoControl(KernelHandle, + IOCTL_OPEN_WDMAUD, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + + if ( ! MMSUCCESS(Result) ) + { + CloseHandle(Instance->hNotifyEvent); + CloseHandle(Instance->hStopEvent); + return TranslateInternalMmResult(Result); + } + + hThread = CreateThread(NULL, 0, MixerEventThreadRoutine, (LPVOID)Instance, 0, NULL); + if ( hThread ) + { + CloseHandle(hThread); + } + + /* Store sound device handle instance handle */ + Instance->Handle = (PVOID)DeviceInfo.hDevice; + + return MMSYSERR_NOERROR; +} + +MMRESULT +SetWdmWaveDeviceFormat( + IN PSOUND_DEVICE_INSTANCE Instance, + IN DWORD DeviceId, + IN PWAVEFORMATEX WaveFormat, + IN DWORD WaveFormatSize) +{ + MMRESULT Result; + PSOUND_DEVICE SoundDevice; + PVOID Identifier; + WDMAUD_DEVICE_INFO DeviceInfo; + MMDEVICE_TYPE DeviceType; + + Result = GetSoundDeviceFromInstance(Instance, &SoundDevice); + + if ( ! MMSUCCESS(Result) ) + { + return TranslateInternalMmResult(Result); + } + + Result = GetSoundDeviceIdentifier(SoundDevice, &Identifier); + + if ( ! MMSUCCESS(Result) ) + { + return TranslateInternalMmResult(Result); + } + + if (Instance->Handle != KernelHandle) + { + /* device is already open */ + return MMSYSERR_NOERROR; + } + + Result = GetSoundDeviceType(SoundDevice, &DeviceType); + +#ifdef USE_MMIXER_LIB + return WdmAudOpenWavePin(Instance, DeviceId, WaveFormat, DeviceType); +#endif + + + SND_ASSERT( Result == MMSYSERR_NOERROR ); + + ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO)); + DeviceInfo.DeviceType = DeviceType; + DeviceInfo.DeviceIndex = DeviceId; + DeviceInfo.u.WaveFormatEx.cbSize = sizeof(WAVEFORMATEX); //WaveFormat->cbSize; + DeviceInfo.u.WaveFormatEx.wFormatTag = WaveFormat->wFormatTag; +#ifdef USERMODE_MIXER + DeviceInfo.u.WaveFormatEx.nChannels = 2; + DeviceInfo.u.WaveFormatEx.nSamplesPerSec = 44100; + DeviceInfo.u.WaveFormatEx.nBlockAlign = 4; + DeviceInfo.u.WaveFormatEx.nAvgBytesPerSec = 176400; + DeviceInfo.u.WaveFormatEx.wBitsPerSample = 16; +#else + DeviceInfo.u.WaveFormatEx.nChannels = WaveFormat->nChannels; + DeviceInfo.u.WaveFormatEx.nSamplesPerSec = WaveFormat->nSamplesPerSec; + DeviceInfo.u.WaveFormatEx.nBlockAlign = WaveFormat->nBlockAlign; + DeviceInfo.u.WaveFormatEx.nAvgBytesPerSec = WaveFormat->nAvgBytesPerSec; + DeviceInfo.u.WaveFormatEx.wBitsPerSample = WaveFormat->wBitsPerSample; +#endif + + Result = SyncOverlappedDeviceIoControl(KernelHandle, + IOCTL_OPEN_WDMAUD, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + + if ( ! MMSUCCESS(Result) ) + { + return TranslateInternalMmResult(Result); + } + + /* Store format */ + Instance->WaveFormatEx.cbSize = WaveFormat->cbSize; + Instance->WaveFormatEx.wFormatTag = WaveFormat->wFormatTag; + Instance->WaveFormatEx.nChannels = WaveFormat->nChannels; + Instance->WaveFormatEx.nSamplesPerSec = WaveFormat->nSamplesPerSec; + Instance->WaveFormatEx.nBlockAlign = WaveFormat->nBlockAlign; + Instance->WaveFormatEx.nAvgBytesPerSec = WaveFormat->nAvgBytesPerSec; + Instance->WaveFormatEx.wBitsPerSample = WaveFormat->wBitsPerSample; + + /* Store sound device handle instance handle */ + Instance->Handle = (PVOID)DeviceInfo.hDevice; + + /* Now determine framing requirements */ + Result = SyncOverlappedDeviceIoControl(KernelHandle, + IOCTL_GETFRAMESIZE, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + + if ( MMSUCCESS(Result) ) + { + if (DeviceInfo.u.FrameSize) + { + Instance->FrameSize = DeviceInfo.u.FrameSize * 2; + Instance->BufferCount = WaveFormat->nAvgBytesPerSec / Instance->FrameSize; + SND_TRACE(L"FrameSize %u BufferCount %u\n", Instance->FrameSize, Instance->BufferCount); + } + } + else + { + // use a default of 100 buffers + Instance->BufferCount = 100; + } + + if (DeviceType == WAVE_OUT_DEVICE_TYPE) + { + /* Now start the stream */ + DeviceInfo.u.State = KSSTATE_RUN; + SyncOverlappedDeviceIoControl(KernelHandle, + IOCTL_SETDEVICE_STATE, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + } + + return MMSYSERR_NOERROR; +} + + +MMRESULT +SetWdmWaveState( + IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance, + IN BOOL bStart) +{ + MMRESULT Result; + PSOUND_DEVICE SoundDevice; + WDMAUD_DEVICE_INFO DeviceInfo; + MMDEVICE_TYPE DeviceType; + HANDLE Handle; + + Result = GetSoundDeviceFromInstance(SoundDeviceInstance, &SoundDevice); + + if ( ! MMSUCCESS(Result) ) + { + return TranslateInternalMmResult(Result); + } + + Result = GetSoundDeviceType(SoundDevice, &DeviceType); + SND_ASSERT( Result == MMSYSERR_NOERROR ); + + Result = GetSoundDeviceInstanceHandle(SoundDeviceInstance, &Handle); + SND_ASSERT( Result == MMSYSERR_NOERROR ); + + ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO)); + DeviceInfo.hDevice = Handle; + DeviceInfo.DeviceType = DeviceType; + + if (bStart) + DeviceInfo.u.State = KSSTATE_RUN; + else + DeviceInfo.u.State = KSSTATE_PAUSE; + Result = SyncOverlappedDeviceIoControl(KernelHandle, + IOCTL_SETDEVICE_STATE, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + + return Result; +} + +MMRESULT +GetDeviceInterfaceString( + IN MMDEVICE_TYPE DeviceType, + IN DWORD DeviceId, + IN LPWSTR Interface, + IN DWORD InterfaceLength, + OUT DWORD * InterfaceSize) +{ + WDMAUD_DEVICE_INFO DeviceInfo; + MMRESULT Result; + + ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO)); + DeviceInfo.DeviceType = DeviceType; + DeviceInfo.DeviceIndex = DeviceId; + + + Result = SyncOverlappedDeviceIoControl(KernelHandle, + IOCTL_QUERYDEVICEINTERFACESTRING, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + + + if ( ! MMSUCCESS(Result) ) + { + return TranslateInternalMmResult(Result); + } + + + if (!Interface) + { + SND_ASSERT(InterfaceSize); + + *InterfaceSize = DeviceInfo.u.Interface.DeviceInterfaceStringSize; + return MMSYSERR_NOERROR; + } + + if (InterfaceLength < DeviceInfo.u.Interface.DeviceInterfaceStringSize) + { + /* buffer is too small */ + return MMSYSERR_MOREDATA; + } + + DeviceInfo.u.Interface.DeviceInterfaceStringSize = InterfaceLength; + DeviceInfo.u.Interface.DeviceInterfaceString = Interface; + + Result = SyncOverlappedDeviceIoControl(KernelHandle, + IOCTL_QUERYDEVICEINTERFACESTRING, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + + if ( MMSUCCESS(Result) && InterfaceLength > 2) + { + Interface[1] = L'\\'; + Interface[InterfaceLength-1] = L'\0'; + } + + return Result; +} + +MMRESULT +GetWdmPosition( + IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance, + IN MMTIME* Time) +{ + MMRESULT Result; + PSOUND_DEVICE SoundDevice; + WDMAUD_DEVICE_INFO DeviceInfo; + MMDEVICE_TYPE DeviceType; + HANDLE Handle; + + Result = GetSoundDeviceFromInstance(SoundDeviceInstance, &SoundDevice); + + if ( ! MMSUCCESS(Result) ) + { + return TranslateInternalMmResult(Result); + } + + Result = GetSoundDeviceType(SoundDevice, &DeviceType); + SND_ASSERT( Result == MMSYSERR_NOERROR ); + + Result = GetSoundDeviceInstanceHandle(SoundDeviceInstance, &Handle); + SND_ASSERT( Result == MMSYSERR_NOERROR ); + + ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO)); + DeviceInfo.hDevice = Handle; + DeviceInfo.DeviceType = DeviceType; + + Result = SyncOverlappedDeviceIoControl(KernelHandle, + IOCTL_OPEN_WDMAUD, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + + if ( ! MMSUCCESS(Result) ) + { + return TranslateInternalMmResult(Result); + } + + Time->wType = TIME_BYTES; + Time->u.cb = (DWORD)DeviceInfo.u.Position; + + return MMSYSERR_NOERROR; +} + +MMRESULT +ResetStream( + IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance, + IN MMDEVICE_TYPE DeviceType, + IN BOOLEAN bStartReset) +{ + MMRESULT Result; + HANDLE Handle; + WDMAUD_DEVICE_INFO DeviceInfo; + + Result = GetSoundDeviceInstanceHandle(SoundDeviceInstance, &Handle); + SND_ASSERT( Result == MMSYSERR_NOERROR ); + + ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO)); + DeviceInfo.hDevice = Handle; + DeviceInfo.DeviceType = DeviceType; + DeviceInfo.u.ResetStream = (bStartReset ? KSRESET_BEGIN : KSRESET_END); + + Result = SyncOverlappedDeviceIoControl(KernelHandle, + IOCTL_RESET_STREAM, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + return Result; +} + + +MMRESULT +QueryMixerInfo( + IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance, + IN UINT uMsg, + IN LPVOID Parameter, + IN DWORD Flags) +{ + MMRESULT Result; + WDMAUD_DEVICE_INFO DeviceInfo; + HANDLE Handle; + DWORD IoControlCode; + LPMIXERLINEW MixLine; + LPMIXERLINECONTROLSW MixControls; + LPMIXERCONTROLDETAILS MixDetails; + + SND_TRACE(L"uMsg %x Flags %x\n", uMsg, Flags); + + Result = GetSoundDeviceInstanceHandle(SoundDeviceInstance, &Handle); + SND_ASSERT( Result == MMSYSERR_NOERROR ); + + ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO)); + DeviceInfo.hDevice = Handle; + DeviceInfo.DeviceType = MIXER_DEVICE_TYPE; + DeviceInfo.Flags = Flags; + + MixLine = (LPMIXERLINEW)Parameter; + MixControls = (LPMIXERLINECONTROLSW)Parameter; + MixDetails = (LPMIXERCONTROLDETAILS)Parameter; + +#ifdef USE_MMIXER_LIB + switch(uMsg) + { + case MXDM_GETLINEINFO: + return WdmAudGetLineInfo(SoundDeviceInstance->Handle, MixLine, Flags); + case MXDM_GETLINECONTROLS: + return WdmAudGetLineControls(SoundDeviceInstance->Handle, MixControls, Flags); + case MXDM_SETCONTROLDETAILS: + return WdmAudSetControlDetails(SoundDeviceInstance->Handle, MixDetails, Flags); + break; + case MXDM_GETCONTROLDETAILS: + return WdmAudGetControlDetails(SoundDeviceInstance->Handle, MixDetails, Flags); + break; + default: + SND_ASSERT(0); + return MMSYSERR_NOTSUPPORTED; + } +#endif + + + switch(uMsg) + { + case MXDM_GETLINEINFO: + RtlCopyMemory(&DeviceInfo.u.MixLine, MixLine, sizeof(MIXERLINEW)); + IoControlCode = IOCTL_GETLINEINFO; + break; + case MXDM_GETLINECONTROLS: + RtlCopyMemory(&DeviceInfo.u.MixControls, MixControls, sizeof(MIXERLINECONTROLSW)); + IoControlCode = IOCTL_GETLINECONTROLS; + break; + case MXDM_SETCONTROLDETAILS: + RtlCopyMemory(&DeviceInfo.u.MixDetails, MixDetails, sizeof(MIXERCONTROLDETAILS)); + IoControlCode = IOCTL_SETCONTROLDETAILS; + break; + case MXDM_GETCONTROLDETAILS: + RtlCopyMemory(&DeviceInfo.u.MixDetails, MixDetails, sizeof(MIXERCONTROLDETAILS)); + IoControlCode = IOCTL_GETCONTROLDETAILS; + break; + default: + SND_ASSERT(0); + return MMSYSERR_NOTSUPPORTED; + } + + Result = SyncOverlappedDeviceIoControl(KernelHandle, + IoControlCode, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + + if ( ! MMSUCCESS(Result) ) + { + return Result; + } + + switch(uMsg) + { + case MXDM_GETLINEINFO: + { + RtlCopyMemory(MixLine, &DeviceInfo.u.MixLine, sizeof(MIXERLINEW)); + break; + } + } + + return Result; +} + + MMRESULT PopulateWdmDeviceList( + HANDLE Handle, MMDEVICE_TYPE DeviceType) { MMRESULT Result; @@ -37,13 +812,10 @@ MMFUNCTION_TABLE FuncTable; DWORD i; + VALIDATE_MMSYS_PARAMETER( Handle != INVALID_HANDLE_VALUE ); VALIDATE_MMSYS_PARAMETER( IS_VALID_SOUND_DEVICE_TYPE(DeviceType) ); -#ifdef USE_MMIXER_LIB - Result = WdmAudGetNumDevsByMMixer(DeviceType, &DeviceCount); -#else - Result = WdmAudGetNumWdmDevsByLegacy(DeviceType, &DeviceCount); -#endif + Result = GetNumWdmDevs(Handle, DeviceType, &DeviceCount); if ( ! MMSUCCESS(Result) ) { @@ -66,58 +838,41 @@ /* Set up our function table */ ZeroMemory(&FuncTable, sizeof(MMFUNCTION_TABLE)); -#ifdef USE_MMIXER_LIB - FuncTable.GetCapabilities = WdmAudGetCapabilitiesByMMixer; - FuncTable.Open = WdmAudOpenSoundDeviceByMMixer; - FuncTable.Close = WdmAudCloseSoundDeviceByMMixer; - FuncTable.GetDeviceInterfaceString = WdmAudGetDeviceInterfaceStringByMMixer; -#else - FuncTable.GetCapabilities = WdmAudGetCapabilitiesByLegacy; - FuncTable.Open = WdmAudOpenSoundDeviceByLegacy; - FuncTable.Close = WdmAudCloseSoundDeviceByLegacy; - FuncTable.GetDeviceInterfaceString = WdmAudGetDeviceInterfaceStringByLegacy; -#endif - + FuncTable.GetCapabilities = GetWdmDeviceCapabilities; FuncTable.QueryWaveFormatSupport = QueryWdmWaveDeviceFormatSupport; if (DeviceType == MIXER_DEVICE_TYPE) { -#ifdef USE_MMIXER_LIB - FuncTable.SetWaveFormat = WdmAudSetMixerDeviceFormatByMMixer; - FuncTable.QueryMixerInfo = WdmAudQueryMixerInfoByMMixer; + FuncTable.SetWaveFormat = SetWdmMixerDeviceFormat; + FuncTable.QueryMixerInfo = QueryMixerInfo; + } + else + { + FuncTable.SetWaveFormat = SetWdmWaveDeviceFormat; + } + + if (DeviceType == WAVE_IN_DEVICE_TYPE || DeviceType == WAVE_OUT_DEVICE_TYPE) + { + FuncTable.SetState = SetWdmWaveState; + FuncTable.ResetStream = ResetStream; + } + + FuncTable.Open = OpenWdmSoundDevice; + FuncTable.Close = CloseWdmSoundDevice; + FuncTable.GetDeviceInterfaceString = GetDeviceInterfaceString; +#ifndef USERMODE_MIXER + FuncTable.CommitWaveBuffer = WriteFileEx_Committer2; #else - FuncTable.SetWaveFormat = WdmAudSetMixerDeviceFormatByLegacy; - FuncTable.QueryMixerInfo = WdmAudQueryMixerInfoByLegacy; + FuncTable.CommitWaveBuffer = WriteFileEx_Remixer; #endif - } - - if (DeviceType == WAVE_IN_DEVICE_TYPE || DeviceType == WAVE_OUT_DEVICE_TYPE) - { -#ifdef USE_MMIXER_LIB - FuncTable.SetWaveFormat = WdmAudSetWdmWaveDeviceFormatByMMixer; - FuncTable.SetState = WdmAudSetWdmWaveStateByMMixer; - FuncTable.ResetStream = WdmAudResetStreamByMMixer; - FuncTable.GetPos = WdmAudGetWdmPositionByMMixer; -#else - FuncTable.SetWaveFormat = WdmAudSetWaveDeviceFormatByLegacy; - FuncTable.SetState = WdmAudSetWaveStateByLegacy; - FuncTable.ResetStream = WdmAudResetStreamByLegacy; - FuncTable.GetPos = WdmAudGetWavePositionByLegacy; -#endif - -#ifdef USE_MMIXER_LIB - FuncTable.CommitWaveBuffer = WdmAudCommitWaveBufferByMMixer; -#elif defined (USERMODE_MIXER) - FuncTable.CommitWaveBuffer = WriteFileEx_Remixer; -#else - FuncTable.CommitWaveBuffer = WriteFileEx_Committer2; -#endif - } + FuncTable.GetPos = GetWdmPosition; SetSoundDeviceFunctionTable(SoundDevice, &FuncTable); } return MMSYSERR_NOERROR; } + + LONG APIENTRY @@ -134,6 +889,7 @@ { case DRV_LOAD : { + HANDLE Handle; SND_TRACE(L"DRV_LOAD\n"); Result = InitEntrypointMutexes(); @@ -141,14 +897,9 @@ if ( ! MMSUCCESS(Result) ) return 0L; -#ifdef USE_MMIXER_LIB - if (!WdmAudInitUserModeMixer()) - { - SND_ERR(L"Failed to initialize mmixer lib\n"); - return 0; - } -#else - if (WdmAudOpenSoundDeviceByLegacy() != MMSYSERR_NOERROR) + OpenWdmSoundDevice(NULL, &Handle); + + if ( Handle == INVALID_HANDLE_VALUE ) { SND_ERR(L"Failed to open \\\\.\\wdmaud\n"); CleanupEntrypointMutexes(); @@ -157,16 +908,15 @@ return 0L; } -#endif /* Populate the device lists */ SND_TRACE(L"Populating device lists\n"); - PopulateWdmDeviceList(WAVE_OUT_DEVICE_TYPE); - PopulateWdmDeviceList(WAVE_IN_DEVICE_TYPE); - PopulateWdmDeviceList(MIDI_OUT_DEVICE_TYPE); - PopulateWdmDeviceList(MIDI_IN_DEVICE_TYPE); - PopulateWdmDeviceList(AUX_DEVICE_TYPE); - PopulateWdmDeviceList(MIXER_DEVICE_TYPE); + PopulateWdmDeviceList(KernelHandle, WAVE_OUT_DEVICE_TYPE); + PopulateWdmDeviceList(KernelHandle, WAVE_IN_DEVICE_TYPE); + PopulateWdmDeviceList(KernelHandle, MIDI_OUT_DEVICE_TYPE); + PopulateWdmDeviceList(KernelHandle, MIDI_IN_DEVICE_TYPE); + PopulateWdmDeviceList(KernelHandle, AUX_DEVICE_TYPE); + PopulateWdmDeviceList(KernelHandle, MIXER_DEVICE_TYPE); SND_TRACE(L"Initialisation complete\n"); @@ -177,11 +927,11 @@ { SND_TRACE(L"DRV_FREE\n"); -#ifdef USE_MMIXER_LIB - WdmAudCleanupMMixer(); -#else - WdmAudCleanupLegacy(); -#endif + if ( KernelHandle != INVALID_HANDLE_VALUE ) + { + CloseHandle(KernelHandle); + KernelHandle = INVALID_HANDLE_VALUE; + } /* TODO: Clean up the path names! */ UnlistAllSoundDevices(); @@ -235,6 +985,9 @@ switch ( fdwReason ) { case DLL_PROCESS_ATTACH : +#ifdef USE_MMIXER_LIB + WdmAudInitUserModeMixer(); +#endif SND_TRACE(L"WDMAUD.DRV - Process attached\n"); break; case DLL_PROCESS_DETACH :
14 years, 11 months
1
0
0
0
[dgorbachev] 44930: Chinese translations of NTVDM by Samuel Lee. Bug #5087.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Mon Jan 4 17:39:38 2010 New Revision: 44930 URL:
http://svn.reactos.org/svn/reactos?rev=44930&view=rev
Log: Chinese translations of NTVDM by Samuel Lee. Bug #5087. Added: trunk/reactos/subsystems/ntvdm/lang/zh-CN.rc (with props) trunk/reactos/subsystems/ntvdm/lang/zh-TW.rc (with props) Modified: trunk/reactos/subsystems/ntvdm/rsrc.rc Added: trunk/reactos/subsystems/ntvdm/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/lang/zh-C…
============================================================================== --- trunk/reactos/subsystems/ntvdm/lang/zh-CN.rc (added) +++ trunk/reactos/subsystems/ntvdm/lang/zh-CN.rc [iso-8859-1] Mon Jan 4 17:39:38 2010 @@ -1,0 +1,9 @@ +#include "resource.h" + +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED +STRINGTABLE DISCARDABLE +BEGIN + +STRING_WelcomeMsg, "ReactOS ÐéÄâ DOS »úÖ§³Ö¡£\n" +STRING_PromptMsg, "ÊäÈë r<cr> ÒÔ±ãÔËÐУ¬s<cr> ÒÔ±ã¹Ø±Õ»òÕß q<cr> ÒÔ±ãÁ¢¼´Í˳ö¡£" +END Propchange: trunk/reactos/subsystems/ntvdm/lang/zh-CN.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/subsystems/ntvdm/lang/zh-TW.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/lang/zh-T…
============================================================================== --- trunk/reactos/subsystems/ntvdm/lang/zh-TW.rc (added) +++ trunk/reactos/subsystems/ntvdm/lang/zh-TW.rc [iso-8859-1] Mon Jan 4 17:39:38 2010 @@ -1,0 +1,9 @@ +#include "resource.h" + +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL +STRINGTABLE DISCARDABLE +BEGIN + +STRING_WelcomeMsg, "ReactOS µêÀÀ DOS ¾÷¤ä´©¡C\n" +STRING_PromptMsg, "Áä¤J r<cr> ¥H«K¹B¦æ¡A s<cr> ¥H«KÃö³¬©ÎªÌ q<cr> ¥H«K¥ß§Y°h¥X¡C" +END Propchange: trunk/reactos/subsystems/ntvdm/lang/zh-TW.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/subsystems/ntvdm/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/rsrc.rc?r…
============================================================================== --- trunk/reactos/subsystems/ntvdm/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/rsrc.rc [iso-8859-1] Mon Jan 4 17:39:38 2010 @@ -19,3 +19,5 @@ #include "lang/pt-BR.rc" #include "lang/ru-RU.rc" #include "lang/sk-SK.rc" +#include "lang/zh-CN.rc" +#include "lang/zh-TW.rc"
14 years, 11 months
1
0
0
0
[gedmurphy] 44929: Rehack the explorer hack for secure CRT usage. This should fix the build, unless there are any more oddities in our tree.
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Mon Jan 4 17:10:33 2010 New Revision: 44929 URL:
http://svn.reactos.org/svn/reactos?rev=44929&view=rev
Log: Rehack the explorer hack for secure CRT usage. This should fix the build, unless there are any more oddities in our tree. Modified: trunk/reactos/base/shell/explorer/utility/utility.cpp trunk/reactos/base/shell/explorer/utility/utility.h trunk/reactos/base/shell/explorer/utility/xmlstorage.h Modified: trunk/reactos/base/shell/explorer/utility/utility.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/utilit…
============================================================================== --- trunk/reactos/base/shell/explorer/utility/utility.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/utility/utility.cpp [iso-8859-1] Mon Jan 4 17:10:33 2010 @@ -158,7 +158,7 @@ BOOL time_to_filetime(const time_t* t, FILETIME* ftime) { -#ifdef __STDC_WANT_SECURE_LIB__ +#if defined(__STDC_WANT_SECURE_LIB__) && defined(_MS_VER) SYSTEMTIME stime; struct tm tm_; struct tm* tm = &tm_; Modified: trunk/reactos/base/shell/explorer/utility/utility.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/utilit…
============================================================================== --- trunk/reactos/base/shell/explorer/utility/utility.h [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/utility/utility.h [iso-8859-1] Mon Jan 4 17:10:33 2010 @@ -183,7 +183,7 @@ // secure CRT functions -#ifdef __STDC_WANT_SECURE_LIB__ // for VS 2005: _MSC_VER>=1400 +#if defined(__STDC_WANT_SECURE_LIB__) && defined(_MS_VER) // for VS 2005: _MSC_VER>=1400 #define _stprintf_s1 _stprintf_s #define _stprintf_s2 _stprintf_s Modified: trunk/reactos/base/shell/explorer/utility/xmlstorage.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/utilit…
============================================================================== --- trunk/reactos/base/shell/explorer/utility/xmlstorage.h [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/utility/xmlstorage.h [iso-8859-1] Mon Jan 4 17:10:33 2010 @@ -512,7 +512,7 @@ { FileHolder(LPCTSTR path, LPCTSTR mode) { -#ifdef __STDC_WANT_SECURE_LIB__ // secure CRT functions using VS 2005 +#if defined(__STDC_WANT_SECURE_LIB__) && defined(_MS_VER) // secure CRT functions using VS 2005 if (_tfopen_s(&_pfile, path, mode) != 0) _pfile = NULL; #else
14 years, 11 months
1
0
0
0
[gedmurphy] 44928: Fix __STDC_WANT_SECURE_LIB__ redefinition
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Mon Jan 4 15:02:49 2010 New Revision: 44928 URL:
http://svn.reactos.org/svn/reactos?rev=44928&view=rev
Log: Fix __STDC_WANT_SECURE_LIB__ redefinition Modified: trunk/reactos/lib/sdk/crt/time/ctime.c Modified: trunk/reactos/lib/sdk/crt/time/ctime.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/time/ctime.c?r…
============================================================================== --- trunk/reactos/lib/sdk/crt/time/ctime.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/time/ctime.c [iso-8859-1] Mon Jan 4 15:02:49 2010 @@ -8,7 +8,6 @@ #define MINGW_HAS_SECURE_API 1 #include <tchar.h> -#define __STDC_WANT_SECURE_LIB__ #include <time.h> #include "bitsfixup.h"
14 years, 11 months
1
0
0
0
[gedmurphy] 44927: Add wcsncat back, it was removed accidentally
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Mon Jan 4 14:47:19 2010 New Revision: 44927 URL:
http://svn.reactos.org/svn/reactos?rev=44927&view=rev
Log: Add wcsncat back, it was removed accidentally Modified: trunk/reactos/include/crt/string.h Modified: trunk/reactos/include/crt/string.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/string.h?rev=4…
============================================================================== --- trunk/reactos/include/crt/string.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/string.h [iso-8859-1] Mon Jan 4 14:47:19 2010 @@ -112,6 +112,7 @@ _CRTIMP errno_t __cdecl wcscpy_s(wchar_t * Dest, size_t SizeInWords, const wchar_t * _Source); #endif _CRTIMP size_t __cdecl wcscspn(const wchar_t *_Str,const wchar_t *_Control); + _CRTIMP wchar_t *wcsncat(wchar_t *_Dest,const wchar_t *_Source,size_t _Count); _CRTIMP size_t __cdecl wcslen(const wchar_t *_Str); _CRTIMP _CRT_INSECURE_DEPRECATE(wcsnlen_s) size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount); #if __STDC_WANT_SECURE_LIB__
14 years, 11 months
1
0
0
0
[gedmurphy] 44926: Add some of the string safe stuff to the headers.
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Mon Jan 4 14:36:59 2010 New Revision: 44926 URL:
http://svn.reactos.org/svn/reactos?rev=44926&view=rev
Log: Add some of the string safe stuff to the headers. Modified: trunk/reactos/include/crt/crtdefs.h trunk/reactos/include/crt/string.h Modified: trunk/reactos/include/crt/crtdefs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/crtdefs.h?rev=…
============================================================================== --- trunk/reactos/include/crt/crtdefs.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/crtdefs.h [iso-8859-1] Mon Jan 4 14:36:59 2010 @@ -163,7 +163,17 @@ /** Deprecated ***************************************************************/ -#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated) +#ifdef __GNUC__ +#define _CRT_DEPRECATE_TEXT(_Text) __attribute__ ((deprecated)) +#elif defined(_MSC_VER) +#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text)) +#else +#define _CRT_DEPRECATE_TEXT(_Text) +#endif + +#ifndef __STDC_WANT_SECURE_LIB__ +#define __STDC_WANT_SECURE_LIB__ 1 +#endif #ifndef _CRT_INSECURE_DEPRECATE # ifdef _CRT_SECURE_NO_DEPRECATE Modified: trunk/reactos/include/crt/string.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/string.h?rev=4…
============================================================================== --- trunk/reactos/include/crt/string.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/string.h [iso-8859-1] Mon Jan 4 14:36:59 2010 @@ -101,16 +101,27 @@ #define _WSTRING_DEFINED _CRTIMP wchar_t *__cdecl _wcsdup(const wchar_t *_Str); - _CRTIMP wchar_t *__cdecl wcscat(wchar_t *_Dest,const wchar_t *_Source); + _CRTIMP _CRT_INSECURE_DEPRECATE(wcsat_s) wchar_t *__cdecl wcscat(wchar_t *_Dest,const wchar_t *_Source); +#if __STDC_WANT_SECURE_LIB__ + _CRTIMP errno_t __cdecl wcsat_s(wchar_t * Dest, size_t SizeInWords, const wchar_t * _Source); +#endif _CRTIMP _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch); _CRTIMP int __cdecl wcscmp(const wchar_t *_Str1,const wchar_t *_Str2); - _CRTIMP wchar_t *__cdecl wcscpy(wchar_t *_Dest,const wchar_t *_Source); + _CRTIMP _CRT_INSECURE_DEPRECATE(wcscpy_s) wchar_t *__cdecl wcscpy(wchar_t *_Dest,const wchar_t *_Source); +#if __STDC_WANT_SECURE_LIB__ + _CRTIMP errno_t __cdecl wcscpy_s(wchar_t * Dest, size_t SizeInWords, const wchar_t * _Source); +#endif _CRTIMP size_t __cdecl wcscspn(const wchar_t *_Str,const wchar_t *_Control); _CRTIMP size_t __cdecl wcslen(const wchar_t *_Str); - _CRTIMP size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount); - _CRTIMP wchar_t *wcsncat(wchar_t *_Dest,const wchar_t *_Source,size_t _Count); + _CRTIMP _CRT_INSECURE_DEPRECATE(wcsnlen_s) size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount); +#if __STDC_WANT_SECURE_LIB__ + _CRTIMP errno_t __cdecl wcsnlen_s(wchar_t **_Src, size_t _MaxCount); +#endif _CRTIMP int __cdecl wcsncmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); - _CRTIMP wchar_t *wcsncpy(wchar_t *_Dest,const wchar_t *_Source,size_t _Count); + _CRTIMP _CRT_INSECURE_DEPRECATE(wcsncpy_s) wchar_t *wcsncpy(wchar_t *_Dest,const wchar_t *_Source,size_t _Count); +#if __STDC_WANT_SECURE_LIB__ + _CRTIMP errno_t __cdecl wcsncpy_s(wchar_t *_Dest, size_t SizeInWords, const wchar_t *_Source ,size_t _Count); +#endif _CRTIMP _CONST_RETURN wchar_t *__cdecl wcspbrk(const wchar_t *_Str,const wchar_t *_Control); _CRTIMP _CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch); _CRTIMP size_t __cdecl wcsspn(const wchar_t *_Str,const wchar_t *_Control);
14 years, 11 months
1
0
0
0
[fireball] 44925: - Remove unnecessary line from FreeEnvironmentStringsW. See issue #5073 for more details.
by fireball@svn.reactos.org
Author: fireball Date: Mon Jan 4 12:17:57 2010 New Revision: 44925 URL:
http://svn.reactos.org/svn/reactos?rev=44925&view=rev
Log: - Remove unnecessary line from FreeEnvironmentStringsW. See issue #5073 for more details. Modified: trunk/reactos/dll/win32/kernel32/misc/env.c Modified: trunk/reactos/dll/win32/kernel32/misc/env.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/en…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/env.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/env.c [iso-8859-1] Mon Jan 4 12:17:57 2010 @@ -382,7 +382,6 @@ LPWSTR EnvironmentStrings ) { - (void)EnvironmentStrings; return TRUE; }
14 years, 11 months
1
0
0
0
← Newer
1
...
41
42
43
44
45
46
47
...
53
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Results per page:
10
25
50
100
200