00773 {
00774
NTSTATUS status;
00775 HANDLE dgHandle;
00776 HANDLE keyHandle;
00777 OBJECT_ATTRIBUTES objectAttributes;
00778 IO_STATUS_BLOCK ioStatusBlock;
00779 UNICODE_STRING string;
00780 UNICODE_STRING computerName;
00781 UNICODE_STRING domainName;
00782 PUCHAR buffer;
00783 ULONG bufferLength;
00784 PLMR_REQUEST_PACKET rrp;
00785 PLMDR_REQUEST_PACKET drrp;
00786 WKSTA_INFO_502 wkstaConfig;
00787 WKSTA_TRANSPORT_INFO_0 wkstaTransportInfo;
00788 LARGE_INTEGER interval;
00789 ULONG length;
00790 PKEY_VALUE_PARTIAL_INFORMATION keyValue;
00791 BOOLEAN startDatagramReceiver;
00792 ULONG enumerateAttempts;
00793
#if defined(REMOTE_BOOT)
00794
PWSTR NetHDCSCPartition;
00795 BOOLEAN leaveRdrHandleOpen;
00796 BOOLEAN pinNetDriver;
00797
#else
00798
HANDLE RdrHandle;
00799
#endif // defined(REMOTE_BOOT)
00800
00801
00802
00803
00804
00805 buffer =
NULL;
00806 computerName.Buffer =
NULL;
00807 domainName.Buffer =
NULL;
00808 dgHandle =
NULL;
00809 RdrHandle =
NULL;
00810
#if defined(REMOTE_BOOT)
00811
NetHDCSCPartition =
NULL;
00812 leaveRdrHandleOpen =
FALSE;
00813 pinNetDriver =
FALSE;
00814
#endif // defined(REMOTE_BOOT)
00815
00816
00817
00818
00819
00820
00821 bufferLength =
max(
sizeof(LMR_REQUEST_PACKET) + (MAX_PATH + 1) *
sizeof(WCHAR) +
00822 (DNLEN + 1) *
sizeof(WCHAR),
00823
max(
sizeof(LMDR_REQUEST_PACKET),
00824 FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data) + MAX_PATH));
00825 bufferLength =
max(bufferLength,
sizeof(LMMR_RI_INITIALIZE_SECRET));
00826
00827
#if defined(REMOTE_BOOT)
00828
NetHDCSCPartition =
ExAllocatePoolWithTag(
00829 NonPagedPool,
00830 (80 *
sizeof(WCHAR)) + bufferLength,
00831 'bRoI'
00832 );
00833
if (NetHDCSCPartition ==
NULL) {
00834 KdPrint((
"IopStartNetworkForRemoteBoot: Unable to allocate buffer\n"));
00835 status = STATUS_INSUFFICIENT_RESOURCES;
00836
goto cleanup;
00837 }
00838 buffer = (PUCHAR)(NetHDCSCPartition + 80);
00839
#else
00840
buffer =
ExAllocatePoolWithTag( NonPagedPool, bufferLength, 'bRoI' );
00841
if (buffer ==
NULL) {
00842 KdPrint((
"IopStartNetworkForRemoteBoot: Unable to allocate buffer\n"));
00843 status = STATUS_INSUFFICIENT_RESOURCES;
00844
goto cleanup;
00845 }
00846
#endif // defined(REMOTE_BOOT)
00847
00848 rrp = (PLMR_REQUEST_PACKET)buffer;
00849 drrp = (PLMDR_REQUEST_PACKET)buffer;
00850
00851
00852
00853
00854
00855
RtlInitUnicodeString( &string, L
"\\Device\\LanmanRedirector" );
00856
00857 InitializeObjectAttributes(
00858 &objectAttributes,
00859 &string,
00860 OBJ_CASE_INSENSITIVE,
00861 NULL,
00862 NULL
00863 );
00864
00865 status =
NtCreateFile(
00866 &RdrHandle,
00867 GENERIC_READ | GENERIC_WRITE,
00868 &objectAttributes,
00869 &ioStatusBlock,
00870 NULL,
00871 0,
00872 FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
00873 FILE_OPEN,
00874 FILE_SYNCHRONOUS_IO_NONALERT,
00875 NULL,
00876 0
00877 );
00878
if ( !
NT_SUCCESS(status) ) {
00879 KdPrint((
"IopStartNetworkForRemoteBoot: Unable to open redirector: %x\n", status ));
00880
goto cleanup;
00881 }
00882
00883
#if defined(REMOTE_BOOT)
00884
RdrHandleProcess = &
IoGetCurrentProcess()->
Pcb;
00885
#endif // defined(REMOTE_BOOT)
00886
00887
RtlInitUnicodeString( &string, DD_BROWSER_DEVICE_NAME_U );
00888
00889 InitializeObjectAttributes(
00890 &objectAttributes,
00891 &string,
00892 OBJ_CASE_INSENSITIVE,
00893 NULL,
00894 NULL
00895 );
00896
00897 status =
NtCreateFile(
00898 &dgHandle,
00899 GENERIC_READ | GENERIC_WRITE,
00900 &objectAttributes,
00901 &ioStatusBlock,
00902 NULL,
00903 0,
00904 FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
00905 FILE_OPEN,
00906 FILE_SYNCHRONOUS_IO_NONALERT,
00907 NULL,
00908 0
00909 );
00910
if ( !
NT_SUCCESS(status) ) {
00911 KdPrint((
"IopStartNetworkForRemoteBoot: Unable to open datagram receiver: %x\n", status ));
00912
goto cleanup;
00913 }
00914
00915
00916
00917
00918
00919
00920
00921
#if defined(REMOTE_BOOT)
00922
if (LoaderBlock->
SetupLoaderBlock->
NetBootSecret)
00923
#endif // defined(REMOTE_BOOT)
00924
{
00925 PLMMR_RI_INITIALIZE_SECRET RbInit = (PLMMR_RI_INITIALIZE_SECRET)buffer;
00926
00927
ASSERT(LoaderBlock->
SetupLoaderBlock->
NetBootSecret != NULL);
00928 RtlCopyMemory(
00929 &RbInit->Secret,
00930 LoaderBlock->
SetupLoaderBlock->
NetBootSecret,
00931
sizeof(RI_SECRET));
00932
#if defined(REMOTE_BOOT)
00933
RbInit->UsePassword2 = LoaderBlock->
SetupLoaderBlock->NetBootUsePassword2;
00934
#endif // defined(REMOTE_BOOT)
00935
00936 status =
NtFsControlFile(
00937 RdrHandle,
00938 NULL,
00939 NULL,
00940 NULL,
00941 &ioStatusBlock,
00942 FSCTL_LMMR_RI_INITIALIZE_SECRET,
00943 buffer,
00944
sizeof(LMMR_RI_INITIALIZE_SECRET),
00945 NULL,
00946 0
00947 );
00948
00949
if (
NT_SUCCESS(status) ) {
00950 status = ioStatusBlock.Status;
00951 }
00952
if ( !
NT_SUCCESS(status) ) {
00953 KdPrint((
"IopStartNetworkForRemoteBoot: Unable to FSCTL(RB initialize) redirector: %x\n", status ));
00954
goto cleanup;
00955 }
00956 }
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967
00968
RtlInitUnicodeString( &string, L
"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\ComputerName\\ComputerName" );
00969
00970 InitializeObjectAttributes(
00971 &objectAttributes,
00972 &string,
00973 OBJ_CASE_INSENSITIVE,
00974 NULL,
00975 NULL
00976 );
00977
00978 status =
NtOpenKey( &keyHandle, KEY_ALL_ACCESS, &objectAttributes );
00979
if ( !
NT_SUCCESS(status) ) {
00980 KdPrint((
"IopStartNetworkForRemoteBoot: Unable to open ComputerName key: %x\n", status ));
00981
goto cleanup;
00982 }
00983
00984
RtlInitUnicodeString( &string, L
"ComputerName" );
00985
00986 keyValue = (PKEY_VALUE_PARTIAL_INFORMATION)buffer;
00987 RtlZeroMemory(buffer, bufferLength);
00988
00989 status =
NtQueryValueKey(
00990 keyHandle,
00991 &string,
00992 KeyValuePartialInformation,
00993 keyValue,
00994 bufferLength,
00995 &length);
00996
00997
NtClose( keyHandle );
00998
if ( !
NT_SUCCESS(status) ) {
00999 KdPrint((
"IopStartNetworkForRemoteBoot: Unable to query ComputerName value: %x\n", status ));
01000
goto cleanup;
01001 }
01002
01003
if ( !
RtlCreateUnicodeString(&computerName, (PWSTR)keyValue->Data) ) {
01004 KdPrint((
"IopStartNetworkForRemoteBoot: Unable to create ComputerName string\n" ));
01005 status = STATUS_INSUFFICIENT_RESOURCES;
01006
goto cleanup;
01007 }
01008
01009 domainName.Length = 0;
01010
01011
RtlInitUnicodeString( &string, L
"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\ComputerName\\DomainName" );
01012
01013 InitializeObjectAttributes(
01014 &objectAttributes,
01015 &string,
01016 OBJ_CASE_INSENSITIVE,
01017 NULL,
01018 NULL
01019 );
01020
01021 status =
NtOpenKey( &keyHandle, KEY_ALL_ACCESS, &objectAttributes );
01022
if ( !
NT_SUCCESS(status) ) {
01023 KdPrint((
"IopStartNetworkForRemoteBoot: Unable to open DomainName key: %x\n", status ));
01024 startDatagramReceiver =
FALSE;
01025 }
else {
01026
01027
RtlInitUnicodeString( &string, L
"DomainName" );
01028
01029 keyValue = (PKEY_VALUE_PARTIAL_INFORMATION)buffer;
01030 RtlZeroMemory(buffer, bufferLength);
01031
01032 status =
NtQueryValueKey(
01033 keyHandle,
01034 &string,
01035 KeyValuePartialInformation,
01036 keyValue,
01037 bufferLength,
01038 &length);
01039
01040
NtClose( keyHandle );
01041
if ( !
NT_SUCCESS(status) ) {
01042 KdPrint((
"IopStartNetworkForRemoteBoot: Unable to query Domain value: %x\n", status ));
01043 startDatagramReceiver =
FALSE;
01044 }
else {
01045
if ( !
RtlCreateUnicodeString(&domainName, (PWSTR)keyValue->Data) ) {
01046 KdPrint((
"IopStartNetworkForRemoteBoot: Unable to create DomainName string\n" ));
01047 status = STATUS_INSUFFICIENT_RESOURCES;
01048
goto cleanup;
01049 }
01050 startDatagramReceiver =
TRUE;
01051 }
01052 }
01053
01054
01055
01056
01057
01058 rrp->Type = ConfigInformation;
01059 rrp->Version = REQUEST_PACKET_VERSION;
01060
01061 rrp->Parameters.Start.RedirectorNameLength = computerName.Length;
01062 RtlCopyMemory(rrp->Parameters.Start.RedirectorName,
01063 computerName.Buffer,
01064 computerName.Length);
01065
01066 rrp->Parameters.Start.DomainNameLength = domainName.Length;
01067 RtlCopyMemory(((PUCHAR)rrp->Parameters.Start.RedirectorName) + computerName.Length,
01068 domainName.Buffer,
01069 domainName.Length);
01070
01071
RtlFreeUnicodeString(&computerName);
01072
RtlFreeUnicodeString(&domainName);
01073
01074 wkstaConfig.wki502_char_wait = 3600;
01075 wkstaConfig.wki502_maximum_collection_count = 16;
01076 wkstaConfig.wki502_collection_time = 250;
01077 wkstaConfig.wki502_keep_conn = 600;
01078 wkstaConfig.wki502_max_cmds = 5;
01079 wkstaConfig.wki502_sess_timeout = 45;
01080 wkstaConfig.wki502_siz_char_buf = 512;
01081 wkstaConfig.wki502_max_threads = 17;
01082 wkstaConfig.wki502_lock_quota = 6144;
01083 wkstaConfig.wki502_lock_increment = 10;
01084 wkstaConfig.wki502_lock_maximum = 500;
01085 wkstaConfig.wki502_pipe_increment = 10;
01086 wkstaConfig.wki502_pipe_maximum = 500;
01087 wkstaConfig.wki502_cache_file_timeout = 40;
01088 wkstaConfig.wki502_dormant_file_limit = 45;
01089 wkstaConfig.wki502_read_ahead_throughput = MAXULONG;
01090 wkstaConfig.wki502_num_mailslot_buffers = 3;
01091 wkstaConfig.wki502_num_srv_announce_buffers = 20;
01092 wkstaConfig.wki502_max_illegal_datagram_events = 5;
01093 wkstaConfig.wki502_illegal_datagram_event_reset_frequency = 60;
01094 wkstaConfig.wki502_log_election_packets =
FALSE;
01095 wkstaConfig.wki502_use_opportunistic_locking =
TRUE;
01096 wkstaConfig.wki502_use_unlock_behind =
TRUE;
01097 wkstaConfig.wki502_use_close_behind =
TRUE;
01098 wkstaConfig.wki502_buf_named_pipes =
TRUE;
01099 wkstaConfig.wki502_use_lock_read_unlock =
TRUE;
01100 wkstaConfig.wki502_utilize_nt_caching =
TRUE;
01101 wkstaConfig.wki502_use_raw_read =
TRUE;
01102 wkstaConfig.wki502_use_raw_write =
TRUE;
01103 wkstaConfig.wki502_use_write_raw_data =
TRUE;
01104 wkstaConfig.wki502_use_encryption =
TRUE;
01105 wkstaConfig.wki502_buf_files_deny_write =
TRUE;
01106 wkstaConfig.wki502_buf_read_only_files =
TRUE;
01107 wkstaConfig.wki502_force_core_create_mode =
TRUE;
01108 wkstaConfig.wki502_use_512_byte_max_transfer =
FALSE;
01109
01110 status =
NtFsControlFile(
01111 RdrHandle,
01112 NULL,
01113 NULL,
01114 NULL,
01115 &ioStatusBlock,
01116 FSCTL_LMR_START | 0x80000000,
01117 rrp,
01118
sizeof(LMR_REQUEST_PACKET) +
01119 rrp->Parameters.Start.RedirectorNameLength +
01120 rrp->Parameters.Start.DomainNameLength,
01121 &wkstaConfig,
01122
sizeof(wkstaConfig)
01123 );
01124
01125
if (
NT_SUCCESS(status) ) {
01126 status = ioStatusBlock.Status;
01127 }
01128
if ( !
NT_SUCCESS(status) ) {
01129 KdPrint((
"IopStartNetworkForRemoteBoot: Unable to FSCTL(start) redirector: %x\n", status ));
01130
goto cleanup;
01131 }
01132
01133
if (startDatagramReceiver) {
01134
01135
01136
01137
01138
01139 drrp->Version = LMDR_REQUEST_PACKET_VERSION;
01140
01141 drrp->Parameters.Start.NumberOfMailslotBuffers = 16;
01142 drrp->Parameters.Start.NumberOfServerAnnounceBuffers = 20;
01143 drrp->Parameters.Start.IllegalDatagramThreshold = 5;
01144 drrp->Parameters.Start.EventLogResetFrequency = 60;
01145 drrp->Parameters.Start.LogElectionPackets =
FALSE;
01146
01147 drrp->Parameters.Start.IsLanManNt =
FALSE;
01148
01149 status =
NtDeviceIoControlFile(
01150 dgHandle,
01151 NULL,
01152 NULL,
01153 NULL,
01154 &ioStatusBlock,
01155 IOCTL_LMDR_START,
01156 drrp,
01157
sizeof(LMDR_REQUEST_PACKET),
01158 NULL,
01159 0
01160 );
01161
01162
if (
NT_SUCCESS(status) ) {
01163 status = ioStatusBlock.Status;
01164 }
01165
01166
NtClose( dgHandle );
01167 dgHandle =
NULL;
01168
01169
if ( !
NT_SUCCESS(status) ) {
01170 KdPrint((
"IopStartNetworkForRemoteBoot: Unable to IOCTL(start) datagram receiver: %x\n", status ));
01171
goto cleanup;
01172 }
01173
01174 }
else {
01175
01176
NtClose( dgHandle );
01177 dgHandle =
NULL;
01178
01179
01180
01181
01182
01183
01184
01185
01186
01187
01188 status =
NtFsControlFile(
01189 RdrHandle,
01190 NULL,
01191 NULL,
01192 NULL,
01193 &ioStatusBlock,
01194 FSCTL_LMR_BIND_TO_TRANSPORT | 0x80000000,
01195 NULL,
01196 0,
01197 NULL,
01198 0
01199 );
01200
01201
if (
NT_SUCCESS(status) ) {
01202 status = ioStatusBlock.Status;
01203 }
01204
01205
if ( !
NT_SUCCESS(status) ) {
01206 KdPrint((
"IopStartNetworkForRemoteBoot: Unable to FSCTL(bind) redirector: %x\n", status ));
01207
goto cleanup;
01208 }
01209 }
01210
01211
#if defined(REMOTE_BOOT)
01212
if (((LoaderBlock->
SetupLoaderBlock->
Flags &
SETUPBLK_FLAGS_IS_TEXTMODE) == 0) &&
01213 ((LoaderBlock->
SetupLoaderBlock->
Flags & SETUPBLK_FLAGS_FORMAT_NEEDED) == 0)) {
01214
01215
01216
01217
01218
01219
01220 IopGetHarddiskInfo(NetHDCSCPartition);
01221
01222
01223
01224
01225
01226
01227
01228
01229 status =
NtFsControlFile(
01230 RdrHandle,
01231 NULL,
01232 NULL,
01233 NULL,
01234 &ioStatusBlock,
01235 FSCTL_LMR_START_RBR,
01236 NetHDCSCPartition,
01237 wcslen(NetHDCSCPartition) *
sizeof(WCHAR),
01238 NULL,
01239 0
01240 );
01241
01242
if (
NT_SUCCESS(status) ) {
01243 status = ioStatusBlock.Status;
01244 }
01245
01246
if ( !
NT_SUCCESS(status) ) {
01247 KdPrint((
"IopStartNetworkForRemoteBoot: Unable to FSCTL(RBR) redirector: %x\n", status ));
01248 }
01249 }
01250
01251
if ( (LoaderBlock->
SetupLoaderBlock->
Flags & SETUPBLK_FLAGS_DISCONNECTED) == 0 )
01252
#endif // defined(REMOTE_BOOT)
01253
{
01254
01255
01256
01257
01258
01259
01260
01261
01262 interval.QuadPart = -500 * 1000 * 10;
01263 enumerateAttempts = 0;
01264
01265
while (
TRUE) {
01266
01267
KeDelayExecutionThread(KernelMode, FALSE, &interval);
01268
01269 RtlZeroMemory(rrp,
sizeof(LMR_REQUEST_PACKET));
01270
01271 rrp->Type = EnumerateTransports;
01272 rrp->Version = REQUEST_PACKET_VERSION;
01273
01274 status =
NtFsControlFile(
01275 RdrHandle,
01276 NULL,
01277 NULL,
01278 NULL,
01279 &ioStatusBlock,
01280 FSCTL_LMR_ENUMERATE_TRANSPORTS,
01281 rrp,
01282
sizeof(LMR_REQUEST_PACKET),
01283 &wkstaTransportInfo,
01284
sizeof(wkstaTransportInfo)
01285 );
01286
01287
if (
NT_SUCCESS(status) ) {
01288 status = ioStatusBlock.Status;
01289 }
01290
if ( !
NT_SUCCESS(status) ) {
01291
01292 }
else if (rrp->Parameters.Get.TotalBytesNeeded == 0) {
01293
01294 }
else {
01295
break;
01296 }
01297
01298 ++enumerateAttempts;
01299
01300
if (enumerateAttempts == 5) {
01301 KdPrint((
"IopStartNetworkForRemoteBoot: Redirector didn't start\n" ));
01302 status = STATUS_REDIRECTOR_NOT_STARTED;
01303
goto cleanup;
01304 }
01305
01306 interval.QuadPart *= 2;
01307
01308 }
01309 }
01310
01311
01312
01313
01314
01315
#if defined(REMOTE_BOOT)
01316
IopEnableRemoteBootSecurity(LoaderBlock);
01317
#endif // defined(REMOTE_BOOT)
01318
IopSetDefaultGateway(LoaderBlock->
SetupLoaderBlock->
DefaultRouter);
01319
IopCacheNetbiosNameForIpAddress(LoaderBlock);
01320
01321
#if defined(REMOTE_BOOT)
01322
01323
01324
01325
01326
01327
if (((LoaderBlock->
SetupLoaderBlock->
Flags &
SETUPBLK_FLAGS_IS_TEXTMODE) == 0) &&
01328 ((LoaderBlock->
SetupLoaderBlock->
Flags & SETUPBLK_FLAGS_FORMAT_NEEDED) == 0)
01329
#if 0
01330
&& ((LoaderBlock->
SetupLoaderBlock->
Flags & SETUPBLK_FLAGS_DISABLE_CSC) != 0)
01331
#endif
01332
) {
01333
01334 wcstombs(buffer, NetHDCSCPartition, wcslen(NetHDCSCPartition) + 1);
01335 strcat(buffer, REMOTE_BOOT_IMIRROR_PATH_A REMOTE_BOOT_CSC_SUBDIR_A);
01336
01337 status = IopInitCsc( buffer );
01338
01339
01340
01341
01342
01343
01344
if (
NT_SUCCESS(status) ) {
01345
01346
if (StartCsc == FLUSH_CSC ) {
01347
01348
if ((LoaderBlock->
SetupLoaderBlock->
Flags & SETUPBLK_FLAGS_DISCONNECTED) == 0) {
01349
01350
01351
01352
01353
01354 status = IopResetCsc( buffer );
01355
01356
if ( !
NT_SUCCESS(status) ) {
01357 KdPrint((
"IopStartNetworkForRemoteBoot: reset of Csc failed %x\n", status));
01358 }
01359 }
else {
01360 IoCscInitializationFailed =
TRUE;
01361 }
01362 }
else if ((LoaderBlock->
SetupLoaderBlock->
Flags & SETUPBLK_FLAGS_PIN_NET_DRIVER) &&
01363 (LoaderBlock->
SetupLoaderBlock->
NetbootCardDriverName[0] !=
L'\0')) {
01364
01365
01366
01367
01368
01369
01370
01371 pinNetDriver =
TRUE;
01372 }
01373 }
01374
01375
if ( !
NT_SUCCESS(status) ) {
01376 KdPrint((
"IopStartNetworkForRemoteBoot: initialization of Csc failed %x\n", status));
01377 IoCscInitializationFailed =
TRUE;
01378 SharedUserData->SystemFlags |= SYSTEM_FLAG_DISKLESS_CLIENT;
01379 }
01380
01381 }
else {
01382 IoCscInitializationFailed =
TRUE;
01383 SharedUserData->SystemFlags |= SYSTEM_FLAG_DISKLESS_CLIENT;
01384 }
01385
#endif // defined(REMOTE_BOOT)
01386
01387
IopAssignNetworkDriveLetter(LoaderBlock);
01388
01389
#if defined(REMOTE_BOOT)
01390
if (pinNetDriver) {
01391
01392
01393
01394
01395
01396
01397
01398 HANDLE driverHandle =
NULL;
01399 PWCHAR fullDriverName;
01400
01401 fullDriverName = (PWCHAR)
ExAllocatePoolWithTag(
01402 NonPagedPool,
01403
sizeof( L
"\\SystemRoot\\System32\\Drivers\\" ) +
01404
sizeof( LoaderBlock->
SetupLoaderBlock->
NetbootCardDriverName ),
01405 'bRoI'
01406 );
01407
01408
if (fullDriverName !=
NULL) {
01409
01410 wcscpy(fullDriverName, L
"\\SystemRoot\\System32\\Drivers\\");
01411 wcscat(fullDriverName, LoaderBlock->
SetupLoaderBlock->
NetbootCardDriverName);
01412
01413
RtlInitUnicodeString( &string, fullDriverName );
01414
01415 InitializeObjectAttributes(
01416 &objectAttributes,
01417 &string,
01418 OBJ_CASE_INSENSITIVE,
01419 NULL,
01420 NULL
01421 );
01422
01423 status =
NtCreateFile(
01424 &driverHandle,
01425 GENERIC_READ,
01426 &objectAttributes,
01427 &ioStatusBlock,
01428 NULL,
01429 FILE_ATTRIBUTE_NORMAL,
01430 FILE_SHARE_READ,
01431 FILE_OPEN,
01432 FILE_SYNCHRONOUS_IO_NONALERT,
01433 NULL,
01434 0
01435 );
01436
if ( !
NT_SUCCESS(status) ) {
01437
01438
01439
01440
01441
01442 KdPrint((
"IopStartNetworkForRemoteBoot: Unable to open new net driver: 0x%x\n", status ));
01443 }
01444
if (driverHandle !=
NULL) {
01445
NtClose( driverHandle );
01446 }
01447
01448
ExFreePool( fullDriverName );
01449
01450 }
else {
01451
01452
01453
01454
01455
01456 KdPrint((
"IopStartNetworkForRemoteBoot: Unable to allocate buffer to pin netcard driver\n" ));
01457 }
01458 }
01459
01460 leaveRdrHandleOpen =
TRUE;
01461
#endif // defined(REMOTE_BOOT)
01462
01463 cleanup:
01464
01465
RtlFreeUnicodeString( &computerName );
01466
RtlFreeUnicodeString( &domainName );
01467
#if defined(REMOTE_BOOT)
01468
if ( NetHDCSCPartition !=
NULL ) {
01469
ExFreePool( NetHDCSCPartition );
01470 }
01471
#else
01472
if ( buffer !=
NULL ) {
01473
ExFreePool( buffer );
01474 }
01475
#endif // defined(REMOTE_BOOT)
01476
01477
if ( dgHandle !=
NULL ) {
01478
NtClose( dgHandle );
01479 }
01480
01481
#if defined(REMOTE_BOOT)
01482
01483
01484
01485
01486
if ( !leaveRdrHandleOpen && (RdrHandle !=
NULL) ) {
01487
NtClose( RdrHandle );
01488 RdrHandle =
NULL;
01489 }
01490
#endif // defined(REMOTE_BOOT)
01491
01492
return status;
01493 }