Port lock was not acquired! - all the times

Hello,

recently I am developing a IEEE function driver for a proprietary device with WDF 1.9 for Win 7 x64. I am using WinDbg 6.12. OS on both machines is Win 7 x64. I am using Ajays USB 2.0 Debug cable for the debugging connection.

While debugging I get often the message “Port lock was not acquired!”. After hours of searching I didn’t find useful information in the internet. I can’t say when or why this message comes. Sometimes never and sometimes 5 times between one debug step. Sometimes it comes right after the first break into the code at DriverEntry.

ViewerConfigPath = ‘C:\ProgramData\Microsoft\Event Viewer’: Microsoft.Windows.ManagementUI.CombinedControls.EventsNode
ViewerViewsFolderPath = ‘C:\ProgramData\Microsoft\Event Viewer\Views’: Microsoft.Windows.ManagementUI.CombinedControls.EventsNode
ViewerAdminViewsPath = ‘C:\ProgramData\Microsoft\Event Viewer\Views\ApplicationViewsRootNode’:

Microsoft.Windows.ManagementUI.CombinedControls.EventsNode
ViewerExternalLogsPath = ‘C:\ProgramData\Microsoft\Event Viewer\ExternalLogs’: Microsoft.Windows.ManagementUI.CombinedControls.EventsNode
AddIcons: Microsoft.TaskScheduler.SnapIn.TaskSchedulerExtension
WdfLdr: WdfVersionBind - Port lock was not acquired!
WdfLdr: WdfVersionBind: enter
Port lock was not acquired!
WdfLdr: GetVersionRegistryHandle - Port lock was not acquired!
Component path \Registry\Machine\System\CurrentControlSet\Control\Wdf\Kmdf\KmdfLibrary\Versions
Port lock was not acquired!
WdfLdr: GetVersionServicePath - Port lock was not acquired!
GetVersionServicePath (\Registry\Machine\System\CurrentControlSet\Services\Wdf01000)
Port lock was not acquired!
WdfLdr: GetImageName - Port lock was not acquired!
Version Image Name “ARTNet.sys”
Port lock was not acquired!
WdfLdr: LibraryLinkInClient - Port lock was not acquired!
Client Image Name: ARTNet.sys
Port lock was not acquired!
Wdf01000: Port lock was not acquired!
LibraryRegisterClient: enter
Port lock was not acquired!
Wdf01000: Port lock was not acquired!
LibraryRegisterClient: enter
Port lock was not acquired!
Wdf01000: Port lock was not acquired!
LibraryRegisterClient: WdfFunctions FFFFF88006617CC0
Port lock was not acquired!
Wdf01000: Port lock was not acquired!
LibraryRegisterClient: exit: status 0
Port lock was not acquired!
WdfLdr: WdfVersionBind - Port lock was not acquired!
Returning with Status 0x0
Port lock was not acquired!
ARTNet Driver: Port lock was not acquired!
DriverEntry Enter
Port lock was not acquired!
ARTNet Driver: Port lock was not acquired!
ARTNet Driver
Port lock was not acquired!
ARTNet Driver: Port lock was not acquired!
Built Mar 7 2011 12:06:59

or :

6: kd> g
ARTNet Driver: Port lock was not acquired!
ARTNet Driver: Port lock was not acquired!
Request Queue is empty.
Port lock was not acquired!
ARTNet Driver: Port lock was not acquired!
ARTNet_BusResetRoutine - WORKITEM Enter
Port lock was not acquired!
Breakpoint 3 hit
ARTNet!ARTNet_BusResetRoutineWorkItem+0x59:

While debugging my driver crashes very often with BugCheck 101, without debugging my codes work quite better. I don’t know if this messages comes from Wdf, the kernel, or from the debugging usb driver…

Has anyone any idea?
Many thanks in advance.
Tom

Have you ran and resolved the Prefast findings? Have you enabled Driver Verifier?

Gary G. Little

----- Original Message -----
From: xxxxx@kir.at
To: “Kernel Debugging Interest List”
Sent: Monday, March 7, 2011 6:36:00 AM
Subject: [windbg] Port lock was not acquired! - all the times

Hello,

recently I am developing a IEEE function driver for a proprietary device with WDF 1.9 for Win 7 x64. I am using WinDbg 6.12. OS on both machines is Win 7 x64. I am using Ajays USB 2.0 Debug cable for the debugging connection.

While debugging I get often the message “Port lock was not acquired!”. After hours of searching I didn’t find useful information in the internet. I can’t say when or why this message comes. Sometimes never and sometimes 5 times between one debug step. Sometimes it comes right after the first break into the code at DriverEntry.

