AllocateCommonBuffer causes blue screen?

I want to write a pci driver for my plx9056 pci card to implement dma transfer.

I followed advise from windows documents by calling ddk routine AllocateCommonBuffer() to allocate buffer for both pci card and driver. But during the driver installed, after executed AllocateCommonBuffer(), the whole OS crashed and show me a blue screen.
Below is my partical code in startdevice(). Driver is compiled with NTDDK on win xp, and runs on win xp.

// allocate common buffer for dma

// Allocate a DMA adapter object for physical memory allocations
status = DmaAdapterAllocate(pdx) != STATUS_SUCCESS;
if (!NT_SUCCESS(status))
{
KdPrint((DRIVERNAME " - DmaAdapterAllocate failed - %X\n", status));
return status;
}

PHYSICAL_ADDRESS BufferLogicalAddress;

// Verify the DMA adapter object
if (pdx->pDmaAdapter == NULL)
{
KdPrint((
“ERROR - DMA Adapter object does not exist, cannot allocate physical memory\n”
));

return NULL;
}

pdx->pDmaAdapter->DmaOperations->AllocateCommonBuffer(
pdx->pDmaAdapter,
64
&BufferLogicalAddress,
0 // Enable Caching for buffer?
);

if (pdx->pDmaBufferAdd->UserAddr == NULL)
{
KdPrint((
“ERROR - Cannot allocate physical memory\n”
));

return NULL;
}

NTSTATUS DmaAdapterAllocate( DEVICE_EXTENSION *pdx )
{
ULONG NumMapRegisters;
DEVICE_DESCRIPTION DeviceDescription;

KdPrint((
“Allocating DMA Adapter object…\n”
));

// Verify object not already created
if (pdx->pDmaAdapter != NULL)
{
KdPrint((“ERROR - DMA Adapter object already exist, unable to allocate\n”));
return STATUS_OBJECT_NAME_EXISTS;
}

// Clear device description
RtlZeroMemory(
&DeviceDescription,
sizeof(DEVICE_DESCRIPTION)
);

// Set device DMA properties
DeviceDescription.Version = DEVICE_DESCRIPTION_VERSION;
DeviceDescription.Master = FALSE; // Device is bus master
DeviceDescription.ScatterGather = FALSE; // Device supports SGL
DeviceDescription.Dma32BitAddresses = TRUE; // Device supports 32-bit addressing
DeviceDescription.Dma64BitAddresses = FALSE; // Don’t use 64-bit addressing
DeviceDescription.InterfaceType = PCIBus; // Device is PCI
DeviceDescription.MaximumLength = (0x10 << 4) // Max bytes per DMA xfer

// OS will assign map register count
NumMapRegisters = 0;

// Allocate a DMA adapter object
pdx->pDmaAdapter =
IoGetDmaAdapter(
pdx->DeviceObject,
&DeviceDescription,
&NumMapRegisters
);

if (pdx->pDmaAdapter == NULL)
{
KdPrint((“ERROR - DMA Adapter allocation failed\n”));
return STATUS_INSUFFICIENT_RESOURCES;
}

return STATUS_SUCCESS;
}

Please post the results of !analyze -v.

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Thursday, September 09, 2010 10:42 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] AllocateCommonBuffer causes blue screen?

I want to write a pci driver for my plx9056 pci card to implement dma
transfer.

I followed advise from windows documents by calling ddk routine
AllocateCommonBuffer() to allocate buffer for both pci card and driver. But
during the driver installed, after executed AllocateCommonBuffer(), the
whole OS crashed and show me a blue screen.
Below is my partical code in startdevice(). Driver is compiled with NTDDK
on win xp, and runs on win xp.

// allocate common buffer for dma

// Allocate a DMA adapter object for physical memory allocations
status = DmaAdapterAllocate(pdx) != STATUS_SUCCESS;
if (!NT_SUCCESS(status))
{
KdPrint((DRIVERNAME " - DmaAdapterAllocate failed - %X\n",
status));
return status;
}

PHYSICAL_ADDRESS BufferLogicalAddress;

