Author: cgutman
Date: Sun Nov 13 06:02:08 2011
New Revision: 54372
URL: http://svn.reactos.org/svn/reactos?rev=54372&view=rev
Log:
[NDIS]
- Fix a critical bug in NdisMGetDmaAlignment which was causing every NIC driver calling this function to crash because we thought we were passed an NDIS_DMA_BLOCK handle when in fact we receive an NDIS_MINIPORT_BLOCK handle
- Fixes RTL8169 and 3Com NICs (and probably several more) [bug 6651 and bug 4330]
Modified:
trunk/reactos/drivers/network/ndis/ndis/io.c
Modified: trunk/reactos/drivers/network/ndis/ndis/io.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/io.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/io.c [iso-8859-1] Sun Nov 13 06:02:08 2011
@@ -831,6 +831,7 @@
NdisMReadDmaCounter(
IN NDIS_HANDLE MiniportDmaHandle)
{
+ /* NOTE: Unlike NdisMGetDmaAlignment() below, this is a handle to the DMA block */
PNDIS_DMA_BLOCK DmaBlock = MiniportDmaHandle;
PDMA_ADAPTER AdapterObject = (PDMA_ADAPTER)DmaBlock->SystemAdapterObject;
@@ -846,10 +847,11 @@
ULONG
EXPORT
NdisMGetDmaAlignment(
- IN NDIS_HANDLE MiniportDmaHandle)
-{
- PNDIS_DMA_BLOCK DmaBlock = MiniportDmaHandle;
- PDMA_ADAPTER AdapterObject = (PDMA_ADAPTER)DmaBlock->SystemAdapterObject;
+ IN NDIS_HANDLE MiniportAdapterHandle)
+{
+ /* NOTE: Unlike NdisMReadDmaCounter() above, this is a handle to the NDIS miniport block */
+ PLOGICAL_ADAPTER Adapter = MiniportAdapterHandle;
+ PDMA_ADAPTER AdapterObject = (PDMA_ADAPTER)Adapter->NdisMiniportBlock.SystemAdapterObject;
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
Author: cgutman
Date: Sun Nov 13 05:49:33 2011
New Revision: 54371
URL: http://svn.reactos.org/svn/reactos?rev=54371&view=rev
Log:
[HAL]
- Fix DMA on the EISA bus
- Fix a critical calculation error in map register size resulting in the map register allocation worker not allocating enough map registers for a dynamic resize
Modified:
trunk/reactos/hal/halx86/generic/dma.c
Modified: trunk/reactos/hal/halx86/generic/dma.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/dma.c?r…
==============================================================================
--- trunk/reactos/hal/halx86/generic/dma.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/dma.c [iso-8859-1] Sun Nov 13 05:49:33 2011
@@ -614,9 +614,12 @@
* Also note that we check for channel number since there are only 8 DMA
* channels on ISA, so any request above this requires new adapter.
*/
- if ((DeviceDescription->InterfaceType == Isa) || !(DeviceDescription->Master))
- {
- if ((DeviceDescription->InterfaceType == Isa) && (DeviceDescription->DmaChannel >= 8))
+ if (((DeviceDescription->InterfaceType == Eisa) ||
+ (DeviceDescription->InterfaceType == Isa)) || !(DeviceDescription->Master))
+ {
+ if (((DeviceDescription->InterfaceType == Isa) ||
+ (DeviceDescription->InterfaceType == Eisa)) &&
+ (DeviceDescription->DmaChannel >= 8))
{
EisaAdapter = FALSE;
}
@@ -1208,7 +1211,7 @@
*/
KeWaitForSingleObject(&HalpDmaLock, Executive, KernelMode, FALSE, NULL);
Succeeded = HalpGrowMapBuffers(WorkItem->AdapterObject->MasterAdapter,
- WorkItem->NumberOfMapRegisters);
+ WorkItem->NumberOfMapRegisters << PAGE_SHIFT);
KeSetEvent(&HalpDmaLock, 0, 0);
if (Succeeded)
Author: ekohl
Date: Sun Nov 13 00:13:00 2011
New Revision: 54370
URL: http://svn.reactos.org/svn/reactos?rev=54370&view=rev
Log:
[SERVICES]
RControlService: Initialize the callers service status information.
Modified:
trunk/reactos/base/system/services/rpcserver.c
Modified: trunk/reactos/base/system/services/rpcserver.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/rpcse…
==============================================================================
--- trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] Sun Nov 13 00:13:00 2011
@@ -1095,7 +1095,6 @@
return ERROR_INVALID_HANDLE;
}
-
/* Check the service entry point */
lpService = hSvc->ServiceEntry;
if (lpService == NULL)
@@ -1131,6 +1130,11 @@
if (!RtlAreAllAccessesGranted(hSvc->Handle.DesiredAccess,
DesiredAccess))
return ERROR_ACCESS_DENIED;
+
+ /* Return the current service status information */
+ RtlCopyMemory(lpServiceStatus,
+ &lpService->Status,
+ sizeof(SERVICE_STATUS));
if (dwControl == SERVICE_CONTROL_STOP)
{
Author: ekohl
Date: Sat Nov 12 21:16:20 2011
New Revision: 54369
URL: http://svn.reactos.org/svn/reactos?rev=54369&view=rev
Log:
[SERVICES]
RControlService returns ERROR_SERVICE_NOT_ACTIVE if the service has not been started.
Modified:
trunk/reactos/base/system/services/rpcserver.c
Modified: trunk/reactos/base/system/services/rpcserver.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/rpcse…
==============================================================================
--- trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] Sat Nov 12 21:16:20 2011
@@ -646,6 +646,7 @@
return ERROR_INVALID_PARAMETER;
}
+
DWORD
ScmCanonDriverImagePath(DWORD dwStartType,
const wchar_t *lpServiceName,
@@ -1178,6 +1179,10 @@
{
dwControlsAccepted = lpService->Status.dwControlsAccepted;
dwCurrentState = lpService->Status.dwCurrentState;
+
+ /* Return ERROR_SERVICE_NOT_ACTIVE if the service has not been started */
+ if (lpService->lpImage == NULL || dwCurrentState == SERVICE_STOPPED)
+ return ERROR_SERVICE_NOT_ACTIVE;
/* Check the current state before sending a control request */
switch (dwCurrentState)
@@ -2064,9 +2069,10 @@
/* Unlock the service database */
ScmUnlockDatabase();
- /* check if it is marked for deletion */
+ /* Check if it is marked for deletion */
if (lpService->bDeleted)
return ERROR_SERVICE_MARKED_FOR_DELETE;
+
/* Return Error exist */
return ERROR_SERVICE_EXISTS;
}