Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1356 lines
45 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. config.c
  5. Abstract:
  6. This file contains all routines necessary for the support of dynamic
  7. configuration.
  8. Author:
  9. Rajesh Sundaram (rajeshsu)
  10. Environment:
  11. Kernel Mode
  12. Revision History:
  13. --*/
  14. #include "psched.h"
  15. #pragma hdrstop
  16. //
  17. // Forward declaration for using #pragma
  18. NDIS_STATUS
  19. PsReadAdapterRegistryDataInit(PADAPTER Adapter,
  20. PNDIS_STRING AdapterKey
  21. );
  22. NDIS_STATUS
  23. PsReadAdapterRegistryData(PADAPTER Adapter,
  24. PNDIS_STRING MachineKey,
  25. PNDIS_STRING AdapterKey);
  26. #pragma alloc_text(PAGE, PsReadAdapterRegistryData)
  27. #pragma alloc_text(PAGE, PsReadAdapterRegistryDataInit)
  28. //
  29. // Local functions used to access the registry.
  30. //
  31. NDIS_STATUS
  32. PsReadRegistryInt(
  33. IN NDIS_HANDLE ConfigHandle,
  34. IN PNDIS_STRING ValueName,
  35. IN ULONG ValueDefault,
  36. IN OUT PULONG ValuePtr,
  37. IN ULONG ValueMin,
  38. IN ULONG ValueMax,
  39. IN BOOLEAN Subkey,
  40. IN PNDIS_STRING SubKeyName,
  41. IN HANDLE SubKeyHandle,
  42. IN BOOLEAN ZAW
  43. )
  44. {
  45. PNDIS_CONFIGURATION_PARAMETER ConfigParam;
  46. NDIS_STATUS Status;
  47. NTSTATUS NtStatus;
  48. ULONG Value;
  49. RTL_QUERY_REGISTRY_TABLE ServiceKeys[] =
  50. {
  51. {NULL,
  52. 0,
  53. NULL,
  54. NULL,
  55. 0,
  56. NULL,
  57. 0},
  58. {NULL,
  59. 0,
  60. NULL,
  61. NULL,
  62. 0,
  63. NULL,
  64. 0},
  65. {NULL,
  66. 0,
  67. NULL,
  68. NULL,
  69. 0,
  70. NULL,
  71. 0}
  72. };
  73. if(Subkey)
  74. {
  75. PsDbgOut(DBG_INFO, DBG_INIT | DBG_ZAW,
  76. ("[PsReadSingleParameter]: Subkey %ws, Key %ws \n",
  77. SubKeyName->Buffer, ValueName->Buffer));
  78. NdisReadConfiguration(&Status,
  79. &ConfigParam,
  80. SubKeyHandle,
  81. ValueName,
  82. NdisParameterInteger);
  83. }
  84. else
  85. {
  86. PsDbgOut(DBG_INFO, DBG_INIT | DBG_ZAW,
  87. ("[PsReadSingleParameter]: Subkey NULL, Key %ws \n", ValueName->Buffer));
  88. NdisReadConfiguration(&Status,
  89. &ConfigParam,
  90. ConfigHandle,
  91. ValueName,
  92. NdisParameterInteger);
  93. }
  94. if(Status == NDIS_STATUS_SUCCESS)
  95. {
  96. *ValuePtr = ConfigParam->ParameterData.IntegerData;
  97. if(*ValuePtr < ValueMin || *ValuePtr > ValueMax)
  98. {
  99. PsDbgOut(DBG_FAILURE, DBG_INIT | DBG_ZAW,
  100. ("[PsReadSingleParameter]: Per adapter: %d does not fall in range (%d - %d) \n",
  101. *ValuePtr, ValueMin, ValueMax));
  102. *ValuePtr = ValueDefault;
  103. }
  104. PsDbgOut(DBG_INFO, DBG_INIT | DBG_ZAW,
  105. ("\t\t Per adapter: 0x%x \n", *ValuePtr));
  106. return Status;
  107. }
  108. else
  109. {
  110. if(ZAW)
  111. {
  112. //
  113. // See if we can read it from the per machine area. We need to use the RtlAPIs for this.
  114. //
  115. if(Subkey)
  116. {
  117. ServiceKeys[0].QueryRoutine = NULL;
  118. ServiceKeys[0].Flags = RTL_QUERY_REGISTRY_SUBKEY;
  119. ServiceKeys[0].Name = SubKeyName->Buffer;
  120. ServiceKeys[0].EntryContext = NULL;
  121. ServiceKeys[0].DefaultType = REG_NONE;
  122. ServiceKeys[0].DefaultData = NULL;
  123. ServiceKeys[0].DefaultLength = 0;
  124. ServiceKeys[1].QueryRoutine = NULL;
  125. ServiceKeys[1].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED;
  126. ServiceKeys[1].Name = ValueName->Buffer;
  127. ServiceKeys[1].EntryContext = &Value;
  128. ServiceKeys[1].DefaultType = REG_DWORD;
  129. ServiceKeys[1].DefaultData = NULL;
  130. ServiceKeys[1].DefaultLength = 0;
  131. }
  132. else
  133. {
  134. ServiceKeys[0].QueryRoutine = NULL;
  135. ServiceKeys[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED;
  136. ServiceKeys[0].Name = ValueName->Buffer;
  137. ServiceKeys[0].EntryContext = &Value;
  138. ServiceKeys[0].DefaultType = REG_DWORD;
  139. ServiceKeys[0].DefaultData = NULL;
  140. ServiceKeys[0].DefaultLength = 0;
  141. }
  142. NtStatus = RtlQueryRegistryValues(
  143. RTL_REGISTRY_ABSOLUTE,
  144. MachineRegistryKey.Buffer,
  145. ServiceKeys,
  146. NULL,
  147. NULL);
  148. if(NT_SUCCESS(NtStatus))
  149. {
  150. *ValuePtr = Value;
  151. if(*ValuePtr < ValueMin || *ValuePtr > ValueMax)
  152. {
  153. PsDbgOut(DBG_FAILURE, DBG_INIT | DBG_ZAW,
  154. ("[PsReadSingleParameter]: ZAW %ws %d does not fall in range (%d - %d) \n",
  155. ValueName->Buffer, *ValuePtr, ValueMin, ValueMax));
  156. *ValuePtr = ValueDefault;
  157. }
  158. PsDbgOut(DBG_INFO, DBG_INIT | DBG_ZAW, ("\t\tZAW 0x%x \n", *ValuePtr));
  159. return NDIS_STATUS_SUCCESS;
  160. }
  161. else
  162. {
  163. *ValuePtr = ValueDefault;
  164. PsDbgOut(DBG_INFO, DBG_INIT | DBG_ZAW,
  165. ("\t\tNot in ZAW/Adapter, Using default %d \n", *ValuePtr));
  166. return NtStatus;
  167. }
  168. }
  169. else
  170. {
  171. *ValuePtr = ValueDefault;
  172. PsDbgOut(DBG_INFO, DBG_INIT | DBG_ZAW,
  173. ("\t\tNot in ZAW/Adapter, Using default %d \n", *ValuePtr));
  174. return Status;
  175. }
  176. }
  177. }
  178. NTSTATUS
  179. PsReadRegistryString(IN NDIS_HANDLE ConfigHandle,
  180. IN PNDIS_STRING Key,
  181. IN PNDIS_STRING Buffer
  182. )
  183. {
  184. NDIS_STATUS Status;
  185. PNDIS_CONFIGURATION_PARAMETER ConfigParam;
  186. NdisReadConfiguration(&Status,
  187. &ConfigParam,
  188. ConfigHandle,
  189. Key,
  190. NdisParameterMultiString);
  191. if(Status == NDIS_STATUS_SUCCESS)
  192. {
  193. Buffer->Length = ConfigParam->ParameterData.StringData.Length;
  194. Buffer->MaximumLength = Buffer->Length + sizeof(WCHAR);
  195. PsAllocatePool(Buffer->Buffer,
  196. Buffer->MaximumLength,
  197. PsMiscTag);
  198. if(Buffer->Buffer)
  199. {
  200. RtlCopyUnicodeString(Buffer, &ConfigParam->ParameterData.StringData);
  201. } else {
  202. Status = NDIS_STATUS_RESOURCES;
  203. }
  204. }
  205. return Status;
  206. }
  207. STATIC VOID
  208. ReadProfiles(
  209. NDIS_HANDLE ConfigHandle
  210. )
  211. /*++
  212. Routine Description:
  213. This routine is used by the driver to read the Profiles key from the
  214. registry. The profile is a multiple string list of available profiles.
  215. Each entry on this list identifies another value under Psched\Parameters
  216. which contains the list of modules that comprise the profile.
  217. Arguments:
  218. ConfigHandle - Handle to the registry entry
  219. Return Value:
  220. --*/
  221. {
  222. NDIS_STATUS Status;
  223. PNDIS_CONFIGURATION_PARAMETER pConfigParam;
  224. PNDIS_CONFIGURATION_PARAMETER pProfileParam;
  225. PPS_PROFILE pProfileInfo;
  226. PWSTR r, p;
  227. UINT i, j, cnt;
  228. NDIS_STRING ProfileKey = NDIS_STRING_CONST("Profiles");
  229. NDIS_STRING StringName;
  230. BOOLEAN StubFlag;
  231. NDIS_STRING StubComponent = NDIS_STRING_CONST("SchedulerStub");
  232. NdisReadConfiguration( &Status,
  233. &pConfigParam,
  234. ConfigHandle,
  235. &ProfileKey,
  236. NdisParameterMultiString);
  237. if ( NT_SUCCESS( Status ))
  238. {
  239. //
  240. // pConfigParam now contains a list of profiles.
  241. //
  242. for (p = pConfigParam->ParameterData.StringData.Buffer, i = 0;
  243. *p != L'\0';
  244. i++)
  245. {
  246. //
  247. // Allocate a new PS_PROFILE entry and store it into
  248. // a global list.
  249. //
  250. PsAllocatePool(pProfileInfo, sizeof(PS_PROFILE), ProfileTag);
  251. if(!pProfileInfo)
  252. {
  253. //
  254. // Don't have to worry about freeing the previous profiles as they will get freed
  255. // when we clear the PsProfileList.
  256. //
  257. PsDbgOut(DBG_CRITICAL_ERROR, DBG_INIT,
  258. ("[ReadProfiles]: cannot allocate memory to hold profile \n"));
  259. break;
  260. }
  261. NdisZeroMemory(pProfileInfo, sizeof(PS_PROFILE));
  262. InsertHeadList( &PsProfileList, &pProfileInfo->Links );
  263. // Copy the Profile Name
  264. // 1. Initialize the unicode strings
  265. // 2. Allocate memory for the string
  266. // 3. Copy the string over.
  267. RtlInitUnicodeString(&StringName, p);
  268. RtlInitUnicodeString(&pProfileInfo->ProfileName, p);
  269. PsAllocatePool(pProfileInfo->ProfileName.Buffer,
  270. pProfileInfo->ProfileName.MaximumLength,
  271. ProfileTag);
  272. if(!pProfileInfo->ProfileName.Buffer)
  273. {
  274. //
  275. // Again, cleanup of the other profils will be done when we clean up the ProfileList
  276. //
  277. PsDbgOut(DBG_CRITICAL_ERROR, DBG_INIT,
  278. ("[ReadProfiles]: cannot allocate memory to hold profile's name \n"));
  279. break;
  280. }
  281. NdisZeroMemory(pProfileInfo->ProfileName.Buffer,
  282. pProfileInfo->ProfileName.MaximumLength);
  283. RtlCopyUnicodeString(&pProfileInfo->ProfileName, &StringName);
  284. PsDbgOut(DBG_TRACE,
  285. DBG_INIT,
  286. ("[ReadProfiles]: Adding profile %ws \n",
  287. pProfileInfo->ProfileName.Buffer));
  288. // The last scheduling component of every profile should
  289. // be a stub component. If this component is not present
  290. // in the profile, we have to add it manually.
  291. StubFlag = FALSE;
  292. cnt = 0;
  293. //
  294. // Each of the name identifies another value under
  295. // "Psched\Parameters". This value contains the list of
  296. // components that comprize the profile.
  297. //
  298. NdisReadConfiguration( &Status,
  299. &pProfileParam,
  300. ConfigHandle,
  301. &pProfileInfo->ProfileName,
  302. NdisParameterMultiString);
  303. if(NT_SUCCESS (Status))
  304. {
  305. // Read the components and associate with a
  306. // PSI_INFO.
  307. NDIS_STRING ComponentName;
  308. for (r = pProfileParam->ParameterData.StringData.Buffer, j=0;
  309. *r != L'\0'; j++)
  310. {
  311. PSI_INFO *PsiComponentInfo = 0;
  312. RtlInitUnicodeString(&ComponentName, r);
  313. PsDbgOut(DBG_TRACE, DBG_INIT,
  314. ("[ReadProfiles]: Adding component %ws to "
  315. "Profile %ws \n",
  316. ComponentName.Buffer,
  317. pProfileInfo->ProfileName.Buffer));
  318. if(!StubFlag && (RtlCompareUnicodeString(&ComponentName,
  319. &StubComponent,
  320. FALSE)== 0))
  321. StubFlag = TRUE;
  322. if(cnt == MAX_COMPONENT_PER_PROFILE)
  323. {
  324. PsDbgOut(DBG_CRITICAL_ERROR,
  325. DBG_INIT,
  326. ("[ReadProfiles]: Profile %ws cannot have "
  327. "more than %d components \n",
  328. pProfileInfo->ProfileName.Buffer,
  329. MAX_COMPONENT_PER_PROFILE));
  330. }
  331. else
  332. {
  333. if(FindSchedulingComponent(&ComponentName, &PsiComponentInfo) ==
  334. NDIS_STATUS_FAILURE)
  335. {
  336. //
  337. // The component does not exist. Therefore, we
  338. // store the unregistered component in the list
  339. //
  340. PsDbgOut(DBG_TRACE, DBG_INIT,
  341. ("[ReadProfiles]: Adding add-in component"
  342. " %ws to list\n", ComponentName.Buffer));
  343. PsAllocatePool(PsiComponentInfo,
  344. sizeof(PSI_INFO),
  345. ComponentTag);
  346. if(!PsiComponentInfo)
  347. {
  348. PsDbgOut(DBG_CRITICAL_ERROR, DBG_INIT,
  349. ("[ReadProfiles]: No memory to store add-in components \n"));
  350. break;
  351. }
  352. pProfileInfo->UnregisteredAddInCnt ++;
  353. NdisZeroMemory(PsiComponentInfo, sizeof(PSI_INFO));
  354. RtlInitUnicodeString(&PsiComponentInfo->ComponentName, r);
  355. PsAllocatePool(
  356. PsiComponentInfo->ComponentName.Buffer,
  357. ComponentName.MaximumLength,
  358. ComponentTag);
  359. if(!PsiComponentInfo->ComponentName.Buffer)
  360. {
  361. PsDbgOut(DBG_CRITICAL_ERROR, DBG_INIT,
  362. ("[ReadProfiles]: No memory to store add-in components \n"));
  363. PsFreePool(PsiComponentInfo);
  364. break;
  365. }
  366. RtlCopyUnicodeString(&PsiComponentInfo->ComponentName,
  367. &ComponentName);
  368. PsiComponentInfo->Registered = FALSE;
  369. PsiComponentInfo->AddIn = TRUE;
  370. InsertHeadList(&PsComponentList, &PsiComponentInfo->Links );
  371. }
  372. // Add the component to the profile.
  373. pProfileInfo->ComponentList[cnt++]=PsiComponentInfo;
  374. pProfileInfo->ComponentCnt = cnt;
  375. }
  376. r = (PWSTR)((PUCHAR)r + ComponentName.Length +
  377. sizeof(WCHAR));
  378. }
  379. }
  380. if(!StubFlag)
  381. {
  382. PsDbgOut(DBG_INFO, DBG_INIT,
  383. ("[ReadProfiles]: Profile %ws should end in a stub "
  384. "component. Adding a stub component \n",
  385. pProfileInfo->ProfileName.Buffer));
  386. // Needn't worry about overflow, as we have allocated an
  387. // extra one for the stub component.
  388. pProfileInfo->ComponentList[cnt++] = &SchedulerStubInfo;
  389. pProfileInfo->ComponentCnt = cnt;
  390. }
  391. p = (PWSTR)((PUCHAR)p + pProfileInfo->ProfileName.Length
  392. + sizeof(WCHAR));
  393. }
  394. }
  395. }
  396. NDIS_STATUS
  397. PsReadDriverRegistryDataInit (
  398. )
  399. /*++
  400. Routine Description:
  401. This routine is called by the driver to get information from the configuration
  402. management routines. We read the registry, starting at RegistryPath,
  403. to get the parameters. If they don't exist, we use the defaults in this module.
  404. Arguments:
  405. RegistryPath - The name of the driver's node in the registry.
  406. ConfigurationInfo - A pointer to the configuration information structure.
  407. Return Value:
  408. Status - STATUS_SUCCESS if everything OK, STATUS_INSUFFICIENT_RESOURCES
  409. otherwise.
  410. --*/
  411. {
  412. NDIS_HANDLE ConfigHandle;
  413. NDIS_STATUS Status;
  414. NDIS_STRING PSParamsKey = NDIS_STRING_CONST("PSched\\Parameters");
  415. #if DBG
  416. ULONG Size;
  417. NTSTATUS NtStatus;
  418. NDIS_STRING DebugLevelKey = NDIS_STRING_CONST("DebugLevel");
  419. NDIS_STRING DebugMaskKey = NDIS_STRING_CONST("DebugMask");
  420. NDIS_STRING TraceLogLevelKey = NDIS_STRING_CONST("TraceLogLevel");
  421. NDIS_STRING TraceLogMaskKey = NDIS_STRING_CONST("TraceLogMask");
  422. NDIS_STRING TraceBufferSizeKey = NDIS_STRING_CONST("TraceBufferSize");
  423. NDIS_STRING ClassificationTypeKey = NDIS_STRING_CONST("ClassificationType");
  424. #endif
  425. NdisOpenProtocolConfiguration(&Status, &ConfigHandle, &PSParamsKey);
  426. if(!NT_SUCCESS(Status))
  427. {
  428. PsDbgOut(DBG_CRITICAL_ERROR, DBG_INIT,
  429. ("[PsReadDriverRegistryDataInit]: cannot read registry \n"));
  430. return Status;
  431. }
  432. #if DBG
  433. PsReadRegistryInt(
  434. ConfigHandle,
  435. &DebugLevelKey,
  436. 0,
  437. &DbgTraceLevel,
  438. 0,
  439. 0xffffffff,
  440. FALSE,
  441. NULL,
  442. NULL,
  443. FALSE);
  444. PsReadRegistryInt(
  445. ConfigHandle,
  446. &DebugMaskKey,
  447. 0,
  448. &DbgTraceMask,
  449. 0,
  450. 0xffffffff,
  451. FALSE,
  452. NULL,
  453. NULL,
  454. FALSE);
  455. PsReadRegistryInt(
  456. ConfigHandle,
  457. &TraceLogLevelKey,
  458. DBG_VERBOSE,
  459. &LogTraceLevel,
  460. 0,
  461. 0xffffffff,
  462. FALSE,
  463. NULL,
  464. NULL,
  465. FALSE);
  466. PsReadRegistryInt(
  467. ConfigHandle,
  468. &TraceLogMaskKey,
  469. (DBG_INIT | DBG_IO | DBG_GPC_QOS | DBG_MINIPORT | DBG_PROTOCOL |
  470. DBG_VC | DBG_WMI | DBG_STATE | DBG_WAN),
  471. &LogTraceMask,
  472. 0,
  473. 0xffffffff,
  474. FALSE,
  475. NULL,
  476. NULL,
  477. FALSE);
  478. PsReadRegistryInt(
  479. ConfigHandle,
  480. &TraceBufferSizeKey,
  481. TRACE_BUFFER_SIZE,
  482. &Size,
  483. 0,
  484. 0xffffffff,
  485. FALSE,
  486. NULL,
  487. NULL,
  488. FALSE);
  489. PsReadRegistryInt(
  490. ConfigHandle,
  491. &ClassificationTypeKey,
  492. 0,
  493. &ClassificationType,
  494. 0,
  495. 0xffffffff,
  496. FALSE,
  497. NULL,
  498. NULL,
  499. FALSE);
  500. SchedInitialize(Size);
  501. #endif
  502. ReadProfiles(ConfigHandle);
  503. NdisCloseConfiguration( ConfigHandle );
  504. return STATUS_SUCCESS;
  505. }
  506. NDIS_STATUS
  507. PsReadDriverRegistryData(
  508. )
  509. {
  510. ULONG TimerResolution;
  511. ULONG desiredResolution;
  512. NDIS_STRING PSParamsKey = NDIS_STRING_CONST("PSched\\Parameters");
  513. NDIS_STRING TimerResolutionKey = NDIS_STRING_CONST("TimerResolution");
  514. NTSTATUS NtStatus;
  515. NDIS_HANDLE ConfigHandle;
  516. NDIS_STATUS Status;
  517. // No value was specified in the registry. Let's just keep it at the system's default.
  518. // But, we need to query this value so that we can respond correctly to OID_QOS_TIMER_RESOLUTION
  519. //
  520. if(gTimerSet)
  521. {
  522. //
  523. // Timer was set initially, but now it has been blown away. So, let's get back to the
  524. // system default.
  525. //
  526. gTimerSet = 0;
  527. gTimerResolutionActualTime = ExSetTimerResolution(0, FALSE);
  528. }
  529. else
  530. {
  531. //
  532. // Timer has never been set. Let's remember the system defaults.
  533. //
  534. gTimerResolutionActualTime = KeQueryTimeIncrement();
  535. }
  536. return STATUS_SUCCESS;
  537. }
  538. NDIS_STATUS
  539. PsReadAdapterRegistryDataInit(PADAPTER Adapter,
  540. PNDIS_STRING AdapterKey
  541. )
  542. {
  543. ULONG DisableDRR, IntermediateSystem;
  544. NTSTATUS NtStatus;
  545. NDIS_HANDLE ConfigHandle, ServiceKeyHandle;
  546. NDIS_STRING DisableDRRKey = NDIS_STRING_CONST("DisableDRR");
  547. NDIS_STRING IntermediateSystemKey = NDIS_STRING_CONST("IntermediateSystem");
  548. NDIS_STRING BestEffortLimitKey = NDIS_STRING_CONST("BestEffortLimit");
  549. NDIS_STRING ISSLOWTokenRateKey = NDIS_STRING_CONST("ISSLOWTokenRate");
  550. NDIS_STRING ISSLOWPacketSizeKey = NDIS_STRING_CONST("ISSLOWPacketSize");
  551. NDIS_STRING ISSLOWLinkSpeedKey = NDIS_STRING_CONST("ISSLOWLinkSpeed");
  552. NDIS_STRING ISSLOWFragmentSizeKey = NDIS_STRING_CONST("ISSLOWFragmentSize");
  553. NDIS_STRING BestEffortKey = NDIS_STRING_CONST("ServiceTypeBestEffort");
  554. NDIS_STRING NonConformingKey = NDIS_STRING_CONST("ServiceTypeNonConforming");
  555. NDIS_STRING ControlledLoadKey = NDIS_STRING_CONST("ServiceTypeControlledLoad");
  556. NDIS_STRING GuaranteedKey = NDIS_STRING_CONST("ServiceTypeGuaranteed");
  557. NDIS_STRING QualitativeKey = NDIS_STRING_CONST("ServiceTypeQualitative");
  558. NDIS_STRING NetworkControlKey = NDIS_STRING_CONST("ServiceTypeNetworkControl");
  559. NDIS_STRING ShapeDiscardModeKey = NDIS_STRING_CONST("ShapeDiscardMode");
  560. NDIS_STRING UpperBindingsKey = NDIS_STRING_CONST("UpperBindings");
  561. NDIS_STRING ProfileKey = NDIS_STRING_CONST("Profile");
  562. NDIS_STATUS Status;
  563. PAGED_CODE();
  564. NdisOpenProtocolConfiguration(&Status, &ConfigHandle, AdapterKey);
  565. if(Status != NDIS_STATUS_SUCCESS)
  566. {
  567. PsDbgOut(DBG_FAILURE, DBG_INIT ,
  568. ("[PsReadAdapterRegistryDataInit]: Adapter %08X, Could not open config handle \n",
  569. Adapter));
  570. return Status;
  571. }
  572. PsReadRegistryString(
  573. ConfigHandle,
  574. &UpperBindingsKey,
  575. &Adapter->UpperBinding);
  576. if(!Adapter->UpperBinding.Buffer)
  577. {
  578. PsAdapterWriteEventLog(
  579. (ULONG)EVENT_PS_MISSING_ADAPTER_REGISTRY_DATA,
  580. 0,
  581. &Adapter->MpDeviceName,
  582. 0,
  583. NULL);
  584. PsDbgOut(DBG_FAILURE, DBG_PROTOCOL | DBG_INIT,
  585. ("[PsReadAdapterRegistryDataInit]: Adapter %08X: Missing UpperBindings key ", Adapter));
  586. NdisCloseConfiguration(ConfigHandle);
  587. return NDIS_STATUS_FAILURE;
  588. }
  589. PsReadRegistryString(
  590. ConfigHandle,
  591. &ProfileKey,
  592. &Adapter->ProfileName);
  593. PsReadRegistryInt(
  594. ConfigHandle,
  595. &DisableDRRKey,
  596. 0,
  597. &DisableDRR,
  598. 0,
  599. 0xffffffff,
  600. FALSE,
  601. NULL,
  602. NULL,
  603. FALSE);
  604. PsReadRegistryInt(
  605. ConfigHandle,
  606. &IntermediateSystemKey,
  607. 0,
  608. &IntermediateSystem,
  609. 0,
  610. 0xffffffff,
  611. FALSE,
  612. NULL,
  613. NULL,
  614. FALSE);
  615. PsReadRegistryInt(
  616. ConfigHandle,
  617. &BestEffortLimitKey,
  618. UNSPECIFIED_RATE,
  619. &Adapter->BestEffortLimit,
  620. 0,
  621. 0xffffffff,
  622. FALSE,
  623. NULL,
  624. NULL,
  625. FALSE);
  626. //
  627. // Read the ISSLOW related parameters.
  628. //
  629. PsReadRegistryInt(
  630. ConfigHandle,
  631. &ISSLOWFragmentSizeKey,
  632. DEFAULT_ISSLOW_FRAGMENT_SIZE,
  633. &Adapter->ISSLOWFragmentSize,
  634. 0,
  635. 0xffffffff,
  636. FALSE,
  637. NULL,
  638. NULL,
  639. FALSE);
  640. PsReadRegistryInt(
  641. ConfigHandle,
  642. &ISSLOWTokenRateKey,
  643. DEFAULT_ISSLOW_TOKENRATE,
  644. &Adapter->ISSLOWTokenRate,
  645. 0,
  646. 0xffffffff,
  647. FALSE,
  648. NULL,
  649. NULL,
  650. FALSE);
  651. PsReadRegistryInt(
  652. ConfigHandle,
  653. &ISSLOWPacketSizeKey,
  654. DEFAULT_ISSLOW_PACKETSIZE,
  655. &Adapter->ISSLOWPacketSize,
  656. 0,
  657. 0xffffffff,
  658. FALSE,
  659. NULL,
  660. NULL,
  661. FALSE);
  662. PsReadRegistryInt(
  663. ConfigHandle,
  664. &ISSLOWLinkSpeedKey,
  665. DEFAULT_ISSLOW_LINKSPEED,
  666. &Adapter->ISSLOWLinkSpeed,
  667. 0,
  668. 0xffffffff,
  669. FALSE,
  670. NULL,
  671. NULL,
  672. FALSE);
  673. //
  674. // Read the ShapeDiscardMode for the service types.
  675. //
  676. NdisOpenConfigurationKeyByName(&Status,
  677. ConfigHandle,
  678. &ShapeDiscardModeKey,
  679. &ServiceKeyHandle);
  680. if(!NT_SUCCESS(Status))
  681. {
  682. PsDbgOut(DBG_FAILURE, DBG_PROTOCOL | DBG_INIT,
  683. ("[PsReadAdapterRegistryDataInit]: Adapter %08X, Using defaults for ShapeDiscardMode"
  684. "since key cannot be opened \n", Adapter));
  685. Adapter->SDModeGuaranteed = TC_NONCONF_SHAPE;
  686. Adapter->SDModeControlledLoad = TC_NONCONF_BORROW;
  687. Adapter->SDModeQualitative = TC_NONCONF_BORROW;
  688. Adapter->SDModeNetworkControl = TC_NONCONF_BORROW;
  689. }
  690. else
  691. {
  692. PsReadRegistryInt(
  693. ConfigHandle,
  694. &GuaranteedKey,
  695. TC_NONCONF_SHAPE,
  696. &Adapter->SDModeGuaranteed,
  697. TC_NONCONF_BORROW,
  698. TC_NONCONF_BORROW_PLUS,
  699. TRUE,
  700. &ShapeDiscardModeKey,
  701. ServiceKeyHandle,
  702. FALSE);
  703. PsReadRegistryInt(
  704. ConfigHandle,
  705. &ControlledLoadKey,
  706. TC_NONCONF_BORROW,
  707. &Adapter->SDModeControlledLoad,
  708. TC_NONCONF_BORROW,
  709. TC_NONCONF_BORROW_PLUS,
  710. TRUE,
  711. &ShapeDiscardModeKey,
  712. ServiceKeyHandle,
  713. FALSE);
  714. PsReadRegistryInt(
  715. ConfigHandle,
  716. &QualitativeKey,
  717. TC_NONCONF_BORROW,
  718. &Adapter->SDModeQualitative,
  719. TC_NONCONF_BORROW,
  720. TC_NONCONF_BORROW_PLUS,
  721. TRUE,
  722. &ShapeDiscardModeKey,
  723. ServiceKeyHandle,
  724. FALSE);
  725. PsReadRegistryInt(
  726. ConfigHandle,
  727. &NetworkControlKey,
  728. TC_NONCONF_BORROW,
  729. &Adapter->SDModeNetworkControl,
  730. TC_NONCONF_BORROW,
  731. TC_NONCONF_BORROW_PLUS,
  732. TRUE,
  733. &ShapeDiscardModeKey,
  734. ServiceKeyHandle,
  735. FALSE);
  736. NdisCloseConfiguration(ServiceKeyHandle);
  737. }
  738. NdisCloseConfiguration(ConfigHandle);
  739. if(DisableDRR)
  740. {
  741. Adapter->PipeFlags |= PS_DISABLE_DRR;
  742. }
  743. if(IntermediateSystem)
  744. {
  745. Adapter->PipeFlags |= PS_INTERMEDIATE_SYS;
  746. }
  747. return NDIS_STATUS_SUCCESS;
  748. }
  749. NDIS_STATUS
  750. PsReadAdapterRegistryData(PADAPTER Adapter,
  751. PNDIS_STRING MachineKey,
  752. PNDIS_STRING AdapterKey)
  753. /*++
  754. Routine Description:
  755. Obtain the PSched specific info associated with the underlying MP.
  756. Arguments:
  757. AdapterKey - location of the per adapter key in the registry
  758. MachineKey - location of the per Machine key in the registry
  759. Adapter - pointer to the adapter structure
  760. Return Value:
  761. NDIS_STATUS_SUCCESS if everything worked ok
  762. --*/
  763. {
  764. NDIS_STRING BestEffortKey = NDIS_STRING_CONST("ServiceTypeBestEffort");
  765. NDIS_STRING NonConformingKey = NDIS_STRING_CONST("ServiceTypeNonConforming");
  766. NDIS_STRING ControlledLoadKey = NDIS_STRING_CONST("ServiceTypeControlledLoad");
  767. NDIS_STRING GuaranteedKey = NDIS_STRING_CONST("ServiceTypeGuaranteed");
  768. NDIS_STRING QualitativeKey = NDIS_STRING_CONST("ServiceTypeQualitative");
  769. NDIS_STRING NetworkControlKey = NDIS_STRING_CONST("ServiceTypeNetworkControl");
  770. NDIS_STRING TcpTrafficKey = NDIS_STRING_CONST("ServiceTypeTcpTraffic");
  771. NDIS_STRING MaxOutstandingSendsKey = NDIS_STRING_CONST("MaxOutstandingSends");
  772. NDIS_STRING NonBestEffortLimitKey = NDIS_STRING_CONST("NonBestEffortLimit");
  773. NDIS_STRING DiffservKeyC = NDIS_STRING_CONST("DiffservByteMappingConforming");
  774. NDIS_STRING DiffservKeyNC = NDIS_STRING_CONST("DiffservByteMappingNonConforming");
  775. NDIS_STRING UserKey = NDIS_STRING_CONST("UserPriorityMapping");
  776. NDIS_STATUS Status;
  777. NDIS_HANDLE SubKeyHandle, ConfigHandle;
  778. ULONG Value;
  779. PAGED_CODE();
  780. PsDbgOut(DBG_INFO, DBG_INIT | DBG_ZAW,
  781. ("\n [PsReadAdapterRegistryData]: Adapter %08X (%ws): Reading Registry Data \n",
  782. Adapter, Adapter->RegistryPath.Buffer));
  783. NdisOpenProtocolConfiguration(&Status, &ConfigHandle, &Adapter->RegistryPath);
  784. if(Status != NDIS_STATUS_SUCCESS)
  785. {
  786. PsDbgOut(DBG_FAILURE, DBG_INIT | DBG_ZAW,
  787. ("[PsReadAdapterRegistryData]: Adapter %08X, Could not open config handle \n",
  788. Adapter));
  789. return Status;
  790. }
  791. PsReadRegistryInt(ConfigHandle,
  792. &MaxOutstandingSendsKey,
  793. DEFAULT_MAX_OUTSTANDING_SENDS,
  794. &Adapter->MaxOutstandingSends,
  795. 1,
  796. 0xffffffff,
  797. FALSE,
  798. NULL,
  799. NULL,
  800. TRUE);
  801. PsReadRegistryInt(ConfigHandle,
  802. &NonBestEffortLimitKey,
  803. RESERVABLE_FRACTION,
  804. &Adapter->ReservationLimitValue,
  805. 0,
  806. 200,
  807. FALSE,
  808. NULL,
  809. NULL,
  810. TRUE);
  811. //
  812. // Read the conforming values of DiffservByteMapping.
  813. //
  814. NdisOpenConfigurationKeyByName(&Status,
  815. ConfigHandle,
  816. &DiffservKeyC,
  817. &SubKeyHandle);
  818. if(!NT_SUCCESS(Status))
  819. {
  820. PsDbgOut(DBG_FAILURE, DBG_PROTOCOL | DBG_INIT,
  821. ("[PsReadAdapterRegistryData]: Adapter %08X, Using defaults for "
  822. "DiffservByteMappingConforming since key cannot be opened \n", Adapter));
  823. Adapter->IPServiceTypeBestEffort = PS_IP_SERVICETYPE_CONFORMING_BESTEFFORT_DEFAULT;
  824. Adapter->IPServiceTypeControlledLoad = PS_IP_SERVICETYPE_CONFORMING_CONTROLLEDLOAD_DEFAULT;
  825. Adapter->IPServiceTypeGuaranteed = PS_IP_SERVICETYPE_CONFORMING_GUARANTEED_DEFAULT;
  826. Adapter->IPServiceTypeQualitative = PS_IP_SERVICETYPE_CONFORMING_QUALITATIVE_DEFAULT;
  827. Adapter->IPServiceTypeNetworkControl = PS_IP_SERVICETYPE_CONFORMING_NETWORK_CONTROL_DEFAULT;
  828. Adapter->IPServiceTypeTcpTraffic = PS_IP_SERVICETYPE_CONFORMING_TCPTRAFFIC_DEFAULT;
  829. }
  830. else
  831. {
  832. PsReadRegistryInt(ConfigHandle,
  833. &TcpTrafficKey,
  834. PS_IP_SERVICETYPE_CONFORMING_TCPTRAFFIC_DEFAULT,
  835. &Value,
  836. 0,
  837. PREC_MAX_VALUE,
  838. TRUE,
  839. &DiffservKeyC,
  840. SubKeyHandle,
  841. TRUE);
  842. Adapter->IPServiceTypeTcpTraffic = (UCHAR)Value;
  843. PsReadRegistryInt(ConfigHandle,
  844. &BestEffortKey,
  845. PS_IP_SERVICETYPE_CONFORMING_BESTEFFORT_DEFAULT,
  846. &Value,
  847. 0,
  848. PREC_MAX_VALUE,
  849. TRUE,
  850. &DiffservKeyC,
  851. SubKeyHandle,
  852. TRUE);
  853. Adapter->IPServiceTypeBestEffort = (UCHAR)Value;
  854. PsReadRegistryInt(ConfigHandle,
  855. &ControlledLoadKey,
  856. PS_IP_SERVICETYPE_CONFORMING_CONTROLLEDLOAD_DEFAULT,
  857. &Value,
  858. 0,
  859. PREC_MAX_VALUE,
  860. TRUE,
  861. &DiffservKeyC,
  862. SubKeyHandle,
  863. TRUE);
  864. Adapter->IPServiceTypeControlledLoad = (UCHAR)Value;
  865. PsReadRegistryInt(ConfigHandle,
  866. &GuaranteedKey,
  867. PS_IP_SERVICETYPE_CONFORMING_GUARANTEED_DEFAULT,
  868. &Value,
  869. 0,
  870. PREC_MAX_VALUE,
  871. TRUE,
  872. &DiffservKeyC,
  873. SubKeyHandle,
  874. TRUE);
  875. Adapter->IPServiceTypeGuaranteed = (UCHAR)Value;
  876. PsReadRegistryInt(ConfigHandle,
  877. &QualitativeKey,
  878. PS_IP_SERVICETYPE_CONFORMING_QUALITATIVE_DEFAULT,
  879. &Value,
  880. 0,
  881. PREC_MAX_VALUE,
  882. TRUE,
  883. &DiffservKeyC,
  884. SubKeyHandle,
  885. TRUE);
  886. Adapter->IPServiceTypeQualitative = (UCHAR)Value;
  887. PsReadRegistryInt(ConfigHandle,
  888. &NetworkControlKey,
  889. PS_IP_SERVICETYPE_CONFORMING_NETWORK_CONTROL_DEFAULT,
  890. &Value,
  891. 0,
  892. PREC_MAX_VALUE,
  893. TRUE,
  894. &DiffservKeyC,
  895. SubKeyHandle,
  896. TRUE);
  897. Adapter->IPServiceTypeNetworkControl = (UCHAR)Value;
  898. NdisCloseConfiguration(SubKeyHandle);
  899. }
  900. //
  901. // Read the non-conforming values of DiffservByteMapping.
  902. //
  903. NdisOpenConfigurationKeyByName(&Status,
  904. ConfigHandle,
  905. &DiffservKeyNC,
  906. &SubKeyHandle);
  907. if(!NT_SUCCESS(Status))
  908. {
  909. PsDbgOut(DBG_FAILURE, DBG_PROTOCOL | DBG_INIT,
  910. ("[PsReadAdapterRegistryData]: Adapter %08X, Using defaults for "
  911. "DiffservByteMappingNonConforming since key cannot be opened \n", Adapter));
  912. Adapter->IPServiceTypeBestEffortNC = PS_IP_SERVICETYPE_NONCONFORMING_BESTEFFORT_DEFAULT;
  913. Adapter->IPServiceTypeControlledLoadNC = PS_IP_SERVICETYPE_NONCONFORMING_CONTROLLEDLOAD_DEFAULT;
  914. Adapter->IPServiceTypeGuaranteedNC = PS_IP_SERVICETYPE_NONCONFORMING_GUARANTEED_DEFAULT;
  915. Adapter->IPServiceTypeQualitativeNC = PS_IP_SERVICETYPE_NONCONFORMING_QUALITATIVE_DEFAULT;
  916. Adapter->IPServiceTypeNetworkControlNC = PS_IP_SERVICETYPE_NONCONFORMING_BESTEFFORT_DEFAULT;
  917. Adapter->IPServiceTypeTcpTrafficNC = PS_IP_SERVICETYPE_NONCONFORMING_TCPTRAFFIC_DEFAULT;
  918. }
  919. else
  920. {
  921. PsReadRegistryInt(ConfigHandle,
  922. &TcpTrafficKey,
  923. PS_IP_SERVICETYPE_NONCONFORMING_TCPTRAFFIC_DEFAULT,
  924. &Value,
  925. 0,
  926. PREC_MAX_VALUE,
  927. TRUE,
  928. &DiffservKeyNC,
  929. SubKeyHandle,
  930. TRUE);
  931. Adapter->IPServiceTypeTcpTrafficNC = (UCHAR)Value;
  932. PsReadRegistryInt(ConfigHandle,
  933. &BestEffortKey,
  934. PS_IP_SERVICETYPE_NONCONFORMING_BESTEFFORT_DEFAULT,
  935. &Value,
  936. 0,
  937. PREC_MAX_VALUE,
  938. TRUE,
  939. &DiffservKeyNC,
  940. SubKeyHandle,
  941. TRUE);
  942. Adapter->IPServiceTypeBestEffortNC = (UCHAR)Value;
  943. PsReadRegistryInt(ConfigHandle,
  944. &ControlledLoadKey,
  945. PS_IP_SERVICETYPE_NONCONFORMING_CONTROLLEDLOAD_DEFAULT,
  946. &Value,
  947. 0,
  948. PREC_MAX_VALUE,
  949. TRUE,
  950. &DiffservKeyNC,
  951. SubKeyHandle,
  952. TRUE);
  953. Adapter->IPServiceTypeControlledLoadNC = (UCHAR)Value;
  954. PsReadRegistryInt(ConfigHandle,
  955. &GuaranteedKey,
  956. PS_IP_SERVICETYPE_NONCONFORMING_GUARANTEED_DEFAULT,
  957. &Value,
  958. 0,
  959. PREC_MAX_VALUE,
  960. TRUE,
  961. &DiffservKeyNC,
  962. SubKeyHandle,
  963. TRUE);
  964. Adapter->IPServiceTypeGuaranteedNC = (UCHAR)Value;
  965. PsReadRegistryInt(ConfigHandle,
  966. &QualitativeKey,
  967. PS_IP_SERVICETYPE_NONCONFORMING_QUALITATIVE_DEFAULT,
  968. &Value,
  969. 0,
  970. PREC_MAX_VALUE,
  971. TRUE,
  972. &DiffservKeyNC,
  973. SubKeyHandle,
  974. TRUE);
  975. Adapter->IPServiceTypeQualitativeNC = (UCHAR)Value;
  976. PsReadRegistryInt(ConfigHandle,
  977. &NetworkControlKey,
  978. PS_IP_SERVICETYPE_NONCONFORMING_NETWORK_CONTROL_DEFAULT,
  979. &Value,
  980. 0,
  981. PREC_MAX_VALUE,
  982. TRUE,
  983. &DiffservKeyNC,
  984. SubKeyHandle,
  985. TRUE);
  986. Adapter->IPServiceTypeNetworkControlNC = (UCHAR)Value;
  987. NdisCloseConfiguration(SubKeyHandle);
  988. }
  989. //
  990. // Read the 802.1p values. The nonconforming in 802.1p does not depend on the
  991. // service type.
  992. //
  993. NdisOpenConfigurationKeyByName(&Status,
  994. ConfigHandle,
  995. &UserKey,
  996. &SubKeyHandle);
  997. if(!NT_SUCCESS(Status))
  998. {
  999. PsDbgOut(DBG_FAILURE, DBG_PROTOCOL | DBG_INIT,
  1000. ("[PsReadAdapterRegistryData]: Adapter %08X, Using defaults for "
  1001. "UserPriorityMapping since key cannot be opened \n", Adapter));
  1002. Adapter->UserServiceTypeBestEffort = PS_USER_SERVICETYPE_BESTEFFORT_DEFAULT;
  1003. Adapter->UserServiceTypeControlledLoad = PS_USER_SERVICETYPE_CONTROLLEDLOAD_DEFAULT;
  1004. Adapter->UserServiceTypeGuaranteed = PS_USER_SERVICETYPE_GUARANTEED_DEFAULT;
  1005. Adapter->UserServiceTypeQualitative = PS_USER_SERVICETYPE_QUALITATIVE_DEFAULT;
  1006. Adapter->UserServiceTypeNetworkControl = PS_USER_SERVICETYPE_NETWORK_CONTROL_DEFAULT;
  1007. Adapter->UserServiceTypeNonConforming = PS_USER_SERVICETYPE_NONCONFORMING_DEFAULT;
  1008. Adapter->UserServiceTypeTcpTraffic = PS_USER_SERVICETYPE_TCPTRAFFIC_DEFAULT;
  1009. }
  1010. else
  1011. {
  1012. PsReadRegistryInt(ConfigHandle,
  1013. &TcpTrafficKey,
  1014. PS_USER_SERVICETYPE_TCPTRAFFIC_DEFAULT,
  1015. &Value,
  1016. 0,
  1017. USER_PRIORITY_MAX_VALUE,
  1018. TRUE,
  1019. &UserKey,
  1020. SubKeyHandle,
  1021. TRUE);
  1022. Adapter->UserServiceTypeTcpTraffic = (UCHAR)Value;
  1023. PsReadRegistryInt(ConfigHandle,
  1024. &BestEffortKey,
  1025. PS_USER_SERVICETYPE_BESTEFFORT_DEFAULT,
  1026. &Value,
  1027. 0,
  1028. USER_PRIORITY_MAX_VALUE,
  1029. TRUE,
  1030. &UserKey,
  1031. SubKeyHandle,
  1032. TRUE);
  1033. Adapter->UserServiceTypeBestEffort = (UCHAR)Value;
  1034. PsReadRegistryInt(ConfigHandle,
  1035. &ControlledLoadKey,
  1036. PS_USER_SERVICETYPE_CONTROLLEDLOAD_DEFAULT,
  1037. &Value,
  1038. 0,
  1039. USER_PRIORITY_MAX_VALUE,
  1040. TRUE,
  1041. &UserKey,
  1042. SubKeyHandle,
  1043. TRUE);
  1044. Adapter->UserServiceTypeControlledLoad = (UCHAR)Value;
  1045. PsReadRegistryInt(ConfigHandle,
  1046. &GuaranteedKey,
  1047. PS_USER_SERVICETYPE_GUARANTEED_DEFAULT,
  1048. &Value,
  1049. 0,
  1050. USER_PRIORITY_MAX_VALUE,
  1051. TRUE,
  1052. &UserKey,
  1053. SubKeyHandle,
  1054. TRUE);
  1055. Adapter->UserServiceTypeGuaranteed = (UCHAR)Value;
  1056. PsReadRegistryInt(ConfigHandle,
  1057. &QualitativeKey,
  1058. PS_USER_SERVICETYPE_QUALITATIVE_DEFAULT,
  1059. &Value,
  1060. 0,
  1061. USER_PRIORITY_MAX_VALUE,
  1062. TRUE,
  1063. &UserKey,
  1064. SubKeyHandle,
  1065. TRUE);
  1066. Adapter->UserServiceTypeQualitative = (UCHAR)Value;
  1067. PsReadRegistryInt(ConfigHandle,
  1068. &NonConformingKey,
  1069. PS_USER_SERVICETYPE_NONCONFORMING_DEFAULT,
  1070. &Value,
  1071. 0,
  1072. USER_PRIORITY_MAX_VALUE,
  1073. TRUE,
  1074. &UserKey,
  1075. SubKeyHandle,
  1076. TRUE);
  1077. Adapter->UserServiceTypeNonConforming = (UCHAR)Value;
  1078. PsReadRegistryInt(ConfigHandle,
  1079. &NetworkControlKey,
  1080. PS_USER_SERVICETYPE_NETWORK_CONTROL_DEFAULT,
  1081. &Value,
  1082. 0,
  1083. USER_PRIORITY_MAX_VALUE,
  1084. TRUE,
  1085. &UserKey,
  1086. SubKeyHandle,
  1087. TRUE);
  1088. Adapter->UserServiceTypeNetworkControl = (UCHAR)Value;
  1089. NdisCloseConfiguration(SubKeyHandle);
  1090. }
  1091. //
  1092. // Now, we need to take this number, swap the bits around and put it in the higher order bits.
  1093. // The DSCP codepoint is as follows:
  1094. //
  1095. // --------------------------------
  1096. // Bits | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  1097. // --------------------------------
  1098. // | DSCP | CU |
  1099. // --------------------------------
  1100. //
  1101. // Where DSCP - Differentiated services code point
  1102. // CU - Currently unused.
  1103. //
  1104. Adapter->IPServiceTypeBestEffort = Adapter->IPServiceTypeBestEffort << 2;
  1105. Adapter->IPServiceTypeControlledLoad = Adapter->IPServiceTypeControlledLoad << 2;
  1106. Adapter->IPServiceTypeGuaranteed = Adapter->IPServiceTypeGuaranteed << 2;
  1107. Adapter->IPServiceTypeQualitative = Adapter->IPServiceTypeQualitative << 2;
  1108. Adapter->IPServiceTypeNetworkControl = Adapter->IPServiceTypeNetworkControl << 2;
  1109. Adapter->IPServiceTypeBestEffortNC = Adapter->IPServiceTypeBestEffortNC << 2;
  1110. Adapter->IPServiceTypeControlledLoadNC = Adapter->IPServiceTypeControlledLoadNC << 2;
  1111. Adapter->IPServiceTypeGuaranteedNC = Adapter->IPServiceTypeGuaranteedNC << 2;
  1112. Adapter->IPServiceTypeQualitativeNC = Adapter->IPServiceTypeQualitativeNC << 2;
  1113. Adapter->IPServiceTypeNetworkControlNC = Adapter->IPServiceTypeNetworkControlNC << 2;
  1114. Adapter->IPServiceTypeTcpTraffic = Adapter->IPServiceTypeTcpTraffic << 2;
  1115. Adapter->IPServiceTypeTcpTrafficNC = Adapter->IPServiceTypeTcpTrafficNC << 2;
  1116. NdisCloseConfiguration(ConfigHandle);
  1117. return NDIS_STATUS_SUCCESS;
  1118. }