Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <code>Extents</code> field is a variable length array inlined in a struct. The actual struct will have <code>ExtentCount</code> elements. You cannot use a Delphi dynamic array here. In fact you can never use a Delphi dynamic array in interop.</p> <p>So, declare it as <code>array [0..0]</code> just as the C code does. In order to access it you'll need to disable range checking. An actual instance of this record will have valid data in indices <code>0..ExtentCount-1</code>.</p> <p>For your integral types, map <code>DWORD</code> in C to <code>DWORD</code> in Delphi. And <code>LARGE_INTEGER</code> in C to <code>LARGE_INTEGER</code> in Delphi. Neither of those are the same as Delphi <code>Integer</code>. The former is unsigned, and the latter is 64 bits wide.</p> <pre><code>PRetrievalPointersBuffer = ^TRetrievalPointersBuffer; TRetrievalPointersBuffer = record ExtentCount: DWORD; StartingVcn: LARGE_INTEGER; Extents: array [0..0] of record NextVcn: LARGE_INTEGER; Lcn: LARGE_INTEGER; end; end; </code></pre> <p>The <code>LARGE_INTEGER</code> type is rather awkward to work with. You may prefer to declare those fields as <code>Int64</code> instead.</p> <hr> <p>This type of struct is invariably heap allocated. The heap allocation code has to work out the size needed to fit <code>ElementCount</code> items in the variable length array. If you are allocating the buffer then you'll need the inner record in a separately defined type so that you can conveniently name it to pass to <code>SizeOf</code>. If the API allocates then you are fine as above.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload