Difference between revisions of "Unit Storage"
From Ultibo.org
(16 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
---- | ---- | ||
− | '''Ultibo Storage | + | '''Ultibo Storage Interface unit''' |
− | This unit provides | + | This unit provides the generic Storage device interface used by all storage drivers. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
=== Constants === | === Constants === | ||
Line 38: | Line 30: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Storage device type | + | <div style="font-size: 14px; padding-left: 12px;">'''Storage device type''' <code> STORAGE_TYPE_* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 72: | Line 64: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Storage device state | + | <div style="font-size: 14px; padding-left: 12px;">'''Storage device state''' <code> STORAGE_STATE_* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 97: | Line 89: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Storage device flag | + | <div style="font-size: 14px; padding-left: 12px;">'''Storage device flag''' <code> STORAGE_FLAG_* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 141: | Line 133: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Storage device control code | + | <div style="font-size: 14px; padding-left: 12px;">'''Storage device control code''' <code> STORAGE_CONTROL_* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 170: | Line 162: | ||
|- | |- | ||
| <code>STORAGE_CONTROL_GET_VENDORID = 9;</code> | | <code>STORAGE_CONTROL_GET_VENDORID = 9;</code> | ||
− | | Get Vendor | + | | Get Vendor Id |
|- | |- | ||
| <code>STORAGE_CONTROL_GET_PRODUCTID = 10;</code> | | <code>STORAGE_CONTROL_GET_PRODUCTID = 10;</code> | ||
− | | Get Product | + | | Get Product Id |
|- | |- | ||
| <code>STORAGE_CONTROL_GET_SERIAL = 11;</code> | | <code>STORAGE_CONTROL_GET_SERIAL = 11;</code> | ||
Line 191: | Line 183: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Storage logging | + | <div style="font-size: 14px; padding-left: 12px;">'''Storage logging''' <code> STORAGE_LOG_* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 200: | Line 192: | ||
| <code>STORAGE_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code> | | <code>STORAGE_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code> | ||
| Storage informational messages, such as a device being attached or detached | | Storage informational messages, such as a device being attached or detached | ||
+ | |- | ||
+ | | <code>STORAGE_LOG_LEVEL_WARN = LOG_LEVEL_WARN;</code> | ||
+ | | Storage warning messages | ||
|- | |- | ||
| <code>STORAGE_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code> | | <code>STORAGE_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code> | ||
Line 210: | Line 205: | ||
</div></div> | </div></div> | ||
<br /> | <br /> | ||
− | + | ||
− | + | === Type definitions === | |
− | + | ---- | |
− | {| class="wikitable" style="font-size: 14px; | + | |
+ | |||
+ | '''Storage enumeration callback''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
|- | |- | ||
− | | <code> | + | | <code>TStorageEnumerate = function(Storage:PStorageDevice; Data:Pointer):LongWord;</code> |
− | | | + | | style="width: 40%;"| |
|- | |- | ||
− | | | + | |} |
+ | |||
+ | '''Storage notification callback''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
|- | |- | ||
− | | | + | | <code>TStorageNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;</code> |
+ | | style="width: 40%;"| | ||
|- | |- | ||
− | | | + | |} |
− | | | + | |
+ | '''Storage device read''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
|- | |- | ||
− | | | + | | <code>TStorageDeviceRead = function(Storage:PStorageDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;</code> |
+ | | style="width: 40%;"| | ||
|- | |- | ||
− | | | + | |} |
+ | |||
+ | '''Storage device write''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
|- | |- | ||
− | | <code> | + | | <code>TStorageDeviceWrite = function(Storage:PStorageDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;</code> |
− | | | + | | style="width: 40%;"| |
|- | |- | ||
− | | | + | |} |
− | | | + | |
+ | '''Storage device erase''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
|- | |- | ||
− | | | + | | <code>TStorageDeviceErase = function(Storage:PStorageDevice; const Start,Count:Int64):LongWord;</code> |
+ | | style="width: 40%;"| | ||
|- | |- | ||
− | | | + | |} |
+ | |||
+ | '''Storage device control''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
|- | |- | ||
− | | <code> | + | | <code>TStorageDeviceControl = function(Storage:PStorageDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;</code> |
− | | | + | | style="width: 40%;"| |
|- | |- | ||
− | | | + | |} |
+ | |||
+ | '''Storage device''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PStorageDevice = ^TStorageDevice;</code> | ||
+ | |||
+ | <code>TStorageDevice = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | | | + | |colspan="2"|''Device Properties'' |
− | | | + | |
|- | |- | ||
− | | <code> | + | | <code>Device:TDevice;</code> |
− | | | + | | The Device entry for this Storage |
|- | |- | ||
− | |colspan="2"| | + | |colspan="2"|''Storage Properties'' |
|- | |- | ||
− | | <code> | + | | <code>StorageId:LongWord;</code> |
− | | | + | | Unique Id of this Storage in the Storage table |
|- | |- | ||
− | | | + | | <code>StorageState:LongWord;</code> |
+ | | Storage state (eg STORAGE_STATE_INSERTED) | ||
|- | |- | ||
− | | <code> | + | | <code>DeviceRead:TStorageDeviceRead;</code> |
− | | | + | | A Device specific DeviceRead method implementing a standard Storage device interface |
|- | |- | ||
− | | | + | | <code>DeviceWrite:TStorageDeviceWrite;</code> |
+ | | A Device specific DeviceWrite method implementing a standard Storage device interface | ||
|- | |- | ||
− | | | + | | <code>DeviceErase:TStorageDeviceErase;</code> |
+ | | A Device specific DeviceErase method implementing a standard Storage device interface | ||
|- | |- | ||
− | | <code> | + | | <code>DeviceControl:TStorageDeviceControl;</code> |
− | | | + | | A Device specific DeviceControl method implementing a standard Storage device interface |
|- | |- | ||
− | |colspan="2"| | + | |colspan="2"|''Driver Properties'' |
|- | |- | ||
− | | <code> | + | | <code>Lock:TMutexHandle;</code> |
− | | | + | | Storage lock |
|- | |- | ||
− | | <code> | + | | <code>TargetID:LongWord;</code> |
− | | | + | | SCSI Id |
|- | |- | ||
− | | <code> | + | | <code>TargetLUN:LongWord;</code> |
− | | | + | | LUN |
|- | |- | ||
− | | | + | | <code>BlockSize:LongWord;</code> |
+ | | Block Size | ||
|- | |- | ||
− | | <code> | + | | <code>BlockCount:Int64;</code> |
− | | | + | | Number of Blocks |
|- | |- | ||
− | | | + | | <code>BlockShift:LongWord;</code> |
+ | | Shift Count for Blocks to Bytes conversion (eg 9 for 512 byte blocks) | ||
|- | |- | ||
− | | | + | | <code>Vendor:PChar;</code> |
+ | | ATA Model, SCSI Vendor | ||
|- | |- | ||
− | | <code> | + | | <code>Product:PChar;</code> |
− | | | + | | ATA Serial No, SCSI Product |
|- | |- | ||
− | | | + | | <code>Revision:PChar;</code> |
+ | | Firmware Revision | ||
|- | |- | ||
− | | | + | | <code>StatusTimer:TTimerHandle;</code> |
+ | | Timer for status change detection | ||
|- | |- | ||
− | | <code> | + | |colspan="2"|''Statistics Properties'' |
+ | |- | ||
+ | | <code>ReadCount:LongWord;</code> | ||
| | | | ||
|- | |- | ||
− | | <code> | + | | <code>ReadErrors:LongWord;</code> |
| | | | ||
|- | |- | ||
− | | <code> | + | | <code>WriteCount:LongWord;</code> |
| | | | ||
|- | |- | ||
− | | <code> | + | | <code>WriteErrors:LongWord;</code> |
| | | | ||
|- | |- | ||
− | | <code> | + | | <code>EraseCount:LongWord;</code> |
| | | | ||
|- | |- | ||
− | | <code> | + | | <code>EraseErrors:LongWord;</code> |
− | | | + | | |
|- | |- | ||
− | |colspan="2"| | + | |colspan="2"|''Internal Properties'' |
|- | |- | ||
− | | | + | | <code>Prev:PStorageDevice;</code> |
+ | | Previous entry in Storage table | ||
|- | |- | ||
− | + | | <code>Next:PStorageDevice;</code> | |
− | + | | Next entry in Storage table | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | | <code> | + | |
− | | | + | |
|- | |- | ||
|} | |} | ||
− | </div></div> | + | </div></div> |
− | <br /> | + | <br /> |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
=== Public variables === | === Public variables === | ||
Line 351: | Line 371: | ||
|- | |- | ||
| <code>STORAGE_DEFAULT_LOG_LEVEL:LongWord = STORAGE_LOG_LEVEL_DEBUG;</code> | | <code>STORAGE_DEFAULT_LOG_LEVEL:LongWord = STORAGE_LOG_LEVEL_DEBUG;</code> | ||
− | | style="width: | + | | style="width: 40%;"|Minimum level for Storage messages. Only messages with level greater than or equal to this will be printed. |
|- | |- | ||
|} | |} | ||
Line 357: | Line 377: | ||
|- | |- | ||
| <code>STORAGE_LOG_ENABLED:Boolean;</code> | | <code>STORAGE_LOG_ENABLED:Boolean;</code> | ||
− | | style="width: | + | | style="width: 40%;"| |
|- | |- | ||
|} | |} | ||
Line 374: | Line 394: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 389: | Line 409: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 401: | Line 421: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 413: | Line 433: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 420: | Line 440: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function StorageDeviceControl(Storage:PStorageDevice; Request:Integer; Argument1: | + | <pre style="border: 0; padding-bottom:0px;">function StorageDeviceControl(Storage:PStorageDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 437: | Line 457: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Storage |
| The storage to set the state for | | The storage to set the state for | ||
|- | |- | ||
− | ! | + | ! State |
| The new state to set and notify | | The new state to set and notify | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 455: | Line 475: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Storage |
| The storage to start status monitoring for | | The storage to start status monitoring for | ||
|- | |- | ||
− | ! | + | ! Interval |
| The status monitoring interval in milliseconds | | The status monitoring interval in milliseconds | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 473: | Line 493: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Storage |
| The storage to stop status monitoring for | | The storage to stop status monitoring for | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 488: | Line 508: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| Pointer to new Storage entry or nil if storage could not be created | | Pointer to new Storage entry or nil if storage could not be created | ||
|- | |- | ||
Line 500: | Line 520: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Size |
| Size in bytes to allocate for new storage (Including the storage entry) | | Size in bytes to allocate for new storage (Including the storage entry) | ||
|- | |- | ||
− | ! | + | ! Return |
| Pointer to new Storage entry or nil if storage could not be created | | Pointer to new Storage entry or nil if storage could not be created | ||
|- | |- | ||
Line 515: | Line 535: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 527: | Line 547: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 539: | Line 559: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 551: | Line 571: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 558: | Line 578: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function | + | <pre style="border: 0; padding-bottom:0px;">function StorageDeviceFindByDevice(Device:PDevice):PStorageDevice;</pre> |
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Find a Storage device by the matching DeviceData property</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
− | | | + | | The device entry to match with the DeviceData value |
+ | |- | ||
+ | ! Return | ||
+ | | The Storage device matched or nil if none found | ||
|- | |- | ||
|} | |} | ||
Line 570: | Line 593: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function | + | <pre style="border: 0; padding-bottom:0px;">function StorageDeviceFindByName(const Name:String):PStorageDevice; inline;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 582: | Line 605: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function | + | <pre style="border: 0; padding-bottom:0px;">function StorageDeviceFindByDescription(const Description:String):PStorageDevice; inline;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 594: | Line 617: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function | + | <pre style="border: 0; padding-bottom:0px;">function StorageDeviceEnumerate(Callback:TStorageEnumerate; Data:Pointer):LongWord;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 605: | Line 628: | ||
</div></div> | </div></div> | ||
<br /> | <br /> | ||
− | |||
− | |||
− | |||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function | + | <pre style="border: 0; padding-bottom:0px;">function StorageDeviceNotification(Storage:PStorageDevice; Callback:TStorageNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
|} | |} | ||
Line 729: | Line 644: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function StorageGetCount:LongWord | + | <pre style="border: 0; padding-bottom:0px;">function StorageGetCount:LongWord;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current storage count</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current storage count</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 746: | Line 661: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 758: | Line 673: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 770: | Line 685: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 782: | Line 697: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 794: | Line 709: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 801: | Line 716: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">procedure StorageLogInfo(Storage:PStorageDevice; const AText:String);</pre> | + | <pre style="border: 0; padding-bottom:0px;">procedure StorageLogInfo(Storage:PStorageDevice; const AText:String); inline;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 813: | Line 728: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">procedure | + | <pre style="border: 0; padding-bottom:0px;">procedure StorageLogWarn(Storage:PStorageDevice; const AText:String); inline;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 825: | Line 740: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">procedure | + | <pre style="border: 0; padding-bottom:0px;">procedure StorageLogError(Storage:PStorageDevice; const AText:String); inline;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 837: | Line 752: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">procedure | + | <pre style="border: 0; padding-bottom:0px;">procedure StorageLogDebug(Storage:PStorageDevice; const AText:String); inline;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 848: | Line 763: | ||
</div></div> | </div></div> | ||
<br /> | <br /> | ||
− | |||
− | |||
− | |||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;"> | + | <pre style="border: 0; padding-bottom:0px;">procedure StorageStatusTimer(Storage:PStorageDevice);</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
|} | |} |
Latest revision as of 03:24, 29 March 2024
Return to Unit Reference
Contents
[hide]Description
Ultibo Storage Interface unit
This unit provides the generic Storage device interface used by all storage drivers.
Constants
[Expand]
Storage specific constants
STORAGE_*
[Expand]
Storage device type
STORAGE_TYPE_*
[Expand]
Storage device state
STORAGE_STATE_*
[Expand]
Storage device flag
STORAGE_FLAG_*
[Expand]
Storage device control code
STORAGE_CONTROL_*
[Expand]
Storage logging
STORAGE_LOG_*
Type definitions
Storage enumeration callback
TStorageEnumerate = function(Storage:PStorageDevice; Data:Pointer):LongWord;
|
Storage notification callback
TStorageNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;
|
Storage device read
TStorageDeviceRead = function(Storage:PStorageDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;
|
Storage device write
TStorageDeviceWrite = function(Storage:PStorageDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;
|
Storage device erase
TStorageDeviceErase = function(Storage:PStorageDevice; const Start,Count:Int64):LongWord;
|
Storage device control
TStorageDeviceControl = function(Storage:PStorageDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;
|
Storage device
Public variables
Storage logging
STORAGE_DEFAULT_LOG_LEVEL:LongWord = STORAGE_LOG_LEVEL_DEBUG;
|
Minimum level for Storage messages. Only messages with level greater than or equal to this will be printed. |
STORAGE_LOG_ENABLED:Boolean;
|
Function declarations
Initialization functions
Storage functions
[Expand]
function StorageDeviceRead(Storage:PStorageDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;
Description: To be documented
[Expand]
function StorageDeviceWrite(Storage:PStorageDevice; const Start,Count:Int64; Buffer:Pointer):LongWord;
Description: To be documented
[Expand]
function StorageDeviceErase(Storage:PStorageDevice; const Start,Count:Int64):LongWord;
Description: To be documented
[Expand]
function StorageDeviceControl(Storage:PStorageDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;
Description: To be documented
[Expand]
function StorageDeviceSetState(Storage:PStorageDevice; State:LongWord):LongWord;
Description: Set the state of the specified storage and send a notification
[Expand]
function StorageDeviceStartStatus(Storage:PStorageDevice; Interval:LongWord):LongWord;
Description: Start status monitoring on the specified storage for insert/eject notifications
[Expand]
function StorageDeviceStopStatus(Storage:PStorageDevice):LongWord;
Description: Stop status monitoring on the specified storage for insert/eject notifications
[Expand]
function StorageDeviceCreateEx(Size:LongWord):PStorageDevice;
Description: Create a new Storage entry
[Expand]
function StorageDeviceDestroy(Storage:PStorageDevice):LongWord;
Description: Destroy an existing Storage entry
[Expand]
function StorageDeviceRegister(Storage:PStorageDevice):LongWord;
Description: Register a new Storage in the Storage table
[Expand]
function StorageDeviceDeregister(Storage:PStorageDevice):LongWord;
Description: Deregister a Storage from the Storage table
[Expand]
function StorageDeviceFind(StorageId:LongWord):PStorageDevice;
Description: To be documented
[Expand]
function StorageDeviceFindByDevice(Device:PDevice):PStorageDevice;
Description: Find a Storage device by the matching DeviceData property
[Expand]
function StorageDeviceFindByName(const Name:String):PStorageDevice; inline;
Description: To be documented
[Expand]
function StorageDeviceFindByDescription(const Description:String):PStorageDevice; inline;
Description: To be documented
[Expand]
function StorageDeviceEnumerate(Callback:TStorageEnumerate; Data:Pointer):LongWord;
Description: To be documented
[Expand]
function StorageDeviceNotification(Storage:PStorageDevice; Callback:TStorageNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented
Storage helper functions
[Expand]
function StorageDeviceCheck(Storage:PStorageDevice):PStorageDevice;
Description: Check if the supplied Storage is in the storage table
[Expand]
function StorageDeviceTypeToString(StorageType:LongWord):String;
Description: To be documented
[Expand]
function StorageDeviceStateToString(StorageState:LongWord):String;
Description: To be documented
[Expand]
function StorageDeviceStateToNotification(State:LongWord):LongWord;
Description: Convert a Storage state value into the notification code for device notifications
[Expand]
procedure StorageLog(Level:LongWord; Storage:PStorageDevice; const AText:String);
Description: To be documented
[Expand]
procedure StorageLogInfo(Storage:PStorageDevice; const AText:String); inline;
Description: To be documented
[Expand]
procedure StorageLogWarn(Storage:PStorageDevice; const AText:String); inline;
Description: To be documented
[Expand]
procedure StorageLogError(Storage:PStorageDevice; const AText:String); inline;
Description: To be documented
[Expand]
procedure StorageLogDebug(Storage:PStorageDevice; const AText:String); inline;
Description: To be documented
Return to Unit Reference