ViewerConfigPath = ‘C:\ProgramData\Microsoft\Event Viewer’: Microsoft.Windows.ManagementUI.CombinedControls.EventsNode
ViewerViewsFolderPath = ‘C:\ProgramData\Microsoft\Event Viewer\Views’: Microsoft.Windows.ManagementUI.CombinedControls.EventsNode
ViewerAdminViewsPath = ‘C:\ProgramData\Microsoft\Event Viewer\Views\ApplicationViewsRootNode’:

Microsoft.Windows.ManagementUI.CombinedControls.EventsNode
ViewerExternalLogsPath = ‘C:\ProgramData\Microsoft\Event Viewer\ExternalLogs’: Microsoft.Windows.ManagementUI.CombinedControls.EventsNode
AddIcons: Microsoft.TaskScheduler.SnapIn.TaskSchedulerExtension
WdfLdr: WdfVersionBind - Port lock was not acquired!
WdfLdr: WdfVersionBind: enter
Port lock was not acquired!
WdfLdr: GetVersionRegistryHandle - Port lock was not acquired!
Component path \Registry\Machine\System\CurrentControlSet\Control\Wdf\Kmdf\KmdfLibrary\Versions
Port lock was not acquired!
WdfLdr: GetVersionServicePath - Port lock was not acquired!
GetVersionServicePath (\Registry\Machine\System\CurrentControlSet\Services\Wdf01000)
Port lock was not acquired!
WdfLdr: GetImageName - Port lock was not acquired!
Version Image Name “ARTNet.sys”
Port lock was not acquired!
WdfLdr: LibraryLinkInClient - Port lock was not acquired!
Client Image Name: ARTNet.sys
Port lock was not acquired!
Wdf01000: Port lock was not acquired!
LibraryRegisterClient: enter
Port lock was not acquired!
Wdf01000: Port lock was not acquired!
LibraryRegisterClient: enter
Port lock was not acquired!
Wdf01000: Port lock was not acquired!
LibraryRegisterClient: WdfFunctions FFFFF88006617CC0
Port lock was not acquired!
Wdf01000: Port lock was not acquired!
LibraryRegisterClient: exit: status 0
Port lock was not acquired!
WdfLdr: WdfVersionBind - Port lock was not acquired!
Returning with Status 0x0
Port lock was not acquired!
ARTNet Driver: Port lock was not acquired!
DriverEntry Enter
Port lock was not acquired!
ARTNet Driver: Port lock was not acquired!
ARTNet Driver
Port lock was not acquired!
ARTNet Driver: Port lock was not acquired!
Built Mar 7 2011 12:06:59

or :

6: kd> g
ARTNet Driver: Port lock was not acquired!
ARTNet Driver: Port lock was not acquired!
Request Queue is empty.
Port lock was not acquired!
ARTNet Driver: Port lock was not acquired!
ARTNet_BusResetRoutine - WORKITEM Enter
Port lock was not acquired!
Breakpoint 3 hit
ARTNet!ARTNet_BusResetRoutineWorkItem+0x59:

While debugging my driver crashes very often with BugCheck 101, without debugging my codes work quite better. I don’t know if this messages comes from Wdf, the kernel, or from the debugging usb driver…

Has anyone any idea?
Many thanks in advance.
Tom


WINDBG 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

Hello Gary,

thank you for your fast response. I have 1 error in prefast (where I have no idea how to resolve it) and I have some warnings from prefast, but all inside code which will not be executed during the first driver load and initialization.

PREFAST:
here my prefast-error:
DriversModel.xml(1) : warning 28244: The annotation for function 'InterlockedExchangePointer' parameter 0 (out of range) has an unparseable parameter/external annotation.
1


16
17
18
19
20
21
22
23
24

Driver Verifier:
I was not able to get a stable Verifiery ON situation. I see my driver inside the Driver Verifier control application, I have the settings inside the registry (all on the target computer) at ... services/ArtNet/Parameters/Wdf. VerifierOn and VerifyOn are set. During my work I got it once that driver verifier reportes ON for artnet. But funny - it was once for 20 tries (and only the time the driver verifier control application ran)

This response I got inside DriverEntry before WdfDriverCreate. Core machine ist MP Core i7 - 860, with 6GB Memory. I am using partial checked build Windows 7 Kernel Version 7600 (Service Pack 1.178) MP (8 procs) Checked x64, Built by: 7600.16385.amd64chk.win7_rtm.090713-1255. This is SP1 Beta from Win7. Maybe there are inconsistencies with the hal of the SP1 Beta build and the hal checked dll from the WDK 7600.16385.1?

