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
March 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
28 participants
483 discussions
Start a n
N
ew thread
[fireball] 39903: - Fix UsbBuildGetStatusRequest macro.
by fireball@svn.reactos.org
Author: fireball Date: Sat Mar 7 23:15:29 2009 New Revision: 39903 URL:
http://svn.reactos.org/svn/reactos?rev=39903&view=rev
Log: - Fix UsbBuildGetStatusRequest macro. Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.h Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.h [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.h [iso-8859-1] Sat Mar 7 23:15:29 2009 @@ -129,12 +129,12 @@ ( uRb )->endp_handle = ( endp_hanDle ); \ ( uRb )->data_buffer = ( transferBufFer ); \ ( uRb )->data_length = sizeof(USHORT); \ - ( uRb )->compleiton = ( completIon );\ + ( uRb )->completion = ( completIon );\ ( uRb )->context = ( contExt );\ ( uRb )->reference = ( refereNce );\ pseTup->bmRequestType = ( 0x80 | recipiEnt );\ pseTup->bRequest = USB_REQ_GET_STATUS;\ - pseTup->wIndex = ( index ); \ + pseTup->wIndex = ( inDex ); \ pseTup->wValue = 0;\ pseTup->wLength = sizeof( USHORT );\ }
15 years, 9 months
1
0
0
0
[janderwald] 39902: - Rewrite writing to common buffer to fix stuttering sound
by janderwald@svn.reactos.org
Author: janderwald Date: Sat Mar 7 22:59:57 2009 New Revision: 39902 URL:
http://svn.reactos.org/svn/reactos?rev=39902&view=rev
Log: - Rewrite writing to common buffer to fix stuttering sound Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c [iso-8859-1] Sat Mar 7 22:59:57 2009 @@ -94,12 +94,78 @@ static VOID +UpdateCommonBuffer( + IPortPinWaveCyclicImpl * This, + ULONG Position) +{ + ULONG BufferLength; + ULONG BytesToCopy; + ULONG BufferSize; + PUCHAR Buffer; + NTSTATUS Status; + + BufferLength = Position - This->CommonBufferOffset; + while(BufferLength) + { + Status = This->IrpQueue->lpVtbl->GetMapping(This->IrpQueue, &Buffer, &BufferSize); + if (!NT_SUCCESS(Status)) + return; + + BytesToCopy = min(BufferLength, BufferSize); + This->DmaChannel->lpVtbl->CopyTo(This->DmaChannel, + (PUCHAR)This->CommonBuffer + This->CommonBufferOffset, + Buffer, + BytesToCopy); + + This->IrpQueue->lpVtbl->UpdateMapping(This->IrpQueue, BytesToCopy); + This->CommonBufferOffset += BytesToCopy; + + BufferLength = Position - This->CommonBufferOffset; + } +} + +static +VOID +UpdateCommonBufferOverlap( + IPortPinWaveCyclicImpl * This, + ULONG Position) +{ + ULONG BufferLength; + ULONG BytesToCopy; + ULONG BufferSize; + PUCHAR Buffer; + NTSTATUS Status; + + BufferLength = This->CommonBufferSize - This->CommonBufferOffset; + while(BufferLength) + { + Status = This->IrpQueue->lpVtbl->GetMapping(This->IrpQueue, &Buffer, &BufferSize); + if (!NT_SUCCESS(Status)) + return; + + BytesToCopy = min(BufferLength, BufferSize); + This->DmaChannel->lpVtbl->CopyTo(This->DmaChannel, + (PUCHAR)This->CommonBuffer + This->CommonBufferOffset, + Buffer, + BytesToCopy); + + This->IrpQueue->lpVtbl->UpdateMapping(This->IrpQueue, BytesToCopy); + This->CommonBufferOffset += BytesToCopy; + + BufferLength = This->CommonBufferSize - This->CommonBufferOffset; + } + This->CommonBufferOffset = 0; + UpdateCommonBuffer(This, Position); +} + + +static +VOID NTAPI IServiceSink_fnRequestService( IServiceSink* iface) { ULONG Position; - ULONG BufferLength, BytesToCopy; NTSTATUS Status; PUCHAR Buffer; ULONG BufferSize; @@ -134,57 +200,12 @@ if (Position < This->CommonBufferOffset) { - BufferLength = This->CommonBufferSize - This->CommonBufferOffset; - - BytesToCopy = min(BufferLength, BufferSize); - - DPRINT("Copying %u\n", BytesToCopy); - - if (BytesToCopy) - { - This->DmaChannel->lpVtbl->CopyTo(This->DmaChannel, (PUCHAR)This->CommonBuffer + This->CommonBufferOffset, Buffer, BytesToCopy); - This->IrpQueue->lpVtbl->UpdateMapping(This->IrpQueue, BytesToCopy); - This->CommonBufferOffset = 0; - } - - - Status = This->IrpQueue->lpVtbl->GetMapping(This->IrpQueue, &Buffer, &BufferSize); - if (!NT_SUCCESS(Status)) - { - DPRINT("IServiceSink_fnRequestService> Waiting for mapping\n"); - This->ServiceGroup->lpVtbl->RequestDelayedService(This->ServiceGroup, -10000000L); - This->RetryCount++; - return; - } - - BytesToCopy = min(Position, BufferSize); - - DPRINT("Copying %u\n", BytesToCopy); - - if (BytesToCopy) - { - This->DmaChannel->lpVtbl->CopyTo(This->DmaChannel, (PUCHAR)(PUCHAR)This->CommonBuffer, Buffer, BytesToCopy); - This->IrpQueue->lpVtbl->UpdateMapping(This->IrpQueue, BytesToCopy); - This->CommonBufferOffset = Position; - } - + UpdateCommonBufferOverlap(This, Position); } else if (Position >= This->CommonBufferOffset) { - BufferLength = Position - This->CommonBufferOffset; - - BytesToCopy = min(BufferLength, BufferSize); - DPRINT("Copying %u\n", BytesToCopy); - - This->DmaChannel->lpVtbl->CopyTo(This->DmaChannel, - (PUCHAR)This->CommonBuffer + This->CommonBufferOffset, - Buffer, - BytesToCopy); - - This->IrpQueue->lpVtbl->UpdateMapping(This->IrpQueue, BytesToCopy); - This->CommonBufferOffset = Position; - } - + UpdateCommonBuffer(This, Position); + } } static IServiceSinkVtbl vt_IServiceSink =
15 years, 9 months
1
0
0
0
[janderwald] 39901: - Free queued audio buffers and complete irps
by janderwald@svn.reactos.org
Author: janderwald Date: Sat Mar 7 20:41:03 2009 New Revision: 39901 URL:
http://svn.reactos.org/svn/reactos?rev=39901&view=rev
Log: - Free queued audio buffers and complete irps Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c [iso-8859-1] Sat Mar 7 20:41:03 2009 @@ -15,7 +15,6 @@ { KSSTREAM_HEADER *Header; PIRP Irp; - LIST_ENTRY Entry; struct _IRP_MAPPING_ * Next; }IRP_MAPPING, *PIRP_MAPPING; @@ -32,8 +31,16 @@ LONG NumMappings; IN KSPIN_CONNECT *ConnectDetails; + KDPC Dpc; PIRP_MAPPING FirstMap; PIRP_MAPPING LastMap; + + ULONG DpcActive; + PIRP_MAPPING FreeMapHead; + PIRP_MAPPING FreeMapTail; + + LONG FreeCount; + }IIrpQueueImpl; VOID @@ -42,7 +49,35 @@ IN struct _KDPC *Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, - IN PVOID SystemArgument2); + IN PVOID SystemArgument2) +{ + PIRP_MAPPING CurMapping, NextMapping = NULL; + ULONG Count; + IIrpQueueImpl * This = (IIrpQueueImpl*)DeferredContext; + + CurMapping = (PIRP_MAPPING)SystemArgument1; + ASSERT(CurMapping); + + Count = 0; + while(CurMapping) + { + NextMapping = CurMapping->Next; + + CurMapping->Irp->IoStatus.Information = CurMapping->Header->DataUsed; + CurMapping->Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(CurMapping->Irp, IO_SOUND_INCREMENT); + + ExFreePool(CurMapping->Header->Data); + ExFreePool(CurMapping->Header); + ExFreePool(CurMapping); + + CurMapping = NextMapping; + InterlockedDecrement(&This->FreeCount); + Count++; + } + This->DpcActive = FALSE; + DPRINT1("Freed %u Buffers / IRP\n", Count); +} NTSTATUS @@ -102,6 +137,7 @@ IIrpQueueImpl * This = (IIrpQueueImpl*)iface; This->ConnectDetails = ConnectDetails; + KeInitializeDpc(&This->Dpc, DpcRoutine, (PVOID)This); return STATUS_SUCCESS; } @@ -123,6 +159,7 @@ Mapping->Header = (KSSTREAM_HEADER*)Buffer; Mapping->Irp = Irp; + Mapping->Next = NULL; if (!This->FirstMap) This->FirstMap = Mapping; @@ -175,10 +212,24 @@ Mapping = This->FirstMap; This->FirstMap = This->FirstMap->Next; - //ExFreePool(Mapping->Header->Data); - //ExFreePool(Mapping->Header); - //IoCompleteRequest(Mapping->Irp, IO_NO_INCREMENT); - //ExFreePool(Mapping); + This->FreeCount++; + + if (!This->FreeMapHead) + This->FreeMapHead = Mapping; + else + This->FreeMapTail->Next = Mapping; + + This->FreeMapTail = Mapping; + Mapping->Next = NULL; + + if (This->FreeCount > iface->lpVtbl->MinMappings(iface) && This->DpcActive == FALSE) + { + Mapping = This->FreeMapHead; + This->FreeMapHead = NULL; + This->FreeMapTail = NULL; + This->DpcActive = TRUE; + KeInsertQueueDpc(&This->Dpc, (PVOID)Mapping, NULL); + } } }
15 years, 9 months
1
0
0
0
[dchapyshev] 39900: - Sync comctl32, cryptui, mlang, msctf, netapi32, ole32, urlmon with Wine head
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sat Mar 7 11:34:55 2009 New Revision: 39900 URL:
http://svn.reactos.org/svn/reactos?rev=39900&view=rev
Log: - Sync comctl32, cryptui, mlang, msctf, netapi32, ole32, urlmon with Wine head Added: trunk/reactos/dll/win32/urlmon/gopher.c (with props) Modified: trunk/reactos/dll/win32/comctl32/status.c trunk/reactos/dll/win32/comctl32/treeview.c trunk/reactos/dll/win32/cryptui/main.c trunk/reactos/dll/win32/mlang/mlang.c trunk/reactos/dll/win32/msctf/msctf.c trunk/reactos/dll/win32/netapi32/access.c trunk/reactos/dll/win32/netapi32/nbt.c trunk/reactos/dll/win32/netapi32/netbios.c trunk/reactos/dll/win32/netapi32/wksta.c trunk/reactos/dll/win32/ole32/ole2.c trunk/reactos/dll/win32/urlmon/umon.c trunk/reactos/dll/win32/urlmon/umstream.c trunk/reactos/dll/win32/urlmon/urlmon.rbuild trunk/reactos/dll/win32/urlmon/urlmon_main.c trunk/reactos/dll/win32/urlmon/urlmon_main.h Modified: trunk/reactos/dll/win32/comctl32/status.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/status.…
============================================================================== --- trunk/reactos/dll/win32/comctl32/status.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/status.c [iso-8859-1] Sat Mar 7 11:34:55 2009 @@ -762,6 +762,7 @@ part->text = (LPWSTR)text; } else { LPWSTR ntext; + WCHAR *idx; if (text && !isW) { LPCSTR atxt = (LPCSTR)text; @@ -774,6 +775,16 @@ if (!ntext) return FALSE; strcpyW (ntext, text); } else ntext = 0; + + /* replace nonprintable characters with spaces */ + if (ntext) { + idx = ntext; + while (*idx) { + if(!isprintW(*idx)) + *idx = ' '; + idx++; + } + } /* check if text is unchanged -> no need to redraw */ if (text) { Modified: trunk/reactos/dll/win32/comctl32/treeview.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/treevie…
============================================================================== --- trunk/reactos/dll/win32/comctl32/treeview.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/treeview.c [iso-8859-1] Sat Mar 7 11:34:55 2009 @@ -2306,11 +2306,13 @@ & (TVS_LINESATROOT|TVS_HASLINES|TVS_HASBUTTONS)) > TVS_LINESATROOT); HBRUSH hbr, hbrOld; + COLORREF clrBk = infoPtr->clrBk == -1 ? GetSysColor(COLOR_WINDOW): + infoPtr->clrBk; if (!lar && item->iLevel == 0) return; - hbr = CreateSolidBrush(infoPtr->clrBk); + hbr = CreateSolidBrush(clrBk); hbrOld = SelectObject(hdc, hbr); centerx = (item->linesOffset + item->stateOffset) / 2; @@ -2423,8 +2425,8 @@ { Rectangle(hdc, centerx - 1, centery - plussize + 1, centerx + 2, centery + plussize); - SetPixel(hdc, centerx - 1, centery, infoPtr->clrBk); - SetPixel(hdc, centerx + 1, centery, infoPtr->clrBk); + SetPixel(hdc, centerx - 1, centery, clrBk); + SetPixel(hdc, centerx + 1, centery, clrBk); } } } @@ -2472,7 +2474,8 @@ } else { - nmcdhdr.clrTextBk = infoPtr->clrBk; + nmcdhdr.clrTextBk = infoPtr->clrBk == -1 ? GetSysColor(COLOR_WINDOW): + infoPtr->clrBk; if ((infoPtr->dwStyle & TVS_TRACKSELECT) && (wineItem == infoPtr->hotItem)) nmcdhdr.clrText = comctl32_color.clrHighlight; else if (infoPtr->clrText == -1) @@ -2782,9 +2785,12 @@ static LRESULT TREEVIEW_EraseBackground(const TREEVIEW_INFO *infoPtr, HDC hDC) { - HBRUSH hBrush = CreateSolidBrush(infoPtr->clrBk); + HBRUSH hBrush; + COLORREF clrBk = infoPtr->clrBk == -1 ? GetSysColor(COLOR_WINDOW): + infoPtr->clrBk; RECT rect; + hBrush = CreateSolidBrush(clrBk); GetClientRect(infoPtr->hwnd, &rect); FillRect(hDC, &rect, hBrush); DeleteObject(hBrush); @@ -4942,7 +4948,7 @@ infoPtr->scrollX = 0; - infoPtr->clrBk = GetSysColor(COLOR_WINDOW); + infoPtr->clrBk = -1; /* use system color */ infoPtr->clrText = -1; /* use system color */ infoPtr->clrLine = RGB(128, 128, 128); infoPtr->clrInsertMark = GetSysColor(COLOR_BTNTEXT); Modified: trunk/reactos/dll/win32/cryptui/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/cryptui/main.c?r…
============================================================================== --- trunk/reactos/dll/win32/cryptui/main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/cryptui/main.c [iso-8859-1] Sat Mar 7 11:34:55 2009 @@ -3236,8 +3236,7 @@ name = HeapAlloc(GetProcessHeap(), 0, cb); if (name) { - if (!CertGetCertificateContextProperty(cert, prop, (LPBYTE)name, - &cb)) + if (!CertGetCertificateContextProperty(cert, prop, name, &cb)) { HeapFree(GetProcessHeap(), 0, name); name = NULL; @@ -4460,7 +4459,7 @@ if (CryptDecodeObjectEx(X509_ASN_ENCODING, szOID_BASIC_CONSTRAINTS, ext->Value.pbData, ext->Value.cbData, CRYPT_DECODE_ALLOC_FLAG, - NULL, (LPBYTE)&info, &size)) + NULL, &info, &size)) { if (info->SubjectType.cbData == 1) isCA = info->SubjectType.pbData[0] & CERT_CA_SUBJECT_FLAG; Modified: trunk/reactos/dll/win32/mlang/mlang.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mlang/mlang.c?re…
============================================================================== --- trunk/reactos/dll/win32/mlang/mlang.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mlang/mlang.c [iso-8859-1] Sat Mar 7 11:34:55 2009 @@ -1495,7 +1495,7 @@ static inline EnumCodePage_impl *impl_from_IEnumCodePage( IEnumCodePage *iface ) { - return (EnumCodePage_impl *)CONTAINING_RECORD( iface, EnumCodePage_impl, vtbl_IEnumCodePage ); + return CONTAINING_RECORD( iface, EnumCodePage_impl, vtbl_IEnumCodePage ); } static HRESULT WINAPI fnIEnumCodePage_QueryInterface( @@ -1688,7 +1688,7 @@ static inline EnumScript_impl *impl_from_IEnumScript( IEnumScript *iface ) { - return (EnumScript_impl *)CONTAINING_RECORD( iface, EnumScript_impl, vtbl_IEnumScript ); + return CONTAINING_RECORD( iface, EnumScript_impl, vtbl_IEnumScript ); } static HRESULT WINAPI fnIEnumScript_QueryInterface( @@ -1850,7 +1850,7 @@ static inline MLang_impl *impl_from_IMLangFontLink( IMLangFontLink *iface ) { - return (MLang_impl *)CONTAINING_RECORD( iface, MLang_impl, vtbl_IMLangFontLink ); + return CONTAINING_RECORD( iface, MLang_impl, vtbl_IMLangFontLink ); } static HRESULT WINAPI fnIMLangFontLink_QueryInterface( @@ -1954,7 +1954,7 @@ TRACE("(%p) Seeking %u\n",This, uCodePage); - rc = TranslateCharsetInfo((DWORD*)uCodePage, &cs, TCI_SRCCODEPAGE); + rc = TranslateCharsetInfo((DWORD*)(DWORD_PTR)uCodePage, &cs, TCI_SRCCODEPAGE); if (rc) { @@ -1985,8 +1985,9 @@ *puCodePage = 0x00000000; - rc = TranslateCharsetInfo((DWORD*)uDefaultCodePage, &cs, TCI_SRCCODEPAGE); - + rc = TranslateCharsetInfo((DWORD*)(DWORD_PTR)uDefaultCodePage, &cs, + TCI_SRCCODEPAGE); + if (rc && (dwCodePages & cs.fs.fsCsb[0])) { TRACE("Found Default Codepage\n"); @@ -2087,7 +2088,7 @@ static inline MLang_impl *impl_from_IMultiLanguage( IMultiLanguage *iface ) { - return (MLang_impl *)CONTAINING_RECORD( iface, MLang_impl, vtbl_IMultiLanguage ); + return CONTAINING_RECORD( iface, MLang_impl, vtbl_IMultiLanguage ); } static HRESULT WINAPI fnIMultiLanguage_QueryInterface( @@ -2280,7 +2281,7 @@ static inline EnumRfc1766_impl *impl_from_IEnumRfc1766( IEnumRfc1766 *iface ) { - return (EnumRfc1766_impl *)CONTAINING_RECORD( iface, EnumRfc1766_impl, vtbl_IEnumRfc1766 ); + return CONTAINING_RECORD( iface, EnumRfc1766_impl, vtbl_IEnumRfc1766 ); } static HRESULT WINAPI fnIEnumRfc1766_QueryInterface( @@ -2550,7 +2551,7 @@ static inline MLang_impl *impl_from_IMultiLanguage3( IMultiLanguage3 *iface ) { - return (MLang_impl *)CONTAINING_RECORD( iface, MLang_impl, vtbl_IMultiLanguage3 ); + return CONTAINING_RECORD( iface, MLang_impl, vtbl_IMultiLanguage3 ); } static HRESULT WINAPI fnIMultiLanguage2_QueryInterface( @@ -2592,7 +2593,8 @@ { CHARSETINFO csi; - if (TranslateCharsetInfo((DWORD *)ml_data->family_codepage, &csi, TCI_SRCCODEPAGE)) + if (TranslateCharsetInfo((DWORD*)(DWORD_PTR)ml_data->family_codepage, &csi, + TCI_SRCCODEPAGE)) mime_cp_info->bGDICharset = csi.ciCharset; else mime_cp_info->bGDICharset = DEFAULT_CHARSET; @@ -3169,7 +3171,7 @@ static inline MLang_impl *impl_from_IMLangFontLink2( IMLangFontLink2 *iface ) { - return (MLang_impl *)CONTAINING_RECORD( iface, MLang_impl, vtbl_IMLangFontLink2 ); + return CONTAINING_RECORD( iface, MLang_impl, vtbl_IMLangFontLink2 ); } static HRESULT WINAPI fnIMLangFontLink2_QueryInterface( @@ -3323,7 +3325,7 @@ static inline MLang_impl *impl_from_IMLangLineBreakConsole( IMLangLineBreakConsole *iface ) { - return (MLang_impl *)CONTAINING_RECORD( iface, MLang_impl, vtbl_IMLangLineBreakConsole ); + return CONTAINING_RECORD( iface, MLang_impl, vtbl_IMLangLineBreakConsole ); } static HRESULT WINAPI fnIMLangLineBreakConsole_QueryInterface( Modified: trunk/reactos/dll/win32/msctf/msctf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/msctf.c?re…
============================================================================== --- trunk/reactos/dll/win32/msctf/msctf.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/msctf.c [iso-8859-1] Sat Mar 7 11:34:55 2009 @@ -148,7 +148,7 @@ This->vtbl = &ClassFactoryVtbl; This->ref = 1; This->ctor = ctor; - *ppvOut = (LPVOID)This; + *ppvOut = This; TRACE("Created class factory %p\n", This); MSCTF_refCount++; return S_OK; @@ -217,7 +217,7 @@ HRESULT WINAPI TF_GetThreadMgr(ITfThreadMgr **pptim) { TRACE("\n"); - *pptim = (ITfThreadMgr*)TlsGetValue(tlsIndex); + *pptim = TlsGetValue(tlsIndex); if (*pptim) ITfThreadMgr_AddRef(*pptim); Modified: trunk/reactos/dll/win32/netapi32/access.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/access.…
============================================================================== --- trunk/reactos/dll/win32/netapi32/access.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/access.c [iso-8859-1] Sat Mar 7 11:34:55 2009 @@ -658,7 +658,7 @@ admin_size - sizeof(NET_DISPLAY_USER) + guest_size - sizeof(NET_DISPLAY_USER), SortedBuffer); - inf = (PNET_DISPLAY_USER) *SortedBuffer; + inf = *SortedBuffer; str = (LPWSTR) ((PBYTE) inf + sizeof(NET_DISPLAY_USER) * records); inf->usri1_name = str; str = (LPWSTR) ( @@ -826,8 +826,7 @@ } umi = (USER_MODALS_INFO_2 *) *pbuffer; - umi->usrmod2_domain_id = (PSID)(*pbuffer + - sizeof(USER_MODALS_INFO_2)); + umi->usrmod2_domain_id = *pbuffer + sizeof(USER_MODALS_INFO_2); umi->usrmod2_domain_name = (LPWSTR)(*pbuffer + sizeof(USER_MODALS_INFO_2) + GetLengthSid(domainIdentifier)); Modified: trunk/reactos/dll/win32/netapi32/nbt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/nbt.c?r…
============================================================================== --- trunk/reactos/dll/win32/netapi32/nbt.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/nbt.c [iso-8859-1] Sat Mar 7 11:34:55 2009 @@ -400,7 +400,7 @@ static BOOL NetBTFindNameAnswerCallback(void *pVoid, WORD answerCount, WORD answerIndex, PUCHAR rData, WORD rLen) { - NetBTNameQueryData *queryData = (NetBTNameQueryData *)pVoid; + NetBTNameQueryData *queryData = pVoid; BOOL ret; if (queryData) @@ -696,7 +696,7 @@ static BOOL NetBTNodeStatusAnswerCallback(void *pVoid, WORD answerCount, WORD answerIndex, PUCHAR rData, WORD rLen) { - NetBTNodeQueryData *data = (NetBTNodeQueryData *)pVoid; + NetBTNodeQueryData *data = pVoid; if (data && !data->gotResponse && rData && rLen >= 1) { @@ -811,7 +811,7 @@ static UCHAR NetBTAstat(void *adapt, PNCB ncb) { - NetBTAdapter *adapter = (NetBTAdapter *)adapt; + NetBTAdapter *adapter = adapt; UCHAR ret; TRACE("adapt %p, NCB %p\n", adapt, ncb); @@ -856,7 +856,7 @@ static UCHAR NetBTFindName(void *adapt, PNCB ncb) { - NetBTAdapter *adapter = (NetBTAdapter *)adapt; + NetBTAdapter *adapter = adapt; UCHAR ret; const NBNameCacheEntry *cacheEntry = NULL; PFIND_NAME_HEADER foundName; @@ -973,7 +973,7 @@ static UCHAR NetBTCall(void *adapt, PNCB ncb, void **sess) { - NetBTAdapter *adapter = (NetBTAdapter *)adapt; + NetBTAdapter *adapter = adapt; UCHAR ret; const NBNameCacheEntry *cacheEntry = NULL; @@ -1074,8 +1074,8 @@ */ static UCHAR NetBTSend(void *adapt, void *sess, PNCB ncb) { - NetBTAdapter *adapter = (NetBTAdapter *)adapt; - NetBTSession *session = (NetBTSession *)sess; + NetBTAdapter *adapter = adapt; + NetBTSession *session = sess; UCHAR buffer[NBSS_HDRSIZE], ret; int r; WSABUF wsaBufs[2]; @@ -1123,8 +1123,8 @@ static UCHAR NetBTRecv(void *adapt, void *sess, PNCB ncb) { - NetBTAdapter *adapter = (NetBTAdapter *)adapt; - NetBTSession *session = (NetBTSession *)sess; + NetBTAdapter *adapter = adapt; + NetBTSession *session = sess; UCHAR buffer[NBSS_HDRSIZE], ret; int r; WSABUF wsaBufs[2]; @@ -1231,7 +1231,7 @@ static UCHAR NetBTHangup(void *adapt, void *sess) { - NetBTSession *session = (NetBTSession *)sess; + NetBTSession *session = sess; TRACE("adapt %p, session %p\n", adapt, session); @@ -1255,7 +1255,7 @@ TRACE("adapt %p\n", adapt); if (adapt) { - NetBTAdapter *adapter = (NetBTAdapter *)adapt; + NetBTAdapter *adapter = adapt; if (adapter->nameCache) NBNameCacheDestroy(adapter->nameCache); @@ -1310,7 +1310,7 @@ ULONG transport, const NetBIOSAdapterImpl *data, void *closure) { BOOL ret; - PMIB_IPADDRTABLE table = (PMIB_IPADDRTABLE)closure; + PMIB_IPADDRTABLE table = closure; if (table && data) { @@ -1319,7 +1319,7 @@ ret = FALSE; for (ndx = 0; !ret && ndx < table->dwNumEntries; ndx++) { - const NetBTAdapter *adapter = (const NetBTAdapter *)data->data; + const NetBTAdapter *adapter = data->data; if (table->table[ndx].dwIndex == adapter->ipr.dwIndex) { Modified: trunk/reactos/dll/win32/netapi32/netbios.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/netbios…
============================================================================== --- trunk/reactos/dll/win32/netapi32/netbios.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/netbios.c [iso-8859-1] Sat Mar 7 11:34:55 2009 @@ -762,7 +762,7 @@ static DWORD WINAPI nbCmdThread(LPVOID lpVoid) { - PNCB ncb = (PNCB)lpVoid; + PNCB ncb = lpVoid; if (ncb) { Modified: trunk/reactos/dll/win32/netapi32/wksta.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/wksta.c…
============================================================================== --- trunk/reactos/dll/win32/netapi32/wksta.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/wksta.c [iso-8859-1] Sat Mar 7 11:34:55 2009 @@ -157,8 +157,7 @@ ULONG transport, const NetBIOSAdapterImpl *data, void *closure) { BOOL ret; - struct WkstaTransportEnumData *enumData = (struct WkstaTransportEnumData *) - closure; + struct WkstaTransportEnumData *enumData = closure; if (enumData && enumData->pbuf) { Modified: trunk/reactos/dll/win32/ole32/ole2.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ole2.c?rev…
============================================================================== --- trunk/reactos/dll/win32/ole32/ole2.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/ole2.c [iso-8859-1] Sat Mar 7 11:34:55 2009 @@ -2642,6 +2642,7 @@ case VT_BSTR: case VT_ERROR: case VT_BOOL: + case VT_DECIMAL: case VT_UI1: case VT_UI2: case VT_UI4: @@ -2712,6 +2713,7 @@ case VT_DATE: case VT_ERROR: case VT_BOOL: + case VT_DECIMAL: case VT_UI1: case VT_UI2: case VT_UI4: @@ -2799,7 +2801,7 @@ ULONG len; HRESULT hr; - TRACE("(%p, %p)\n", pvarDest, pvarSrc); + TRACE("(%p, %p vt %04x)\n", pvarDest, pvarSrc, pvarSrc->vt); hr = PROPVARIANT_ValidateType(pvarSrc->vt); if (FAILED(hr)) @@ -2817,6 +2819,7 @@ case VT_I2: case VT_UI2: case VT_BOOL: + case VT_DECIMAL: case VT_I4: case VT_UI4: case VT_R4: Added: trunk/reactos/dll/win32/urlmon/gopher.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/gopher.c?…
============================================================================== --- trunk/reactos/dll/win32/urlmon/gopher.c (added) +++ trunk/reactos/dll/win32/urlmon/gopher.c [iso-8859-1] Sat Mar 7 11:34:55 2009 @@ -1,0 +1,299 @@ +/* + * Copyright 2009 Jacek Caban for CodeWeavers + * + * 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 "urlmon_main.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(urlmon); + +typedef struct { + Protocol base; + + const IInternetProtocolVtbl *lpInternetProtocolVtbl; + const IInternetPriorityVtbl *lpInternetPriorityVtbl; + + LONG ref; +} GopherProtocol; + +#define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl) +#define PRIORITY(x) ((IInternetPriority*) &(x)->lpInternetPriorityVtbl) + +#define ASYNCPROTOCOL_THIS(iface) DEFINE_THIS2(GopherProtocol, base, iface) + +static HRESULT GopherProtocol_open_request(Protocol *prot, LPCWSTR url, DWORD request_flags, + IInternetBindInfo *bind_info) +{ + GopherProtocol *This = ASYNCPROTOCOL_THIS(prot); + + This->base.request = InternetOpenUrlW(This->base.internet, url, NULL, 0, + request_flags, (DWORD_PTR)&This->base); + if (!This->base.request && GetLastError() != ERROR_IO_PENDING) { + WARN("InternetOpenUrl failed: %d\n", GetLastError()); + return INET_E_RESOURCE_NOT_FOUND; + } + + return S_OK; +} + +static HRESULT GopherProtocol_start_downloading(Protocol *prot) +{ + return S_OK; +} + +static void GopherProtocol_close_connection(Protocol *prot) +{ +} + +#undef ASYNCPROTOCOL_THIS + +static const ProtocolVtbl AsyncProtocolVtbl = { + GopherProtocol_open_request, + GopherProtocol_start_downloading, + GopherProtocol_close_connection +}; + +#define PROTOCOL_THIS(iface) DEFINE_THIS(GopherProtocol, InternetProtocol, iface) + +static HRESULT WINAPI GopherProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv) +{ + GopherProtocol *This = PROTOCOL_THIS(iface); + + *ppv = NULL; + if(IsEqualGUID(&IID_IUnknown, riid)) { + TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); + *ppv = PROTOCOL(This); + }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) { + TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv); + *ppv = PROTOCOL(This); + }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) { + TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv); + *ppv = PROTOCOL(This); + }else if(IsEqualGUID(&IID_IInternetPriority, riid)) { + TRACE("(%p)->(IID_IInternetPriority %p)\n", This, ppv); + *ppv = PRIORITY(This); + } + + if(*ppv) { + IInternetProtocol_AddRef(iface); + return S_OK; + } + + WARN("not supported interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI GopherProtocol_AddRef(IInternetProtocol *iface) +{ + GopherProtocol *This = PROTOCOL_THIS(iface); + LONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p) ref=%d\n", This, ref); + return ref; +} + +static ULONG WINAPI GopherProtocol_Release(IInternetProtocol *iface) +{ + GopherProtocol *This = PROTOCOL_THIS(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + if(!ref) { + heap_free(This); + + URLMON_UnlockModule(); + } + + return ref; +} + +static HRESULT WINAPI GopherProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, + IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, + DWORD grfPI, DWORD dwReserved) +{ + GopherProtocol *This = PROTOCOL_THIS(iface); + + TRACE("(%p)->(%s %p %p %08x %d)\n", This, debugstr_w(szUrl), pOIProtSink, + pOIBindInfo, grfPI, dwReserved); + + return protocol_start(&This->base, PROTOCOL(This), szUrl, pOIProtSink, pOIBindInfo); +} + +static HRESULT WINAPI GopherProtocol_Continue(IInternetProtocol *iface, PROTOCOLDATA *pProtocolData) +{ + GopherProtocol *This = PROTOCOL_THIS(iface); + + TRACE("(%p)->(%p)\n", This, pProtocolData); + + return protocol_continue(&This->base, pProtocolData); +} + +static HRESULT WINAPI GopherProtocol_Abort(IInternetProtocol *iface, HRESULT hrReason, + DWORD dwOptions) +{ + GopherProtocol *This = PROTOCOL_THIS(iface); + FIXME("(%p)->(%08x %08x)\n", This, hrReason, dwOptions); + return E_NOTIMPL; +} + +static HRESULT WINAPI GopherProtocol_Terminate(IInternetProtocol *iface, DWORD dwOptions) +{ + GopherProtocol *This = PROTOCOL_THIS(iface); + + TRACE("(%p)->(%08x)\n", This, dwOptions); + + protocol_close_connection(&This->base); + return S_OK; +} + +static HRESULT WINAPI GopherProtocol_Suspend(IInternetProtocol *iface) +{ + GopherProtocol *This = PROTOCOL_THIS(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI GopherProtocol_Resume(IInternetProtocol *iface) +{ + GopherProtocol *This = PROTOCOL_THIS(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI GopherProtocol_Read(IInternetProtocol *iface, void *pv, + ULONG cb, ULONG *pcbRead) +{ + GopherProtocol *This = PROTOCOL_THIS(iface); + + TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead); + + return protocol_read(&This->base, pv, cb, pcbRead); +} + +static HRESULT WINAPI GopherProtocol_Seek(IInternetProtocol *iface, LARGE_INTEGER dlibMove, + DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition) +{ + GopherProtocol *This = PROTOCOL_THIS(iface); + FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition); + return E_NOTIMPL; +} + +static HRESULT WINAPI GopherProtocol_LockRequest(IInternetProtocol *iface, DWORD dwOptions) +{ + GopherProtocol *This = PROTOCOL_THIS(iface); + + TRACE("(%p)->(%08x)\n", This, dwOptions); + + return protocol_lock_request(&This->base); +} + +static HRESULT WINAPI GopherProtocol_UnlockRequest(IInternetProtocol *iface) +{ + GopherProtocol *This = PROTOCOL_THIS(iface); + + TRACE("(%p)\n", This); + + return protocol_unlock_request(&This->base); +} + +#undef PROTOCOL_THIS + +static const IInternetProtocolVtbl GopherProtocolVtbl = { + GopherProtocol_QueryInterface, + GopherProtocol_AddRef, + GopherProtocol_Release, + GopherProtocol_Start, + GopherProtocol_Continue, + GopherProtocol_Abort, + GopherProtocol_Terminate, + GopherProtocol_Suspend, + GopherProtocol_Resume, + GopherProtocol_Read, + GopherProtocol_Seek, + GopherProtocol_LockRequest, + GopherProtocol_UnlockRequest +}; + +#define PRIORITY_THIS(iface) DEFINE_THIS(GopherProtocol, InternetPriority, iface) + +static HRESULT WINAPI GopherPriority_QueryInterface(IInternetPriority *iface, REFIID riid, void **ppv) +{ + GopherProtocol *This = PRIORITY_THIS(iface); + return IInternetProtocol_QueryInterface(PROTOCOL(This), riid, ppv); +} + +static ULONG WINAPI GopherPriority_AddRef(IInternetPriority *iface) +{ + GopherProtocol *This = PRIORITY_THIS(iface); + return IInternetProtocol_AddRef(PROTOCOL(This)); +} + +static ULONG WINAPI GopherPriority_Release(IInternetPriority *iface) +{ + GopherProtocol *This = PRIORITY_THIS(iface); + return IInternetProtocol_Release(PROTOCOL(This)); +} + +static HRESULT WINAPI GopherPriority_SetPriority(IInternetPriority *iface, LONG nPriority) +{ + GopherProtocol *This = PRIORITY_THIS(iface); + + TRACE("(%p)->(%d)\n", This, nPriority); + + This->base.priority = nPriority; + return S_OK; +} + +static HRESULT WINAPI GopherPriority_GetPriority(IInternetPriority *iface, LONG *pnPriority) +{ + GopherProtocol *This = PRIORITY_THIS(iface); + + TRACE("(%p)->(%p)\n", This, pnPriority); + + *pnPriority = This->base.priority; + return S_OK; +} + +#undef PRIORITY_THIS + +static const IInternetPriorityVtbl GopherPriorityVtbl = { + GopherPriority_QueryInterface, + GopherPriority_AddRef, + GopherPriority_Release, + GopherPriority_SetPriority, + GopherPriority_GetPriority +}; + +HRESULT GopherProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) +{ + GopherProtocol *ret; + + TRACE("(%p %p)\n", pUnkOuter, ppobj); + + URLMON_LockModule(); + + ret = heap_alloc_zero(sizeof(GopherProtocol)); + + ret->base.vtbl = &AsyncProtocolVtbl; + ret->lpInternetProtocolVtbl = &GopherProtocolVtbl; + ret->lpInternetPriorityVtbl = &GopherPriorityVtbl; + ret->ref = 1; + + *ppobj = PROTOCOL(ret); + + return S_OK; +} Propchange: trunk/reactos/dll/win32/urlmon/gopher.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/urlmon/umon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/umon.c?re…
============================================================================== --- trunk/reactos/dll/win32/urlmon/umon.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/umon.c [iso-8859-1] Sat Mar 7 11:34:55 2009 @@ -33,251 +33,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(urlmon); -/* native urlmon.dll uses this key, too */ -static WCHAR BSCBHolder[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 }; - -/*static BOOL registered_wndclass = FALSE;*/ - -typedef struct { - const IBindingVtbl *lpVtbl; - - LONG ref; - - LPWSTR URLName; - - HWND hwndCallback; - IBindCtx *pBC; - HINTERNET hinternet, hconnect, hrequest; - HANDLE hCacheFile; - IUMCacheStream *pstrCache; - IBindStatusCallback *pbscb; - DWORD total_read, expected_size; -} Binding; - -static HRESULT WINAPI Binding_QueryInterface(IBinding* iface, REFIID riid, void **ppvObject) -{ - Binding *This = (Binding*)iface; - - TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppvObject); - - if((This == NULL) || (ppvObject == NULL)) - return E_INVALIDARG; - - if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_IBinding, riid)) { - *ppvObject = iface; - IBinding_AddRef(iface); - return S_OK; - } - - *ppvObject = NULL; - return E_NOINTERFACE; -} - -static ULONG WINAPI Binding_AddRef(IBinding* iface) -{ - Binding *This = (Binding*)iface; - ULONG ref = InterlockedIncrement(&This->ref); - - TRACE("(%p) ref=%d\n", This, ref); - - return ref; -} - -static ULONG WINAPI Binding_Release(IBinding* iface) -{ - Binding *This = (Binding*)iface; - ULONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p) ref=%d\n",This, ref); - - if(!ref) { - heap_free(This->URLName); - if (This->hCacheFile) - CloseHandle(This->hCacheFile); - if (This->pstrCache) - { - UMCloseCacheFileStream(This->pstrCache); - IStream_Release((IStream *)This->pstrCache); - } - if (This->pbscb) - IBindStatusCallback_Release(This->pbscb); - - heap_free(This); - - URLMON_UnlockModule(); - } - - return ref; -} - -static HRESULT WINAPI Binding_Abort(IBinding* iface) -{ - Binding *This = (Binding*)iface; - - FIXME("(%p): stub\n", This); - - return E_NOTIMPL; -} - -static HRESULT WINAPI Binding_GetBindResult(IBinding* iface, CLSID* pclsidProtocol, DWORD* pdwResult, LPOLESTR* pszResult, DWORD* pdwReserved) -{ - Binding *This = (Binding*)iface; - - FIXME("(%p)->(%p, %p, %p, %p): stub\n", This, pclsidProtocol, pdwResult, pszResult, pdwReserved); - - return E_NOTIMPL; -} - -static HRESULT WINAPI Binding_GetPriority(IBinding* iface, LONG* pnPriority) -{ - Binding *This = (Binding*)iface; - - FIXME("(%p)->(%p): stub\n", This, pnPriority); - - return E_NOTIMPL; -} - -static HRESULT WINAPI Binding_Resume(IBinding* iface) -{ - Binding *This = (Binding*)iface; - - FIXME("(%p): stub\n", This); - - return E_NOTIMPL; -} - -static HRESULT WINAPI Binding_SetPriority(IBinding* iface, LONG nPriority) -{ - Binding *This = (Binding*)iface; - - FIXME("(%p)->(%d): stub\n", This, nPriority); - - return E_NOTIMPL; -} - -static HRESULT WINAPI Binding_Suspend(IBinding* iface) -{ - Binding *This = (Binding*)iface; - - FIXME("(%p): stub\n", This); - - return E_NOTIMPL; -} - -static void Binding_CloseCacheDownload(Binding *This) -{ - CloseHandle(This->hCacheFile); - This->hCacheFile = 0; - UMCloseCacheFileStream(This->pstrCache); - IStream_Release((IStream *)This->pstrCache); - This->pstrCache = 0; -} - -static HRESULT Binding_MoreCacheData(Binding *This, const char *buf, DWORD dwBytes) -{ - DWORD written; - - if (WriteFile(This->hCacheFile, buf, dwBytes, &written, NULL) && written == dwBytes) - { - HRESULT hr; - - This->total_read += written; - hr = IBindStatusCallback_OnProgress(This->pbscb, - This->total_read + written, - This->expected_size, - (This->total_read == written) ? - BINDSTATUS_BEGINDOWNLOADDATA : - BINDSTATUS_DOWNLOADINGDATA, - This->URLName); - if (hr == S_OK) - { - STGMEDIUM stg; - FORMATETC fmt; - - fmt.cfFormat = 0; - fmt.ptd = NULL; - fmt.dwAspect = 0; - fmt.lindex = -1; - fmt.tymed = TYMED_ISTREAM; - - stg.tymed = TYMED_ISTREAM; - stg.u.pstm = (IStream *)This->pstrCache; - stg.pUnkForRelease = NULL; - - hr = IBindStatusCallback_OnDataAvailable(This->pbscb, - (This->total_read == written) ? - BSCF_FIRSTDATANOTIFICATION : - BSCF_INTERMEDIATEDATANOTIFICATION, - This->total_read + written, - &fmt, - &stg); - } - if (written < dwBytes) - return STG_E_MEDIUMFULL; - else - return hr; - } - return HRESULT_FROM_WIN32(GetLastError()); -} - -static void Binding_FinishedDownload(Binding *This, HRESULT hr) -{ - STGMEDIUM stg; - FORMATETC fmt; - - fmt.ptd = NULL; - fmt.dwAspect = 0; - fmt.lindex = -1; - fmt.tymed = TYMED_ISTREAM; - - stg.tymed = TYMED_ISTREAM; - stg.u.pstm = (IStream *)This->pstrCache; - stg.pUnkForRelease = NULL; - - IBindStatusCallback_OnProgress(This->pbscb, This->total_read, This->expected_size, - BINDSTATUS_ENDDOWNLOADDATA, This->URLName); - IBindStatusCallback_OnDataAvailable(This->pbscb, BSCF_LASTDATANOTIFICATION, This->total_read, &fmt, &stg); - if (hr != S_OK) - { - WCHAR *pwchError = 0; - - FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_ALLOCATE_BUFFER, - NULL, (DWORD) hr, - 0, (LPWSTR) &pwchError, - 0, NULL); - if (!pwchError) - { - static const WCHAR achFormat[] = { '%', '0', '8', 'x', 0 }; - - pwchError =(WCHAR *) LocalAlloc(LMEM_FIXED, sizeof(WCHAR) * 9); - wsprintfW(pwchError, achFormat, hr); - } - IBindStatusCallback_OnStopBinding(This->pbscb, hr, pwchError); - LocalFree(pwchError); - } - else - { - IBindStatusCallback_OnStopBinding(This->pbscb, hr, NULL); - } - IBindStatusCallback_Release(This->pbscb); - This->pbscb = 0; -} - -static const IBindingVtbl BindingVtbl = -{ - Binding_QueryInterface, - Binding_AddRef, - Binding_Release, - Binding_Abort, - Binding_Suspend, - Binding_Resume, - Binding_SetPriority, - Binding_GetPriority, - Binding_GetBindResult -}; - -/* filemoniker data structure */ typedef struct { const IMonikerVtbl* lpvtbl; /* VTable relative to the IMoniker interface.*/ @@ -493,158 +248,6 @@ /****************************************************************************** * URLMoniker_BindToStorage ******************************************************************************/ -static HRESULT URLMonikerImpl_BindToStorage_hack(LPCWSTR URLName, IBindCtx* pbc, VOID** ppvObject) -{ - HRESULT hres; - BINDINFO bi; - DWORD bindf; - WCHAR szFileName[MAX_PATH + 1]; - Binding *bind; - int len; - - WARN("(%s %p %p)\n", debugstr_w(URLName), pbc, ppvObject); - - bind = heap_alloc_zero(sizeof(Binding)); - bind->lpVtbl = &BindingVtbl; - bind->ref = 1; - URLMON_LockModule(); - - len = lstrlenW(URLName)+1; - bind->URLName = heap_alloc(len*sizeof(WCHAR)); - memcpy(bind->URLName, URLName, len*sizeof(WCHAR)); - - hres = UMCreateStreamOnCacheFile(bind->URLName, 0, szFileName, &bind->hCacheFile, &bind->pstrCache); - - if(SUCCEEDED(hres)) { - TRACE("Created stream...\n"); - - *ppvObject = (void *) bind->pstrCache; - IStream_AddRef((IStream *) bind->pstrCache); - - hres = IBindCtx_GetObjectParam(pbc, BSCBHolder, (IUnknown**)&bind->pbscb); - if(SUCCEEDED(hres)) { - TRACE("Got IBindStatusCallback...\n"); - - memset(&bi, 0, sizeof(bi)); - bi.cbSize = sizeof(bi); - bindf = 0; - hres = IBindStatusCallback_GetBindInfo(bind->pbscb, &bindf, &bi); - if(SUCCEEDED(hres)) { - URL_COMPONENTSW url; - WCHAR *host, *path, *user, *pass; - - TRACE("got bindinfo. bindf = %08x extrainfo = %s bindinfof = %08x bindverb = %08x iid %s\n", - bindf, debugstr_w(bi.szExtraInfo), bi.grfBindInfoF, bi.dwBindVerb, debugstr_guid(&bi.iid)); - hres = IBindStatusCallback_OnStartBinding(bind->pbscb, 0, (IBinding*)bind); - TRACE("OnStartBinding rets %08x\n", hres); - - bind->expected_size = 0; - bind->total_read = 0; - - memset(&url, 0, sizeof(url)); - url.dwStructSize = sizeof(url); - url.dwSchemeLength = url.dwHostNameLength = url.dwUrlPathLength = url.dwUserNameLength = url.dwPasswordLength = 1; - InternetCrackUrlW(URLName, 0, ICU_ESCAPE, &url); - host = heap_alloc((url.dwHostNameLength + 1) * sizeof(WCHAR)); - memcpy(host, url.lpszHostName, url.dwHostNameLength * sizeof(WCHAR)); - host[url.dwHostNameLength] = '\0'; - path = heap_alloc((url.dwUrlPathLength + 1) * sizeof(WCHAR)); - memcpy(path, url.lpszUrlPath, url.dwUrlPathLength * sizeof(WCHAR)); - path[url.dwUrlPathLength] = '\0'; - if (url.dwUserNameLength) - { - user = heap_alloc(((url.dwUserNameLength + 1) * sizeof(WCHAR))); - memcpy(user, url.lpszUserName, url.dwUserNameLength * sizeof(WCHAR)); - user[url.dwUserNameLength] = 0; - } - else - { - user = 0; - } - if (url.dwPasswordLength) - { - pass = heap_alloc(((url.dwPasswordLength + 1) * sizeof(WCHAR))); - memcpy(pass, url.lpszPassword, url.dwPasswordLength * sizeof(WCHAR)); - pass[url.dwPasswordLength] = 0; - } - else - { - pass = 0; - } - - - do { - bind->hinternet = InternetOpenA("User Agent", 0, NULL, NULL, 0); - if (!bind->hinternet) - { - hres = HRESULT_FROM_WIN32(GetLastError()); - break; - } - - if (!url.nPort) - url.nPort = INTERNET_DEFAULT_GOPHER_PORT; - bind->hconnect = InternetConnectW(bind->hinternet, host, url.nPort, user, pass, - INTERNET_SERVICE_GOPHER, 0, (DWORD_PTR)bind); - if (!bind->hconnect) - { - hres = HRESULT_FROM_WIN32(GetLastError()); - CloseHandle(bind->hinternet); - break; - } - - hres = IBindStatusCallback_OnProgress(bind->pbscb, 0, 0, 0x22, NULL); - hres = IBindStatusCallback_OnProgress(bind->pbscb, 0, 0, BINDSTATUS_FINDINGRESOURCE, NULL); - hres = IBindStatusCallback_OnProgress(bind->pbscb, 0, 0, BINDSTATUS_CONNECTING, NULL); - hres = IBindStatusCallback_OnProgress(bind->pbscb, 0, 0, BINDSTATUS_SENDINGREQUEST, NULL); - - bind->hrequest = GopherOpenFileW(bind->hconnect, - path, - 0, - INTERNET_FLAG_RELOAD, - 0); - if (bind->hrequest) - { - TRACE("res = %d gle = %u url len = %d\n", hres, GetLastError(), bind->expected_size); - - IBindStatusCallback_OnProgress(bind->pbscb, 0, 0, BINDSTATUS_CACHEFILENAMEAVAILABLE, szFileName); - - while(1) { - char buf[4096]; - DWORD bufread; - if(InternetReadFile(bind->hrequest, buf, sizeof(buf), &bufread)) { - TRACE("read %d bytes %s...\n", bufread, debugstr_an(buf, 10)); - if(bufread == 0) break; - hres = Binding_MoreCacheData(bind, buf, bufread); - } else - break; - } - InternetCloseHandle(bind->hrequest); - hres = S_OK; - }else { - hres = HRESULT_FROM_WIN32(GetLastError()); - } - - - InternetCloseHandle(bind->hconnect); - InternetCloseHandle(bind->hinternet); - } while(0); - - Binding_FinishedDownload(bind, hres); - Binding_CloseCacheDownload(bind); - - heap_free(user); - heap_free(pass); - heap_free(path); - heap_free(host); - } - } - } - - IBinding_Release((IBinding*)bind); - - return hres; -} - static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft, @@ -652,25 +255,11 @@ VOID** ppvObject) { URLMonikerImpl *This = (URLMonikerImpl*)iface; - WCHAR schema[64]; - BOOL bret; - - URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW), schema, - sizeof(schema)/sizeof(WCHAR), 0, NULL, 0, 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0}; + + TRACE("(%p)->(%p %p %s %p)\n", This, pbc, pmkToLeft, debugstr_guid(riid), ppvObject); if(pmkToLeft) FIXME("Unsupported pmkToLeft\n"); - - bret = InternetCrackUrlW(This->URLName, 0, ICU_ESCAPE, &url); - if(!bret) { - ERR("InternetCrackUrl failed: %u\n", GetLastError()); - return E_FAIL; - } - - if(IsEqualGUID(&IID_IStream, riid) && url.nScheme == INTERNET_SCHEME_GOPHER) - return URLMonikerImpl_BindToStorage_hack(This->URLName, pbc, ppvObject); - - TRACE("(%p)->(%p %p %s %p)\n", This, pbc, pmkToLeft, debugstr_guid(riid), ppvObject); return bind_to_storage(This->URLName, pbc, riid, ppvObject); } Modified: trunk/reactos/dll/win32/urlmon/umstream.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/umstream.…
============================================================================== --- trunk/reactos/dll/win32/urlmon/umstream.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/umstream.c [iso-8859-1] Sat Mar 7 11:34:55 2009 @@ -30,342 +30,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(urlmon); -static const IStreamVtbl stvt; - -HRESULT UMCreateStreamOnCacheFile(LPCWSTR pszURL, - DWORD dwSize, - LPWSTR pszFileName, - HANDLE *phfile, - IUMCacheStream **ppstr) -{ - IUMCacheStream* ucstr; - HANDLE handle; - DWORD size; - LPWSTR url, c, ext = NULL; - HRESULT hr; - - size = (strlenW(pszURL)+1)*sizeof(WCHAR); - url = heap_alloc(size); - memcpy(url, pszURL, size); - - for (c = url; *c && *c != '#' && *c != '?'; ++c) - { - if (*c == '.') - ext = c+1; - else if(*c == '/') - ext = NULL; - } - - *c = 0; - - if(!CreateUrlCacheEntryW(url, dwSize, ext, pszFileName, 0)) - hr = HRESULT_FROM_WIN32(GetLastError()); - else - hr = S_OK; - - heap_free(url); - - if (hr != S_OK) - return hr; - - TRACE("Opening %s\n", debugstr_w(pszFileName) ); - - handle = CreateFileW( pszFileName, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, 0, NULL ); - if( handle == INVALID_HANDLE_VALUE ) - return HRESULT_FROM_WIN32(GetLastError()); - - if (phfile) - { - /* Call CreateFileW again because we need a handle with its own file pointer, and DuplicateHandle will return - * a handle that shares its file pointer with the original. - */ - *phfile = CreateFileW( pszFileName, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL ); - - if (*phfile == (HANDLE) HFILE_ERROR) - { - DWORD dwError = GetLastError(); - - CloseHandle(handle); - return HRESULT_FROM_WIN32(dwError); - } - } - - ucstr = heap_alloc_zero(sizeof(IUMCacheStream)); - if(ucstr) - { - ucstr->pszURL = heap_alloc_zero(sizeof(WCHAR) * (lstrlenW(pszURL) + 1)); - if (ucstr->pszURL) - { - ucstr->pszFileName = heap_alloc_zero(sizeof(WCHAR) * (lstrlenW(pszFileName) + 1)); - if (ucstr->pszFileName) - { - ucstr->lpVtbl=&stvt; - ucstr->ref = 1; - ucstr->handle = handle; - ucstr->closed = 0; - lstrcpyW(ucstr->pszURL, pszURL); - lstrcpyW(ucstr->pszFileName, pszFileName); - - *ppstr = ucstr; - - return S_OK; - } - heap_free(ucstr->pszURL); - } - heap_free(ucstr); - } - CloseHandle(handle); - if (phfile) - CloseHandle(*phfile); - return E_OUTOFMEMORY; -} - -void UMCloseCacheFileStream(IUMCacheStream *This) -{ - if (!This->closed) - { - FILETIME ftZero; - - ftZero.dwLowDateTime = ftZero.dwHighDateTime = 0; - - This->closed = 1; - CommitUrlCacheEntryW(This->pszURL, - This->pszFileName, - ftZero, - ftZero, - NORMAL_CACHE_ENTRY, - 0, - 0, - 0, - 0); - } -} - -/************************************************************************** -* IStream_fnQueryInterface -*/ -static HRESULT WINAPI IStream_fnQueryInterface(IStream *iface, - REFIID riid, - LPVOID *ppvObj) -{ - IUMCacheStream *This = (IUMCacheStream *)iface; - - TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj); - - *ppvObj = NULL; - - if(IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IStream)) - { - *ppvObj = This; - } - - if(*ppvObj) - { - IStream_AddRef((IStream*)*ppvObj); - TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); - return S_OK; - } - TRACE("-- Interface: E_NOINTERFACE\n"); - return E_NOINTERFACE; -} - -/************************************************************************** -* IStream_fnAddRef -*/ -static ULONG WINAPI IStream_fnAddRef(IStream *iface) -{ - IUMCacheStream *This = (IUMCacheStream *)iface; - ULONG refCount = InterlockedIncrement(&This->ref); - - TRACE("(%p)->(count=%u)\n", This, refCount - 1); - - return refCount; -} - -/************************************************************************** -* IStream_fnRelease -*/ -static ULONG WINAPI IStream_fnRelease(IStream *iface) -{ - IUMCacheStream *This = (IUMCacheStream *)iface; - ULONG refCount = InterlockedDecrement(&This->ref); - - TRACE("(%p)->(count=%u)\n", This, refCount + 1); - - if (!refCount) - { - TRACE(" destroying UMCacheStream (%p)\n",This); - UMCloseCacheFileStream(This); - CloseHandle(This->handle); - heap_free(This->pszFileName); - heap_free(This->pszURL); - heap_free(This); - } - return refCount; -} - -static HRESULT WINAPI IStream_fnRead (IStream * iface, - void* pv, - ULONG cb, - ULONG* pcbRead) -{ - ULONG dwBytesRead; - IUMCacheStream *This = (IUMCacheStream *)iface; - - TRACE("(%p)->(%p,0x%08x,%p)\n",This, pv, cb, pcbRead); - - if ( !pv ) - return STG_E_INVALIDPOINTER; - - if ( !pcbRead) - pcbRead = &dwBytesRead; - - if ( ! ReadFile( This->handle, pv, cb, pcbRead, NULL ) ) - return S_FALSE; - - if (!*pcbRead) - return This->closed ? S_FALSE : E_PENDING; - return S_OK; -} - -static HRESULT WINAPI IStream_fnWrite (IStream * iface, - const void* pv, - ULONG cb, - ULONG* pcbWritten) -{ - return E_NOTIMPL; -} - -static HRESULT WINAPI IStream_fnSeek (IStream * iface, - LARGE_INTEGER dlibMove, - DWORD dwOrigin, - ULARGE_INTEGER* plibNewPosition) -{ - LARGE_INTEGER newpos; - IUMCacheStream *This = (IUMCacheStream *)iface; - - TRACE("(%p)\n",This); - - if (!SetFilePointerEx( This->handle, dlibMove, &newpos, dwOrigin )) - return E_FAIL; - - if (plibNewPosition) - plibNewPosition->QuadPart = newpos.QuadPart; - - return S_OK; -} - -static HRESULT WINAPI IStream_fnSetSize (IStream * iface, - ULARGE_INTEGER libNewSize) -{ - LARGE_INTEGER newpos; - IUMCacheStream *This = (IUMCacheStream *)iface; - - TRACE("(%p)\n",This); - - newpos.QuadPart = libNewSize.QuadPart; - if( ! SetFilePointerEx( This->handle, newpos, NULL, FILE_BEGIN ) ) - return E_FAIL; - - if( ! SetEndOfFile( This->handle ) ) - return E_FAIL; - - return S_OK; -} - -static HRESULT WINAPI IStream_fnCopyTo (IStream * iface, - IStream* pstm, - ULARGE_INTEGER cb, - ULARGE_INTEGER* pcbRead, - ULARGE_INTEGER* pcbWritten) -{ - IUMCacheStream *This = (IUMCacheStream *)iface; - - TRACE("(%p)\n",This); - - return E_NOTIMPL; -} - -static HRESULT WINAPI IStream_fnCommit (IStream * iface, - DWORD grfCommitFlags) -{ - IUMCacheStream *This = (IUMCacheStream *)iface; - - TRACE("(%p)\n",This); - - return E_NOTIMPL; -} - -static HRESULT WINAPI IStream_fnRevert (IStream * iface) -{ - IUMCacheStream *This = (IUMCacheStream *)iface; - - TRACE("(%p)\n",This); - - return E_NOTIMPL; -} -static HRESULT WINAPI IStream_fnLockRegion (IStream * iface, - ULARGE_INTEGER libOffset, - ULARGE_INTEGER cb, - DWORD dwLockType) -{ - IUMCacheStream *This = (IUMCacheStream *)iface; - - TRACE("(%p)\n",This); - - return E_NOTIMPL; -} -static HRESULT WINAPI IStream_fnUnlockRegion (IStream * iface, - ULARGE_INTEGER libOffset, - ULARGE_INTEGER cb, - DWORD dwLockType) -{ - IUMCacheStream *This = (IUMCacheStream *)iface; - - TRACE("(%p)\n",This); - - return E_NOTIMPL; -} -static HRESULT WINAPI IStream_fnStat (IStream * iface, - STATSTG* pstatstg, - DWORD grfStatFlag) -{ - IUMCacheStream *This = (IUMCacheStream *)iface; - - TRACE("(%p)\n",This); - - return E_NOTIMPL; -} -static HRESULT WINAPI IStream_fnClone (IStream * iface, - IStream** ppstm) -{ - IUMCacheStream *This = (IUMCacheStream *)iface; - - TRACE("(%p)\n",This); - - return E_NOTIMPL; -} - -static const IStreamVtbl stvt = -{ - IStream_fnQueryInterface, - IStream_fnAddRef, - IStream_fnRelease, - IStream_fnRead, - IStream_fnWrite, - IStream_fnSeek, - IStream_fnSetSize, - IStream_fnCopyTo, - IStream_fnCommit, - IStream_fnRevert, - IStream_fnLockRegion, - IStream_fnUnlockRegion, - IStream_fnStat, - IStream_fnClone - -}; - typedef struct ProxyBindStatusCallback { const IBindStatusCallbackVtbl *lpVtbl; Modified: trunk/reactos/dll/win32/urlmon/urlmon.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon.rb…
============================================================================== --- trunk/reactos/dll/win32/urlmon/urlmon.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/urlmon.rbuild [iso-8859-1] Sat Mar 7 11:34:55 2009 @@ -15,6 +15,7 @@ <file>file.c</file> <file>format.c</file> <file>ftp.c</file> + <file>gopher.c</file> <file>http.c</file> <file>internet.c</file> <file>mk.c</file> Modified: trunk/reactos/dll/win32/urlmon/urlmon_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon_ma…
============================================================================== --- trunk/reactos/dll/win32/urlmon/urlmon_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/urlmon_main.c [iso-8859-1] Sat Mar 7 11:34:55 2009 @@ -173,6 +173,8 @@ { &ClassFactoryVtbl, FileProtocol_Construct}; static const ClassFactory FtpProtocolCF = { &ClassFactoryVtbl, FtpProtocol_Construct}; +static const ClassFactory GopherProtocolCF = + { &ClassFactoryVtbl, GopherProtocol_Construct}; static const ClassFactory HttpProtocolCF = { &ClassFactoryVtbl, HttpProtocol_Construct}; static const ClassFactory HttpSProtocolCF = @@ -193,6 +195,7 @@ static const WCHAR wszFile[] = {'f','i','l','e',0}; static const WCHAR wszFtp[] = {'f','t','p',0}; +static const WCHAR wszGopher[] = {'g','o','p','h','e','r',0}; static const WCHAR wszHttp[] = {'h','t','t','p',0}; static const WCHAR wszHttps[] = {'h','t','t','p','s',0}; static const WCHAR wszMk[] = {'m','k',0}; @@ -201,6 +204,7 @@ { { &CLSID_FileProtocol, CLASSFACTORY(&FileProtocolCF), wszFile }, { &CLSID_FtpProtocol, CLASSFACTORY(&FtpProtocolCF), wszFtp }, + { &CLSID_GopherProtocol, CLASSFACTORY(&GopherProtocolCF), wszGopher }, { &CLSID_HttpProtocol, CLASSFACTORY(&HttpProtocolCF), wszHttp }, { &CLSID_HttpSProtocol, CLASSFACTORY(&HttpSProtocolCF), wszHttps }, { &CLSID_MkProtocol, CLASSFACTORY(&MkProtocolCF), wszMk }, Modified: trunk/reactos/dll/win32/urlmon/urlmon_main.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon_ma…
============================================================================== --- trunk/reactos/dll/win32/urlmon/urlmon_main.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/urlmon_main.h [iso-8859-1] Sat Mar 7 11:34:55 2009 @@ -42,6 +42,7 @@ extern HRESULT HttpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); extern HRESULT HttpSProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); extern HRESULT FtpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); +extern HRESULT GopherProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); extern HRESULT MkProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); /********************************************************************** @@ -54,19 +55,6 @@ #define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) #define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc))) #define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface) - -typedef struct -{ - const IStreamVtbl *lpVtbl; - LONG ref; - HANDLE handle; - BOOL closed; - WCHAR *pszFileName; - WCHAR *pszURL; -} IUMCacheStream; - -HRESULT UMCreateStreamOnCacheFile(LPCWSTR pszURL, DWORD dwSize, LPWSTR pszFileName, HANDLE *phfile, IUMCacheStream **ppstr); -void UMCloseCacheFileStream(IUMCacheStream *pstr); IInternetProtocolInfo *get_protocol_info(LPCWSTR url); HRESULT get_protocol_handler(LPCWSTR url, CLSID *clsid, IClassFactory **ret);
15 years, 9 months
1
0
0
0
[arty] 39899: Fix remaining issues in this neglected imported code. It's my fault it was in a poor state for so long.
by arty@svn.reactos.org
Author: arty Date: Sat Mar 7 03:18:06 2009 New Revision: 39899 URL:
http://svn.reactos.org/svn/reactos?rev=39899&view=rev
Log: Fix remaining issues in this neglected imported code. It's my fault it was in a poor state for so long. Modified: trunk/reactos/lib/rtl/austin/avl.c Modified: trunk/reactos/lib/rtl/austin/avl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/austin/avl.c?rev=3…
============================================================================== --- trunk/reactos/lib/rtl/austin/avl.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/austin/avl.c [iso-8859-1] Sat Mar 7 03:18:06 2009 @@ -34,9 +34,9 @@ #define LESS GenericLessThan #define GREATER GenericGreaterThan -void print_node(udict_t *ud, udict_node_t *node, int indent) -{ - int i; +int print_node(udict_t *ud, udict_node_t *node, int indent) +{ + int i, rh = 0, lh = 0; char buf[100]; udict_node_t *nil = ud->BalancedRoot.Parent; @@ -44,19 +44,49 @@ if( node == ud->BalancedRoot.Parent ) { sprintf(buf+i, "Nil\n"); DbgPrint("%s", buf); + return 0; } else { sprintf(buf+i, "Node %p (parent %p: balance %d)\n", node, node->parent, node->Balance); DbgPrint("%s", buf); if( node->LeftChild != nil ) { sprintf(buf+i, "--> Left\n"); DbgPrint("%s", buf); - print_node(ud, node->LeftChild, indent+1); + lh = print_node(ud, node->LeftChild, indent+1); } if( node->RightChild != nil ) { sprintf(buf+i, "--> Right\n"); DbgPrint("%s", buf); - print_node(ud, node->RightChild, indent+1); + rh = print_node(ud, node->RightChild, indent+1); } + if (indent) + { + if (rh < lh - 1 || lh < rh - 1) + { + sprintf(buf+i, "warning: tree is too unbalanced %d vs %d\n", + lh, rh); + DbgPrint("%s", buf); + } + if (rh != lh && node->Balance == BALANCED) + { + sprintf(buf+i, "warning: tree says balanced, but %d vs %d\n", + lh, rh); + DbgPrint("%s", buf); + } + else if (lh <= rh && node->Balance == LEFTHEAVY) + { + sprintf(buf+i, "warning: tree says leftheavy but %d vs %d\n", + lh, rh); + DbgPrint("%s", buf); + } + else if (lh >= rh && node->Balance == RIGHTHEAVY) + { + sprintf(buf+i, "warning: tree says rightheavy but %d vs %d\n", + lh, rh); + DbgPrint("%s", buf); + } + } + if (rh > lh) return 1+rh; + else return 1+lh; } } @@ -248,8 +278,6 @@ ud->BalancedRoot.balance = LEFTHEAVY; } - print_tree(ud); - ud->nodecount++; } @@ -306,7 +334,7 @@ }/*if*/ }/*if*/ - while (parent != nil) { + while (parent != &ud->BalancedRoot) { if ((parent->left == nil) && (parent->right == nil)) { assert (child == nil); parent->balance = BALANCED;
15 years, 9 months
1
0
0
0
[mkupfer] 39898: - translate remaining items to native language (German)
by mkupfer@svn.reactos.org
Author: mkupfer Date: Sat Mar 7 01:33:54 2009 New Revision: 39898 URL:
http://svn.reactos.org/svn/reactos?rev=39898&view=rev
Log: - translate remaining items to native language (German) Modified: trunk/reactos/dll/win32/kernel32/nls/dea.nls trunk/reactos/dll/win32/kernel32/nls/dec.nls trunk/reactos/dll/win32/kernel32/nls/del.nls trunk/reactos/dll/win32/kernel32/nls/des.nls Modified: trunk/reactos/dll/win32/kernel32/nls/dea.nls URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/nls/dea…
============================================================================== --- trunk/reactos/dll/win32/kernel32/nls/dea.nls [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/nls/dea.nls [iso-8859-1] Sat Mar 7 01:33:54 2009 @@ -136,21 +136,21 @@ LOCALE_STIMEFORMAT "HH:mm:ss" LOCALE_SYEARMONTH "MMMM yyyy" - LGRPID_WESTERN_EUROPE+LGRPID_RES_BASE "Western Europe and United States" - LGRPID_CENTRAL_EUROPE+LGRPID_RES_BASE "Central Europe" - LGRPID_BALTIC+LGRPID_RES_BASE "Baltic" - LGRPID_GREEK+LGRPID_RES_BASE "Greek" - LGRPID_CYRILLIC+LGRPID_RES_BASE "Cyrillic" - LGRPID_TURKISH+LGRPID_RES_BASE "Turkic" - LGRPID_JAPANESE+LGRPID_RES_BASE "Japanese" - LGRPID_KOREAN+LGRPID_RES_BASE "Korean" - LGRPID_TRADITIONAL_CHINESE+LGRPID_RES_BASE "Traditional Chinese" - LGRPID_SIMPLIFIED_CHINESE+LGRPID_RES_BASE "Simplified Chinese" + LGRPID_WESTERN_EUROPE+LGRPID_RES_BASE "Westeuropa und Vereinigte Staaten" + LGRPID_CENTRAL_EUROPE+LGRPID_RES_BASE "Mitteleuropa" + LGRPID_BALTIC+LGRPID_RES_BASE "Baltisch" + LGRPID_GREEK+LGRPID_RES_BASE "Griechisch" + LGRPID_CYRILLIC+LGRPID_RES_BASE "Kyrillisch" + LGRPID_TURKISH+LGRPID_RES_BASE "Turkisch" + LGRPID_JAPANESE+LGRPID_RES_BASE "Japanisch" + LGRPID_KOREAN+LGRPID_RES_BASE "Koreanisch" + LGRPID_TRADITIONAL_CHINESE+LGRPID_RES_BASE "Chinesisch (Traditionell)" + LGRPID_SIMPLIFIED_CHINESE+LGRPID_RES_BASE "Chinesisch (Vereinfacht)" LGRPID_THAI+LGRPID_RES_BASE "Thai" - LGRPID_HEBREW+LGRPID_RES_BASE "Hebrew" - LGRPID_ARABIC+LGRPID_RES_BASE "Arabic" - LGRPID_VIETNAMESE+LGRPID_RES_BASE "Vietnamese" - LGRPID_INDIC+LGRPID_RES_BASE "Indic" - LGRPID_GEORGIAN+LGRPID_RES_BASE "Georgian" - LGRPID_ARMENIAN+LGRPID_RES_BASE "Armenian" + LGRPID_HEBREW+LGRPID_RES_BASE "Hebräisch" + LGRPID_ARABIC+LGRPID_RES_BASE "Arabisch" + LGRPID_VIETNAMESE+LGRPID_RES_BASE "Vietnamesisch" + LGRPID_INDIC+LGRPID_RES_BASE "Indisch" + LGRPID_GEORGIAN+LGRPID_RES_BASE "Georgisch" + LGRPID_ARMENIAN+LGRPID_RES_BASE "Armenisch" } Modified: trunk/reactos/dll/win32/kernel32/nls/dec.nls URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/nls/dec…
============================================================================== --- trunk/reactos/dll/win32/kernel32/nls/dec.nls [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/nls/dec.nls [iso-8859-1] Sat Mar 7 01:33:54 2009 @@ -136,21 +136,21 @@ LOCALE_STIMEFORMAT "HH:mm:ss" LOCALE_SYEARMONTH "MMMM yyyy" - LGRPID_WESTERN_EUROPE+LGRPID_RES_BASE "Western Europe and United States" - LGRPID_CENTRAL_EUROPE+LGRPID_RES_BASE "Central Europe" - LGRPID_BALTIC+LGRPID_RES_BASE "Baltic" - LGRPID_GREEK+LGRPID_RES_BASE "Greek" - LGRPID_CYRILLIC+LGRPID_RES_BASE "Cyrillic" - LGRPID_TURKISH+LGRPID_RES_BASE "Turkic" - LGRPID_JAPANESE+LGRPID_RES_BASE "Japanese" - LGRPID_KOREAN+LGRPID_RES_BASE "Korean" - LGRPID_TRADITIONAL_CHINESE+LGRPID_RES_BASE "Traditional Chinese" - LGRPID_SIMPLIFIED_CHINESE+LGRPID_RES_BASE "Simplified Chinese" + LGRPID_WESTERN_EUROPE+LGRPID_RES_BASE "Westeuropa und Vereinigte Staaten" + LGRPID_CENTRAL_EUROPE+LGRPID_RES_BASE "Mitteleuropa" + LGRPID_BALTIC+LGRPID_RES_BASE "Baltisch" + LGRPID_GREEK+LGRPID_RES_BASE "Griechisch" + LGRPID_CYRILLIC+LGRPID_RES_BASE "Kyrillisch" + LGRPID_TURKISH+LGRPID_RES_BASE "Turkisch" + LGRPID_JAPANESE+LGRPID_RES_BASE "Japanisch" + LGRPID_KOREAN+LGRPID_RES_BASE "Koreanisch" + LGRPID_TRADITIONAL_CHINESE+LGRPID_RES_BASE "Chinesisch (Traditionell)" + LGRPID_SIMPLIFIED_CHINESE+LGRPID_RES_BASE "Chinesisch (Vereinfacht)" LGRPID_THAI+LGRPID_RES_BASE "Thai" - LGRPID_HEBREW+LGRPID_RES_BASE "Hebrew" - LGRPID_ARABIC+LGRPID_RES_BASE "Arabic" - LGRPID_VIETNAMESE+LGRPID_RES_BASE "Vietnamese" - LGRPID_INDIC+LGRPID_RES_BASE "Indic" - LGRPID_GEORGIAN+LGRPID_RES_BASE "Georgian" - LGRPID_ARMENIAN+LGRPID_RES_BASE "Armenian" + LGRPID_HEBREW+LGRPID_RES_BASE "Hebräisch" + LGRPID_ARABIC+LGRPID_RES_BASE "Arabisch" + LGRPID_VIETNAMESE+LGRPID_RES_BASE "Vietnamesisch" + LGRPID_INDIC+LGRPID_RES_BASE "Indisch" + LGRPID_GEORGIAN+LGRPID_RES_BASE "Georgisch" + LGRPID_ARMENIAN+LGRPID_RES_BASE "Armenisch" } Modified: trunk/reactos/dll/win32/kernel32/nls/del.nls URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/nls/del…
============================================================================== --- trunk/reactos/dll/win32/kernel32/nls/del.nls [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/nls/del.nls [iso-8859-1] Sat Mar 7 01:33:54 2009 @@ -136,21 +136,21 @@ LOCALE_STIMEFORMAT "HH:mm:ss" LOCALE_SYEARMONTH "MMMM yyyy" - LGRPID_WESTERN_EUROPE+LGRPID_RES_BASE "Western Europe and United States" - LGRPID_CENTRAL_EUROPE+LGRPID_RES_BASE "Central Europe" - LGRPID_BALTIC+LGRPID_RES_BASE "Baltic" - LGRPID_GREEK+LGRPID_RES_BASE "Greek" - LGRPID_CYRILLIC+LGRPID_RES_BASE "Cyrillic" - LGRPID_TURKISH+LGRPID_RES_BASE "Turkic" - LGRPID_JAPANESE+LGRPID_RES_BASE "Japanese" - LGRPID_KOREAN+LGRPID_RES_BASE "Korean" - LGRPID_TRADITIONAL_CHINESE+LGRPID_RES_BASE "Traditional Chinese" - LGRPID_SIMPLIFIED_CHINESE+LGRPID_RES_BASE "Simplified Chinese" + LGRPID_WESTERN_EUROPE+LGRPID_RES_BASE "Westeuropa und Vereinigte Staaten" + LGRPID_CENTRAL_EUROPE+LGRPID_RES_BASE "Mitteleuropa" + LGRPID_BALTIC+LGRPID_RES_BASE "Baltisch" + LGRPID_GREEK+LGRPID_RES_BASE "Griechisch" + LGRPID_CYRILLIC+LGRPID_RES_BASE "Kyrillisch" + LGRPID_TURKISH+LGRPID_RES_BASE "Turkisch" + LGRPID_JAPANESE+LGRPID_RES_BASE "Japanisch" + LGRPID_KOREAN+LGRPID_RES_BASE "Koreanisch" + LGRPID_TRADITIONAL_CHINESE+LGRPID_RES_BASE "Chinesisch (Traditionell)" + LGRPID_SIMPLIFIED_CHINESE+LGRPID_RES_BASE "Chinesisch (Vereinfacht)" LGRPID_THAI+LGRPID_RES_BASE "Thai" - LGRPID_HEBREW+LGRPID_RES_BASE "Hebrew" - LGRPID_ARABIC+LGRPID_RES_BASE "Arabic" - LGRPID_VIETNAMESE+LGRPID_RES_BASE "Vietnamese" - LGRPID_INDIC+LGRPID_RES_BASE "Indic" - LGRPID_GEORGIAN+LGRPID_RES_BASE "Georgian" - LGRPID_ARMENIAN+LGRPID_RES_BASE "Armenian" + LGRPID_HEBREW+LGRPID_RES_BASE "Hebräisch" + LGRPID_ARABIC+LGRPID_RES_BASE "Arabisch" + LGRPID_VIETNAMESE+LGRPID_RES_BASE "Vietnamesisch" + LGRPID_INDIC+LGRPID_RES_BASE "Indisch" + LGRPID_GEORGIAN+LGRPID_RES_BASE "Georgisch" + LGRPID_ARMENIAN+LGRPID_RES_BASE "Armenisch" } Modified: trunk/reactos/dll/win32/kernel32/nls/des.nls URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/nls/des…
============================================================================== --- trunk/reactos/dll/win32/kernel32/nls/des.nls [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/nls/des.nls [iso-8859-1] Sat Mar 7 01:33:54 2009 @@ -136,21 +136,21 @@ LOCALE_STIMEFORMAT "HH:mm:ss" LOCALE_SYEARMONTH "MMMM yyyy" - LGRPID_WESTERN_EUROPE+LGRPID_RES_BASE "Western Europe and United States" - LGRPID_CENTRAL_EUROPE+LGRPID_RES_BASE "Central Europe" - LGRPID_BALTIC+LGRPID_RES_BASE "Baltic" - LGRPID_GREEK+LGRPID_RES_BASE "Greek" - LGRPID_CYRILLIC+LGRPID_RES_BASE "Cyrillic" - LGRPID_TURKISH+LGRPID_RES_BASE "Turkic" - LGRPID_JAPANESE+LGRPID_RES_BASE "Japanese" - LGRPID_KOREAN+LGRPID_RES_BASE "Korean" - LGRPID_TRADITIONAL_CHINESE+LGRPID_RES_BASE "Traditional Chinese" - LGRPID_SIMPLIFIED_CHINESE+LGRPID_RES_BASE "Simplified Chinese" + LGRPID_WESTERN_EUROPE+LGRPID_RES_BASE "Westeuropa und Vereinigte Staaten" + LGRPID_CENTRAL_EUROPE+LGRPID_RES_BASE "Mitteleuropa" + LGRPID_BALTIC+LGRPID_RES_BASE "Baltisch" + LGRPID_GREEK+LGRPID_RES_BASE "Griechisch" + LGRPID_CYRILLIC+LGRPID_RES_BASE "Kyrillisch" + LGRPID_TURKISH+LGRPID_RES_BASE "Turkisch" + LGRPID_JAPANESE+LGRPID_RES_BASE "Japanisch" + LGRPID_KOREAN+LGRPID_RES_BASE "Koreanisch" + LGRPID_TRADITIONAL_CHINESE+LGRPID_RES_BASE "Chinesisch (Traditionell)" + LGRPID_SIMPLIFIED_CHINESE+LGRPID_RES_BASE "Chinesisch (Vereinfacht)" LGRPID_THAI+LGRPID_RES_BASE "Thai" - LGRPID_HEBREW+LGRPID_RES_BASE "Hebrew" - LGRPID_ARABIC+LGRPID_RES_BASE "Arabic" - LGRPID_VIETNAMESE+LGRPID_RES_BASE "Vietnamese" - LGRPID_INDIC+LGRPID_RES_BASE "Indic" - LGRPID_GEORGIAN+LGRPID_RES_BASE "Georgian" - LGRPID_ARMENIAN+LGRPID_RES_BASE "Armenian" + LGRPID_HEBREW+LGRPID_RES_BASE "Hebräisch" + LGRPID_ARABIC+LGRPID_RES_BASE "Arabisch" + LGRPID_VIETNAMESE+LGRPID_RES_BASE "Vietnamesisch" + LGRPID_INDIC+LGRPID_RES_BASE "Indisch" + LGRPID_GEORGIAN+LGRPID_RES_BASE "Georgisch" + LGRPID_ARMENIAN+LGRPID_RES_BASE "Armenisch" }
15 years, 9 months
1
0
0
0
[mkupfer] 39897: - temporary fix to show current time format setting in control panel
by mkupfer@svn.reactos.org
Author: mkupfer Date: Sat Mar 7 01:25:34 2009 New Revision: 39897 URL:
http://svn.reactos.org/svn/reactos?rev=39897&view=rev
Log: - temporary fix to show current time format setting in control panel Modified: trunk/reactos/dll/win32/kernel32/misc/lcformat.c Modified: trunk/reactos/dll/win32/kernel32/misc/lcformat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/lc…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/lcformat.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/lcformat.c [iso-8859-1] Sat Mar 7 01:25:34 2009 @@ -1803,9 +1803,69 @@ */ BOOL WINAPI EnumTimeFormatsW( TIMEFMT_ENUMPROCW lpTimeFmtEnumProc, LCID Locale, DWORD dwFlags ) { - FIXME("(%p,%ld,%ld): stub\n", lpTimeFmtEnumProc, Locale, dwFlags); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + LCID Loc = GetUserDefaultLCID(); + if(!lpTimeFmtEnumProc) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + if(dwFlags) + { + FIXME("Unknown time format (%ld)\n", dwFlags); + } + + switch( Loc ) + { + case 0x00000407: /* (Loc,"de_DE") */ + { + if(!(*lpTimeFmtEnumProc)(L"HH.mm")) return TRUE; + if(!(*lpTimeFmtEnumProc)(L"HH:mm:ss")) return TRUE; + if(!(*lpTimeFmtEnumProc)(L"H:mm:ss")) return TRUE; + if(!(*lpTimeFmtEnumProc)(L"H.mm")) return TRUE; + if(!(*lpTimeFmtEnumProc)(L"H.mm'Uhr'")) return TRUE; + return TRUE; + } + + case 0x0000040c: /* (Loc,"fr_FR") */ + case 0x00000c0c: /* (Loc,"fr_CA") */ + { + if(!(*lpTimeFmtEnumProc)(L"H:mm")) return TRUE; + if(!(*lpTimeFmtEnumProc)(L"HH:mm:ss")) return TRUE; + if(!(*lpTimeFmtEnumProc)(L"H:mm:ss")) return TRUE; + if(!(*lpTimeFmtEnumProc)(L"HH.mm")) return TRUE; + if(!(*lpTimeFmtEnumProc)(L"HH'h'mm")) return TRUE; + return TRUE; + } + + case 0x00000809: /* (Loc,"en_UK") */ + case 0x00000c09: /* (Loc,"en_AU") */ + case 0x00001409: /* (Loc,"en_NZ") */ + case 0x00001809: /* (Loc,"en_IE") */ + { + if(!(*lpTimeFmtEnumProc)(L"h:mm:ss tt")) return TRUE; + if(!(*lpTimeFmtEnumProc)(L"HH:mm:ss")) return TRUE; + if(!(*lpTimeFmtEnumProc)(L"H:mm:ss")) return TRUE; + return TRUE; + } + + case 0x00001c09: /* (Loc,"en_ZA") */ + case 0x00002809: /* (Loc,"en_BZ") */ + case 0x00002c09: /* (Loc,"en_TT") */ + { + if(!(*lpTimeFmtEnumProc)(L"h:mm:ss tt")) return TRUE; + if(!(*lpTimeFmtEnumProc)(L"hh:mm:ss tt")) return TRUE; + return TRUE; + } + + default: /* default to US style "en_US" */ + { + if(!(*lpTimeFmtEnumProc)(L"h:mm:ss tt")) return TRUE; + if(!(*lpTimeFmtEnumProc)(L"hh:mm:ss tt")) return TRUE; + if(!(*lpTimeFmtEnumProc)(L"H:mm:ss")) return TRUE; + if(!(*lpTimeFmtEnumProc)(L"HH:mm:ss")) return TRUE; + return TRUE; + } + } } /******************************************************************************
15 years, 9 months
1
0
0
0
[cgutman] 39896: - Merge aicom-network-fixes up to r39293
by cgutman@svn.reactos.org
Author: cgutman Date: Fri Mar 6 23:32:17 2009 New Revision: 39896 URL:
http://svn.reactos.org/svn/reactos?rev=39896&view=rev
Log: - Merge aicom-network-fixes up to r39293 Modified: trunk/reactos/drivers/network/afd/afd/listen.c trunk/reactos/drivers/network/afd/afd/select.c trunk/reactos/drivers/network/lan/lan/routines.c trunk/reactos/drivers/network/tcpip/include/irp.h trunk/reactos/drivers/network/tcpip/tcpip/buffer.c trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c trunk/reactos/drivers/network/tcpip/tcpip/irp.c trunk/reactos/drivers/network/tcpip/tcpip/main.c trunk/reactos/drivers/network/tcpip/tcpip/mockbuffer.c trunk/reactos/lib/drivers/ip/network/memtrack.c trunk/reactos/lib/drivers/ip/network/neighbor.c Modified: trunk/reactos/drivers/network/afd/afd/listen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/li…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] Fri Mar 6 23:32:17 2009 @@ -12,17 +12,15 @@ #include "tdiconn.h" #include "debug.h" -static VOID SatisfyAccept( PAFD_DEVICE_EXTENSION DeviceExt, +static NTSTATUS SatisfyAccept( PAFD_DEVICE_EXTENSION DeviceExt, PIRP Irp, PFILE_OBJECT NewFileObject, PAFD_TDI_OBJECT_QELT Qelt ) { PAFD_FCB FCB = NewFileObject->FsContext; NTSTATUS Status; - if( !SocketAcquireStateLock( FCB ) ) { - LostSocket( Irp ); - return; - } + if( !SocketAcquireStateLock( FCB ) ) + return LostSocket( Irp ); /* Transfer the connection to the new socket, launch the opening read */ AFD_DbgPrint(MID_TRACE,("Completing a real accept (FCB %x)\n", FCB)); @@ -50,9 +48,11 @@ IoCompleteRequest( Irp, IO_NETWORK_INCREMENT ); SocketStateUnlock( FCB ); -} - -static VOID SatisfyPreAccept( PIRP Irp, PAFD_TDI_OBJECT_QELT Qelt ) { + + return Status; +} + +static NTSTATUS SatisfyPreAccept( PIRP Irp, PAFD_TDI_OBJECT_QELT Qelt ) { PAFD_RECEIVED_ACCEPT_DATA ListenReceive = (PAFD_RECEIVED_ACCEPT_DATA)Irp->AssociatedIrp.SystemBuffer; PTA_IP_ADDRESS IPAddr; @@ -74,6 +74,7 @@ Irp->IoStatus.Status = STATUS_NO_MEMORY; Irp->IoStatus.Information = 0; IoCompleteRequest( Irp, IO_NETWORK_INCREMENT ); + return STATUS_NO_MEMORY; } AFD_DbgPrint(MID_TRACE,("IPAddr->TAAddressCount %d\n", @@ -92,6 +93,7 @@ Irp->IoStatus.Information = ((PCHAR)&IPAddr[1]) - ((PCHAR)ListenReceive); Irp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest( Irp, IO_NETWORK_INCREMENT ); + return STATUS_SUCCESS; } static NTSTATUS NTAPI ListenComplete @@ -244,6 +246,7 @@ PIO_STACK_LOCATION IrpSp ) { PFILE_OBJECT FileObject = IrpSp->FileObject; PAFD_FCB FCB = FileObject->FsContext; + NTSTATUS Status; AFD_DbgPrint(MID_TRACE,("Called\n")); @@ -253,7 +256,7 @@ PLIST_ENTRY PendingConn = FCB->PendingConnections.Flink; /* We have a pending connection ... complete this irp right away */ - SatisfyPreAccept + Status = SatisfyPreAccept ( Irp, CONTAINING_RECORD ( PendingConn, AFD_TDI_OBJECT_QELT, ListEntry ) ); @@ -264,7 +267,7 @@ PollReeval( FCB->DeviceExt, FCB->FileObject ); SocketStateUnlock( FCB ); - return Irp->IoStatus.Status; + return Status; } else { AFD_DbgPrint(MID_TRACE,("Holding\n")); @@ -341,7 +344,7 @@ ASSERT(NewFileObject->FsContext != FCB); /* We have a pending connection ... complete this irp right away */ - SatisfyAccept( DeviceExt, Irp, NewFileObject, PendingConnObj ); + Status = SatisfyAccept( DeviceExt, Irp, NewFileObject, PendingConnObj ); ObDereferenceObject( NewFileObject ); @@ -355,7 +358,7 @@ } SocketStateUnlock( FCB ); - return Irp->IoStatus.Status; + return Status; } } Modified: trunk/reactos/drivers/network/afd/afd/select.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/se…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] Fri Mar 6 23:32:17 2009 @@ -181,7 +181,7 @@ Irp->IoStatus.Status = STATUS_NO_MEMORY; Irp->IoStatus.Information = 0; IoCompleteRequest( Irp, IO_NETWORK_INCREMENT ); - return Irp->IoStatus.Status; + return STATUS_NO_MEMORY; } if( Exclusive ) { @@ -262,8 +262,6 @@ KeReleaseSpinLock( &DeviceExt->Lock, OldIrql ); AFD_DbgPrint(MID_TRACE,("Returning %x\n", Status)); - - Irp->IoStatus.Status = Status; return Status; } Modified: trunk/reactos/drivers/network/lan/lan/routines.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/lan/lan/ro…
============================================================================== --- trunk/reactos/drivers/network/lan/lan/routines.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/lan/lan/routines.c [iso-8859-1] Fri Mar 6 23:32:17 2009 @@ -87,23 +87,22 @@ NDIS_STATUS Status; PCHAR NewData; - NewData = ExAllocatePool( NonPagedPool, Len ); + NewData = exAllocatePool( NonPagedPool, Len ); if( !NewData ) return NDIS_STATUS_NOT_ACCEPTED; // XXX - TrackWithTag(EXALLOC_TAG, NewData, File, Line); if( Data ) RtlCopyMemory(NewData, Data, Len); NdisAllocatePacket( &Status, &Packet, GlobalPacketPool ); if( Status != NDIS_STATUS_SUCCESS ) { - ExFreePool( NewData ); + exFreePool( NewData ); return Status; } TrackWithTag(NDIS_PACKET_TAG, Packet, File, Line); NdisAllocateBuffer( &Status, &Buffer, GlobalBufferPool, NewData, Len ); if( Status != NDIS_STATUS_SUCCESS ) { - ExFreePool( NewData ); + exFreePool( NewData ); FreeNdisPacket( Packet ); } TrackWithTag(NDIS_BUFFER_TAG, Buffer, File, Line); @@ -139,8 +138,7 @@ NdisQueryBuffer(Buffer, &Data, &Length); NdisFreeBuffer(Buffer); UntrackFL(File,Line,Buffer); - ExFreePool(Data); - UntrackFL(File,Line,Data); + exFreePool(Data); } /* Finally free the NDIS packet discriptor */ Modified: trunk/reactos/drivers/network/tcpip/include/irp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
============================================================================== --- trunk/reactos/drivers/network/tcpip/include/irp.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/include/irp.h [iso-8859-1] Fri Mar 6 23:32:17 2009 @@ -10,10 +10,4 @@ VOID IRPRemember( PIRP Irp, PCHAR File, UINT Line ); NTSTATUS IRPFinish( PIRP Irp, NTSTATUS Status ); -#ifdef MEMTRACK -#define RIRP(x) IRPRemember(x,__FILE__,__LINE__) -#else -#define RIRP(x) -#endif - #endif/*__IRP_H*/ Modified: trunk/reactos/drivers/network/tcpip/tcpip/buffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/buffer.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/buffer.c [iso-8859-1] Fri Mar 6 23:32:17 2009 @@ -365,7 +365,6 @@ NdisAllocateBuffer( &Status, &Buffer, GlobalBufferPool, NewData, Len ); if( Status != NDIS_STATUS_SUCCESS ) { exFreePool( NewData ); - UntrackFL( File, Line, Packet, NDIS_PACKET_TAG ); FreeNdisPacket( Packet ); return Status; } Modified: trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] Fri Mar 6 23:32:17 2009 @@ -106,7 +106,7 @@ Irp->IoStatus.Information)); TI_DbgPrint(DEBUG_IRP, ("Completing IRP at (0x%X).\n", Irp)); - IRPFinish(Irp, Irp->IoStatus.Status); + IRPFinish(Irp, Status); TI_DbgPrint(DEBUG_IRP, ("Done Completing IRP\n")); } @@ -181,11 +181,11 @@ TCPRemoveIRP( TranContext->Handle.ConnectionContext, Irp ); + IoReleaseCancelSpinLock(Irp->CancelIrql); + if( !ChewCreate( &WorkItem, sizeof(DISCONNECT_TYPE), DispDoDisconnect, &DisType ) ) ASSERT(0); - - IoReleaseCancelSpinLock(Irp->CancelIrql); return; case TDI_SEND_DATAGRAM: @@ -212,7 +212,7 @@ } IoReleaseCancelSpinLock(Irp->CancelIrql); - IoCompleteRequest(Irp, IO_NO_INCREMENT); + IRPFinish(Irp, STATUS_CANCELLED); TI_DbgPrint(MAX_TRACE, ("Leaving.\n")); } @@ -256,7 +256,8 @@ IoReleaseCancelSpinLock(Irp->CancelIrql); - DispDataRequestComplete(Irp, STATUS_CANCELLED, 0); + Irp->IoStatus.Information = 0; + IRPFinish(Irp, STATUS_CANCELLED); TI_DbgPrint(MAX_TRACE, ("Leaving.\n")); } Modified: trunk/reactos/drivers/network/tcpip/tcpip/irp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/irp.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/irp.c [iso-8859-1] Fri Mar 6 23:32:17 2009 @@ -12,9 +12,7 @@ #include "precomp.h" VOID IRPRemember( PIRP Irp, PCHAR File, UINT Line ) { -#ifdef MEMTRACK TrackWithTag( IRP_TAG, Irp, File, Line ); -#endif } NTSTATUS IRPFinish( PIRP Irp, NTSTATUS Status ) { @@ -23,9 +21,7 @@ //DbgPrint("Called: Irp %x, Status %x Event %x\n", Irp, Status, Irp->UserEvent); -#ifdef MEMTRACK - UntrackFL( __FILE__, __LINE__, Irp ); -#endif + UntrackFL( __FILE__, __LINE__, Irp, IRP_TAG ); Irp->IoStatus.Status = Status; Modified: trunk/reactos/drivers/network/tcpip/tcpip/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/main.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/main.c [iso-8859-1] Fri Mar 6 23:32:17 2009 @@ -406,7 +406,7 @@ NTSTATUS Status; PTRANSPORT_CONTEXT Context; - RIRP(Irp); + IRPRemember(Irp, __FILE__, __LINE__); // DbgPrint("Called. DeviceObject is at (0x%X), IRP is at (0x%X).\n", DeviceObject, Irp); @@ -457,7 +457,7 @@ BOOLEAN Complete = TRUE; PIO_STACK_LOCATION IrpSp; - RIRP(Irp); + IRPRemember(Irp, __FILE__, __LINE__); IrpSp = IoGetCurrentIrpStackLocation(Irp); @@ -540,8 +540,6 @@ if( Complete ) IRPFinish( Irp, Status ); - else - Irp->IoStatus.Status = Status; return Status; } @@ -563,7 +561,7 @@ NTSTATUS Status; PIO_STACK_LOCATION IrpSp; - RIRP(Irp); + IRPRemember(Irp, __FILE__, __LINE__); IrpSp = IoGetCurrentIrpStackLocation(Irp); Modified: trunk/reactos/drivers/network/tcpip/tcpip/mockbuffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/mockbuffer.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/mockbuffer.c [iso-8859-1] Fri Mar 6 23:32:17 2009 @@ -432,7 +432,6 @@ NewData = exAllocatePool( NonPagedPool, Len ); if( !NewData ) return NDIS_STATUS_NOT_ACCEPTED; // XXX - TrackWithTag(EXALLOC_TAG, NewData, File, Line); if( Data ) RtlCopyMemory(NewData, Data, Len); Modified: trunk/reactos/lib/drivers/ip/network/memtrack.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/mem…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/memtrack.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/memtrack.c [iso-8859-1] Fri Mar 6 23:32:17 2009 @@ -82,17 +82,14 @@ if( ThingInList->Thing == Thing ) { RemoveEntryList(Entry); - TcpipReleaseSpinLock( &AllocatedObjectsLock, OldIrql ); - ShowTrackedThing( "Alloc", ThingInList, FALSE ); - - TrackDumpFL( FileName, LineNo ); - DbgPrint("TRACK: SPECIFIED ALREADY ALLOCATED ITEM %x\n", Thing); - ShowTrackedThing( "Double Alloc (Item in list)", ThingInList, TRUE ); - ShowTrackedThing( "Double Alloc (Item not in list)", TrackedThing, TRUE ); - TcpipBugCheck( 0 ); + TI_DbgPrint(MAX_TRACE,("TRACK: SPECIFIED ALREADY ALLOCATED ITEM %x\n", Thing)); + ShowTrackedThing( "Double Alloc (Item in list)", ThingInList, FALSE ); + ShowTrackedThing( "Double Alloc (Item not in list)", TrackedThing, FALSE ); ExFreeToNPagedLookasideList( &AllocatedObjectsLookasideList, ThingInList ); + + break; } Entry = Entry->Flink; } @@ -100,8 +97,6 @@ InsertHeadList( &AllocatedObjectsList, &TrackedThing->Entry ); TcpipReleaseSpinLock( &AllocatedObjectsLock, OldIrql ); - - /*TrackDumpFL( FileName, LineNo );*/ } BOOLEAN ShowTag( ULONG Tag ) { Modified: trunk/reactos/lib/drivers/ip/network/neighbor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/nei…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] Fri Mar 6 23:32:17 2009 @@ -237,7 +237,7 @@ { TI_DbgPrint(DEBUG_NCACHE, ("Called. NCE (0x%X).\n", NCE)); - if (NCE->State == NUD_INCOMPLETE) + if (NCE->State & NUD_INCOMPLETE) { /* This is the first solicitation of this neighbor. Broadcast a request for the neighbor */
15 years, 9 months
1
0
0
0
[janderwald] 39895: - Sorry broke build
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Mar 6 22:22:56 2009 New Revision: 39895 URL:
http://svn.reactos.org/svn/reactos?rev=39895&view=rev
Log: - Sorry broke build Modified: trunk/reactos/drivers/wdm/audio/drivers/directory.rbuild Modified: trunk/reactos/drivers/wdm/audio/drivers/directory.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/drivers/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/drivers/directory.rbuild [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/drivers/directory.rbuild [iso-8859-1] Fri Mar 6 22:22:56 2009 @@ -4,10 +4,6 @@ <directory name="mpu401"> <xi:include href="mpu401/mpu401.rbuild" /> </directory> - <directory name="CMIDriver"> - <xi:include href="CMIDriver/cmidriver.rbuild" /> - </directory> - <!--directory name="sb16"> <xi:include href="sb16/sb16.rbuild" /> </directory-->
15 years, 9 months
1
0
0
0
[janderwald] 39894: - Fix a few issues to open wdmaud / write to - Under lucky circunstances, you might be able to now to play an mp3 with winamp ; ) - Dedicated to all people helping to achieve this
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Mar 6 22:14:56 2009 New Revision: 39894 URL:
http://svn.reactos.org/svn/reactos?rev=39894&view=rev
Log: - Fix a few issues to open wdmaud / write to - Under lucky circunstances, you might be able to now to play an mp3 with winamp ;) - Dedicated to all people helping to achieve this Modified: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c 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] Fri Mar 6 22:14:56 2009 @@ -79,6 +79,7 @@ MMRESULT Result; MMDEVICE_TYPE DeviceType; + WDMAUD_DEVICE_INFO DeviceInfo; SND_ASSERT( SoundDevice ); SND_ASSERT( Capabilities ); @@ -91,21 +92,40 @@ if ( ! MMSUCCESS(Result) ) return Result; + + ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO)); + DeviceInfo.DeviceType = DeviceType; + DeviceInfo.DeviceIndex = 0; //FIXME + + 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 WAVE_OUT_DEVICE_TYPE : { LPWAVEOUTCAPS WaveOutCaps = (LPWAVEOUTCAPS) Capabilities; - WaveOutCaps->wMid = 0; - WaveOutCaps->wPid = 0; + WaveOutCaps->wMid = DeviceInfo.u.WaveOutCaps.wMid; + WaveOutCaps->wPid = DeviceInfo.u.WaveOutCaps.wPid; + WaveOutCaps->vDriverVersion = 0x0001; CopyWideString(WaveOutCaps->szPname, UnknownWaveOut); - /* HACK: We may not really support all formats! */ - WaveOutCaps->dwFormats = 0xffffffff; - WaveOutCaps->wChannels = 2; - WaveOutCaps->dwSupport = 0; + WaveOutCaps->dwFormats = DeviceInfo.u.WaveOutCaps.dwFormats; + WaveOutCaps->wChannels = DeviceInfo.u.WaveOutCaps.wChannels; + WaveOutCaps->dwSupport = DeviceInfo.u.WaveOutCaps.dwSupport; break; } case WAVE_IN_DEVICE_TYPE : @@ -130,7 +150,7 @@ if ( KernelHandle == INVALID_HANDLE_VALUE ) { SND_TRACE(L"Opening wdmaud device\n"); - KernelHandle = CreateFile(KERNEL_DEVICE_NAME, + KernelHandle = CreateFileW(KERNEL_DEVICE_NAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, @@ -152,7 +172,7 @@ MMRESULT CloseWdmSoundDevice( - IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance, /* NOT USED */ + IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance, IN PVOID Handle) { if ( OpenCount == 0 ) @@ -162,7 +182,12 @@ SND_ASSERT( KernelHandle != INVALID_HANDLE_VALUE ); - -- OpenCount; + if (SoundDeviceInstance->Handle != (PVOID)KernelHandle) + { + CloseHandle((HANDLE)SoundDeviceInstance->Handle); + } + + --OpenCount; if ( OpenCount < 1 ) { @@ -194,6 +219,7 @@ PSOUND_DEVICE SoundDevice; PVOID Identifier; WDMAUD_DEVICE_INFO DeviceInfo; + MMDEVICE_TYPE DeviceType; Result = GetSoundDeviceFromInstance(Instance, &SoundDevice); @@ -209,7 +235,19 @@ return TranslateInternalMmResult(Result); } + if (Instance->Handle != KernelHandle) + { + /* device is already open */ + return MMSYSERR_NOERROR; + } + + + Result = GetSoundDeviceType(SoundDevice, &DeviceType); + SND_ASSERT( Result == MMSYSERR_NOERROR ); + ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO)); + DeviceInfo.DeviceType = DeviceType; + DeviceInfo.DeviceIndex = 0; //FIXME DeviceInfo.u.WaveFormatEx.cbSize = WaveFormat->cbSize; DeviceInfo.u.WaveFormatEx.wFormatTag = WaveFormat->wFormatTag; DeviceInfo.u.WaveFormatEx.nChannels = WaveFormat->nChannels; @@ -231,6 +269,48 @@ return TranslateInternalMmResult(Result); } + Instance->Handle = (PVOID)DeviceInfo.hDevice; + + return MMSYSERR_NOERROR; +} + +MMRESULT +WriteFileEx_Committer2( + IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, + IN PVOID OffsetPtr, + IN DWORD Length, + IN PSOUND_OVERLAPPED Overlap, + IN LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine) +{ + HANDLE Handle; + WDMAUD_DEVICE_INFO DeviceInfo; + + + VALIDATE_MMSYS_PARAMETER( SoundDeviceInstance ); + VALIDATE_MMSYS_PARAMETER( OffsetPtr ); + VALIDATE_MMSYS_PARAMETER( Overlap ); + VALIDATE_MMSYS_PARAMETER( CompletionRoutine ); + + GetSoundDeviceInstanceHandle(SoundDeviceInstance, &Handle); + + SND_ASSERT(Handle); + + ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO)); + DeviceInfo.hDevice = Handle; + DeviceInfo.DeviceType = WAVE_OUT_DEVICE_TYPE; //FIXME + DeviceInfo.Buffer = OffsetPtr; + DeviceInfo.BufferSize = Length; + + Overlap->Standard.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL); + + if ( ! WriteFileEx(KernelHandle, &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), (LPOVERLAPPED)Overlap, CompletionRoutine)) + { + // TODO + SND_TRACE(L"WriteFileEx failed with %x\n", GetLastError()); + } + CompletionRoutine(0, Length, (LPOVERLAPPED)Overlap); + + return MMSYSERR_NOERROR; } @@ -277,7 +357,7 @@ FuncTable.SetWaveFormat = SetWdmWaveDeviceFormat; FuncTable.Open = OpenWdmSoundDevice; FuncTable.Close = CloseWdmSoundDevice; - //FuncTable.CommitWaveBuffer = WriteFileEx_Committer; + FuncTable.CommitWaveBuffer = WriteFileEx_Committer2; SetSoundDeviceFunctionTable(SoundDevice, &FuncTable); } @@ -330,8 +410,6 @@ PopulateWdmDeviceList(KernelHandle, AUX_DEVICE_TYPE); PopulateWdmDeviceList(KernelHandle, MIXER_DEVICE_TYPE); - CloseWdmSoundDevice(NULL, Handle); - SND_TRACE(L"Initialisation complete\n"); return 1L;
15 years, 9 months
1
0
0
0
← Newer
1
...
38
39
40
41
42
43
44
...
49
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
Results per page:
10
25
50
100
200