Skip to content

Commit 00b479d

Browse files
committed
Remove WdfObjectDelete call for adapter
Doesn't seen to be needed - according to documentation: > The NETADAPTER object is a standard WDF object. The framework manages its deletion, which occurs when the parent WDFDEVICE is deleted. Bump version to 0.7.4 Signed-off-by: Lev Stipakov <[email protected]>
1 parent 8400e9e commit 00b479d

File tree

4 files changed

+4
-27
lines changed

4 files changed

+4
-27
lines changed

Driver.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,9 @@ VOID OvpnEvtDeviceCleanup(WDFOBJECT obj) {
291291
OvpnBufferQueueDelete(device->ControlRxBufferQueue);
292292
OvpnBufferQueueDelete(device->DataRxBufferQueue);
293293

294-
OvpnAdapterDestroy(device->Adapter);
294+
KIRQL irql = ExAcquireSpinLockExclusive(&device->SpinLock);
295+
device->Adapter = WDF_NO_HANDLE;
296+
ExReleaseSpinLockExclusive(&device->SpinLock, irql);
295297
}
296298

297299
EVT_WDF_DRIVER_DEVICE_ADD OvpnEvtDeviceAdd;

PropertySheet.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<PropertyGroup Label="UserMacros">
55
<OVPN_DCO_VERSION_MAJOR>0</OVPN_DCO_VERSION_MAJOR>
66
<OVPN_DCO_VERSION_MINOR>7</OVPN_DCO_VERSION_MINOR>
7-
<OVPN_DCO_VERSION_PATCH>3</OVPN_DCO_VERSION_PATCH>
7+
<OVPN_DCO_VERSION_PATCH>4</OVPN_DCO_VERSION_PATCH>
88
</PropertyGroup>
99
<PropertyGroup />
1010
<ItemDefinitionGroup>

adapter.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -104,27 +104,6 @@ OvpnAdapterSetLinkState(POVPN_ADAPTER adapter, NET_IF_MEDIA_CONNECT_STATE state)
104104
NetAdapterSetLinkState(adapter->NetAdapter, &linkState);
105105
}
106106

107-
108-
_Use_decl_annotations_
109-
VOID
110-
OvpnAdapterDestroy(NETADAPTER netAdapter)
111-
{
112-
if (netAdapter == WDF_NO_HANDLE)
113-
return;
114-
115-
POVPN_ADAPTER adapter = OvpnGetAdapterContext(netAdapter);
116-
POVPN_DEVICE device = OvpnGetDeviceContext(adapter->WdfDevice);
117-
118-
KIRQL irql = ExAcquireSpinLockExclusive(&device->SpinLock);
119-
device->Adapter = WDF_NO_HANDLE;
120-
ExReleaseSpinLockExclusive(&device->SpinLock, irql);
121-
122-
// TODO: this breaks on Windows 10 when called from EvtCleanupCallback, is this call even needed?
123-
// NetAdapterStop(netAdapter);
124-
125-
WdfObjectDelete(netAdapter);
126-
}
127-
128107
EVT_NET_ADAPTER_CREATE_TXQUEUE OvpnEvtAdapterCreateTxQueue;
129108

130109
_Use_decl_annotations_

adapter.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ _IRQL_requires_same_
4848
NTSTATUS
4949
OvpnAdapterCreate(OVPN_DEVICE* device);
5050

51-
_IRQL_requires_(PASSIVE_LEVEL)
52-
VOID
53-
OvpnAdapterDestroy(NETADAPTER netAdapter);
54-
5551
// notify NetAdapter (if it is ready) that more packets are available
5652
NTSTATUS
5753
OvpnAdapterNotifyRx(NETADAPTER netAdapter);

0 commit comments

Comments
 (0)