// Verify the DMA adapter object
if (pdx->pDmaAdapter == NULL)
{
KdPrint((
“ERROR - DMA Adapter object does not exist, cannot allocate
physical memory\n”
));

return NULL;
}

pdx->pDmaAdapter->DmaOperations->AllocateCommonBuffer(

pdx->pDmaAdapter,

64

&BufferLogicalAddress,

0 // Enable Caching for buffer?
);

if (pdx->pDmaBufferAdd->UserAddr == NULL)
{
KdPrint((
“ERROR - Cannot allocate physical memory\n”
));

return NULL;
}

NTSTATUS DmaAdapterAllocate( DEVICE_EXTENSION *pdx ) {
ULONG NumMapRegisters;
DEVICE_DESCRIPTION DeviceDescription;

KdPrint((
“Allocating DMA Adapter object…\n”
));

// Verify object not already created
if (pdx->pDmaAdapter != NULL)
{
KdPrint((“ERROR - DMA Adapter object already exist, unable to
allocate\n”));
return STATUS_OBJECT_NAME_EXISTS;
}

// Clear device description
RtlZeroMemory(
&DeviceDescription,
sizeof(DEVICE_DESCRIPTION)
);

// Set device DMA properties
DeviceDescription.Version = DEVICE_DESCRIPTION_VERSION;
DeviceDescription.Master = FALSE; //
Device is bus master
DeviceDescription.ScatterGather = FALSE; //
Device supports SGL
DeviceDescription.Dma32BitAddresses = TRUE; //
Device supports 32-bit addressing
DeviceDescription.Dma64BitAddresses = FALSE; // Don’t
use 64-bit addressing
DeviceDescription.InterfaceType = PCIBus; //
Device is PCI
DeviceDescription.MaximumLength = (0x10 << 4) // Max
bytes per DMA xfer

// OS will assign map register count
NumMapRegisters = 0;

// Allocate a DMA adapter object
pdx->pDmaAdapter =
IoGetDmaAdapter(
pdx->DeviceObject,
&DeviceDescription,
&NumMapRegisters
);

if (pdx->pDmaAdapter == NULL)
{
KdPrint((“ERROR - DMA Adapter allocation failed\n”));
return STATUS_INSUFFICIENT_RESOURCES;
}

return STATUS_SUCCESS;
}


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

And if you don’t have the debugger setup, just take the dump and your driver’s PDB, ZIP it into an archive, upload it here to get the complete analysis:

http://www.osronline.com/page.cfm?name=analyze

Post the output here so we can review it.

Peter
OSR

Most likely, it would show that pDmaBufferAdd is not initialized. You also don’t seem to assign the return of AllocateCommonBuffer (the virtual address) to anything.

xxxxx@gmail.com wrote:

I want to write a pci driver for my plx9056 pci card to implement dma transfer.

I followed advise from windows documents by calling ddk routine AllocateCommonBuffer() to allocate buffer for both pci card and driver. But during the driver installed, after executed AllocateCommonBuffer(), the whole OS crashed and show me a blue screen.
Below is my partical code in startdevice(). Driver is compiled with NTDDK on win xp, and runs on win xp.

// allocate common buffer for dma

// Allocate a DMA adapter object for physical memory allocations
status = DmaAdapterAllocate(pdx) != STATUS_SUCCESS;
if (!NT_SUCCESS(status))
{
KdPrint((DRIVERNAME " - DmaAdapterAllocate failed - %X\n", status));
return status;
}

That code is not correct. You should just have this:
status = DmaAdapterAllocate(pdx);

The way you have it, if there is an error, “status” will be 1 (because
the return value != STATUS_SUCCESS), and NT_SUCCESS(1) returns true.
You will never catch any errors.

PHYSICAL_ADDRESS BufferLogicalAddress;

// Verify the DMA adapter object
if (pdx->pDmaAdapter == NULL)
{
KdPrint((
“ERROR - DMA Adapter object does not exist, cannot allocate physical memory\n”
));

return NULL;
}

