fatdev.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976
  1. /*++
  2. Copyright (c) 2014 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. fatdev.c
  5. Abstract:
  6. This module implements support for FAT disk I/O in the setup packet.
  7. Author:
  8. Evan Green 14-Apr-2014
  9. Environment:
  10. User
  11. --*/
  12. //
  13. // ------------------------------------------------------------------- Includes
  14. //
  15. #include <assert.h>
  16. #include <errno.h>
  17. #include <getopt.h>
  18. #include <stdio.h>
  19. #include <stdlib.h>
  20. #include <time.h>
  21. #include "setup.h"
  22. //
  23. // ---------------------------------------------------------------- Definitions
  24. //
  25. //
  26. // ------------------------------------------------------ Data Type Definitions
  27. //
  28. typedef VOID FAT_IO_BUFFER, *PFAT_IO_BUFFER;
  29. /*++
  30. Structure Description:
  31. This structure defines an I/O buffer for the setup program.
  32. Members:
  33. Data - Stores a pointer to the I/O buffer's data buffer.
  34. Size - Stores the size of the memory buffer, in bytes.
  35. CurrentOffset - Stores the current offset into the I/O buffer. All I/O will
  36. begin at the current offset.
  37. --*/
  38. typedef struct _SETUP_FAT_IO_BUFFER {
  39. PVOID Data;
  40. UINTN Size;
  41. UINTN CurrentOffset;
  42. } SETUP_FAT_IO_BUFFER, *PSETUP_FAT_IO_BUFFER;
  43. //
  44. // ----------------------------------------------- Internal Function Prototypes
  45. //
  46. //
  47. // -------------------------------------------------------------------- Globals
  48. //
  49. //
  50. // ------------------------------------------------------------------ Functions
  51. //
  52. PFAT_IO_BUFFER
  53. FatAllocateIoBuffer (
  54. PVOID DeviceToken,
  55. UINTN Size
  56. )
  57. /*++
  58. Routine Description:
  59. This routine allocates memory for device I/O use.
  60. Arguments:
  61. DeviceToken - Supplies an opaque token identifying the underlying device.
  62. Size - Supplies the size of the required allocation, in bytes.
  63. Return Value:
  64. Returns a pointer to the FAT I/O buffer, or NULL on failure.
  65. --*/
  66. {
  67. PSETUP_FAT_IO_BUFFER IoBuffer;
  68. IoBuffer = malloc(sizeof(SETUP_FAT_IO_BUFFER) + Size);
  69. if (IoBuffer == NULL) {
  70. return NULL;
  71. }
  72. IoBuffer->Data = (PVOID)IoBuffer + sizeof(SETUP_FAT_IO_BUFFER);
  73. IoBuffer->Size = Size;
  74. IoBuffer->CurrentOffset = 0;
  75. return IoBuffer;
  76. }
  77. PFAT_IO_BUFFER
  78. FatCreateIoBuffer (
  79. PVOID Buffer,
  80. UINTN Size
  81. )
  82. /*++
  83. Routine Description:
  84. This routine creates a FAT I/O buffer from the given buffer.
  85. Arguments:
  86. Buffer - Supplies a pointer to the memory buffer on which to base the FAT
  87. I/O buffer.
  88. Size - Supplies the size of the memory buffer, in bytes.
  89. Return Value:
  90. Returns an pointer to the FAT I/O buffer, or NULL on failure.
  91. --*/
  92. {
  93. PSETUP_FAT_IO_BUFFER IoBuffer;
  94. IoBuffer = malloc(sizeof(SETUP_FAT_IO_BUFFER));
  95. if (IoBuffer == NULL) {
  96. return NULL;
  97. }
  98. IoBuffer->Data = Buffer;
  99. IoBuffer->Size = Size;
  100. IoBuffer->CurrentOffset = 0;
  101. return IoBuffer;
  102. }
  103. VOID
  104. FatIoBufferUpdateOffset (
  105. PFAT_IO_BUFFER FatIoBuffer,
  106. UINTN OffsetUpdate,
  107. BOOL Decrement
  108. )
  109. /*++
  110. Routine Description:
  111. This routine increments the given FAT I/O buffer's current offset by the
  112. given amount.
  113. Arguments:
  114. FatIoBuffer - Supplies a pointer to a FAT I/O buffer.
  115. OffsetUpdate - Supplies the number of bytes by which the offset will be
  116. updated.
  117. Decrement - Supplies a boolean indicating whether the update will be a
  118. decrement (TRUE) or an increment (FALSE).
  119. Return Value:
  120. None.
  121. --*/
  122. {
  123. if (Decrement == FALSE) {
  124. ((PSETUP_FAT_IO_BUFFER)FatIoBuffer)->CurrentOffset += OffsetUpdate;
  125. } else {
  126. ((PSETUP_FAT_IO_BUFFER)FatIoBuffer)->CurrentOffset -= OffsetUpdate;
  127. }
  128. ASSERT(((PSETUP_FAT_IO_BUFFER)FatIoBuffer)->CurrentOffset <=
  129. ((PSETUP_FAT_IO_BUFFER)FatIoBuffer)->Size);
  130. return;
  131. }
  132. VOID
  133. FatIoBufferSetOffset (
  134. PFAT_IO_BUFFER FatIoBuffer,
  135. UINTN Offset
  136. )
  137. /*++
  138. Routine Description:
  139. This routine sets the given FAT I/O buffer's current offset.
  140. Arguments:
  141. FatIoBuffer - Supplies a pointer to a FAT I/O buffer.
  142. Offset - Supplies the new offset to set.
  143. Return Value:
  144. None.
  145. --*/
  146. {
  147. PSETUP_FAT_IO_BUFFER IoBuffer;
  148. IoBuffer = (PSETUP_FAT_IO_BUFFER)FatIoBuffer;
  149. IoBuffer->CurrentOffset = Offset;
  150. ASSERT(IoBuffer->CurrentOffset <= IoBuffer->Size);
  151. return;
  152. }
  153. KSTATUS
  154. FatZeroIoBuffer (
  155. PFAT_IO_BUFFER FatIoBuffer,
  156. UINTN Offset,
  157. UINTN ByteCount
  158. )
  159. /*++
  160. Routine Description:
  161. This routine zeros the contents of the FAT I/O buffer starting at the
  162. offset for the given number of bytes.
  163. Arguments:
  164. FatIoBuffer - Supplies a pointer to the FAT I/O buffer that is to be zeroed.
  165. Offset - Supplies the offset within the I/O buffer where the zeroing should
  166. begin.
  167. ByteCount - Supplies the number of bytes to zero.
  168. Return Value:
  169. Status code.
  170. --*/
  171. {
  172. PSETUP_FAT_IO_BUFFER IoBuffer;
  173. IoBuffer = (PSETUP_FAT_IO_BUFFER)FatIoBuffer;
  174. RtlZeroMemory(IoBuffer->Data + IoBuffer->CurrentOffset + Offset, ByteCount);
  175. return STATUS_SUCCESS;
  176. }
  177. KSTATUS
  178. FatCopyIoBuffer (
  179. PFAT_IO_BUFFER Destination,
  180. UINTN DestinationOffset,
  181. PFAT_IO_BUFFER Source,
  182. UINTN SourceOffset,
  183. UINTN ByteCount
  184. )
  185. /*++
  186. Routine Description:
  187. This routine copies the contents of the source I/O buffer starting at the
  188. source offset to the destination I/O buffer starting at the destination
  189. offset. It assumes that the arguments are correct such that the copy can
  190. succeed.
  191. Arguments:
  192. Destination - Supplies a pointer to the destination I/O buffer that is to
  193. be copied into.
  194. DestinationOffset - Supplies the offset into the destination I/O buffer
  195. where the copy should begin.
  196. Source - Supplies a pointer to the source I/O buffer whose contents will be
  197. copied to the destination.
  198. SourceOffset - Supplies the offset into the source I/O buffer where the
  199. copy should begin.
  200. ByteCount - Supplies the size of the requested copy in bytes.
  201. Return Value:
  202. Status code.
  203. --*/
  204. {
  205. PVOID DestinationBuffer;
  206. PSETUP_FAT_IO_BUFFER DestinationIoBuffer;
  207. PVOID SourceBuffer;
  208. PSETUP_FAT_IO_BUFFER SourceIoBuffer;
  209. DestinationIoBuffer = (PSETUP_FAT_IO_BUFFER)Destination;
  210. DestinationBuffer = DestinationIoBuffer->Data +
  211. DestinationIoBuffer->CurrentOffset +
  212. DestinationOffset;
  213. SourceIoBuffer = (PSETUP_FAT_IO_BUFFER)Source;
  214. SourceBuffer = SourceIoBuffer->Data +
  215. SourceIoBuffer->CurrentOffset +
  216. SourceOffset;
  217. RtlCopyMemory(DestinationBuffer, SourceBuffer, ByteCount);
  218. return STATUS_SUCCESS;
  219. }
  220. KSTATUS
  221. FatCopyIoBufferData (
  222. PFAT_IO_BUFFER FatIoBuffer,
  223. PVOID Buffer,
  224. UINTN Offset,
  225. UINTN Size,
  226. BOOL ToIoBuffer
  227. )
  228. /*++
  229. Routine Description:
  230. This routine copies from a buffer into the given I/O buffer or out of the
  231. given I/O buffer.
  232. Arguments:
  233. FatIoBuffer - Supplies a pointer to the FAT I/O buffer to copy in or out of.
  234. Buffer - Supplies a pointer to the regular linear buffer to copy to or from.
  235. Offset - Supplies an offset in bytes from the beginning of the I/O buffer
  236. to copy to or from.
  237. Size - Supplies the number of bytes to copy.
  238. ToIoBuffer - Supplies a boolean indicating whether data is copied into the
  239. I/O buffer (TRUE) or out of the I/O buffer (FALSE).
  240. Return Value:
  241. Status code.
  242. --*/
  243. {
  244. PVOID Destination;
  245. PSETUP_FAT_IO_BUFFER IoBuffer;
  246. PVOID Source;
  247. IoBuffer = (PSETUP_FAT_IO_BUFFER)FatIoBuffer;
  248. ASSERT(IoBuffer->CurrentOffset + Offset + Size <= IoBuffer->Size);
  249. Destination = IoBuffer->Data + IoBuffer->CurrentOffset + Offset;
  250. Source = Buffer;
  251. if (ToIoBuffer == FALSE) {
  252. Source = Destination;
  253. Destination = Buffer;
  254. }
  255. RtlCopyMemory(Destination, Source, Size);
  256. return STATUS_SUCCESS;
  257. }
  258. PVOID
  259. FatMapIoBuffer (
  260. PFAT_IO_BUFFER FatIoBuffer
  261. )
  262. /*++
  263. Routine Description:
  264. This routine maps the given FAT I/O buffer and returns the base of the
  265. virtually contiguous mapping.
  266. Arguments:
  267. FatIoBuffer - Supplies a pointer to a FAT I/O buffer.
  268. Return Value:
  269. Returns a pointer to the virtual address of the mapping on success, or
  270. NULL on failure.
  271. --*/
  272. {
  273. return ((PSETUP_FAT_IO_BUFFER)FatIoBuffer)->Data;
  274. }
  275. VOID
  276. FatFreeIoBuffer (
  277. PFAT_IO_BUFFER FatIoBuffer
  278. )
  279. /*++
  280. Routine Description:
  281. This routine frees a FAT I/O buffer.
  282. Arguments:
  283. FatIoBuffer - Supplies a pointer to a FAT I/O buffer.
  284. Return Value:
  285. None.
  286. --*/
  287. {
  288. free(FatIoBuffer);
  289. return;
  290. }
  291. PVOID
  292. FatAllocatePagedMemory (
  293. PVOID DeviceToken,
  294. ULONG SizeInBytes
  295. )
  296. /*++
  297. Routine Description:
  298. This routine allocates paged memory for the FAT library.
  299. Arguments:
  300. DeviceToken - Supplies an opaque token identifying the underlying device.
  301. SizeInBytes - Supplies the number of bytes to allocate.
  302. Return Value:
  303. Returns a pointer to the allocated memory, or NULL on failure.
  304. --*/
  305. {
  306. return malloc(SizeInBytes);
  307. }
  308. PVOID
  309. FatAllocateNonPagedMemory (
  310. PVOID DeviceToken,
  311. ULONG SizeInBytes
  312. )
  313. /*++
  314. Routine Description:
  315. This routine allocates non-paged memory for the FAT library.
  316. Arguments:
  317. DeviceToken - Supplies an opaque token identifying the underlying device.
  318. SizeInBytes - Supplies the number of bytes to allocate.
  319. Return Value:
  320. Returns a pointer to the allocated memory, or NULL on failure.
  321. --*/
  322. {
  323. return malloc(SizeInBytes);
  324. }
  325. VOID
  326. FatFreePagedMemory (
  327. PVOID DeviceToken,
  328. PVOID Allocation
  329. )
  330. /*++
  331. Routine Description:
  332. This routine frees paged memory for the FAT library.
  333. Arguments:
  334. DeviceToken - Supplies an opaque token identifying the underlying device.
  335. Allocation - Supplies a pointer to the allocation to free.
  336. Return Value:
  337. None.
  338. --*/
  339. {
  340. free(Allocation);
  341. return;
  342. }
  343. VOID
  344. FatFreeNonPagedMemory (
  345. PVOID DeviceToken,
  346. PVOID Allocation
  347. )
  348. /*++
  349. Routine Description:
  350. This routine frees memory for the FAT library.
  351. Arguments:
  352. DeviceToken - Supplies an opaque token identifying the underlying device.
  353. Allocation - Supplies a pointer to the allocation to free.
  354. Return Value:
  355. None.
  356. --*/
  357. {
  358. free(Allocation);
  359. return;
  360. }
  361. KSTATUS
  362. FatCreateLock (
  363. PVOID *Lock
  364. )
  365. /*++
  366. Routine Description:
  367. This routine creates a lock.
  368. Arguments:
  369. Lock - Supplies a pointer where an opaque pointer will be returned
  370. representing the lock.
  371. Return Value:
  372. STATUS_SUCCESS on success.
  373. STATUS_INSUFFICIENT_RESOURCES if the lock could not be allocated.
  374. --*/
  375. {
  376. *Lock = NULL;
  377. return STATUS_SUCCESS;
  378. }
  379. VOID
  380. FatDestroyLock (
  381. PVOID Lock
  382. )
  383. /*++
  384. Routine Description:
  385. This routine destroys a created lock.
  386. Arguments:
  387. Lock - Supplies a the opaque pointer returned upon creation.
  388. Return Value:
  389. None.
  390. --*/
  391. {
  392. return;
  393. }
  394. VOID
  395. FatAcquireLock (
  396. PVOID Lock
  397. )
  398. /*++
  399. Routine Description:
  400. This routine acquires a lock.
  401. Arguments:
  402. Lock - Supplies a the opaque pointer returned upon creation.
  403. Return Value:
  404. None.
  405. --*/
  406. {
  407. return;
  408. }
  409. VOID
  410. FatReleaseLock (
  411. PVOID Lock
  412. )
  413. /*++
  414. Routine Description:
  415. This routine releases a lock.
  416. Arguments:
  417. Lock - Supplies a the opaque pointer returned upon creation.
  418. Return Value:
  419. None.
  420. --*/
  421. {
  422. return;
  423. }
  424. KSTATUS
  425. FatReadDevice (
  426. PVOID DeviceToken,
  427. ULONGLONG BlockAddress,
  428. UINTN BlockCount,
  429. ULONG Flags,
  430. PVOID Irp,
  431. PFAT_IO_BUFFER *FatIoBuffer
  432. )
  433. /*++
  434. Routine Description:
  435. This routine reads data from the underlying disk.
  436. Arguments:
  437. DeviceToken - Supplies an opaque token identifying the underlying device.
  438. BlockAddress - Supplies the block index to read (for physical disks, this is
  439. the LBA).
  440. BlockCount - Supplies the number of blocks to read.
  441. Flags - Supplies flags regarding the I/O operation. See IO_FLAG_*
  442. definitions.
  443. Irp - Supplies an optional pointer to the IRP to pass to the read file
  444. function.
  445. FatIoBuffer - Supplies a pointer to a FAT I/O buffer where the data from
  446. the disk will be returned.
  447. Return Value:
  448. Status code.
  449. --*/
  450. {
  451. PVOID Buffer;
  452. size_t ByteCount;
  453. ssize_t BytesRead;
  454. PSETUP_CONTEXT Context;
  455. PSETUP_FAT_IO_BUFFER IoBuffer;
  456. KSTATUS Status;
  457. PSETUP_VOLUME Volume;
  458. assert(SETUP_BLOCK_SIZE != 0);
  459. assert(FatIoBuffer != NULL);
  460. Volume = DeviceToken;
  461. Context = Volume->Context;
  462. IoBuffer = (PSETUP_FAT_IO_BUFFER)FatIoBuffer;
  463. Buffer = IoBuffer->Data + IoBuffer->CurrentOffset;
  464. ByteCount = BlockCount * SETUP_BLOCK_SIZE;
  465. assert((IoBuffer->Size - IoBuffer->CurrentOffset) >= ByteCount);
  466. if ((Volume->DestinationType == SetupDestinationPartition) ||
  467. (Volume->DestinationType == SetupDestinationDisk)) {
  468. SetupPartitionSeek(Context, Volume->BlockHandle, BlockAddress);
  469. BytesRead = SetupPartitionRead(Context,
  470. Volume->BlockHandle,
  471. Buffer,
  472. ByteCount);
  473. } else {
  474. SetupSeek(Volume->BlockHandle, BlockAddress * SETUP_BLOCK_SIZE);
  475. BytesRead = SetupRead(Volume->BlockHandle, Buffer, ByteCount);
  476. }
  477. if (BytesRead != ByteCount) {
  478. Status = STATUS_DEVICE_IO_ERROR;
  479. goto ReadDeviceEnd;
  480. }
  481. Status = STATUS_SUCCESS;
  482. ReadDeviceEnd:
  483. if (!KSUCCESS(Status)) {
  484. printf("Failed to read FAT device: %d\n", Status);
  485. }
  486. return Status;
  487. }
  488. KSTATUS
  489. FatWriteDevice (
  490. PVOID DeviceToken,
  491. ULONGLONG BlockAddress,
  492. UINTN BlockCount,
  493. ULONG Flags,
  494. PVOID Irp,
  495. PFAT_IO_BUFFER FatIoBuffer
  496. )
  497. /*++
  498. Routine Description:
  499. This routine writes data to the underlying disk.
  500. Arguments:
  501. DeviceToken - Supplies an opaque token identifying the underlying device.
  502. BlockAddress - Supplies the block index to write to (for physical disks,
  503. this is the LBA).
  504. BlockCount - Supplies the number of blocks to write.
  505. Flags - Supplies flags regarding the I/O operation. See IO_FLAG_*
  506. definitions.
  507. Irp - Supplies an optional pointer to an IRP to use for the disk operation.
  508. FatIoBuffer - Supplies a pointer to a FAT I/O buffer containing the data to
  509. write.
  510. Return Value:
  511. Status code.
  512. --*/
  513. {
  514. ULONG BlockSize;
  515. PVOID Buffer;
  516. ssize_t BytesWritten;
  517. PSETUP_CONTEXT Context;
  518. PSETUP_FAT_IO_BUFFER SetupIoBuffer;
  519. KSTATUS Status;
  520. PSETUP_VOLUME Volume;
  521. Volume = DeviceToken;
  522. Context = Volume->Context;
  523. BlockSize = SETUP_BLOCK_SIZE;
  524. assert(BlockSize != 0);
  525. SetupIoBuffer = (PSETUP_FAT_IO_BUFFER)FatIoBuffer;
  526. Buffer = SetupIoBuffer->Data + SetupIoBuffer->CurrentOffset;
  527. if ((Volume->DestinationType == SetupDestinationPartition) ||
  528. (Volume->DestinationType == SetupDestinationDisk)) {
  529. SetupPartitionSeek(Context, Volume->BlockHandle, BlockAddress);
  530. BytesWritten = SetupPartitionWrite(Context,
  531. Volume->BlockHandle,
  532. Buffer,
  533. BlockCount * BlockSize);
  534. } else {
  535. SetupSeek(Volume->BlockHandle, BlockAddress * BlockSize);
  536. BytesWritten = SetupWrite(Volume->BlockHandle,
  537. Buffer,
  538. BlockCount * BlockSize);
  539. }
  540. if (BytesWritten != BlockCount * BlockSize) {
  541. Status = STATUS_DEVICE_IO_ERROR;
  542. goto WriteDeviceEnd;
  543. }
  544. Status = STATUS_SUCCESS;
  545. WriteDeviceEnd:
  546. if (!KSUCCESS(Status)) {
  547. printf("Failed to write FAT device: %d\n", Status);
  548. }
  549. return Status;
  550. }
  551. KSTATUS
  552. FatGetDeviceBlockInformation (
  553. PVOID DeviceToken,
  554. PFILE_BLOCK_INFORMATION BlockInformation
  555. )
  556. /*++
  557. Routine Description:
  558. This routine converts a file's block information into disk level block
  559. information by modifying the offsets of each contiguous run.
  560. Arguments:
  561. DeviceToken - Supplies an opaque token identify the underlying device.
  562. BlockInformation - Supplies a pointer to the block information to be
  563. updated.
  564. Return Value:
  565. Status code.
  566. --*/
  567. {
  568. ASSERT(FALSE);
  569. return STATUS_NOT_IMPLEMENTED;
  570. }
  571. ULONG
  572. FatGetIoCacheEntryDataSize (
  573. VOID
  574. )
  575. /*++
  576. Routine Description:
  577. This routine returns the size of data stored in each cache entry.
  578. Arguments:
  579. None.
  580. Return Value:
  581. Returns the size of the data stored in each cache entry, or 0 if there is
  582. no cache.
  583. --*/
  584. {
  585. return 0;
  586. }
  587. ULONG
  588. FatGetPageSize (
  589. VOID
  590. )
  591. /*++
  592. Routine Description:
  593. This routine returns the size of a physical memory page for the current FAT
  594. environment.
  595. Arguments:
  596. None.
  597. Return Value:
  598. Returns the size of a page in the current environment. Returns 0 if the
  599. size is not known.
  600. --*/
  601. {
  602. return 0;
  603. }
  604. VOID
  605. FatGetCurrentSystemTime (
  606. PSYSTEM_TIME SystemTime
  607. )
  608. /*++
  609. Routine Description:
  610. This routine returns the current system time.
  611. Arguments:
  612. SystemTime - Supplies a pointer where the current system time will be
  613. returned.
  614. Return Value:
  615. None.
  616. --*/
  617. {
  618. SystemTime->Seconds = (LONGLONG)time(NULL) - SYSTEM_TIME_TO_EPOCH_DELTA;
  619. SystemTime->Nanoseconds = 0;
  620. return;
  621. }
  622. //
  623. // --------------------------------------------------------- Internal Functions
  624. //