Skip to content

Commit

Permalink
Merge pull request #85 from ViGEm/nefarius/bugfix/sal-annotations
Browse files Browse the repository at this point in the history
Various fixes
  • Loading branch information
nefarius authored Jul 6, 2023
2 parents 38ab1ad + f13d14f commit 43eb09b
Show file tree
Hide file tree
Showing 19 changed files with 462 additions and 637 deletions.
1 change: 1 addition & 0 deletions BthPS3.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=deinitialization/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Devcon/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=DEVPKEY/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Domito/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=DUALSHOCK/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=HKCU/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=HKEY/@EntryIndexedValue">True</s:Boolean>
Expand Down
6 changes: 3 additions & 3 deletions BthPS3/Bluetooth.Context.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ BthPS3_DeviceContextHeaderInit(
break;
}

if (!NT_SUCCESS(status = WdfSpinLockCreate(
if (!NT_SUCCESS(status = WdfWaitLockCreate(
&attributes,
&Header->ClientsLock
)))
Expand All @@ -104,9 +104,9 @@ BthPS3_DeviceContextHeaderInit(
break;
}

if (!NT_SUCCESS(status = WdfSpinLockCreate(
if (!NT_SUCCESS(status = WdfWaitLockCreate(
&attributes,
&Header->SlotsSpinLock
&Header->SlotsLock
)))
{
break;
Expand Down
2 changes: 0 additions & 2 deletions BthPS3/Bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,6 @@ BthPS3_GetHciVersion(
return status;
}

_IRQL_requires_max_(PASSIVE_LEVEL)
_IRQL_requires_same_
ScheduledTask_Result_Type
BthPS3_EvtQueuedWorkItemHandler(
_In_ DMFMODULE DmfModule,
Expand Down
6 changes: 3 additions & 3 deletions BthPS3/Bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ typedef struct _BTHPS3_DEVICE_CONTEXT_HEADER
//
// Lock for ClientConnections collection
//
WDFSPINLOCK ClientsLock;
WDFWAITLOCK ClientsLock;

//
// DMF module to handle PDO creation
Expand All @@ -106,7 +106,7 @@ typedef struct _BTHPS3_DEVICE_CONTEXT_HEADER
//
// Lock protecting Slots access
//
WDFSPINLOCK SlotsSpinLock;
WDFWAITLOCK SlotsLock;

//
// DMF module to enqueue work items
Expand Down Expand Up @@ -261,7 +261,7 @@ BthPS3_UnregisterL2CAPServer(

#pragma endregion

_IRQL_requires_max_(DISPATCH_LEVEL)
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
BthPS3_DeviceContextHeaderInit(
PBTHPS3_DEVICE_CONTEXT_HEADER Header,
Expand Down
20 changes: 15 additions & 5 deletions BthPS3/BthPS3.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
<ClCompile Include="BusLogic.IO.c" />
<ClCompile Include="BusLogic.Slots.c" />
<ClCompile Include="BusLogic.State.c" />
<ClCompile Include="Compatibility.c" />
<ClCompile Include="Device.c" />
<ClCompile Include="Driver.c" />
<ClCompile Include="L2CAP.Connect.c" />
Expand All @@ -43,7 +42,6 @@
<ClInclude Include="..\common\include\BthPS3.h" />
<ClInclude Include="Bluetooth.h" />
<ClInclude Include="BusLogic.h" />
<ClInclude Include="Compatibility.h" />
<ClInclude Include="Device.h" />
<ClInclude Include="Driver.h" />
<ClInclude Include="PSM.h" />
Expand Down Expand Up @@ -119,6 +117,7 @@
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
<IncludePath>$(SolutionDir)\common\include;$(IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH)</IncludePath>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\</OutDir>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
Expand All @@ -130,6 +129,7 @@
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
<IncludePath>$(SolutionDir)\common\include;$(IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH)</IncludePath>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\</OutDir>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
Expand All @@ -138,11 +138,15 @@
<WppScanConfigurationData Condition="'%(ClCompile.ScanConfigurationData)' == ''">trace.h</WppScanConfigurationData>
<WppKernelMode>true</WppKernelMode>
<PreprocessorDefinitions>_NO_CRT_STDIO_INLINE;_WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(DOMITO_INC_PATH);$(DmfRootPath)\DMF\Modules.Library;$(DmfRootPath)\DMF\Modules.Template;$(DmfRootPath)\DMF\Modules.Library.Tests;$(DmfRootPath)\DMF\Framework;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<DriverSign>
<FileDigestAlgorithm>sha256</FileDigestAlgorithm>
</DriverSign>
<Link />
<Link>
<AdditionalDependencies>$(DOMITO_LIB_PATH)\$(DDKPlatform)\$(Configuration)\Domito.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\lib\DmfK\DmfK.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\individual_libs\DmfKModules.Template\DmfKModules.Template.lib;%(AdditionalDependencies);</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
Expand All @@ -151,6 +155,7 @@
<WppScanConfigurationData Condition="'%(ClCompile.ScanConfigurationData)' == ''">trace.h</WppScanConfigurationData>
<WppKernelMode>true</WppKernelMode>
<PreprocessorDefinitions>_NO_CRT_STDIO_INLINE;_WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(DOMITO_INC_PATH);$(DmfRootPath)\DMF\Modules.Library;$(DmfRootPath)\DMF\Modules.Template;$(DmfRootPath)\DMF\Modules.Library.Tests;$(DmfRootPath)\DMF\Framework;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<DriverSign>
<FileDigestAlgorithm>sha256</FileDigestAlgorithm>
Expand All @@ -159,13 +164,17 @@
<TimeStamp>1.1.4.0</TimeStamp>
</Inf>
<Link />
<Link>
<AdditionalDependencies>$(DOMITO_LIB_PATH)\$(DDKPlatform)\$(Configuration)\Domito.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\lib\DmfK\DmfK.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\individual_libs\DmfKModules.Template\DmfKModules.Template.lib;%(AdditionalDependencies);</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<WppEnabled>true</WppEnabled>
<WppRecorderEnabled>true</WppRecorderEnabled>
<WppScanConfigurationData Condition="'%(ClCompile.ScanConfigurationData)' == ''">trace.h</WppScanConfigurationData>
<WppKernelMode>true</WppKernelMode>
<AdditionalIncludeDirectories>$(DOMITO_INC_PATH);$(DmfRootPath)\DMF\Modules.Library;$(DmfRootPath)\DMF\Modules.Template;$(DmfRootPath)\DMF\Modules.Library.Tests;$(DmfRootPath)\DMF\Framework;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<DriverSign>
<FileDigestAlgorithm>sha256</FileDigestAlgorithm>
Expand All @@ -175,7 +184,7 @@
</Inf>
<Link />
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\wdmsec.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\lib\DmfK\DmfK.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\individual_libs\DmfKModules.Template\DmfKModules.Template.lib;%(AdditionalDependencies);</AdditionalDependencies>
<AdditionalDependencies>$(DOMITO_LIB_PATH)\$(DDKPlatform)\$(Configuration)\Domito.lib;$(DDK_LIB_PATH)\wdmsec.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\lib\DmfK\DmfK.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\individual_libs\DmfKModules.Template\DmfKModules.Template.lib;%(AdditionalDependencies);</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
Expand All @@ -184,13 +193,14 @@
<WppRecorderEnabled>true</WppRecorderEnabled>
<WppScanConfigurationData Condition="'%(ClCompile.ScanConfigurationData)' == ''">trace.h</WppScanConfigurationData>
<WppKernelMode>true</WppKernelMode>
<AdditionalIncludeDirectories>$(DOMITO_INC_PATH);$(DmfRootPath)\DMF\Modules.Library;$(DmfRootPath)\DMF\Modules.Template;$(DmfRootPath)\DMF\Modules.Library.Tests;$(DmfRootPath)\DMF\Framework;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<DriverSign>
<FileDigestAlgorithm>sha256</FileDigestAlgorithm>
</DriverSign>
<Link />
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\wdmsec.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\lib\DmfK\DmfK.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\individual_libs\DmfKModules.Template\DmfKModules.Template.lib;%(AdditionalDependencies);</AdditionalDependencies>
<AdditionalDependencies>$(DOMITO_LIB_PATH)\$(DDKPlatform)\$(Configuration)\Domito.lib;$(DDK_LIB_PATH)\wdmsec.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\lib\DmfK\DmfK.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\individual_libs\DmfKModules.Template\DmfKModules.Template.lib;%(AdditionalDependencies);</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down Expand Up @@ -223,7 +233,7 @@
<Target Name="RemoveWppRecorder" AfterTargets="SetLinkLibraryPaths">
<ItemGroup>
<Link>
<AdditionalDependencies>$(ProjectDir)libs\$(PlatformName)\WppRecorder.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\lib\DmfK\DmfK.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\individual_libs\DmfKModules.Template\DmfKModules.Template.lib;$(DDK_LIB_PATH)\wdmsec.lib;$(KernelBufferOverflowLib);$(DDK_LIB_PATH)ntoskrnl.lib;$(DDK_LIB_PATH)hal.lib;$(DDK_LIB_PATH)wmilib.lib;$(KMDF_LIB_PATH)$(KMDF_VER_PATH)\WdfLdr.lib;$(KMDF_LIB_PATH)$(KMDF_VER_PATH)\WdfDriverEntry.lib</AdditionalDependencies>
<AdditionalDependencies>$(DOMITO_LIB_PATH)\$(DDKPlatform)\$(Configuration)\Domito.lib;$(ProjectDir)libs\$(PlatformName)\WppRecorder.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\lib\DmfK\DmfK.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\individual_libs\DmfKModules.Template\DmfKModules.Template.lib;$(DDK_LIB_PATH)\wdmsec.lib;$(KernelBufferOverflowLib);$(DDK_LIB_PATH)ntoskrnl.lib;$(DDK_LIB_PATH)hal.lib;$(DDK_LIB_PATH)wmilib.lib;$(KMDF_LIB_PATH)$(KMDF_VER_PATH)\WdfLdr.lib;$(KMDF_LIB_PATH)$(KMDF_VER_PATH)\WdfDriverEntry.lib</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Platform)'=='ARM64'">
%(AdditionalDependencies);arm64rt.lib
</AdditionalDependencies>
Expand Down
6 changes: 0 additions & 6 deletions BthPS3/BthPS3.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@
<ClInclude Include="Util.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Compatibility.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Device.c">
Expand Down Expand Up @@ -125,9 +122,6 @@
<ClCompile Include="BusLogic.Slots.c">
<Filter>Source Files\BusLogic</Filter>
</ClCompile>
<ClCompile Include="Compatibility.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="BthPS3.rc">
Expand Down
28 changes: 10 additions & 18 deletions BthPS3/BusLogic.IO.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
//
// Handles IOCTL_BTHPS3_HID_CONTROL_READ
//
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
BthPS3_PDO_HandleHidControlRead(
_In_ DMFMODULE DmfModule,
Expand All @@ -60,7 +59,6 @@ BthPS3_PDO_HandleHidControlRead(
UNREFERENCED_PARAMETER(IoctlCode);
UNREFERENCED_PARAMETER(InputBuffer);
UNREFERENCED_PARAMETER(InputBufferSize);
UNREFERENCED_PARAMETER(BytesReturned);
UNREFERENCED_PARAMETER(OutputBufferSize);
UNREFERENCED_PARAMETER(OutputBuffer);

Expand All @@ -70,6 +68,8 @@ BthPS3_PDO_HandleHidControlRead(
const WDFDEVICE device = DMF_ParentDeviceGet(DmfModule);
const PBTHPS3_PDO_CONTEXT pPdoCtx = GetPdoContext(device);

*BytesReturned = 0;

if (!NT_SUCCESS(status = WdfRequestForwardToIoQueue(
Request,
pPdoCtx->Queues.HidControlReadRequests
Expand All @@ -91,7 +91,6 @@ BthPS3_PDO_HandleHidControlRead(
//
// Handles IOCTL_BTHPS3_HID_CONTROL_WRITE
//
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
BthPS3_PDO_HandleHidControlWrite(
_In_ DMFMODULE DmfModule,
Expand All @@ -109,7 +108,6 @@ BthPS3_PDO_HandleHidControlWrite(
UNREFERENCED_PARAMETER(IoctlCode);
UNREFERENCED_PARAMETER(OutputBuffer);
UNREFERENCED_PARAMETER(OutputBufferSize);
UNREFERENCED_PARAMETER(BytesReturned);
UNREFERENCED_PARAMETER(InputBuffer);
UNREFERENCED_PARAMETER(InputBufferSize);

Expand All @@ -119,6 +117,8 @@ BthPS3_PDO_HandleHidControlWrite(
const WDFDEVICE device = DMF_ParentDeviceGet(DmfModule);
const PBTHPS3_PDO_CONTEXT pPdoCtx = GetPdoContext(device);

*BytesReturned = 0;

if (!NT_SUCCESS(status = WdfRequestForwardToIoQueue(
Request,
pPdoCtx->Queues.HidControlWriteRequests
Expand All @@ -140,7 +140,6 @@ BthPS3_PDO_HandleHidControlWrite(
//
// Handles IOCTL_BTHPS3_HID_INTERRUPT_READ
//
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
BthPS3_PDO_HandleHidInterruptRead(
_In_ DMFMODULE DmfModule,
Expand All @@ -158,12 +157,13 @@ BthPS3_PDO_HandleHidInterruptRead(
UNREFERENCED_PARAMETER(IoctlCode);
UNREFERENCED_PARAMETER(InputBuffer);
UNREFERENCED_PARAMETER(InputBufferSize);
UNREFERENCED_PARAMETER(BytesReturned);
UNREFERENCED_PARAMETER(OutputBuffer);
UNREFERENCED_PARAMETER(OutputBufferSize);

FuncEntry(TRACE_BUSLOGIC);

*BytesReturned = 0;

NTSTATUS status;
const WDFDEVICE device = DMF_ParentDeviceGet(DmfModule);
const PBTHPS3_PDO_CONTEXT pPdoCtx = GetPdoContext(device);
Expand All @@ -189,7 +189,6 @@ BthPS3_PDO_HandleHidInterruptRead(
//
// Handles IOCTL_BTHPS3_HID_INTERRUPT_WRITE
//
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
BthPS3_PDO_HandleHidInterruptWrite(
_In_ DMFMODULE DmfModule,
Expand All @@ -207,7 +206,6 @@ BthPS3_PDO_HandleHidInterruptWrite(
UNREFERENCED_PARAMETER(IoctlCode);
UNREFERENCED_PARAMETER(OutputBuffer);
UNREFERENCED_PARAMETER(OutputBufferSize);
UNREFERENCED_PARAMETER(BytesReturned);
UNREFERENCED_PARAMETER(InputBuffer);
UNREFERENCED_PARAMETER(InputBufferSize);

Expand All @@ -217,6 +215,8 @@ BthPS3_PDO_HandleHidInterruptWrite(
const WDFDEVICE device = DMF_ParentDeviceGet(DmfModule);
const PBTHPS3_PDO_CONTEXT pPdoCtx = GetPdoContext(device);

*BytesReturned = 0;

if (!NT_SUCCESS(status = WdfRequestForwardToIoQueue(
Request,
pPdoCtx->Queues.HidInterruptWriteRequests
Expand All @@ -238,7 +238,6 @@ BthPS3_PDO_HandleHidInterruptWrite(
//
// Handles IOCTL_BTH_DISCONNECT_DEVICE requests
//
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
BthPS3_PDO_HandleBthDisconnect(
_In_ DMFMODULE DmfModule,
Expand All @@ -261,7 +260,6 @@ BthPS3_PDO_HandleBthDisconnect(
UNREFERENCED_PARAMETER(InputBuffer);
UNREFERENCED_PARAMETER(OutputBufferSize);
UNREFERENCED_PARAMETER(OutputBuffer);
UNREFERENCED_PARAMETER(BytesReturned);

NTSTATUS status;
const WDFDEVICE device = DMF_ParentDeviceGet(DmfModule);
Expand All @@ -271,6 +269,8 @@ BthPS3_PDO_HandleBthDisconnect(
WDFMEMORY payload;
WDFREQUEST dcRequest = NULL;

*BytesReturned = 0;

do
{
WDF_OBJECT_ATTRIBUTES_INIT(&attributes);
Expand Down Expand Up @@ -381,8 +381,6 @@ BthPS3_PDO_HandleBthDisconnect(
//
// Sends pending HID Control Read Requests through L2CAP channel to remote device
//
_IRQL_requires_same_
_IRQL_requires_max_(DISPATCH_LEVEL)
VOID
BthPS3_PDO_DispatchHidControlRead(
_In_ WDFQUEUE Queue,
Expand Down Expand Up @@ -441,8 +439,6 @@ BthPS3_PDO_DispatchHidControlRead(
//
// Sends pending HID Control Write Requests through L2CAP channel to remote device
//
_IRQL_requires_same_
_IRQL_requires_max_(DISPATCH_LEVEL)
VOID
BthPS3_PDO_DispatchHidControlWrite(
_In_ WDFQUEUE Queue,
Expand Down Expand Up @@ -501,8 +497,6 @@ BthPS3_PDO_DispatchHidControlWrite(
//
// Sends pending HID Interrupt Read Requests through L2CAP channel to remote device
//
_IRQL_requires_same_
_IRQL_requires_max_(DISPATCH_LEVEL)
VOID
BthPS3_PDO_DispatchHidInterruptRead(
_In_ WDFQUEUE Queue,
Expand Down Expand Up @@ -561,8 +555,6 @@ BthPS3_PDO_DispatchHidInterruptRead(
//
// Sends pending HID Interrupt Write Requests through L2CAP channel to remote device
//
_IRQL_requires_same_
_IRQL_requires_max_(DISPATCH_LEVEL)
VOID
BthPS3_PDO_DispatchHidInterruptWrite(
_In_ WDFQUEUE Queue,
Expand Down
12 changes: 6 additions & 6 deletions BthPS3/BusLogic.Slots.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ BthPS3_PDO_QuerySlot(
break;
}

WdfSpinLockAcquire(Header->SlotsSpinLock);
WdfWaitLockAcquire(Header->SlotsLock, NULL);

SetBit(Header->Slots, *Slot);

WdfSpinLockRelease(Header->SlotsSpinLock);
WdfWaitLockRelease(Header->SlotsLock);

status = STATUS_SUCCESS;
}
Expand All @@ -109,7 +109,7 @@ BthPS3_PDO_QuerySlot(
"Looking for free serial"
);

WdfSpinLockAcquire(Header->SlotsSpinLock);
WdfWaitLockAcquire(Header->SlotsLock, NULL);

//
// ...otherwise get next free serial number
Expand All @@ -136,7 +136,7 @@ BthPS3_PDO_QuerySlot(
status = STATUS_NO_MORE_ENTRIES;
}

WdfSpinLockRelease(Header->SlotsSpinLock);
WdfWaitLockRelease(Header->SlotsLock);
}

} while (FALSE);
Expand Down Expand Up @@ -261,11 +261,11 @@ BthPS3_PDO_AssignSlot(
break;
}

WdfSpinLockAcquire(Header->SlotsSpinLock);
WdfWaitLockAcquire(Header->SlotsLock, NULL);

SetBit(Header->Slots, Slot);

WdfSpinLockRelease(Header->SlotsSpinLock);
WdfWaitLockRelease(Header->SlotsLock);

//
// Store occupied slots in registry
Expand Down
Loading

0 comments on commit 43eb09b

Please sign in to comment.