pdx->pDmaAdapter->DmaOperations->AllocateCommonBuffer(
pdx->pDmaAdapter,
64
&BufferLogicalAddress,
0 // Enable Caching for buffer?
);

if (pdx->pDmaBufferAdd->UserAddr == NULL)
{
KdPrint((
“ERROR - Cannot allocate physical memory\n”
));

return NULL;
}

You never stored anything into pdx->pDmaBufferAdd->UserAddr. How will
it not be NULL?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

sorry, i cannot open this website these days. I put the dump result below now.
kd> !analyze -v
*******************************************************************************
* *
* Bugcheck Analysis *
* *
*******************************************************************************

SYSTEM_THREAD_EXCEPTION_NOT_HANDLED (7e)
This is a very common bugcheck. Usually the exception address pinpoints
the driver/function that caused the problem. Always note this address
as well as the link date of the driver/image that contains this address.
Arguments:
Arg1: c0000005, The exception code that was not handled
Arg2: f5672adf, The address that the exception occurred at
Arg3: f78e2884, Exception Record Address
Arg4: f78e2580, Context Record Address

Debugging Details:

***** Kernel symbols are WRONG. Please fix symbols to do analysis.

*************************************************************************
*** ***
*** ***
*** Your debugger is not using the correct symbols ***
*** ***
*** In order for this command to work properly, your symbol path ***
*** must point to .pdb files that have full type information. ***
*** ***
*** Certain .pdb files (such as the public OS symbols) do not ***
*** contain the required information. Contact the group that ***
*** provided you with these symbols if you need this command to ***
*** work. ***
*** ***
*** Type referenced: nt!_KPRCB ***
*** ***
*************************************************************************
*************************************************************************
*** ***
*** ***
*** Your debugger is not using the correct symbols ***
*** ***
*** In order for this command to work properly, your symbol path ***
*** must point to .pdb files that have full type information. ***
*** ***
*** Certain .pdb files (such as the public OS symbols) do not ***
*** contain the required information. Contact the group that ***
*** provided you with these symbols if you need this command to ***
*** work. ***
*** ***
*** Type referenced: nt!KPRCB ***
*** ***
*************************************************************************
*************************************************************************
*** ***
*** ***
*** Your debugger is not using the correct symbols ***
*** ***
*** In order for this command to work properly, your symbol path ***
*** must point to .pdb files that have full type information. ***
*** ***
*** Certain .pdb files (such as the public OS symbols) do not ***
*** contain the required information. Contact the group that ***
*** provided you with these symbols if you need this command to ***
*** work. ***
*** ***
*** Type referenced: nt!_KPRCB ***
*** ***
*************************************************************************
*************************************************************************
*** ***
*** ***
*** Your debugger is not using the correct symbols ***
*** ***
*** In order for this command to work properly, your symbol path ***
*** must point to .pdb files that have full type information. ***
*** ***
*** Certain .pdb files (such as the public OS symbols) do not ***
*** contain the required information. Contact the group that ***
*** provided you with these symbols if you need this command to ***
*** work. ***
*** ***
*** Type referenced: nt!KPRCB ***
*** ***
*************************************************************************
*************************************************************************
*** ***
*** ***
*** Your debugger is not using the correct symbols ***
*** ***
*** In order for this command to work properly, your symbol path ***
*** must point to .pdb files that have full type information. ***
*** ***
*** Certain .pdb files (such as the public OS symbols) do not ***
*** contain the required information. Contact the group that ***
*** provided you with these symbols if you need this command to ***
*** work. ***
*** ***
*** Type referenced: nt!_KPRCB ***
*** ***
*************************************************************************
*************************************************************************
*** ***
*** ***
*** Your debugger is not using the correct symbols ***
*** ***
*** In order for this command to work properly, your symbol path ***
*** must point to .pdb files that have full type information. ***
*** ***
*** Certain .pdb files (such as the public OS symbols) do not ***
*** contain the required information. Contact the group that ***
*** provided you with these symbols if you need this command to ***
*** work. ***
*** ***
*** Type referenced: nt!_KPRCB ***
*** ***
*************************************************************************
*************************************************************************
*** ***
*** ***
*** Your debugger is not using the correct symbols ***
*** ***
*** In order for this command to work properly, your symbol path ***
*** must point to .pdb files that have full type information. ***
*** ***
*** Certain .pdb files (such as the public OS symbols) do not ***
*** contain the required information. Contact the group that ***
*** provided you with these symbols if you need this command to ***
*** work. ***
*** ***
*** Type referenced: nt!_KPRCB ***
*** ***
*************************************************************************

