VBoxNetFlt.c revision 75479ee94ecd639290ae67b38c9497d9492f89e1
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * VBoxNetFlt - Network Filter Driver (Host), Common Code.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Copyright (C) 2008-2009 Oracle Corporation
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * available from http://www.virtualbox.org. This file is free software;
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * you can redistribute it and/or modify it under the terms of the GNU
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * General Public License (GPL) as published by the Free Software
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync/** @page pg_netflt VBoxNetFlt - Network Interface Filter
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * This is a kernel module that attaches to a real interface on the host and
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * filters and injects packets.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * In the big picture we're one of the three trunk interface on the internal
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * network, the one named "NIC Filter Driver": @image html Networking_Overview.gif
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @section sec_netflt_locking Locking and Potential Races
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * The main challenge here is to make sure the netfilter and internal network
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * instances won't be destroyed while someone is calling into them.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * The main calls into or out of of the filter driver are:
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * - Async send completion (not implemented yet)
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * - Release by the internal network.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * - Receive.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * - Disappearance of the host networking interface.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * - Reappearance of the host networking interface.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * The latter two calls are can be caused by driver unloading/loading or the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * device being physical unplugged (e.g. a USB network device). Actually, the
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * unload scenario must fervently be prevent as it will cause panics because the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * internal network will assume the trunk is around until it releases it.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @todo Need to figure which host allow unloading and block/fix it.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * Currently the netfilter instance lives until the internal network releases
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * it. So, it is the internal networks responsibility to make sure there are no
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * active calls when it releases the trunk and destroys the network. The
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * netfilter assists in this by providing INTNETTRUNKIFPORT::pfnSetState and
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * INTNETTRUNKIFPORT::pfnWaitForIdle. The trunk state is used to enable/disable
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * promiscuous mode on the hardware NIC (or similar activation) as well
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * indicating that disconnect is imminent and no further calls shall be made
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * into the internal network. After changing the state to disconnecting and
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * prior to invoking INTNETTRUNKIFPORT::pfnDisconnectAndRelease, the internal
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * network will use INTNETTRUNKIFPORT::pfnWaitForIdle to wait for any still
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * active calls to complete.
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * The netfilter employs a busy counter and an internal state in addition to the
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * public trunk state. All these variables are protected using a spinlock.
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * @section sec_netflt_msc Locking / Sequence Diagrams - OBSOLETE
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * !OBSOLETE! - THIS WAS THE OLD APPROACH!
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * This secion contains a few sequence diagrams describing the problematic
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * transitions of a host interface filter instance.
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * The thing that makes it all a bit problematic is that multiple events may
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * happen at the same time, and that we have to be very careful to avoid
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * deadlocks caused by mixing our locks with the ones in the host kernel. The
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * main events are receive, send, async send completion, disappearance of the
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * host networking interface and its reappearance. The latter two events are
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * can be caused by driver unloading/loading or the device being physical
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * unplugged (e.g. a USB network device).
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * The strategy for dealing with these issues are:
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * - Use a simple state machine.
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * - Require the user (IntNet) to serialize all its calls to us,
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * while at the same time not owning any lock used by any of the
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * the callbacks we might call on receive and async send completion.
5e5603ae40c7a0a884fe91e269b7d6d6c0ba56f5vboxsync * - Make sure we're 100% idle before disconnecting, and have a
5e5603ae40c7a0a884fe91e269b7d6d6c0ba56f5vboxsync * disconnected status on both sides to fend off async calls.
5e5603ae40c7a0a884fe91e269b7d6d6c0ba56f5vboxsync * - Protect the host specific interface handle and the state variables
5e5603ae40c7a0a884fe91e269b7d6d6c0ba56f5vboxsync * using a spinlock.
5e5603ae40c7a0a884fe91e269b7d6d6c0ba56f5vboxsync * @subsection subsec_netflt_msc_dis_rel Disconnect from the network and release - OBSOLETE
5e5603ae40c7a0a884fe91e269b7d6d6c0ba56f5vboxsync * VM, IntNet, NetFlt, Kernel, Wire;
5e5603ae40c7a0a884fe91e269b7d6d6c0ba56f5vboxsync * VM->IntNet [label="pkt0", linecolor="green", textcolor="green"];
5e5603ae40c7a0a884fe91e269b7d6d6c0ba56f5vboxsync * IntNet=>IntNet [label="Lock Network", linecolor="green", textcolor="green" ];
5e5603ae40c7a0a884fe91e269b7d6d6c0ba56f5vboxsync * IntNet=>IntNet [label="Route packet -> wire", linecolor="green", textcolor="green" ];
5e5603ae40c7a0a884fe91e269b7d6d6c0ba56f5vboxsync * IntNet=>IntNet [label="Unlock Network", linecolor="green", textcolor="green" ];
5e5603ae40c7a0a884fe91e269b7d6d6c0ba56f5vboxsync * IntNet=>NetFlt [label="pkt0 to wire", linecolor="green", textcolor="green" ];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * NetFlt=>Kernel [label="pkt0 to wire", linecolor="green", textcolor="green"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * Kernel->Wire [label="pkt0 to wire", linecolor="green", textcolor="green"];
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * --- [label="Suspending the trunk interface"];
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * IntNet=>IntNet [label="Lock Network"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * Wire->Kernel [label="pkt1 - racing us", linecolor="red", textcolor="red"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * Kernel=>>NetFlt [label="pkt1 - racing us", linecolor="red", textcolor="red"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * NetFlt=>>IntNet [label="pkt1 recv - blocks", linecolor="red", textcolor="red"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * IntNet=>IntNet [label="Mark Trunk Suspended"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * IntNet=>IntNet [label="Unlock Network"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * IntNet=>NetFlt [label="pfnSetActive(false)"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * NetFlt=>NetFlt [label="Mark inactive (atomic)"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * IntNet<<NetFlt;
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * IntNet=>NetFlt [label="pfnWaitForIdle(forever)"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * IntNet=>>NetFlt [label="pkt1 to host", linecolor="red", textcolor="red"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * NetFlt=>>Kernel [label="pkt1 to host", linecolor="red", textcolor="red"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * Kernel<-Wire [label="pkt0 on wire", linecolor="green", textcolor="green"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * NetFlt<<Kernel [label="pkt0 on wire", linecolor="green", textcolor="green"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * IntNet<<=NetFlt [label="pfnSGRelease", linecolor="green", textcolor="green"];
3c1c973ceaac2fdf7f3b0305f57ae30531acb9ccvboxsync * IntNet<<=IntNet [label="Lock Net, free SG, Unlock Net", linecolor="green", textcolor="green"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * IntNet>>NetFlt [label="pfnSGRelease", linecolor="green", textcolor="green"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * NetFlt<-NetFlt [label="idle", linecolor="green", textcolor="green"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * IntNet<<NetFlt [label="idle (pfnWaitForIdle)"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * Wire->Kernel [label="pkt2", linecolor="red", textcolor="red"];
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * Kernel=>>NetFlt [label="pkt2", linecolor="red", textcolor="red"];
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * NetFlt=>>Kernel [label="pkt2 to host", linecolor="red", textcolor="red"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * VM->IntNet [label="pkt3", linecolor="green", textcolor="green"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * IntNet=>IntNet [label="Lock Network", linecolor="green", textcolor="green" ];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * IntNet=>IntNet [label="Route packet -> drop", linecolor="green", textcolor="green" ];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * IntNet=>IntNet [label="Unlock Network", linecolor="green", textcolor="green" ];
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * --- [label="The trunk interface is idle now, disconnect it"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * IntNet=>IntNet [label="Lock Network"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * IntNet=>IntNet [label="Unlink Trunk"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * IntNet=>IntNet [label="Unlock Network"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * IntNet=>NetFlt [label="pfnDisconnectAndRelease"];
e0dec59adb362e8486c0622785420ad10e720972vboxsync * NetFlt=>Kernel [label="iflt_detach"];
e0dec59adb362e8486c0622785420ad10e720972vboxsync * NetFlt<<=Kernel [label="iff_detached"];
e0dec59adb362e8486c0622785420ad10e720972vboxsync * NetFlt>>Kernel [label="iff_detached"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * NetFlt<<Kernel [label="iflt_detach"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * NetFlt=>NetFlt [label="Release"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * IntNet<<NetFlt [label="pfnDisconnectAndRelease"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @subsection subsec_netflt_msc_hif_rm Host Interface Removal - OBSOLETE
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * The ifnet_t (pIf) is a tricky customer as any reference to it can potentially
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * race the filter detaching. The simple way of solving it on Darwin is to guard
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * all access to the pIf member with a spinlock. The other host systems will
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * probably have similar race conditions, so the spinlock is a generic thing.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * VM, IntNet, NetFlt, Kernel;
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * VM->IntNet [label="pkt0", linecolor="green", textcolor="green"];
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * IntNet=>IntNet [label="Lock Network", linecolor="green", textcolor="green" ];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * IntNet=>IntNet [label="Route packet -> wire", linecolor="green", textcolor="green" ];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * IntNet=>IntNet [label="Unlock Network", linecolor="green", textcolor="green" ];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * IntNet=>NetFlt [label="pkt0 to wire", linecolor="green", textcolor="green" ];
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * NetFlt=>Kernel [label="ifnet_reference w/ spinlock", linecolor="green", textcolor="green" ];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * NetFlt<<Kernel [label="ifnet_reference", linecolor="green", textcolor="green" ];
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * NetFlt=>Kernel [label="pkt0 to wire (blocks)", linecolor="green", textcolor="green" ];
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * --- [label="The host interface is being disconnected"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Kernel->NetFlt [label="iff_detached"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * NetFlt=>Kernel [label="ifnet_release w/ spinlock"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * NetFlt<<Kernel [label="ifnet_release"];
e0dec59adb362e8486c0622785420ad10e720972vboxsync * NetFlt=>NetFlt [label="fDisconnectedFromHost=true"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * NetFlt>>Kernel [label="iff_detached"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * NetFlt<<Kernel [label="dropped", linecolor="green", textcolor="green"];
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * NetFlt=>NetFlt [label="Acquire spinlock", linecolor="green", textcolor="green"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * NetFlt=>Kernel [label="ifnet_release", linecolor="green", textcolor="green"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * NetFlt<<Kernel [label="ifnet_release", linecolor="green", textcolor="green"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * NetFlt=>NetFlt [label="pIf=NULL", linecolor="green", textcolor="green"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * NetFlt=>NetFlt [label="Release spinlock", linecolor="green", textcolor="green"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * IntNet<=NetFlt [label="pfnSGRelease", linecolor="green", textcolor="green"];
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * IntNet>>NetFlt [label="pfnSGRelease", linecolor="green", textcolor="green"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * IntNet<<NetFlt [label="pkt0 to wire", linecolor="green", textcolor="green"];
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @subsection subsec_netflt_msc_hif_rm Host Interface Rediscovery - OBSOLETE
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * The rediscovery is performed when we receive a send request and a certain
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * period have elapsed since the last attempt, i.e. we're polling it. We
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * synchronize the rediscovery with disconnection from the internal network
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * by means of the pfnWaitForIdle call, so no special handling is required.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * VM2, VM1, IntNet, NetFlt, Kernel, Wire;
* NetFlt=>NetFlt [label="!pIf || fRediscoveryPending (w/ spinlock)", linecolor="red", textcolor="red"];
#include "VBoxNetFltInternal.h"
static PVBOXNETFLTINS vboxNetFltFindInstanceLocked(PVBOXNETFLTGLOBALS pGlobals, const char *pszName)
return pCur;
return NULL;
return pRet;
bool fRediscovered;
bool fDoIt;
if (fDoIt)
if (fDoIt)
if (fRediscovered)
return fRediscovered;
static DECLCALLBACK(int) vboxNetFltPortXmit(PINTNETTRUNKIFPORT pIfPort, PINTNETSG pSG, uint32_t fDst)
return rc;
int rc;
return rc;
static DECLCALLBACK(INTNETTRUNKIFSTATE) vboxNetFltPortSetState(PINTNETTRUNKIFPORT pIfPort, INTNETTRUNKIFSTATE enmState)
AssertReturn(vboxNetFltGetState(pThis) == kVBoxNetFltInsState_Connected, INTNETTRUNKIFSTATE_INVALID);
return enmOldTrunkState;
#ifdef VBOXNETFLT_STATIC_CONFIG
int rc;
#ifdef VBOXNETFLT_STATIC_CONFIG
if (fBusy)
if (!cRefs)
if (!cRefs)
if (fBusy)
bool fRc;
if (fRc)
return fRc;
bool fRc;
if (fRc)
return fRc;
static int vboxNetFltConnectIt(PVBOXNETFLTINS pThis, PINTNETTRUNKSWPORT pSwitchPort, PINTNETTRUNKIFPORT *ppIfPort)
int rc;
#ifdef VBOXNETFLT_STATIC_CONFIG
return rc;
static int vboxNetFltNewInstance(PVBOXNETFLTGLOBALS pGlobals, const char *pszName, PINTNETTRUNKSWPORT pSwitchPort,
int rc;
if (!pNew)
return VERR_INTNET_FLT_IF_FAILED;
#ifdef VBOXNETFLT_STATIC_CONFIG
return rc;
return rc;
return rc;
#ifdef VBOXNETFLT_STATIC_CONFIG
DECLHIDDEN(int) vboxNetFltSearchCreateInstance(PVBOXNETFLTGLOBALS pGlobals, const char *pszName, PVBOXNETFLTINS *ppInstance, void *pvContext)
int rc;
while (pCur)
switch (enmState)
return VINF_ALREADY_INITIALIZED;
LogRel(("VBoxNetFlt: Huh? An instance of '%s' already exists! [pCur=%p cRefs=%d fDfH=%RTbool enmState=%d]\n",
return VERR_INTNET_FLT_IF_BUSY;
# ifdef RT_STRICT
return rc;
static DECLCALLBACK(int) vboxNetFltFactoryCreateAndConnect(PINTNETTRUNKFACTORY pIfFactory, const char *pszName,
PVBOXNETFLTGLOBALS pGlobals = (PVBOXNETFLTGLOBALS)((uint8_t *)pIfFactory - RT_OFFSETOF(VBOXNETFLTGLOBALS, TrunkFactory));
int rc;
LogFlow(("vboxNetFltFactoryCreateAndConnect: pszName=%p:{%s} fFlags=%#x\n", pszName, pszName, fFlags));
if (pCur)
#ifdef VBOXNETFLT_STATIC_CONFIG
if (pCur)
return rc;
#ifdef VBOXNETFLT_STATIC_CONFIG
NULL,
ppIfPort);
return rc;
PVBOXNETFLTGLOBALS pGlobals = (PVBOXNETFLTGLOBALS)((uint8_t *)pIfFactory - RT_OFFSETOF(VBOXNETFLTGLOBALS, TrunkFactory));
static DECLCALLBACK(void *) vboxNetFltQueryFactoryInterface(PCSUPDRVFACTORY pSupDrvFactory, PSUPDRVSESSION pSession, const char *pszInterfaceUuid)
PVBOXNETFLTGLOBALS pGlobals = (PVBOXNETFLTGLOBALS)((uint8_t *)pSupDrvFactory - RT_OFFSETOF(VBOXNETFLTGLOBALS, SupDrvFactory));
#ifdef LOG_ENABLED
return NULL;
return fRc;
int rc;
return VERR_WRONG_ORDER;
return VERR_WRONG_ORDER;
return rc;
int rc;
rc = SUPR0IdcOpen(&pGlobals->SupDrvIDC, 0 /* iReqVersion = default */, 0 /* iMinVersion = default */, NULL, NULL, NULL);
return rc;
return rc;
return rc;
return rc;
return rc;
return rc;
return rc;