failed to call StorPortGetDeviceBase in FindAdapter

I got following messages from “!analyze -v” after a fatal system error,
how can I find excactly what wrong or missed in my code?

Thanks

*******************************************************************************
* *
* 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: 98fac3a9, The address that the exception occurred at
Arg3: 8fb836e4, Exception Record Address
Arg4: 8fb83140, Context Record Address

Debugging Details:

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: hba8g
FAULTING_MODULE: 83e55000 nt
DEBUG_FLR_IMAGE_TIMESTAMP: 4fb42e72
EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s.
FAULTING_IP:
hba8g!Cft8gFindAdapter+179 [d:\storport\hba8g.c @ 427]
98fac3a9 8901 mov dword ptr [ecx],eax

EXCEPTION_RECORD: 8fb836e4 – (.exr 0xffffffff8fb836e4)
ExceptionAddress: 98fac3a9 (hba8g!hba8gFindAdapter+0x00000179)
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 00000001
Parameter[1]: 00000000
Attempt to write to address 00000000

CONTEXT: 8fb83140 – (.cxr 0xffffffff8fb83140)
eax=8fa00000 ebx=86792330 ecx=00000000 edx=867a6898 esi=86792488 edi=86792490
eip=98fac3a9 esp=8fb837ac ebp=8fb837e0 iopl=0 nv up ei pl zr na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00010246
hba8g!hba8gFindAdapter+0x179:
98fac3a9 8901 mov dword ptr [ecx],eax ds:0023:00000000=???
Resetting default scope

DEFAULT_BUCKET_ID: VISTA_DRIVER_FAULT
BUGCHECK_STR: 0x7E
CURRENT_IRQL: 0
LAST_CONTROL_TRANSFER: from 98fc07cf to 98fac3a9
STACK_TEXT:

FOLLOWUP_IP:
hba8g!hba8gFindAdapter+179 [d:\storport\hba8g.c @ 427]
98fac3a9 8901 mov dword ptr [ecx],eax
SYMBOL_STACK_INDEX: 0
SYMBOL_NAME: hba8g!hba8gFindAdapter+179
FOLLOWUP_NAME: MachineOwner
IMAGE_NAME: hba8g.sys
STACK_COMMAND: .cxr 0xffffffff8fb83140 ; kb
BUCKET_ID: WRONG_SYMBOLS
Followup: MachineOwner

xxxxx@gmail.com wrote:

I got following messages from “!analyze -v” after a fatal system error,
how can I find excactly what wrong or missed in my code?

Looks pretty clear. At line 427 in hba8g.c, you tried to write
something through a null pointer.


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