ADDITIONAL_DEBUG_TEXT:
Use ‘!findthebuild’ command to search for the target build information.
If the build information is available, run ‘!findthebuild -s ; .reload’ to set symbol path and load symbols.

MODULE_NAME: AnCard

FAULTING_MODULE: 804d8000 nt

DEBUG_FLR_IMAGE_TIMESTAMP: 4c89dc06

EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - “0x%08lx”

FAULTING_IP:
AnCard!StartDevice+3b4 [E:\ZhangJH\pci\AnCard_2010_08_31\Driver\Win2000\DriverEntry.cpp @ 343]
f5672adf 894808 mov dword ptr [eax+8],ecx

EXCEPTION_RECORD: f78e2884 – (.exr 0xfffffffff78e2884)
ExceptionAddress: f5672adf (AnCard!StartDevice+0x000003b4)
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 00000001
Parameter[1]: 00000008
Attempt to write to address 00000008

CONTEXT: f78e2580 – (.cxr 0xfffffffff78e2580)
eax=00000000 ebx=868c8f00 ecx=00001000 edx=854913a0 esi=f78e294c edi=f78e29a4
eip=f5672adf esp=f78e294c ebp=f78e29a4 iopl=0 nv up ei pl zr na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00010246
AnCard!StartDevice+0x3b4:
f5672adf 894808 mov dword ptr [eax+8],ecx ds:0023:00000008=???
Resetting default scope

DEFAULT_BUCKET_ID: DRIVER_FAULT

BUGCHECK_STR: 0x7E

LAST_CONTROL_TRANSFER: from f5674426 to f5672adf

STACK_TEXT:
f78e29a4 f5674426 854912e8 e15f0914 e2d2a564 AnCard!StartDevice+0x3b4 [E:\ZhangJH\pci\AnCard_2010_08_31\Driver\Win2000\DriverEntry.cpp @ 343]
f78e29d8 f56736ba 854912e8 868c8f48 854912e8 AnCard!HandleStartDevice+0x109 [E:\ZhangJH\pci\AnCard_2010_08_31\Driver\Win2000\PlugPlay.cpp @ 371]
f78e2a04 804ef119 854912e8 868c8f48 806d32e8 AnCard!DispatchPnp+0x12b [E:\ZhangJH\pci\AnCard_2010_08_31\Driver\Win2000\PlugPlay.cpp @ 114]
WARNING: Stack unwind information not available. Following frames may be wrong.
f78e2a38 80588fc9 f78e2aa4 863549a8 00000000 nt!IoBuildPartialMdl+0xed
f78e2a64 80589047 854912e8 f78e2a80 00000000 nt!IoReportResourceUsage+0x7ecf
f78e2aa8 804f614c 863549a8 85641008 00000001 nt!IoReportResourceUsage+0x7f4d
f78e2ac4 805886f7 863549a8 86354901 85641008 nt!IoReportTargetDeviceChangeAsynchronous+0x4dc
f78e2d1c 80588c56 86354708 00000001 00000000 nt!IoReportResourceUsage+0x75fd
f78e2d4c 804f68ce 00000003 80553040 8055c0fc nt!IoReportResourceUsage+0x7b5c
f78e2d74 80535c02 00000000 00000000 863a0640 nt!IoReportTargetDeviceChangeAsynchronous+0xc5e
f78e2dac 805c7160 00000000 00000000 00000000 nt!ExQueueWorkItem+0x1b2
f78e2ddc 80542dd2 80535b02 00000001 00000000 nt!PsRemoveCreateThreadNotifyRoutine+0x21e
00000000 00000000 00000000 00000000 00000000 nt!KiDispatchInterrupt+0x5a2

