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
2025
January
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
April 2009
----- 2025 -----
January 2025
----- 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
25 participants
476 discussions
Start a n
N
ew thread
[dchapyshev] 40648: - Implement GetUserNameExA/W (code from Wine)
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Apr 22 18:11:17 2009 New Revision: 40648 URL:
http://svn.reactos.org/svn/reactos?rev=40648&view=rev
Log: - Implement GetUserNameExA/W (code from Wine) Modified: trunk/reactos/dll/win32/secur32/secext.c Modified: trunk/reactos/dll/win32/secur32/secext.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/secur32/secext.c…
============================================================================== --- trunk/reactos/dll/win32/secur32/secext.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/secur32/secext.c [iso-8859-1] Wed Apr 22 18:11:17 2009 @@ -20,6 +20,8 @@ #define NDEBUG #include <debug.h> + +#define UNLEN 256 /*********************************************************************** @@ -189,27 +191,99 @@ } -BOOLEAN -WINAPI -GetUserNameExA ( - EXTENDED_NAME_FORMAT extended_exe_format, - LPSTR lpstr, - PULONG pulong - ) -{ - UNIMPLEMENTED; - return ERROR_CALL_NOT_IMPLEMENTED; -} - - -BOOLEAN -WINAPI -GetUserNameExW ( - EXTENDED_NAME_FORMAT extended_exe_format, - LPWSTR lpstr, - PULONG pulong - ) -{ - UNIMPLEMENTED; - return ERROR_CALL_NOT_IMPLEMENTED; -} +BOOLEAN WINAPI GetUserNameExA( + EXTENDED_NAME_FORMAT NameFormat, LPSTR lpNameBuffer, PULONG nSize) +{ + BOOLEAN rc; + LPWSTR bufferW = NULL; + ULONG sizeW = *nSize; + DPRINT("(%d %p %p)\n", NameFormat, lpNameBuffer, nSize); + if (lpNameBuffer) { + bufferW = HeapAlloc(GetProcessHeap(), 0, sizeW * sizeof(WCHAR)); + if (bufferW == NULL) { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + } + rc = GetUserNameExW(NameFormat, bufferW, &sizeW); + if (rc) { + ULONG len = WideCharToMultiByte(CP_ACP, 0, bufferW, -1, NULL, 0, NULL, NULL); + if (len <= *nSize) + { + WideCharToMultiByte(CP_ACP, 0, bufferW, -1, lpNameBuffer, *nSize, NULL, NULL); + *nSize = len - 1; + } + else + { + *nSize = len; + rc = FALSE; + SetLastError(ERROR_MORE_DATA); + } + } + else + *nSize = sizeW; + HeapFree(GetProcessHeap(), 0, bufferW); + return rc; +} + + +BOOLEAN WINAPI GetUserNameExW( + EXTENDED_NAME_FORMAT NameFormat, LPWSTR lpNameBuffer, PULONG nSize) +{ + BOOLEAN status; + WCHAR samname[UNLEN + 1 + MAX_COMPUTERNAME_LENGTH + 1]; + LPWSTR out; + DWORD len; + DPRINT("(%d %p %p)\n", NameFormat, lpNameBuffer, nSize); + + switch (NameFormat) + { + case NameSamCompatible: + { + /* This assumes the current user is always a local account */ + len = MAX_COMPUTERNAME_LENGTH + 1; + if (GetComputerNameW(samname, &len)) + { + out = samname + lstrlenW(samname); + *out++ = '\\'; + len = UNLEN + 1; + if (GetUserNameW(out, &len)) + { + status = (lstrlenW(samname) < *nSize); + if (status) + { + lstrcpyW(lpNameBuffer, samname); + *nSize = lstrlenW(samname); + } + else + { + SetLastError(ERROR_MORE_DATA); + *nSize = lstrlenW(samname) + 1; + } + } + else + status = FALSE; + } + else + status = FALSE; + } + break; + case NameUnknown: + case NameFullyQualifiedDN: + case NameDisplay: + case NameUniqueId: + case NameCanonical: + case NameUserPrincipal: + case NameCanonicalEx: + case NameServicePrincipal: + case NameDnsDomain: + SetLastError(ERROR_NONE_MAPPED); + status = FALSE; + break; + default: + SetLastError(ERROR_INVALID_PARAMETER); + status = FALSE; + } + + return status; +}
15 years, 9 months
1
0
0
0
[dchapyshev] 40647: - Fix a problem with loading dlls in Iron See issue #4201 for more details.
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Apr 22 16:20:26 2009 New Revision: 40647 URL:
http://svn.reactos.org/svn/reactos?rev=40647&view=rev
Log: - Fix a problem with loading dlls in Iron See issue #4201 for more details. Modified: trunk/reactos/dll/win32/kernel32/misc/ldr.c Modified: trunk/reactos/dll/win32/kernel32/misc/ldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/ld…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/ldr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/ldr.c [iso-8859-1] Wed Apr 22 16:20:26 2009 @@ -40,7 +40,7 @@ UNICODE_STRING ModuleName; DWORD LastError = GetLastError(); /* GetEnvironmentVariable changes LastError */ - if (lpModule != NULL) + if ((lpModule != NULL) && (wcslen(lpModule) > 2) && (lpModule[1] == ':')) { lpModuleEnd = lpModule + wcslen(lpModule); }
15 years, 9 months
1
0
0
0
[janderwald] 40646: - Allocate work item for each filter / pin being opened - Use ExInterlockedInsertTailList to insert a new audio device to prevent race conditions when more than one audio device is present - Free work item in their target worker routine
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Apr 22 14:57:28 2009 New Revision: 40646 URL:
http://svn.reactos.org/svn/reactos?rev=40646&view=rev
Log: - Allocate work item for each filter / pin being opened - Use ExInterlockedInsertTailList to insert a new audio device to prevent race conditions when more than one audio device is present - Free work item in their target worker routine Modified: trunk/reactos/drivers/wdm/audio/sysaudio/control.c trunk/reactos/drivers/wdm/audio/sysaudio/deviface.c trunk/reactos/drivers/wdm/audio/sysaudio/main.c trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h Modified: trunk/reactos/drivers/wdm/audio/sysaudio/control.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/control.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/control.c [iso-8859-1] Wed Apr 22 14:57:28 2009 @@ -236,6 +236,8 @@ { SetIrpIoStatus(WorkerContext->Irp, STATUS_UNSUCCESSFUL, 0); ExFreePool(WorkerContext->DispatchContext); + IoFreeWorkItem(WorkerContext->WorkItem); + ExFreePool(WorkerContext); return; } @@ -252,6 +254,8 @@ SetIrpIoStatus(WorkerContext->Irp, STATUS_UNSUCCESSFUL, 0); ExFreePool(WorkerContext->DispatchContext); ExFreePool(MixerPinConnect); + IoFreeWorkItem(WorkerContext->WorkItem); + ExFreePool(WorkerContext); return; } @@ -391,8 +395,9 @@ *((PHANDLE)WorkerContext->Irp->UserBuffer) = VirtualPinHandle; SetIrpIoStatus(WorkerContext->Irp, STATUS_SUCCESS, sizeof(HANDLE)); + IoFreeWorkItem(WorkerContext->WorkItem); + ExFreePool(WorkerContext); return; - cleanup: if (RealFileObject) @@ -410,7 +415,8 @@ ExFreePool(WorkerContext->DispatchContext); SetIrpIoStatus(WorkerContext->Irp, Status, 0); - + IoFreeWorkItem(WorkerContext->WorkItem); + ExFreePool(WorkerContext); } NTSTATUS @@ -722,8 +728,7 @@ KSPIN_CINSTANCES PinInstances; PPIN_WORKER_CONTEXT WorkerContext; PDISPATCH_CONTEXT DispatchContext; - - + PIO_WORKITEM WorkItem; IoStack = IoGetCurrentIrpStackLocation(Irp); @@ -806,10 +811,7 @@ } } - ASSERT(DeviceExtension->WorkItem); - ASSERT(DeviceExtension->WorkerContext); - - /* create worker context */ + /* create dispatch pin context */ DispatchContext = ExAllocatePool(NonPagedPool, sizeof(DISPATCH_CONTEXT)); if (!DispatchContext) { @@ -817,11 +819,24 @@ return SetIrpIoStatus(Irp, STATUS_NO_MEMORY, 0); } - // FIXME - // mutal exclusion - - /* get worker context */ - WorkerContext = (PPIN_WORKER_CONTEXT)DeviceExtension->WorkerContext; + /* allocate worker context */ + WorkerContext = ExAllocatePool(NonPagedPool, sizeof(PIN_WORKER_CONTEXT)); + if (!WorkerContext) + { + /* no memory */ + ExFreePool(DispatchContext); + return SetIrpIoStatus(Irp, STATUS_NO_MEMORY, 0); + } + + /* allocate work item */ + WorkItem = IoAllocateWorkItem(DeviceObject); + if (!WorkerContext) + { + /* no memory */ + ExFreePool(DispatchContext); + ExFreePool(WorkerContext); + return SetIrpIoStatus(Irp, STATUS_NO_MEMORY, 0); + } /* prepare context */ RtlZeroMemory(WorkerContext, sizeof(PIN_WORKER_CONTEXT)); @@ -841,13 +856,14 @@ WorkerContext->PinConnect = PinConnect; WorkerContext->AudioClient = ClientInfo; WorkerContext->DeviceExtension = DeviceExtension; + WorkerContext->WorkItem = WorkItem; DPRINT("Queing Irp %p\n", Irp); /* queue the work item */ IoMarkIrpPending(Irp); Irp->IoStatus.Status = STATUS_PENDING; Irp->IoStatus.Information = 0; - IoQueueWorkItem(DeviceExtension->WorkItem, CreatePinWorkerRoutine, DelayedWorkQueue, (PVOID)WorkerContext); + IoQueueWorkItem(WorkItem, CreatePinWorkerRoutine, DelayedWorkQueue, (PVOID)WorkerContext); /* mark irp as pending */ return STATUS_PENDING; Modified: trunk/reactos/drivers/wdm/audio/sysaudio/deviface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/deviface.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/deviface.c [iso-8859-1] Wed Apr 22 14:57:28 2009 @@ -28,7 +28,10 @@ NTSTATUS Status; ULONG BytesReturned; PSYSAUDIODEVEXT DeviceExtension; - PKSAUDIO_DEVICE_ENTRY DeviceEntry = (PKSAUDIO_DEVICE_ENTRY)Context; + PKSAUDIO_DEVICE_ENTRY DeviceEntry; + PFILTER_WORKER_CONTEXT Ctx = (PFILTER_WORKER_CONTEXT)Context; + + DeviceEntry = Ctx->DeviceEntry; DPRINT("Querying filter...\n"); @@ -42,21 +45,13 @@ if (!NT_SUCCESS(Status)) { DPRINT1("Failed to query number of pins Status %x\n", Status); - ObDereferenceObject(DeviceEntry->FileObject); - ZwClose(DeviceEntry->Handle); - ExFreePool(DeviceEntry->DeviceName.Buffer); - ExFreePool(DeviceEntry); - return; + goto cleanup; } if (!Count) { DPRINT1("Filter has no pins!\n"); - ObDereferenceObject(DeviceEntry->FileObject); - ZwClose(DeviceEntry->Handle); - ExFreePool(DeviceEntry->DeviceName.Buffer); - ExFreePool(DeviceEntry); - return; + goto cleanup; } /* allocate pin array */ @@ -65,11 +60,7 @@ { /* no memory */ DPRINT1("Failed to allocate memory Block %x\n", Count * sizeof(PIN_INFO)); - ObDereferenceObject(DeviceEntry->FileObject); - ZwClose(DeviceEntry->Handle); - ExFreePool(DeviceEntry->DeviceName.Buffer); - ExFreePool(DeviceEntry); - return; + goto cleanup; } /* clear array */ RtlZeroMemory(DeviceEntry->Pins, sizeof(PIN_INFO) * Count); @@ -114,12 +105,27 @@ } DPRINT("Num Pins %u Num WaveIn Pins %u Name WaveOut Pins %u\n", DeviceEntry->NumberOfPins, DeviceEntry->NumWaveInPin, DeviceEntry->NumWaveOutPin); - + /* fetch device extension */ DeviceExtension = (PSYSAUDIODEVEXT)DeviceObject->DeviceExtension; - - InsertTailList(&DeviceExtension->KsAudioDeviceList, &DeviceEntry->Entry); - DeviceExtension->NumberOfKsAudioDevices++; - + /* insert new audio device */ + ExInterlockedInsertTailList(&DeviceExtension->KsAudioDeviceList, &DeviceEntry->Entry, &DeviceExtension->Lock); + /* increment audio device count */ + InterlockedIncrement((PLONG)&DeviceExtension->NumberOfKsAudioDevices); + + /* free work item */ + IoFreeWorkItem(Ctx->WorkItem); + /* free work item context */ + ExFreePool(Ctx); + return; + +cleanup: + + ObDereferenceObject(DeviceEntry->FileObject); + ZwClose(DeviceEntry->Handle); + ExFreePool(DeviceEntry->DeviceName.Buffer); + ExFreePool(DeviceEntry); + IoFreeWorkItem(Ctx->WorkItem); + ExFreePool(Ctx); } NTSTATUS @@ -177,7 +183,9 @@ DEVICE_INTERFACE_CHANGE_NOTIFICATION * Event; NTSTATUS Status = STATUS_SUCCESS; PSYSAUDIODEVEXT DeviceExtension; - PKSAUDIO_DEVICE_ENTRY DeviceEntry; + PKSAUDIO_DEVICE_ENTRY DeviceEntry = NULL; + PIO_WORKITEM WorkItem = NULL; + PFILTER_WORKER_CONTEXT Ctx = NULL; PDEVICE_OBJECT DeviceObject = (PDEVICE_OBJECT)Context; DeviceExtension = (PSYSAUDIODEVEXT)DeviceObject->DeviceExtension; @@ -191,48 +199,67 @@ DeviceEntry = ExAllocatePool(NonPagedPool, sizeof(KSAUDIO_DEVICE_ENTRY)); if (!DeviceEntry) { - + /* no memory */ return STATUS_INSUFFICIENT_RESOURCES; } + /* initialize audio device entry */ RtlZeroMemory(DeviceEntry, sizeof(KSAUDIO_DEVICE_ENTRY)); + + /* allocate filter ctx */ + Ctx = ExAllocatePool(NonPagedPool, sizeof(FILTER_WORKER_CONTEXT)); + if (!Ctx) + { + /* no memory */ + Status = STATUS_INSUFFICIENT_RESOURCES; + goto cleanup; + } + + /* allocate work item */ + WorkItem = IoAllocateWorkItem(DeviceObject); + if (!WorkItem) + { + /* no memory */ + Status = STATUS_INSUFFICIENT_RESOURCES; + goto cleanup; + } + + /* set device name */ DeviceEntry->DeviceName.Length = 0; DeviceEntry->DeviceName.MaximumLength = Event->SymbolicLinkName->Length + 5 * sizeof(WCHAR); DeviceEntry->DeviceName.Buffer = ExAllocatePool(NonPagedPool, DeviceEntry->DeviceName.MaximumLength); + if (!DeviceEntry->DeviceName.Buffer) { - ExFreePool(DeviceEntry); - return STATUS_INSUFFICIENT_RESOURCES; + Status = STATUS_INSUFFICIENT_RESOURCES; + goto cleanup; } if (!NT_SUCCESS(RtlAppendUnicodeToString(&DeviceEntry->DeviceName, L"\\??\\"))) { - ExFreePool(DeviceEntry->DeviceName.Buffer); - ExFreePool(DeviceEntry); - return STATUS_INSUFFICIENT_RESOURCES; + DPRINT1("RtlAppendUnicodeToString failed with %x\n", Status); + goto cleanup; } if (!NT_SUCCESS(RtlAppendUnicodeStringToString(&DeviceEntry->DeviceName, Event->SymbolicLinkName))) { - ExFreePool(DeviceEntry->DeviceName.Buffer); - ExFreePool(DeviceEntry); - return STATUS_INSUFFICIENT_RESOURCES; + DPRINT1("RtlAppendUnicodeStringToString failed with %x\n", Status); + goto cleanup; } Status = OpenDevice(&DeviceEntry->DeviceName, &DeviceEntry->Handle, &DeviceEntry->FileObject); if (!NT_SUCCESS(Status)) { DPRINT("ZwCreateFile failed with %x\n", Status); - ExFreePool(DeviceEntry->DeviceName.Buffer); - ExFreePool(DeviceEntry); - return Status; + goto cleanup; } DPRINT("Successfully opened audio device %u handle %p file object %p device object %p\n", DeviceExtension->NumberOfKsAudioDevices, DeviceEntry->Handle, DeviceEntry->FileObject, DeviceEntry->FileObject->DeviceObject); - //FIXME - // mutal exclusion - IoQueueWorkItem(DeviceExtension->WorkItem, FilterPinWorkerRoutine, DelayedWorkQueue, (PVOID)DeviceEntry); + Ctx->DeviceEntry = DeviceEntry; + Ctx->WorkItem = WorkItem; + + IoQueueWorkItem(WorkItem, FilterPinWorkerRoutine, DelayedWorkQueue, (PVOID)Ctx); return Status; } else @@ -241,6 +268,23 @@ UNIMPLEMENTED return STATUS_SUCCESS; } + +cleanup: + if (Ctx) + ExFreePool(Ctx); + + if (WorkItem) + IoFreeWorkItem(WorkItem); + + if (DeviceEntry) + { + if (DeviceEntry->DeviceName.Buffer) + ExFreePool(DeviceEntry->DeviceName.Buffer); + + ExFreePool(DeviceEntry); + } + + return Status; } NTSTATUS Modified: trunk/reactos/drivers/wdm/audio/sysaudio/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/main.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/main.c [iso-8859-1] Wed Apr 22 14:57:28 2009 @@ -118,7 +118,7 @@ RtlZeroMemory(DeviceExtension, sizeof(SYSAUDIODEVEXT)); /* Initialize the mutex */ - KeInitializeMutex(&DeviceExtension->Mutex, 0); + KeInitializeSpinLock(&DeviceExtension->Lock); /* Initialize the ks audio device list */ InitializeListHead(&DeviceExtension->KsAudioDeviceList); @@ -128,22 +128,6 @@ if (!NT_SUCCESS(Status)) { DPRINT1("KsAllocateDeviceHeader failed with %x\n", Status); - goto cleanup; - } - - /* allocate work item */ - DeviceExtension->WorkItem = IoAllocateWorkItem(DeviceObject); - if (!DeviceExtension->WorkItem) - { - DPRINT1("Failed to allocate work item\n"); - goto cleanup; - } - - /* allocate work item context */ - DeviceExtension->WorkerContext = ExAllocatePool(NonPagedPool, sizeof(PIN_WORKER_CONTEXT)); - if (!DeviceExtension->WorkerContext) - { - DPRINT1("Failed to allocate work item context\n"); goto cleanup; } Modified: trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h [iso-8859-1] Wed Apr 22 14:57:28 2009 @@ -70,13 +70,10 @@ LIST_ENTRY KsAudioDeviceList; // audio device list PVOID KsAudioNotificationEntry; // ks audio notification hook PVOID EchoCancelNotificationEntry; // ks echo cancel notification hook - KMUTEX Mutex; // audio device list mutex + KSPIN_LOCK Lock; // audio device list mutex PFILE_OBJECT KMixerFileObject; // mixer file object HANDLE KMixerHandle; // mixer file handle - - PIO_WORKITEM WorkItem; // work item for pin creation - PVOID WorkerContext; // work item context }SYSAUDIODEVEXT, *PSYSAUDIODEVEXT; @@ -113,7 +110,15 @@ PSYSAUDIO_CLIENT AudioClient; PSYSAUDIODEVEXT DeviceExtension; PKSDATAFORMAT_WAVEFORMATEX MixerFormat; + PIO_WORKITEM WorkItem; }PIN_WORKER_CONTEXT, *PPIN_WORKER_CONTEXT; + +typedef struct +{ + PIO_WORKITEM WorkItem; + PKSAUDIO_DEVICE_ENTRY DeviceEntry; +}FILTER_WORKER_CONTEXT, *PFILTER_WORKER_CONTEXT; + NTSTATUS SysAudioAllocateDeviceHeader(
15 years, 9 months
1
0
0
0
[janderwald] 40645: - Allocate a work item for each specific request (start / stop / close) and free allocated work items
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Apr 22 14:17:40 2009 New Revision: 40645 URL:
http://svn.reactos.org/svn/reactos?rev=40645&view=rev
Log: - Allocate a work item for each specific request (start / stop / close) and free allocated work items Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/adapter.c trunk/reactos/drivers/wdm/audio/backpln/portcls/filter_wavecyclic.c trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/adapter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/adapter.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/adapter.c [iso-8859-1] Wed Apr 22 14:17:40 2009 @@ -156,36 +156,6 @@ /* clear initializing flag */ fdo->Flags &= ~ DO_DEVICE_INITIALIZING; - /* allocate work item */ - portcls_ext->CloseWorkItem = IoAllocateWorkItem(fdo); - - if (!portcls_ext->CloseWorkItem) - { - /* not enough resources */ - goto cleanup; - status = STATUS_INSUFFICIENT_RESOURCES; - } - - /* allocate work item */ - portcls_ext->StartWorkItem = IoAllocateWorkItem(fdo); - - if (!portcls_ext->StartWorkItem) - { - /* not enough resources */ - goto cleanup; - status = STATUS_INSUFFICIENT_RESOURCES; - } - - /* allocate work item */ - portcls_ext->StopWorkItem = IoAllocateWorkItem(fdo); - - if (!portcls_ext->StopWorkItem) - { - /* not enough resources */ - goto cleanup; - status = STATUS_INSUFFICIENT_RESOURCES; - } - /* allocate the device header */ status = KsAllocateDeviceHeader(&portcls_ext->KsDeviceHeader, MaxObjects, portcls_ext->CreateItems); /* did we succeed */ @@ -220,24 +190,6 @@ { /* free the device header */ KsFreeDeviceHeader(portcls_ext->KsDeviceHeader); - } - - if (portcls_ext->CloseWorkItem) - { - /* free allocated work item */ - IoFreeWorkItem(portcls_ext->CloseWorkItem); - } - - if (portcls_ext->StartWorkItem) - { - /* free allocated work item */ - IoFreeWorkItem(portcls_ext->StartWorkItem); - } - - if (portcls_ext->StopWorkItem) - { - /* free allocated work item */ - IoFreeWorkItem(portcls_ext->StopWorkItem); } if (portcls_ext->CreateItems) Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/filter_wavecyclic.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/filter_wavecyclic.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/filter_wavecyclic.c [iso-8859-1] Wed Apr 22 14:17:40 2009 @@ -116,11 +116,11 @@ return STATUS_UNSUCCESSFUL; } - if (This->Pins[ConnectDetails->PinId] && This->Descriptor->Factory.Instances[ConnectDetails->PinId].CurrentPinInstanceCount) + if (This->Pins[ConnectDetails->PinId] && + (This->Descriptor->Factory.Instances[ConnectDetails->PinId].CurrentPinInstanceCount == This->Descriptor->Factory.Instances[ConnectDetails->PinId].MaxFilterInstanceCount)) { /* release existing instance */ - ASSERT(0); - This->Pins[ConnectDetails->PinId]->lpVtbl->Close(This->Pins[ConnectDetails->PinId], DeviceObject, NULL); + return STATUS_UNSUCCESSFUL; } /* now create the pin */ 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] Wed Apr 22 14:17:40 2009 @@ -38,7 +38,6 @@ ULONG DelayedRequestInProgress; ULONG FrameSize; BOOL Capture; - PIRP CloseIrp; }IPortPinWaveCyclicImpl; @@ -199,18 +198,20 @@ IN PDEVICE_OBJECT DeviceObject, IN PVOID Context) { - PPCLASS_DEVICE_EXTENSION DeviceExtension; - IPortPinWaveCyclicImpl * This = (IPortPinWaveCyclicImpl*)Context; + IPortPinWaveCyclicImpl * This; + PSTOPSTREAM_CONTEXT Ctx = (PSTOPSTREAM_CONTEXT)Context; + + This = (IPortPinWaveCyclicImpl*)Ctx->Pin; /* Set the state to stop */ This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_STOP); /* Set internal state to stop */ This->State = KSSTATE_STOP; - /* Get device extension */ - DeviceExtension = (PPCLASS_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - - DPRINT1("Stopping %u Irql %u\n", This->IrpQueue->lpVtbl->NumMappings(This->IrpQueue), KeGetCurrentIrql()); + IoFreeWorkItem(Ctx->WorkItem); + FreeItem(Ctx, TAG_PORTCLASS); + + DPRINT1("Stopping %p %u Irql %u\n", This, This->IrpQueue->lpVtbl->NumMappings(This->IrpQueue), KeGetCurrentIrql()); } VOID @@ -222,8 +223,9 @@ IN PVOID SystemArgument2) { PDEVICE_OBJECT DeviceObject; - PPCLASS_DEVICE_EXTENSION DeviceExtension; IPortPinWaveCyclicImpl * This = (IPortPinWaveCyclicImpl*)DeferredContext; + PIO_WORKITEM WorkItem; + PSTOPSTREAM_CONTEXT Context; ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL); @@ -238,11 +240,26 @@ /* Get device object */ DeviceObject = GetDeviceObject(This->Port); - /* Get device extension */ - DeviceExtension = (PPCLASS_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + /* allocate stop context */ + Context = AllocateItem(NonPagedPool, sizeof(STOPSTREAM_CONTEXT), TAG_PORTCLASS); + + if (!Context) + return; + + /* allocate work item */ + WorkItem = IoAllocateWorkItem(DeviceObject); + + if (!WorkItem) + { + ExFreePool(Context); + return; + } + + Context->Pin = (PVOID)This; + Context->WorkItem = WorkItem; /* queue the work item */ - IoQueueWorkItem(DeviceExtension->StopWorkItem, StopStreamWorkerRoutine, DelayedWorkQueue, (PVOID)This); + IoQueueWorkItem(WorkItem, StopStreamWorkerRoutine, DelayedWorkQueue, (PVOID)Context); } static @@ -636,14 +653,16 @@ NTAPI CloseStreamRoutine( IN PDEVICE_OBJECT DeviceObject, - IN PVOID Context) + IN PVOID Context) { PMINIPORTWAVECYCLICSTREAM Stream; NTSTATUS Status; ISubdevice *ISubDevice; PSUBDEVICE_DESCRIPTOR Descriptor; - - IPortPinWaveCyclicImpl * This = (IPortPinWaveCyclicImpl*)Context; + IPortPinWaveCyclicImpl * This; + PCLOSESTREAM_CONTEXT Ctx = (PCLOSESTREAM_CONTEXT)Context; + + This = (IPortPinWaveCyclicImpl*)Ctx->Pin; if (This->Stream) { @@ -680,17 +699,21 @@ This->IrpQueue->lpVtbl->Release(This->IrpQueue); } + /* complete the irp */ + Ctx->Irp->IoStatus.Information = 0; + Ctx->Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(Ctx->Irp, IO_NO_INCREMENT); + + /* free the work item */ + IoFreeWorkItem(Ctx->WorkItem); + + /* free work item ctx */ + FreeItem(Ctx, TAG_PORTCLASS); + if (This->Stream) { Stream = This->Stream; This->Stream = NULL; - - if (This->CloseIrp) - { - This->CloseIrp->IoStatus.Information = 0; - This->CloseIrp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(This->CloseIrp, IO_NO_INCREMENT); - } DPRINT1("Closing stream at Irql %u\n", KeGetCurrentIrql()); Stream->lpVtbl->Release(Stream); /* this line is never reached */ @@ -707,32 +730,54 @@ IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { - PPCLASS_DEVICE_EXTENSION DeviceExtension; + PCLOSESTREAM_CONTEXT Ctx; IPortPinWaveCyclicImpl * This = (IPortPinWaveCyclicImpl*)iface; if (This->Stream) { - /* Get device extension */ - DeviceExtension = (PPCLASS_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - - This->CloseIrp = Irp; + Ctx = AllocateItem(NonPagedPool, sizeof(CLOSESTREAM_CONTEXT), TAG_PORTCLASS); + if (!Ctx) + { + DPRINT1("Failed to allocate stream context\n"); + goto cleanup; + } + + Ctx->WorkItem = IoAllocateWorkItem(DeviceObject); + if (!Ctx->WorkItem) + { + DPRINT1("Failed to allocate work item\n"); + goto cleanup; + } + + Ctx->Irp = Irp; + Ctx->Pin = (PVOID)This; + IoMarkIrpPending(Irp); Irp->IoStatus.Information = 0; Irp->IoStatus.Status = STATUS_PENDING; /* defer work item */ - IoQueueWorkItem(DeviceExtension->CloseWorkItem, CloseStreamRoutine, DelayedWorkQueue, (PVOID)This); + IoQueueWorkItem(Ctx->WorkItem, CloseStreamRoutine, DelayedWorkQueue, (PVOID)Ctx); /* Return result */ return STATUS_PENDING; } - if (Irp) - { - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - } + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; + +cleanup: + + if (Ctx) + FreeItem(Ctx, TAG_PORTCLASS); + + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_UNSUCCESSFUL; + } /* @@ -971,9 +1016,9 @@ DPRINT1("Failed to add pin to service group\n"); return Status; } - This->ServiceGroup->lpVtbl->AddRef(This->ServiceGroup); + //This->ServiceGroup->lpVtbl->AddRef(This->ServiceGroup); This->ServiceGroup->lpVtbl->SupportDelayedService(This->ServiceGroup); - This->DmaChannel->lpVtbl->AddRef(This->DmaChannel); + //This->DmaChannel->lpVtbl->AddRef(This->DmaChannel); This->State = KSSTATE_STOP; Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c [iso-8859-1] Wed Apr 22 14:17:40 2009 @@ -29,7 +29,7 @@ { PIRP Irp; IIrpTarget *Filter; - + PIO_WORKITEM WorkItem; }PIN_WORKER_CONTEXT, *PPIN_WORKER_CONTEXT; static GUID InterfaceGuids[2] = @@ -459,7 +459,7 @@ PPIN_WORKER_CONTEXT WorkerContext = (PPIN_WORKER_CONTEXT)Context; DPRINT("CreatePinWorkerRoutine called\n"); - + /* create the pin */ Status = WorkerContext->Filter->lpVtbl->NewIrpTarget(WorkerContext->Filter, &Pin, NULL, @@ -479,10 +479,15 @@ } DPRINT("CreatePinWorkerRoutine completing irp %p\n", WorkerContext->Irp); + /* save status in irp */ WorkerContext->Irp->IoStatus.Status = Status; WorkerContext->Irp->IoStatus.Information = 0; + /* complete the request */ IoCompleteRequest(WorkerContext->Irp, IO_SOUND_INCREMENT); - ExFreePool(WorkerContext); + /* free allocated work item */ + IoFreeWorkItem(WorkerContext->WorkItem); + /* free context */ + FreeItem(WorkerContext, TAG_PORTCLASS); } @@ -590,11 +595,24 @@ Context = AllocateItem(NonPagedPool, sizeof(PIN_WORKER_CONTEXT), TAG_PORTCLASS); if (!Context) { + DPRINT("Failed to allocate worker context\n"); Irp->IoStatus.Information = 0; Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_INSUFFICIENT_RESOURCES; } + /* allocate work item */ + Context->WorkItem = IoAllocateWorkItem(DeviceObject); + if (!Context->WorkItem) + { + DPRINT("Failed to allocate workitem\n"); + FreeItem(Context, TAG_PORTCLASS); + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_INSUFFICIENT_RESOURCES; + } + Context->Filter = Filter; Context->Irp = Irp; @@ -602,7 +620,7 @@ Irp->IoStatus.Information = 0; Irp->IoStatus.Status = STATUS_PENDING; IoMarkIrpPending(Irp); - IoQueueWorkItem(DeviceExt->StartWorkItem, CreatePinWorkerRoutine, DelayedWorkQueue, (PVOID)Context); + IoQueueWorkItem(Context->WorkItem, CreatePinWorkerRoutine, DelayedWorkQueue, (PVOID)Context); return STATUS_PENDING; } } Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h [iso-8859-1] Wed Apr 22 14:17:40 2009 @@ -169,10 +169,6 @@ ULONG MaxSubDevices; KSOBJECT_CREATE_ITEM * CreateItems; - PIO_WORKITEM StartWorkItem; - PIO_WORKITEM StopWorkItem; - PIO_WORKITEM CloseWorkItem; - IResourceList* resources; LIST_ENTRY SubDeviceList; LIST_ENTRY PhysicalConnectionList; @@ -185,6 +181,19 @@ KSSTREAM_HEADER Header; PIRP Irp; }CONTEXT_WRITE, *PCONTEXT_WRITE; + +typedef struct +{ + PVOID Pin; + PIO_WORKITEM WorkItem; +}STOPSTREAM_CONTEXT, *PSTOPSTREAM_CONTEXT; + +typedef struct +{ + PVOID Pin; + PIO_WORKITEM WorkItem; + PIRP Irp; +}CLOSESTREAM_CONTEXT, *PCLOSESTREAM_CONTEXT; NTSTATUS NTAPI Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c [iso-8859-1] Wed Apr 22 14:17:40 2009 @@ -427,10 +427,12 @@ DPRINT("Calling property handler %p\n", PropertyHandler); Status = PropertyHandler(Irp, Property, Irp->UserBuffer); } - - RtlStringFromGUID(&Property->Set, &GuidString); - DPRINT1("Unhandeled property: Set %S Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags); - RtlFreeUnicodeString(&GuidString); + else + { + RtlStringFromGUID(&Property->Set, &GuidString); + DPRINT1("Unhandeled property: Set %S Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags); + RtlFreeUnicodeString(&GuidString); + } /* the information member is set by the handler */ Irp->IoStatus.Status = Status;
15 years, 9 months
1
0
0
0
[dchapyshev] 40644: - Add Font Embedding Dll (it is necessary for Iron and Chrome)
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Apr 22 12:51:09 2009 New Revision: 40644 URL:
http://svn.reactos.org/svn/reactos?rev=40644&view=rev
Log: - Add Font Embedding Dll (it is necessary for Iron and Chrome) Added: trunk/reactos/dll/win32/t2embed/ (with props) trunk/reactos/dll/win32/t2embed/t2embed.c (with props) trunk/reactos/dll/win32/t2embed/t2embed.rbuild (with props) trunk/reactos/dll/win32/t2embed/t2embed.rc (with props) trunk/reactos/dll/win32/t2embed/t2embed.spec (with props) trunk/reactos/include/psdk/t2embapi.h (with props) Modified: trunk/reactos/baseaddress.rbuild trunk/reactos/boot/bootdata/packages/reactos.dff trunk/reactos/dll/win32/win32.rbuild Modified: trunk/reactos/baseaddress.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/baseaddress.rbuild?rev=406…
============================================================================== --- trunk/reactos/baseaddress.rbuild [iso-8859-1] (original) +++ trunk/reactos/baseaddress.rbuild [iso-8859-1] Wed Apr 22 12:51:09 2009 @@ -13,6 +13,7 @@ <property name="BASEADDRESS_WLANAPI" value="0x470F0000" /> <property name="BASEADDRESS_PIDGEN" value="0x473e0000" /> <property name="BASEADDRESS_DWMAPI" value="0x4A3F0000" /> + <property name="BASEADDRESS_T2EMBED" value="0x4b310000" /> <property name="BASEADDRESS_LOADPERF" value="0x4B920000" /> <property name="BASEADDRESS_MPRAPI" value="0x4C400000" /> <property name="BASEADDRESS_MSFTEDIT" value="0x4b460000" /> Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] Wed Apr 22 12:51:09 2009 @@ -412,6 +412,7 @@ dll\win32\sti\sti.dll 1 dll\win32\sxs\sxs.dll 1 dll\win32\syssetup\syssetup.dll 1 +dll\win32\t2embed\t2embed.dll 1 dll\win32\tapi32\tapi32.dll 1 dll\win32\tapiui\tapiui.dll 1 dll\win32\traffic\traffic.dll 1 Propchange: trunk/reactos/dll/win32/t2embed/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Wed Apr 22 12:51:09 2009 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/dll/win32/t2embed/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/dll/win32/t2embed/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/dll/win32/t2embed/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/dll/win32/t2embed/t2embed.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/t2embed/t2embed.…
============================================================================== --- trunk/reactos/dll/win32/t2embed/t2embed.c (added) +++ trunk/reactos/dll/win32/t2embed/t2embed.c [iso-8859-1] Wed Apr 22 12:51:09 2009 @@ -1,0 +1,205 @@ +/* + * PROJECT: Font Embedding Dll + * FILE: dll\win32\t2embed\t2embed.c + * PURPOSE: Main file + * PROGRAMMERS: Dmitry Chapyshev (dmitry(a)reactos.org) + */ + +#include <windows.h> +#include <t2embapi.h> +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(t2embed); + +LONG +WINAPI +TTCharToUnicode(HDC hDC, + UCHAR* pucCharCodes, + ULONG ulCharCodeSize, + USHORT* pusShortCodes, + ULONG ulShortCodeSize, + ULONG ulFlags) +{ + UNIMPLEMENTED; + return E_NONE; +} + +LONG +WINAPI +TTDeleteEmbeddedFont(HANDLE hFontReference, + ULONG ulFlags, + ULONG* pulStatus) +{ + UNIMPLEMENTED; + return E_NONE; +} + +LONG +WINAPI +TTEmbedFont(HDC hDC, + ULONG ulFlags, + ULONG ulCharSet, + ULONG* pulPrivStatus, + ULONG* pulStatus, + WRITEEMBEDPROC lpfnWriteToStream, + LPVOID lpvWriteStream, + USHORT* pusCharCodeSet, + USHORT usCharCodeCount, + USHORT usLanguage, + TTEMBEDINFO* pTTEmbedInfo) +{ + UNIMPLEMENTED; + return E_NONE; +} + +LONG +WINAPI +TTEmbedFontFromFileA(HDC hDC, + LPCSTR szFontFileName, + USHORT usTTCIndex, + ULONG ulFlags, + ULONG ulCharSet, + ULONG* pulPrivStatus, + ULONG* pulStatus, + WRITEEMBEDPROC lpfnWriteToStream, + LPVOID lpvWriteStream, + USHORT* pusCharCodeSet, + USHORT usCharCodeCount, + USHORT usLanguage, + TTEMBEDINFO* pTTEmbedInfo) +{ + UNIMPLEMENTED; + return E_NONE; +} + +LONG +WINAPI +TTEnableEmbeddingForFacename(LPSTR lpszFacename, + BOOL bEnable) +{ + UNIMPLEMENTED; + return E_NONE; +} + +LONG +WINAPI +TTGetEmbeddedFontInfo(ULONG ulFlags, + ULONG* pulPrivStatus, + ULONG ulPrivs, + ULONG* pulStatus, + READEMBEDPROC lpfnReadFromStream, + LPVOID lpvReadStream, + TTLOADINFO* pTTLoadInfo) +{ + UNIMPLEMENTED; + return E_NONE; +} + +LONG +WINAPI +TTGetEmbeddingType(HDC hDC, + ULONG* pulPrivStatus) +{ + UNIMPLEMENTED; + return E_NONE; +} + +LONG +WINAPI +TTIsEmbeddingEnabled(HDC hDC, + BOOL* pbEnabled) +{ + UNIMPLEMENTED; + return E_NONE; +} + +LONG +WINAPI +TTIsEmbeddingEnabledForFacename(LPSTR lpszFacename, + BOOL* pbEnabled) +{ + UNIMPLEMENTED; + return E_NONE; +} + +LONG +WINAPI +TTLoadEmbeddedFont(HANDLE *phFontReference, + ULONG ulFlags, + ULONG* pulPrivStatus, + ULONG ulPrivs, + ULONG* pulStatus, + READEMBEDPROC lpfnReadFromStream, + LPVOID lpvReadStream, + LPWSTR szWinFamilyName, + LPSTR szMacFamilyName, + TTLOADINFO* pTTLoadInfo) +{ + UNIMPLEMENTED; + return E_NONE; +} + +LONG +WINAPI +TTRunValidationTests(HDC hDC, + TTVALIDATIONTESTPARAMS* pTestParam) +{ + UNIMPLEMENTED; + return E_NONE; +} + +LONG +WINAPI +TTEmbedFontEx(HDC hDC, + ULONG ulFlags, + ULONG ulCharSet, + ULONG* pulPrivStatus, + ULONG* pulStatus, + WRITEEMBEDPROC lpfnWriteToStream, + LPVOID lpvWriteStream, + ULONG* pulCharCodeSet, + USHORT usCharCodeCount, + USHORT usLanguage, + TTEMBEDINFO* pTTEmbedInfo) +{ + UNIMPLEMENTED; + return E_NONE; +} + +LONG +WINAPI +TTRunValidationTestsEx(HDC hDC, + TTVALIDATIONTESTPARAMSEX* pTestParam) +{ + UNIMPLEMENTED; + return E_NONE; +} + +LONG +WINAPI +TTGetNewFontName(HANDLE* phFontReference, + LPWSTR szWinFamilyName, + long cchMaxWinName, + LPSTR szMacFamilyName, + long cchMaxMacName) +{ + UNIMPLEMENTED; + return E_NONE; +} + + +BOOL +WINAPI +DllMain(IN HINSTANCE hinstDLL, + IN DWORD dwReason, + IN LPVOID lpvReserved) +{ + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hinstDLL); + break; + } + + return TRUE; +} Propchange: trunk/reactos/dll/win32/t2embed/t2embed.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/t2embed/t2embed.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/t2embed/t2embed.…
============================================================================== --- trunk/reactos/dll/win32/t2embed/t2embed.rbuild (added) +++ trunk/reactos/dll/win32/t2embed/t2embed.rbuild [iso-8859-1] Wed Apr 22 12:51:09 2009 @@ -1,0 +1,13 @@ +<module name="t2embed" type="win32dll" baseaddress="${BASEADDRESS_T2EMBED}" installbase="system32" installname="t2embed.dll" unicode="yes"> + <importlibrary definition="t2embed.spec" /> + <include base="t2embed">.</include> + <include base="ReactOS">include/reactos/wine</include> + <library>kernel32</library> + <library>gdi32</library> + <library>user32</library> + <library>advapi32</library> + <library>version</library> + <library>wine</library> + <file>t2embed.c</file> + <file>t2embed.rc</file> +</module> Propchange: trunk/reactos/dll/win32/t2embed/t2embed.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/t2embed/t2embed.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/t2embed/t2embed.…
============================================================================== --- trunk/reactos/dll/win32/t2embed/t2embed.rc (added) +++ trunk/reactos/dll/win32/t2embed/t2embed.rc [iso-8859-1] Wed Apr 22 12:51:09 2009 @@ -1,0 +1,7 @@ +#include <windows.h> + +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "Font Embedding Dll\0" +#define REACTOS_STR_INTERNAL_NAME "t2embed\0" +#define REACTOS_STR_ORIGINAL_FILENAME "t2embed.dll\0" +#include <reactos/version.rc> Propchange: trunk/reactos/dll/win32/t2embed/t2embed.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/t2embed/t2embed.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/t2embed/t2embed.…
============================================================================== --- trunk/reactos/dll/win32/t2embed/t2embed.spec (added) +++ trunk/reactos/dll/win32/t2embed/t2embed.spec [iso-8859-1] Wed Apr 22 12:51:09 2009 @@ -1,0 +1,25 @@ +@ stdcall TTCharToUnicode(ptr ptr long ptr long long) +@ stdcall TTDeleteEmbeddedFont(ptr long ptr) +@ stdcall TTEmbedFont(ptr long long ptr ptr ptr ptr ptr long long ptr) +@ stdcall TTEmbedFontFromFileA(ptr str long long long ptr ptr ptr ptr ptr long long ptr) +@ stdcall TTEnableEmbeddingForFacename(str long) +@ stdcall TTGetEmbeddedFontInfo(long ptr long ptr ptr ptr ptr) +@ stdcall TTGetEmbeddingType(ptr ptr) +@ stdcall TTIsEmbeddingEnabled(ptr ptr) +@ stdcall TTIsEmbeddingEnabledForFacename(str ptr) +@ stdcall TTLoadEmbeddedFont(ptr long ptr long ptr ptr ptr wstr str ptr) +@ stdcall TTRunValidationTests(ptr ptr) +@ stub _TTCharToUnicode@24 +@ stub _TTDeleteEmbeddedFont@12 +@ stub _TTEmbedFont@44 +@ stub _TTEmbedFontFromFileA@52 +@ stub _TTEnableEmbeddingForFacename@8 +@ stub _TTGetEmbeddedFontInfo@28 +@ stub _TTGetEmbeddingType@8 +@ stub _TTIsEmbeddingEnabled@8 +@ stub _TTIsEmbeddingEnabledForFacename@8 +@ stub _TTLoadEmbeddedFont@40 +@ stub _TTRunValidationTests@8 +@ stdcall TTEmbedFontEx(ptr long long ptr ptr ptr ptr ptr long long ptr) +@ stdcall TTRunValidationTestsEx(ptr ptr) +@ stdcall TTGetNewFontName(ptr wstr long str long) Propchange: trunk/reactos/dll/win32/t2embed/t2embed.spec ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/win32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/win32.rbuild?rev…
============================================================================== --- trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] Wed Apr 22 12:51:09 2009 @@ -511,6 +511,9 @@ <directory name="syssetup"> <xi:include href="syssetup/syssetup.rbuild" /> </directory> +<directory name="t2embed"> + <xi:include href="t2embed/t2embed.rbuild" /> +</directory> <directory name="tapi32"> <xi:include href="tapi32/tapi32.rbuild" /> </directory> Added: trunk/reactos/include/psdk/t2embapi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/t2embapi.h?re…
============================================================================== --- trunk/reactos/include/psdk/t2embapi.h (added) +++ trunk/reactos/include/psdk/t2embapi.h [iso-8859-1] Wed Apr 22 12:51:09 2009 @@ -1,0 +1,286 @@ +#ifndef __T2EMBED_API_H +#define __T2EMBED_API_H + +#ifndef CHARSET_UNICODE +#define CHARSET_UNICODE 1 +#define CHARSET_DEFAULT 1 +#define CHARSET_SYMBOL 2 +#define CHARSET_GLYPHIDX 3 +#endif + +#ifndef EMBED_PREVIEWPRINT +#define EMBED_PREVIEWPRINT 1 +#define EMBED_EDITABLE 2 +#define EMBED_INSTALLABLE 3 +#define EMBED_NOEMBEDDING 4 +#endif + +#ifndef LICENSE_INSTALLABLE +#define LICENSE_INSTALLABLE 0x0 +#define LICENSE_DEFAULT 0x0 +#define LICENSE_NOEMBEDDING 0x2 +#define LICENSE_PREVIEWPRINT 0x4 +#define LICENSE_EDITABLE 0x8 +#endif + +#ifndef TTEMBED_RAW +#define TTEMBED_RAW 0x0 +#define TTEMBED_SUBSET 0x1 +#define TTEMBED_TTCOMPRESSED 0x4 +#define TTEMBED_FAILIFVARIATIONSIMULATED 0x10 +#define TTEMBED_EMBEDEUDC 0x20 +#define TTEMBED_VALIDATIONTESTS 0x40 +#define TTEMBED_WEBOBJECT 0x80 +#define TTEMBED_ENCRYPTDATA 0x10000000 +#endif + +#ifndef E_NONE +#define E_NONE 0x0 +#endif + +#ifndef E_CHARCODECOUNTINVALID +#define E_CHARCODECOUNTINVALID 0x2 +#define E_CHARCODESETINVALID 0x3 +#define E_DEVICETRUETYPEFONT 0x4 +#define E_HDCINVALID 0x6 +#define E_NOFREEMEMORY 0x7 +#define E_FONTREFERENCEINVALID 0x8 +#define E_NOTATRUETYPEFONT 0xA +#define E_ERRORACCESSINGFONTDATA 0xC +#define E_ERRORACCESSINGFACENAME 0xD +#define E_ERRORUNICODECONVERSION 0x11 +#define E_ERRORCONVERTINGCHARS 0x12 +#define E_EXCEPTION 0x13 +#define E_RESERVEDPARAMNOTNULL 0x14 +#define E_CHARSETINVALID 0x15 +#define E_WIN32S_NOTSUPPORTED 0x16 +#define E_FILE_NOT_FOUND 0x17 +#define E_TTC_INDEX_OUT_OF_RANGE 0x18 +#define E_INPUTPARAMINVALID 0x19 +#endif + +#ifndef E_ERRORCOMPRESSINGFONTDATA +#define E_ERRORCOMPRESSINGFONTDATA 0x100 +#define E_FONTDATAINVALID 0x102 +#define E_NAMECHANGEFAILED 0x103 +#define E_FONTNOTEMBEDDABLE 0x104 +#define E_PRIVSINVALID 0x105 +#define E_SUBSETTINGFAILED 0x106 +#define E_READFROMSTREAMFAILED 0x107 +#define E_SAVETOSTREAMFAILED 0x108 +#define E_NOOS2 0x109 +#define E_T2NOFREEMEMORY 0x10A +#define E_ERRORREADINGFONTDATA 0x10B +#define E_FLAGSINVALID 0x10C +#define E_ERRORCREATINGFONTFILE 0x10D +#define E_FONTALREADYEXISTS 0x10E +#define E_FONTNAMEALREADYEXISTS 0x10F +#define E_FONTINSTALLFAILED 0x110 +#define E_ERRORDECOMPRESSINGFONTDATA 0x111 +#define E_ERRORACCESSINGEXCLUDELIST 0x112 +#define E_FACENAMEINVALID 0x113 +#define E_STREAMINVALID 0x114 +#define E_STATUSINVALID 0x115 +#define E_PRIVSTATUSINVALID 0x116 +#define E_PERMISSIONSINVALID 0x117 +#define E_PBENABLEDINVALID 0x118 +#define E_SUBSETTINGEXCEPTION 0x119 +#define E_SUBSTRING_TEST_FAIL 0x11A +#define E_FONTVARIATIONSIMULATED 0x11B +#define E_FONTVALIDATEFAIL 0x11C +#define E_FONTFAMILYNAMENOTINFULL 0x11D +#endif + +#ifndef E_ADDFONTFAILED +#define E_ADDFONTFAILED 0x200 +#define E_COULDNTCREATETEMPFILE 0x201 +#define E_FONTFILECREATEFAILED 0x203 +#define E_WINDOWSAPI 0x204 +#define E_FONTFILENOTFOUND 0x205 +#define E_RESOURCEFILECREATEFAILED 0x206 +#define E_ERROREXPANDINGFONTDATA 0x207 +#define E_ERRORGETTINGDC 0x208 +#define E_EXCEPTIONINDECOMPRESSION 0x209 +#define E_EXCEPTIONINCOMPRESSION 0x20A +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef unsigned long(WINAPIV *WRITEEMBEDPROC) +( + void* lpvWriteStream, + const void* lpvBuffer, + const unsigned long cbBuffer +); + +typedef unsigned long(WINAPIV *READEMBEDPROC) +( + void* lpvReadStream, + void* lpvBuffer, + const unsigned long cbBuffer +); + + +typedef struct +{ + unsigned long ulStructSize; + long lTestFromSize; + long lTestToSize; + unsigned long ulCharSet; + unsigned short usReserved1; + unsigned short usCharCodeCount; + unsigned short* pusCharCodeSet; +} TTVALIDATIONTESTPARAMS; + +typedef struct +{ + unsigned long ulStructSize; + long lTestFromSize; + long lTestToSize; + unsigned long ulCharSet; + unsigned short usReserved1; + unsigned short usCharCodeCount; + unsigned long* pulCharCodeSet; +} TTVALIDATIONTESTPARAMSEX; + +typedef struct +{ + unsigned short usStructSize; + unsigned short usRootStrSize; + unsigned short *pusRootStr; +} TTEMBEDINFO; + +typedef struct +{ + unsigned short usStructSize; + unsigned short usRefStrSize; + unsigned short *pusRefStr; +} TTLOADINFO; + +LONG +WINAPI +TTCharToUnicode(HDC hDC, + UCHAR* pucCharCodes, + ULONG ulCharCodeSize, + USHORT* pusShortCodes, + ULONG ulShortCodeSize, + ULONG ulFlags); + +LONG +WINAPI +TTDeleteEmbeddedFont(HANDLE hFontReference, + ULONG ulFlags, + ULONG* pulStatus); + +LONG +WINAPI +TTEmbedFont(HDC hDC, + ULONG ulFlags, + ULONG ulCharSet, + ULONG* pulPrivStatus, + ULONG* pulStatus, + WRITEEMBEDPROC lpfnWriteToStream, + LPVOID lpvWriteStream, + USHORT* pusCharCodeSet, + USHORT usCharCodeCount, + USHORT usLanguage, + TTEMBEDINFO* pTTEmbedInfo); + +LONG +WINAPI +TTEmbedFontFromFileA(HDC hDC, + LPCSTR szFontFileName, + USHORT usTTCIndex, + ULONG ulFlags, + ULONG ulCharSet, + ULONG* pulPrivStatus, + ULONG* pulStatus, + WRITEEMBEDPROC lpfnWriteToStream, + LPVOID lpvWriteStream, + USHORT* pusCharCodeSet, + USHORT usCharCodeCount, + USHORT usLanguage, + TTEMBEDINFO* pTTEmbedInfo); + +LONG +WINAPI +TTEnableEmbeddingForFacename(LPSTR lpszFacename, + BOOL bEnable); + +LONG +WINAPI +TTGetEmbeddedFontInfo(ULONG ulFlags, + ULONG* pulPrivStatus, + ULONG ulPrivs, + ULONG* pulStatus, + READEMBEDPROC lpfnReadFromStream, + LPVOID lpvReadStream, + TTLOADINFO* pTTLoadInfo); + +LONG +WINAPI +TTGetEmbeddingType(HDC hDC, + ULONG* pulPrivStatus); + +LONG +WINAPI +TTIsEmbeddingEnabled(HDC hDC, + BOOL* pbEnabled); + +LONG +WINAPI +TTIsEmbeddingEnabledForFacename(LPSTR lpszFacename, + BOOL* pbEnabled); + +LONG +WINAPI +TTLoadEmbeddedFont(HANDLE *phFontReference, + ULONG ulFlags, + ULONG* pulPrivStatus, + ULONG ulPrivs, + ULONG* pulStatus, + READEMBEDPROC lpfnReadFromStream, + LPVOID lpvReadStream, + LPWSTR szWinFamilyName, + LPSTR szMacFamilyName, + TTLOADINFO* pTTLoadInfo); + +LONG +WINAPI +TTRunValidationTests(HDC hDC, + TTVALIDATIONTESTPARAMS* pTestParam); + +LONG +WINAPI +TTEmbedFontEx(HDC hDC, + ULONG ulFlags, + ULONG ulCharSet, + ULONG* pulPrivStatus, + ULONG* pulStatus, + WRITEEMBEDPROC lpfnWriteToStream, + LPVOID lpvWriteStream, + ULONG* pulCharCodeSet, + USHORT usCharCodeCount, + USHORT usLanguage, + TTEMBEDINFO* pTTEmbedInfo); + +LONG +WINAPI +TTRunValidationTestsEx(HDC hDC, + TTVALIDATIONTESTPARAMSEX* pTestParam); + +LONG +WINAPI +TTGetNewFontName(HANDLE* phFontReference, + LPWSTR szWinFamilyName, + long cchMaxWinName, + LPSTR szMacFamilyName, + long cchMaxMacName); + +#ifdef __cplusplus + } +#endif + +#endif /* __T2EMBED_API_H */ Propchange: trunk/reactos/include/psdk/t2embapi.h ------------------------------------------------------------------------------ svn:eol-style = native
15 years, 9 months
1
0
0
0
[cgutman] 40643: - Don't attempt to store packets and buffers in the same place
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Apr 22 07:27:33 2009 New Revision: 40643 URL:
http://svn.reactos.org/svn/reactos?rev=40643&view=rev
Log: - Don't attempt to store packets and buffers in the same place Modified: trunk/reactos/drivers/network/ndis/ndis/buffer.c trunk/reactos/drivers/network/ndis/ndis/miniport.c trunk/reactos/drivers/network/ndis/ndis/protocol.c Modified: trunk/reactos/drivers/network/ndis/ndis/buffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/buffer.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/buffer.c [iso-8859-1] Wed Apr 22 07:27:33 2009 @@ -420,7 +420,7 @@ if (Pool->FreeList) { Temp = Pool->FreeList; - Pool->FreeList = (PNDIS_PACKET)Temp->Private.Head; + Pool->FreeList = (PNDIS_PACKET)Temp->Reserved[0]; KeReleaseSpinLock(&Pool->SpinLock.SpinLock, OldIrql); @@ -521,11 +521,11 @@ NextPacket = (PNDIS_PACKET)((ULONG_PTR)Packet + Length); for (i = 1; i < NumberOfDescriptors; i++) { - Packet->Private.Head = (PNDIS_BUFFER)NextPacket; + Packet->Reserved[0] = (ULONG_PTR)NextPacket; Packet = NextPacket; NextPacket = (PNDIS_PACKET)((ULONG_PTR)Packet + Length); } - Packet->Private.Head = NULL; + Packet->Reserved[0] = 0; } else Pool->FreeList = NULL; @@ -701,7 +701,7 @@ if (Pool->FreeList) { Temp = Pool->FreeList; - Pool->FreeList = (PNDIS_PACKET)Temp->Private.Head; + Pool->FreeList = (PNDIS_PACKET)Temp->Reserved[0]; KeReleaseSpinLockFromDpcLevel(&Pool->SpinLock.SpinLock); @@ -750,7 +750,7 @@ if (Pool->FreeList) { Temp = Pool->FreeList; - Pool->FreeList = (PNDIS_PACKET)Temp->Private.Head; + Pool->FreeList = (PNDIS_PACKET)Temp->Reserved[0]; RtlZeroMemory(&Temp->Private, sizeof(NDIS_PACKET_PRIVATE)); Temp->Private.Pool = Pool; @@ -779,7 +779,7 @@ NDIS_DbgPrint(MAX_TRACE, ("Packet (0x%X).\n", Packet)); KeAcquireSpinLockAtDpcLevel(&((NDISI_PACKET_POOL*)Packet->Private.Pool)->SpinLock.SpinLock); - Packet->Private.Head = (PNDIS_BUFFER)((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList; + Packet->Reserved[0] = (ULONG_PTR)((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList; ((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList = Packet; KeReleaseSpinLockFromDpcLevel(&((NDISI_PACKET_POOL*)Packet->Private.Pool)->SpinLock.SpinLock); } @@ -800,7 +800,7 @@ { NDIS_DbgPrint(MAX_TRACE, ("Packet (0x%X).\n", Packet)); - Packet->Private.Head = (PNDIS_BUFFER)((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList; + Packet->Reserved[0] = (ULONG_PTR)((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList; ((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList = Packet; } @@ -874,7 +874,7 @@ NDIS_DbgPrint(MAX_TRACE, ("Packet (0x%X).\n", Packet)); KeAcquireSpinLock(&((NDISI_PACKET_POOL*)Packet->Private.Pool)->SpinLock.SpinLock, &OldIrql); - Packet->Private.Head = (PNDIS_BUFFER)((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList; + Packet->Reserved[0] = (ULONG_PTR)((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList; ((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList = Packet; KeReleaseSpinLock(&((NDISI_PACKET_POOL*)Packet->Private.Pool)->SpinLock.SpinLock, OldIrql); } Modified: trunk/reactos/drivers/network/ndis/ndis/miniport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] Wed Apr 22 07:27:33 2009 @@ -457,7 +457,7 @@ NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n")); - AdapterBinding = (PADAPTER_BINDING)Packet->Reserved[0]; + AdapterBinding = (PADAPTER_BINDING)Packet->Reserved[1]; KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); (*AdapterBinding->ProtocolBinding->Chars.SendCompleteHandler)( @@ -490,7 +490,7 @@ NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n")); - AdapterBinding = (PADAPTER_BINDING)Packet->Reserved[0]; + AdapterBinding = (PADAPTER_BINDING)Packet->Reserved[1]; KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); (*AdapterBinding->ProtocolBinding->Chars.TransferDataCompleteHandler)( Modified: trunk/reactos/drivers/network/ndis/ndis/protocol.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] Wed Apr 22 07:27:33 2009 @@ -279,7 +279,7 @@ ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL); /* XXX what is this crazy black magic? */ - Packet->Reserved[0] = (ULONG_PTR)MacBindingHandle; + Packet->Reserved[1] = (ULONG_PTR)MacBindingHandle; /* * Test the packet to see if it is a MAC loopback.
15 years, 9 months
1
0
0
0
[janderwald] 40642: - Add error debug traces
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Apr 22 02:55:21 2009 New Revision: 40642 URL:
http://svn.reactos.org/svn/reactos?rev=40642&view=rev
Log: - Add error debug traces Modified: trunk/reactos/drivers/wdm/audio/sysaudio/deviface.c Modified: trunk/reactos/drivers/wdm/audio/sysaudio/deviface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/deviface.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/deviface.c [iso-8859-1] Wed Apr 22 02:55:21 2009 @@ -41,6 +41,7 @@ Status = KsSynchronousIoControlDevice(DeviceEntry->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PropertyRequest, sizeof(KSPROPERTY), (PVOID)&Count, sizeof(ULONG), &BytesReturned); if (!NT_SUCCESS(Status)) { + DPRINT1("Failed to query number of pins Status %x\n", Status); ObDereferenceObject(DeviceEntry->FileObject); ZwClose(DeviceEntry->Handle); ExFreePool(DeviceEntry->DeviceName.Buffer); @@ -50,6 +51,7 @@ if (!Count) { + DPRINT1("Filter has no pins!\n"); ObDereferenceObject(DeviceEntry->FileObject); ZwClose(DeviceEntry->Handle); ExFreePool(DeviceEntry->DeviceName.Buffer); @@ -62,6 +64,7 @@ if (!DeviceEntry->Pins) { /* no memory */ + DPRINT1("Failed to allocate memory Block %x\n", Count * sizeof(PIN_INFO)); ObDereferenceObject(DeviceEntry->FileObject); ZwClose(DeviceEntry->Handle); ExFreePool(DeviceEntry->DeviceName.Buffer);
15 years, 9 months
1
0
0
0
[janderwald] 40641: - Implement KSPROPERTY_PIN_CTYPE, KSPROPERTY_PIN_DATAFLOW, KSPROPERTY_PIN_COMMUNICATION for fast property handler
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Apr 22 02:05:33 2009 New Revision: 40641 URL:
http://svn.reactos.org/svn/reactos?rev=40641&view=rev
Log: - Implement KSPROPERTY_PIN_CTYPE, KSPROPERTY_PIN_DATAFLOW, KSPROPERTY_PIN_COMMUNICATION for fast property handler Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c [iso-8859-1] Wed Apr 22 02:05:33 2009 @@ -217,6 +217,7 @@ { PFNKSHANDLER PropertyHandler = NULL; NTSTATUS Status = STATUS_UNSUCCESSFUL; + KSP_PIN * Pin; ASSERT(Descriptor); @@ -236,37 +237,64 @@ switch(Property->Id) { case KSPROPERTY_PIN_CTYPES: + (*(PULONG)Data) = Descriptor->Factory.PinDescriptorCount; + IoStatus->Information = sizeof(ULONG); + IoStatus->Status = Status = STATUS_SUCCESS; + break; case KSPROPERTY_PIN_DATAFLOW: + Pin = (KSP_PIN*)Property; + if (Pin->PinId >= Descriptor->Factory.PinDescriptorCount) + { + IoStatus->Status = Status = STATUS_INVALID_PARAMETER; + IoStatus->Information = 0; + break; + } + + *((KSPIN_DATAFLOW*)Data) = Descriptor->Factory.KsPinDescriptor[Pin->PinId].DataFlow; + IoStatus->Information = sizeof(KSPIN_DATAFLOW); + IoStatus->Status = Status = STATUS_SUCCESS; + break; + case KSPROPERTY_PIN_COMMUNICATION: + Pin = (KSP_PIN*)Property; + if (Pin->PinId >= Descriptor->Factory.PinDescriptorCount) + { + IoStatus->Status = Status = STATUS_INVALID_PARAMETER; + IoStatus->Information = 0; + break; + } + + *((KSPIN_COMMUNICATION*)Data) = Descriptor->Factory.KsPinDescriptor[Pin->PinId].Communication; + IoStatus->Status = Status = STATUS_SUCCESS; + IoStatus->Information = sizeof(KSPIN_COMMUNICATION); + break; + + case KSPROPERTY_PIN_GLOBALCINSTANCES: + Status = HandlePropertyInstances(IoStatus, Property, Data, Descriptor, TRUE); + break; + case KSPROPERTY_PIN_CINSTANCES: + Status = HandlePropertyInstances(IoStatus, Property, Data, Descriptor, FALSE); + break; + case KSPROPERTY_PIN_NECESSARYINSTANCES: + Status = HandleNecessaryPropertyInstances(IoStatus, Property, Data, Descriptor); + break; + + case KSPROPERTY_PIN_DATAINTERSECTION: + Status = HandleDataIntersection(IoStatus, Property, Data, DataLength, Descriptor, SubDevice); + break; + case KSPROPERTY_PIN_PHYSICALCONNECTION: + case KSPROPERTY_PIN_CONSTRAINEDDATARANGES: case KSPROPERTY_PIN_DATARANGES: case KSPROPERTY_PIN_INTERFACES: case KSPROPERTY_PIN_MEDIUMS: - case KSPROPERTY_PIN_COMMUNICATION: case KSPROPERTY_PIN_CATEGORY: case KSPROPERTY_PIN_NAME: case KSPROPERTY_PIN_PROPOSEDATAFORMAT: - Status = KsFastPropertyHandler(FileObject, Property, PropertyLength, Data, DataLength, IoStatus, PropertySetsCount, PropertySet); - break; - case KSPROPERTY_PIN_GLOBALCINSTANCES: - Status = HandlePropertyInstances(IoStatus, Property, Data, Descriptor, TRUE); - break; - case KSPROPERTY_PIN_CINSTANCES: - Status = HandlePropertyInstances(IoStatus, Property, Data, Descriptor, FALSE); - break; - case KSPROPERTY_PIN_NECESSARYINSTANCES: - Status = HandleNecessaryPropertyInstances(IoStatus, Property, Data, Descriptor); - break; - - case KSPROPERTY_PIN_DATAINTERSECTION: - Status = HandleDataIntersection(IoStatus, Property, Data, DataLength, Descriptor, SubDevice); - break; - case KSPROPERTY_PIN_PHYSICALCONNECTION: - case KSPROPERTY_PIN_CONSTRAINEDDATARANGES: UNIMPLEMENTED Status = STATUS_NOT_IMPLEMENTED; break; default: UNIMPLEMENTED - Status = STATUS_UNSUCCESSFUL; + Status = STATUS_NOT_IMPLEMENTED; } return Status; }
15 years, 9 months
1
0
0
0
[janderwald] 40640: - Implement FastDeviceIoControl for IPortFilterWavePci - Partly implement fast property handler
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Apr 22 01:44:15 2009 New Revision: 40640 URL:
http://svn.reactos.org/svn/reactos?rev=40640&view=rev
Log: - Implement FastDeviceIoControl for IPortFilterWavePci - Partly implement fast property handler Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/filter_wavepci.c trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/filter_wavepci.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/filter_wavepci.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/filter_wavepci.c [iso-8859-1] Wed Apr 22 01:44:15 2009 @@ -244,7 +244,6 @@ { This->Pins[Index]->lpVtbl->Close(This->Pins[Index], DeviceObject, NULL); } - } @@ -298,8 +297,49 @@ OUT PIO_STATUS_BLOCK StatusBlock, IN PDEVICE_OBJECT DeviceObject) { - UNIMPLEMENTED - return FALSE; + ULONG Index; + PKSPROPERTY Property; + NTSTATUS Status; + ISubdevice * SubDevice = NULL; + PSUBDEVICE_DESCRIPTOR Descriptor = NULL; + IPortFilterWavePciImpl * This = (IPortFilterWavePciImpl *)iface; + + Property = (PKSPROPERTY)InputBuffer; + + if (InputBufferLength < sizeof(KSPROPERTY)) + return FALSE; + + + /* get private interface */ + Status = This->Port->lpVtbl->QueryInterface(This->Port, &IID_ISubdevice, (PVOID*)&SubDevice); + if (!NT_SUCCESS(Status)) + return FALSE; + + /* get descriptor */ + Status = SubDevice->lpVtbl->GetDescriptor(SubDevice, &Descriptor); + if (!NT_SUCCESS(Status)) + { + SubDevice->lpVtbl->Release(SubDevice); + return FALSE; + } + + Status = STATUS_UNSUCCESSFUL; + for(Index = 0; Index < Descriptor->FilterPropertySet.FreeKsPropertySetOffset; Index++) + { + if (IsEqualGUIDAligned(&Property->Set, Descriptor->FilterPropertySet.Properties[Index].Set)) + { + Status = FastPropertyHandler(FileObject, (PKSPROPERTY)InputBuffer, InputBufferLength, OutputBuffer, OutputBufferLength, StatusBlock, + 1, + &Descriptor->FilterPropertySet.Properties[Index], + Descriptor, SubDevice); + break; + } + } + + if (NT_SUCCESS(Status)) + return TRUE; + else + return FALSE; } /* Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h [iso-8859-1] Wed Apr 22 01:44:15 2009 @@ -248,6 +248,20 @@ PcPropertyHandler( IN PIRP Irp, IN PSUBDEVICE_DESCRIPTOR Descriptor); + +NTSTATUS +NTAPI +FastPropertyHandler( + IN PFILE_OBJECT FileObject, + IN PKSPROPERTY UNALIGNED Property, + IN ULONG PropertyLength, + IN OUT PVOID UNALIGNED Data, + IN ULONG DataLength, + OUT PIO_STATUS_BLOCK IoStatus, + IN ULONG PropertySetsCount, + IN const KSPROPERTY_SET *PropertySet, + IN PSUBDEVICE_DESCRIPTOR Descriptor, + IN ISubdevice *SubDevice); PDEVICE_OBJECT GetDeviceObject( Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c [iso-8859-1] Wed Apr 22 01:44:15 2009 @@ -9,8 +9,17 @@ #include "private.h" NTSTATUS +FindPropertyHandler( + IN PIO_STATUS_BLOCK IoStatus, + IN PSUBDEVICE_DESCRIPTOR Descriptor, + IN PKSPROPERTY Property, + IN ULONG InputBufferLength, + IN ULONG OutputBufferLength, + OUT PFNKSHANDLER *PropertyHandler); + +NTSTATUS HandlePropertyInstances( - IN PIRP Irp, + IN PIO_STATUS_BLOCK IoStatus, IN PKSIDENTIFIER Request, IN OUT PVOID Data, IN PSUBDEVICE_DESCRIPTOR Descriptor, @@ -21,8 +30,8 @@ if (Pin->PinId >= Descriptor->Factory.PinDescriptorCount) { - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; + IoStatus->Information = 0; + IoStatus->Status = STATUS_INVALID_PARAMETER; return STATUS_INVALID_PARAMETER; } @@ -35,14 +44,14 @@ Instances->CurrentCount = Descriptor->Factory.Instances[Pin->PinId].CurrentPinInstanceCount; - Irp->IoStatus.Information = sizeof(KSPIN_CINSTANCES); - Irp->IoStatus.Status = STATUS_SUCCESS; + IoStatus->Information = sizeof(KSPIN_CINSTANCES); + IoStatus->Status = STATUS_SUCCESS; return STATUS_SUCCESS; } NTSTATUS HandleNecessaryPropertyInstances( - IN PIRP Irp, + IN PIO_STATUS_BLOCK IoStatus, IN PKSIDENTIFIER Request, IN OUT PVOID Data, IN PSUBDEVICE_DESCRIPTOR Descriptor) @@ -52,36 +61,78 @@ if (Pin->PinId >= Descriptor->Factory.PinDescriptorCount) { - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; + IoStatus->Information = 0; + IoStatus->Status = STATUS_INVALID_PARAMETER; return STATUS_INVALID_PARAMETER; } Result = (PULONG)Data; *Result = Descriptor->Factory.Instances[Pin->PinId].MinFilterInstanceCount; - Irp->IoStatus.Information = sizeof(ULONG); - Irp->IoStatus.Status = STATUS_SUCCESS; + IoStatus->Information = sizeof(ULONG); + IoStatus->Status = STATUS_SUCCESS; return STATUS_SUCCESS; } NTSTATUS HandleDataIntersection( - IN PIRP Irp, + IN PIO_STATUS_BLOCK IoStatus, IN PKSIDENTIFIER Request, IN OUT PVOID Data, - IN PSUBDEVICE_DESCRIPTOR Descriptor) -{ + IN ULONG DataLength, + IN PSUBDEVICE_DESCRIPTOR Descriptor, + IN ISubdevice *SubDevice) +{ + KSP_PIN * Pin = (KSP_PIN*)Request; + PKSMULTIPLE_ITEM MultipleItem; + PKSDATARANGE DataRange; + NTSTATUS Status = STATUS_NO_MATCH; + ULONG Index, Length; + + /* Access parameters */ + MultipleItem = (PKSMULTIPLE_ITEM)(Pin + 1); + DataRange = (PKSDATARANGE)(MultipleItem + 1); + + for(Index = 0; Index < MultipleItem->Count; Index++) + { + /* Call miniport's properitary handler */ + ASSERT(Descriptor->Factory.KsPinDescriptor[Pin->PinId].DataRangesCount); + ASSERT(Descriptor->Factory.KsPinDescriptor[Pin->PinId].DataRanges[0]); + Status = SubDevice->lpVtbl->DataRangeIntersection(SubDevice, Pin->PinId, DataRange, (PKSDATARANGE)Descriptor->Factory.KsPinDescriptor[Pin->PinId].DataRanges[0], + DataLength, Data, &Length); + + if (Status == STATUS_SUCCESS) + { + IoStatus->Information = Length; + break; + } + DataRange = UlongToPtr(PtrToUlong(DataRange) + DataRange->FormatSize); + } + + IoStatus->Status = Status; + return Status; +} + + +NTSTATUS +NTAPI +PinPropertyHandler( + IN PIRP Irp, + IN PKSIDENTIFIER Request, + IN OUT PVOID Data) +{ + PKSOBJECT_CREATE_ITEM CreateItem; + PSUBDEVICE_DESCRIPTOR Descriptor; + PIO_STACK_LOCATION IoStack; IIrpTarget * IrpTarget; IPort *Port; ISubdevice *SubDevice; - KSP_PIN * Pin = (KSP_PIN*)Request; - PKSOBJECT_CREATE_ITEM CreateItem; - PKSMULTIPLE_ITEM MultipleItem; - PKSDATARANGE DataRange; - PIO_STACK_LOCATION IoStack; - NTSTATUS Status; - ULONG Index, Length; + + + NTSTATUS Status = STATUS_UNSUCCESSFUL; + + Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp); + ASSERT(Descriptor); /* Access the create item */ CreateItem = KSCREATE_ITEM_IRP_STORAGE(Irp); @@ -105,49 +156,8 @@ KeBugCheck(0); } - /* Access parameters */ - MultipleItem = (PKSMULTIPLE_ITEM)(Pin + 1); - DataRange = (PKSDATARANGE)(MultipleItem + 1); - - /* Get current stack location */ + /* get current stack location */ IoStack = IoGetCurrentIrpStackLocation(Irp); - - for(Index = 0; Index < MultipleItem->Count; Index++) - { - /* Call miniport's properitary handler */ - ASSERT(Descriptor->Factory.KsPinDescriptor[Pin->PinId].DataRangesCount); - ASSERT(Descriptor->Factory.KsPinDescriptor[Pin->PinId].DataRanges[0]); - Status = SubDevice->lpVtbl->DataRangeIntersection(SubDevice, Pin->PinId, DataRange, (PKSDATARANGE)Descriptor->Factory.KsPinDescriptor[Pin->PinId].DataRanges[0], - IoStack->Parameters.DeviceIoControl.OutputBufferLength, Data, &Length); - - if (Status == STATUS_SUCCESS) - { - Irp->IoStatus.Information = Length; - break; - } - DataRange = UlongToPtr(PtrToUlong(DataRange) + DataRange->FormatSize); - } - - /* Release reference */ - Port->lpVtbl->Release(Port); - - Irp->IoStatus.Status = Status; - return Status; -} - - -NTSTATUS -NTAPI -PinPropertyHandler( - IN PIRP Irp, - IN PKSIDENTIFIER Request, - IN OUT PVOID Data) -{ - PSUBDEVICE_DESCRIPTOR Descriptor; - NTSTATUS Status = STATUS_UNSUCCESSFUL; - - Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp); - ASSERT(Descriptor); switch(Request->Id) { @@ -163,27 +173,101 @@ Status = KsPinPropertyHandler(Irp, Request, Data, Descriptor->Factory.PinDescriptorCount, Descriptor->Factory.KsPinDescriptor); break; case KSPROPERTY_PIN_GLOBALCINSTANCES: - Status = HandlePropertyInstances(Irp, Request, Data, Descriptor, TRUE); + Status = HandlePropertyInstances(&Irp->IoStatus, Request, Data, Descriptor, TRUE); break; case KSPROPERTY_PIN_CINSTANCES: - Status = HandlePropertyInstances(Irp, Request, Data, Descriptor, FALSE); + Status = HandlePropertyInstances(&Irp->IoStatus, Request, Data, Descriptor, FALSE); break; case KSPROPERTY_PIN_NECESSARYINSTANCES: - Status = HandleNecessaryPropertyInstances(Irp, Request, Data, Descriptor); + Status = HandleNecessaryPropertyInstances(&Irp->IoStatus, Request, Data, Descriptor); break; case KSPROPERTY_PIN_DATAINTERSECTION: - Status = HandleDataIntersection(Irp, Request, Data, Descriptor); + Status = HandleDataIntersection(&Irp->IoStatus, Request, Data, IoStack->Parameters.DeviceIoControl.OutputBufferLength, Descriptor, SubDevice); break; case KSPROPERTY_PIN_PHYSICALCONNECTION: case KSPROPERTY_PIN_CONSTRAINEDDATARANGES: - DPRINT1("Unhandled %x\n", Request->Id); - Status = STATUS_SUCCESS; + UNIMPLEMENTED + Status = STATUS_NOT_IMPLEMENTED; break; default: - Status = STATUS_NOT_FOUND; - } - + UNIMPLEMENTED + Status = STATUS_UNSUCCESSFUL; + } + + /* Release reference */ + Port->lpVtbl->Release(Port); + + return Status; +} + +NTSTATUS +NTAPI +FastPropertyHandler( + IN PFILE_OBJECT FileObject, + IN PKSPROPERTY UNALIGNED Property, + IN ULONG PropertyLength, + IN OUT PVOID UNALIGNED Data, + IN ULONG DataLength, + OUT PIO_STATUS_BLOCK IoStatus, + IN ULONG PropertySetsCount, + IN const KSPROPERTY_SET *PropertySet, + IN PSUBDEVICE_DESCRIPTOR Descriptor, + IN ISubdevice *SubDevice) +{ + PFNKSHANDLER PropertyHandler = NULL; + NTSTATUS Status = STATUS_UNSUCCESSFUL; + + ASSERT(Descriptor); + + if (!IsEqualGUIDAligned(&Property->Set, &KSPROPSETID_Pin)) + { + /* the fast handler only supports pin properties */ + return Status; + } + + /* property handler is used to verify input parameters */ + Status = FindPropertyHandler(IoStatus, Descriptor, Property, PropertyLength, DataLength, &PropertyHandler); + if (!NT_SUCCESS(Status)) + { + return Status; + } + + switch(Property->Id) + { + case KSPROPERTY_PIN_CTYPES: + case KSPROPERTY_PIN_DATAFLOW: + case KSPROPERTY_PIN_DATARANGES: + case KSPROPERTY_PIN_INTERFACES: + case KSPROPERTY_PIN_MEDIUMS: + case KSPROPERTY_PIN_COMMUNICATION: + case KSPROPERTY_PIN_CATEGORY: + case KSPROPERTY_PIN_NAME: + case KSPROPERTY_PIN_PROPOSEDATAFORMAT: + Status = KsFastPropertyHandler(FileObject, Property, PropertyLength, Data, DataLength, IoStatus, PropertySetsCount, PropertySet); + break; + case KSPROPERTY_PIN_GLOBALCINSTANCES: + Status = HandlePropertyInstances(IoStatus, Property, Data, Descriptor, TRUE); + break; + case KSPROPERTY_PIN_CINSTANCES: + Status = HandlePropertyInstances(IoStatus, Property, Data, Descriptor, FALSE); + break; + case KSPROPERTY_PIN_NECESSARYINSTANCES: + Status = HandleNecessaryPropertyInstances(IoStatus, Property, Data, Descriptor); + break; + + case KSPROPERTY_PIN_DATAINTERSECTION: + Status = HandleDataIntersection(IoStatus, Property, Data, DataLength, Descriptor, SubDevice); + break; + case KSPROPERTY_PIN_PHYSICALCONNECTION: + case KSPROPERTY_PIN_CONSTRAINEDDATARANGES: + UNIMPLEMENTED + Status = STATUS_NOT_IMPLEMENTED; + break; + default: + UNIMPLEMENTED + Status = STATUS_UNSUCCESSFUL; + } return Status; } @@ -202,12 +286,61 @@ } NTSTATUS +FindPropertyHandler( + IN PIO_STATUS_BLOCK IoStatus, + IN PSUBDEVICE_DESCRIPTOR Descriptor, + IN PKSPROPERTY Property, + IN ULONG InputBufferLength, + IN ULONG OutputBufferLength, + OUT PFNKSHANDLER *PropertyHandler) +{ + ULONG Index, ItemIndex; + + for(Index = 0; Index < Descriptor->FilterPropertySet.FreeKsPropertySetOffset; Index++) + { + if (IsEqualGUIDAligned(&Property->Set, Descriptor->FilterPropertySet.Properties[Index].Set)) + { + for(ItemIndex = 0; ItemIndex < Descriptor->FilterPropertySet.Properties[Index].PropertiesCount; ItemIndex++) + { + if (Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].PropertyId == Property->Id) + { + if (Property->Flags & KSPROPERTY_TYPE_SET) + *PropertyHandler = Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].SetPropertyHandler; + + if (Property->Flags & KSPROPERTY_TYPE_GET) + *PropertyHandler = Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].GetPropertyHandler; + + if (Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].MinProperty > InputBufferLength) + { + /* too small input buffer */ + IoStatus->Information = Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].MinProperty; + IoStatus->Status = STATUS_BUFFER_TOO_SMALL; + return STATUS_BUFFER_TOO_SMALL; + } + + if (Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].MinData > OutputBufferLength) + { + /* too small output buffer */ + IoStatus->Information = Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].MinData; + IoStatus->Status = STATUS_BUFFER_TOO_SMALL; + return STATUS_BUFFER_TOO_SMALL; + } + return STATUS_SUCCESS; + } + } + } + } + return STATUS_UNSUCCESSFUL; +} + + +NTSTATUS NTAPI PcPropertyHandler( IN PIRP Irp, IN PSUBDEVICE_DESCRIPTOR Descriptor) { - ULONG Index, ItemIndex; + ULONG Index; PIO_STACK_LOCATION IoStack; PKSPROPERTY Property; PFNKSHANDLER PropertyHandler = NULL; @@ -259,60 +392,21 @@ } } - for(Index = 0; Index < Descriptor->FilterPropertySet.FreeKsPropertySetOffset; Index++) - { - if (IsEqualGUIDAligned(&Property->Set, Descriptor->FilterPropertySet.Properties[Index].Set)) - { - for(ItemIndex = 0; ItemIndex < Descriptor->FilterPropertySet.Properties[Index].PropertiesCount; ItemIndex++) - { - if (Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].PropertyId == Property->Id) - { - if (Property->Flags & KSPROPERTY_TYPE_SET) - PropertyHandler = Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].SetPropertyHandler; - - if (Property->Flags & KSPROPERTY_TYPE_GET) - PropertyHandler = Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].GetPropertyHandler; - - if (Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].MinProperty > IoStack->Parameters.DeviceIoControl.InputBufferLength) - { - /* too small input buffer */ - Irp->IoStatus.Information = Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].MinProperty; - Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_BUFFER_TOO_SMALL; - } - - if (Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].MinData > IoStack->Parameters.DeviceIoControl.OutputBufferLength) - { - /* too small output buffer */ - Irp->IoStatus.Information = Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].MinData; - Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_BUFFER_TOO_SMALL; - } - - if (PropertyHandler) - { - KSPROPERTY_ITEM_IRP_STORAGE(Irp) = (PVOID)Descriptor; - DPRINT("Calling property handler %p\n", PropertyHandler); - Status = PropertyHandler(Irp, Property, Irp->UserBuffer); - } - - /* the information member is set by the handler */ - Irp->IoStatus.Status = Status; - DPRINT("Result %x Length %u\n", Status, Irp->IoStatus.Information); - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return Status; - } - } - } + Status = FindPropertyHandler(&Irp->IoStatus, Descriptor, Property, IoStack->Parameters.DeviceIoControl.InputBufferLength, IoStack->Parameters.DeviceIoControl.OutputBufferLength, &PropertyHandler); + if (PropertyHandler) + { + KSPROPERTY_ITEM_IRP_STORAGE(Irp) = (PVOID)Descriptor; + DPRINT("Calling property handler %p\n", PropertyHandler); + Status = PropertyHandler(Irp, Property, Irp->UserBuffer); } RtlStringFromGUID(&Property->Set, &GuidString); DPRINT1("Unhandeled property: Set %S Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags); RtlFreeUnicodeString(&GuidString); - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; + + /* the information member is set by the handler */ + Irp->IoStatus.Status = Status; + DPRINT("Result %x Length %u\n", Status, Irp->IoStatus.Information); IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_NOT_IMPLEMENTED; -} + return Status; +}
15 years, 9 months
1
0
0
0
[cwittich] 40639: fix formatting
by cwittich@svn.reactos.org
Author: cwittich Date: Wed Apr 22 01:40:31 2009 New Revision: 40639 URL:
http://svn.reactos.org/svn/reactos?rev=40639&view=rev
Log: fix formatting Modified: trunk/tools/sysreg2/virt.c Modified: trunk/tools/sysreg2/virt.c URL:
http://svn.reactos.org/svn/reactos/trunk/tools/sysreg2/virt.c?rev=40639&r1=…
============================================================================== --- trunk/tools/sysreg2/virt.c [iso-8859-1] (original) +++ trunk/tools/sysreg2/virt.c [iso-8859-1] Wed Apr 22 01:40:31 2009 @@ -145,7 +145,7 @@ virConnectPtr vConn = NULL; virDomainPtr vDom; virDomainInfo info; - int Crashes; + int Crashes; int Stage; char qemu_img_cmdline[300]; FILE* file; @@ -169,7 +169,7 @@ { /* SysregPrintf("Error: Virtual Machine is already running.\n"); goto cleanup; */ - system("virsh destroy ReactOS"); + system("virsh destroy ReactOS"); } /* If the HD image already exists, delete it */
15 years, 9 months
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
48
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
Results per page:
10
25
50
100
200