2: kd> !wdfkd.wdfdriverinfo artnet 0x1

Default driver image name: artnet
WDF library image name: Wdf01000
FxDriverGlobals 0xfffffa800a3b1010
WdfBindInfo 0xfffff880078e4110
Version v1.9 build(7600)

Driver Handles is NULL

WDF Verifier settings for artnet.sys is OFF

2: kd> g
KDTARGET: Refreshing KD connection
Port lock was not acquired!
ARTNet Driver: Port lock was not acquired!
DriverEntry Exit = 0

I will solve all warnings from prefast now as the next step. Then I'll try to change the debugging connection from usb to 1394 on another 1394 card inside my target computer. Maybe I'll have more luck with that.

Do You have any other suggestions?
Thank You, greatings from Vienna, Austria (Europe),
Tom

I’m assuming, by your reply, that you used “verifier on” from the command line. I’ve never used that, always setting verifier how I wanted it to run by using the GUI after entering “C:\>verifier” . I select the manual path and set all tests except low resources unless that is a specific test needed. Then I reboot, which is required for verifier to actually test the driver you selected.

Gary G. Little

----- Original Message -----
From: xxxxx@kir.at
To: “Kernel Debugging Interest List”
Sent: Monday, March 7, 2011 9:57:34 AM
Subject: RE:[windbg] Port lock was not acquired! - all the times

Hello Gary,

thank you for your fast response. I have 1 error in prefast (where I have no idea how to resolve it) and I have some warnings from prefast, but all inside code which will not be executed during the first driver load and initialization.

PREFAST:
here my prefast-error:
DriversModel.xml(1) : warning 28244: The annotation for function ‘InterlockedExchangePointer’ parameter 0 (out of range) has an unparseable parameter/external annotation.
1


16
17
18
19
20
21
22
23
24

Driver Verifier:
I was not able to get a stable Verifiery ON situation. I see my driver inside the Driver Verifier control application, I have the settings inside the registry (all on the target computer) at … services/ArtNet/Parameters/Wdf. VerifierOn and VerifyOn are set. During my work I got it once that driver verifier reportes ON for artnet. But funny - it was once for 20 tries (and only the time the driver verifier control application ran)

This response I got inside DriverEntry before WdfDriverCreate. Core machine ist MP Core i7 - 860, with 6GB Memory. I am using partial checked build Windows 7 Kernel Version 7600 (Service Pack 1.178) MP (8 procs) Checked x64, Built by: 7600.16385.amd64chk.win7_rtm.090713-1255. This is SP1 Beta from Win7. Maybe there are inconsistencies with the hal of the SP1 Beta build and the hal checked dll from the WDK 7600.16385.1?

2: kd> !wdfkd.wdfdriverinfo artnet 0x1
----------------------------------
Default driver image name: artnet
WDF library image name: Wdf01000
FxDriverGlobals 0xfffffa800a3b1010
WdfBindInfo 0xfffff880078e4110
Version v1.9 build(7600)
----------------------------------
Driver Handles is NULL

WDF Verifier settings for artnet.sys is OFF
----------------------------------
2: kd> g
KDTARGET: Refreshing KD connection
Port lock was not acquired!
ARTNet Driver: Port lock was not acquired!
DriverEntry Exit = 0

I will solve all warnings from prefast now as the next step. Then I’ll try to change the debugging connection from usb to 1394 on another 1394 card inside my target computer. Maybe I’ll have more luck with that.

Do You have any other suggestions?
Thank You, greatings from Vienna, Austria (Europe),
Tom


WINDBG 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

There are two Verifiers: WDF Verifier and Driver Verifier. WDF Verifier is
specific to KMDF/UMDF drivers and Driver Verifier is the built in driver
verification utility in Windows.

If you’re writing a KMDF driver, you should have both enabled. The easiest
way to enable WDF Verifier is to use the control application WdfVerifier.exe
in the WDK. You can find it in:

X:\WinDDK\7600.16385.1\tools\WDF(platform)WdfVerifier.exe

For Driver Verifier, you can use Verifier.exe from your
%SystemRoot%\System32 directory. As Gary mentioned, you can enable
everything but Low Resource Simulation for your testing.

As for the DbgPrint that you’re seeing, I’ve never seen that one before
(looks like it’s coming from ARTNET?). If you want to know for sure you can
always just set a breakpoint on DbgPrint (bp nt!dbgrint) or DbgPrintEx and
check the call stack when it fires.

-scott


Scott Noone
Consulting Associate and Chief System Problem Analyst
OSR Open Systems Resources, Inc.
http://www.osronline.com