FOLLOWUP_IP:
AnCard!StartDevice+3b4 [E:\ZhangJH\pci\AnCard_2010_08_31\Driver\Win2000\DriverEntry.cpp @ 343]
f5672adf 894808 mov dword ptr [eax+8],ecx

FAULTING_SOURCE_CODE:
339:
340: return NULL;
341: }
342: */

343: pdx->pDmaBufferAdd->PhysicalAddr = BufferLogicalAddress.QuadPart;
344:
345: KdPrint((DRIVERNAME " Leaving StartDevice"));
346:
347: return STATUS_SUCCESS;
348: } // StartDevice

SYMBOL_STACK_INDEX: 0

SYMBOL_NAME: AnCard!StartDevice+3b4

FOLLOWUP_NAME: MachineOwner

IMAGE_NAME: AnCard.sys

STACK_COMMAND: .cxr 0xfffffffff78e2580 ; kb

BUCKET_ID: WRONG_SYMBOLS

Followup: MachineOwner

Fix your symbols

On Sep 14, 2010 2:42 PM, wrote:
> sorry, i cannot open this website these days. I put the dump result below
now.
> kd> !analyze -v
>

> *
> * Bugcheck Analysis
> *
>

>
> SYSTEM_THREAD_EXCEPTION_NOT_HANDLED (7e)
> This is a very common bugcheck. Usually the exception address pinpoints
> the driver/function that caused the problem. Always note this address
> as well as the link date of the driver/image that contains this address.
> Arguments:
> Arg1: c0000005, The exception code that was not handled
> Arg2: f5672adf, The address that the exception occurred at
> Arg3: f78e2884, Exception Record Address
> Arg4: f78e2580, Context Record Address
>
> Debugging Details:
> ------------------
>
> Kernel symbols are WRONG. Please fix symbols to do analysis.
>
>
*****************************************************************
> ******
> ******
> Your debugger is not using the correct symbols
> ******
> In order for this command to work properly, your symbol path
> must point to .pdb files that have full type information.
> ******
> Certain .pdb files (such as the public OS symbols) do not
> contain the required information. Contact the group that
> provided you with these symbols if you need this command to
> work.
> ******
> Type referenced: nt!_KPRCB
> ******
>
>

> ******
> ******
> Your debugger is not using the correct symbols
> ******
> In order for this command to work properly, your symbol path
> must point to .pdb files that have full type information.
> ******
> Certain .pdb files (such as the public OS symbols) do not
> contain the required information. Contact the group that
> provided you with these symbols if you need this command to
> work.
> ******
> Type referenced: nt!KPRCB
> ******
>
>

> ******
> ******
> Your debugger is not using the correct symbols
> ******
> In order for this command to work properly, your symbol path
> must point to .pdb files that have full type information.
> ******
> Certain .pdb files (such as the public OS symbols) do not
> contain the required information. Contact the group that
> provided you with these symbols if you need this command to
> work.
> ******
> Type referenced: nt!_KPRCB
> ******
>
>

> ******
> ******
> Your debugger is not using the correct symbols
> ******
> In order for this command to work properly, your symbol path
> must point to .pdb files that have full type information.
> ******
> Certain .pdb files (such as the public OS symbols) do not
> contain the required information. Contact the group that
> provided you with these symbols if you need this command to
> work.
> ******
> Type referenced: nt!KPRCB
> ******
>
>

> ******
> ******
> Your debugger is not using the correct symbols
> ******
> In order for this command to work properly, your symbol path
> must point to .pdb files that have full type information.
> ******
> Certain .pdb files (such as the public OS symbols) do not
> contain the required information. Contact the group that
> provided you with these symbols if you need this command to
> work.
> ******
> Type referenced: nt!_KPRCB
> ******
>
>

> ******
> ******
> Your debugger is not using the correct symbols
> ******
> In order for this command to work properly, your symbol path
> must point to .pdb files that have full type information.
> ******
> Certain .pdb files (such as the public OS symbols) do not
> contain the required information. Contact the group that
> provided you with these symbols if you need this command to
> work.
> ******
> Type referenced: nt!_KPRCB
> ******
>
>

> ******
> ******
> Your debugger is not using the correct symbols
> ******
> In order for this command to work properly, your symbol path
> must point to .pdb files that have full type information.
> ******
> Certain .pdb files (such as the public OS symbols) do not
> contain the required information. Contact the group that
> provided you with these symbols if you need this command to
> work.
> ******
> Type referenced: nt!_KPRCB
> ******
> *************************************************************************
>
> ADDITIONAL_DEBUG_TEXT:
> Use ‘!findthebuild’ command to search for the target build information.
> If the build information is available, run ‘!findthebuild -s ; .reload’ to
set symbol path and load symbols.
>
> MODULE_NAME: AnCard
>
> FAULTING_MODULE: 804d8000 nt
>
> DEBUG_FLR_IMAGE_TIMESTAMP: 4c89dc06
>
> EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - “0x%08lx”
>
> FAULTING_IP:
> AnCard!StartDevice+3b4
[E:\ZhangJH\pci\AnCard_2010_08_31\Driver\Win2000\DriverEntry.cpp @ 343]
> f5672adf 894808 mov dword ptr [eax+8],ecx
>
> EXCEPTION_RECORD: f78e2884 – (.exr 0xfffffffff78e2884)
> ExceptionAddress: f5672adf (AnCard!StartDevice+0x000003b4)
> ExceptionCode: c0000005 (Access violation)
> ExceptionFlags: 00000000
> NumberParameters: 2
> Parameter[0]: 00000001
> Parameter[1]: 00000008
> Attempt to write to address 00000008
>
> CONTEXT: f78e2580 – (.cxr 0xfffffffff78e2580)
> eax=00000000 ebx=868c8f00 ecx=00001000 edx=854913a0 esi=f78e294c
edi=f78e29a4
> eip=f5672adf esp=f78e294c ebp=f78e29a4 iopl=0 nv up ei pl zr na pe nc
> cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00010246
> AnCard!StartDevice+0x3b4:
> f5672adf 894808 mov dword ptr [eax+8],ecx ds:0023:00000008=???
> Resetting default scope
>
> DEFAULT_BUCKET_ID: DRIVER_FAULT
>
> BUGCHECK_STR: 0x7E
>
> LAST_CONTROL_TRANSFER: from f5674426 to f5672adf
>
> STACK_TEXT:
> f78e29a4 f5674426 854912e8 e15f0914 e2d2a564 AnCard!StartDevice+0x3b4
[E:\ZhangJH\pci\AnCard_2010_08_31\Driver\Win2000\DriverEntry.cpp @ 343]
> f78e29d8 f56736ba 854912e8 868c8f48 854912e8
AnCard!HandleStartDevice+0x109
[E:\ZhangJH\pci\AnCard_2010_08_31\Driver\Win2000\PlugPlay.cpp @ 371]
> f78e2a04 804ef119 854912e8 868c8f48 806d32e8 AnCard!DispatchPnp+0x12b
[E:\ZhangJH\pci\AnCard_2010_08_31\Driver\Win2000\PlugPlay.cpp @ 114]
> WARNING: Stack unwind information not available. Following frames may be
wrong.
> f78e2a38 80588fc9 f78e2aa4 863549a8 00000000 nt!IoBuildPartialMdl+0xed
> f78e2a64 80589047 854912e8 f78e2a80 00000000
nt!IoReportResourceUsage+0x7ecf
> f78e2aa8 804f614c 863549a8 85641008 00000001
nt!IoReportResourceUsage+0x7f4d
> f78e2ac4 805886f7 863549a8 86354901 85641008
nt!IoReportTargetDeviceChangeAsynchronous+0x4dc
> f78e2d1c 80588c56 86354708 00000001 00000000
nt!IoReportResourceUsage+0x75fd
> f78e2d4c 804f68ce 00000003 80553040 8055c0fc
nt!IoReportResourceUsage+0x7b5c
> f78e2d74 80535c02 00000000 00000000 863a0640
nt!IoReportTargetDeviceChangeAsynchronous+0xc5e
> f78e2dac 805c7160 00000000 00000000 00000000 nt!ExQueueWorkItem+0x1b2
> f78e2ddc 80542dd2 80535b02 00000001 00000000
nt!PsRemoveCreateThreadNotifyRoutine+0x21e
> 00000000 00000000 00000000 00000000 00000000 nt!KiDispatchInterrupt+0x5a2
>
>
> FOLLOWUP_IP:
> AnCard!StartDevice+3b4
[E:\ZhangJH\pci\AnCard_2010_08_31\Driver\Win2000\DriverEntry.cpp @ 343]
> f5672adf 894808 mov dword ptr [eax+8],ecx
>
> FAULTING_SOURCE_CODE:
> 339:
> 340: return NULL;
> 341: }
> 342: */
>> 343: pdx->pDmaBufferAdd->PhysicalAddr = BufferLogicalAddress.QuadPart;
> 344:
> 345: KdPrint((DRIVERNAME " Leaving StartDevice"));
> 346:
> 347: return STATUS_SUCCESS;
> 348: } // StartDevice
>
>
> SYMBOL_STACK_INDEX: 0
>
> SYMBOL_NAME: AnCard!StartDevice+3b4
>
> FOLLOWUP_NAME: MachineOwner
>
> IMAGE_NAME: AnCard.sys
>
> STACK_COMMAND: .cxr 0xfffffffff78e2580 ; kb
>
> BUCKET_ID: WRONG_SYMBOLS
>
> Followup: MachineOwner
> ---------
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

xxxxx@gmail.com wrote:

sorry, i cannot open this website these days.

Why?

CONTEXT: f78e2580 – (.cxr 0xfffffffff78e2580)
eax=00000000 ebx=868c8f00 ecx=00001000 edx=854913a0 esi=f78e294c edi=f78e29a4
eip=f5672adf esp=f78e294c ebp=f78e29a4 iopl=0 nv up ei pl zr na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00010246
AnCard!StartDevice+0x3b4:
f5672adf 894808 mov dword ptr [eax+8],ecx ds:0023:00000008=???

So, clearly, you’re trying to store the value 0x1000 into a null pointer.

FAULTING_SOURCE_CODE:
339:
340: return NULL;
341: }
342: */
> 343: pdx->pDmaBufferAdd->PhysicalAddr = BufferLogicalAddress.QuadPart;
344:
345: KdPrint((DRIVERNAME " Leaving StartDevice"));
346:
347: return STATUS_SUCCESS;
348: } // StartDevice

So either pdx is NULL or pdx->pDmaBufferAdd is NULL.

However, 0x1000 is not a legitimate physical address. Where did you get
BufferLogicalAddress from?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

So either pdx is NULL or pdx->pDmaBufferAdd is NULL.

oh, i have rewrite code for it by using ExAllocatepool().

However, 0x1000 is not a legitimate physical address. Where did you get
BufferLogicalAddress from?

I dont know it yet after my system do not crash anymore. I thought i get the physical address by calling pdx->pDmaAdapter->DmaOperations->AllocateCommonBuffer(
pdx->pDmaAdapter,64,&BufferLogicalAddress,0);

sorry, i cannot open this website these days.

Why?

I think it is not the website’s porblem. It maybe my poor network.

Fix your symbols

But how? I have already set the symbol path and reload again in my windbg.

Why even bother posting something that’s so obviously wrong? Seriously, why would you do this?

You HAVE to stop and fix your errors as you go along, not just say “oh well” and give up!

Then you didn’t do it correctly. I, personally, just use .SYMFIX – delete the symbol cache on your local machine first.

OR… if you can’t figure it out, TO REPEAT MYSELF:

Peter
OSR