Jump to content

DosPhysicalDisk (FAPI): Difference between revisions

From EDM2
Created page with "==Description== This call obtains information about partitionable disks. ==Syntax== <PRE> DosPhysicalDisk (Function, DataPtr, DataLen, ParmPtr, ParmLen) </PRE> ==Parame..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
This call obtains information about partitionable disks.
This call obtains information about partitionable disks.


==Syntax==
==Syntax==
<PRE>
  DosPhysicalDisk (Function, DataPtr, DataLen, ParmPtr, ParmLen)
  DosPhysicalDisk


    (Function, DataPtr, DataLen, ParmPtr, ParmLen)
</PRE>
==Parameters==
==Parameters==
; Function (USHORT) - input : The functions supported are:
;Function (USHORT) - input : The functions supported are:
 
:1 - Obtain total number of partitionable disks  
    Value        Definition
:2 - Obtain a handle to use with Category 9 IOCTLs
1
:3 - Release a handle for a partitionable disk.
        Obtain total number of partitionable disks  
;DataPtr (PBYTE) - output : Address of the buffer where the returned information is placed.
2
;DataLen (USHORT) - input : Length of the data buffer. The output data for each function is described below.
        Obtain a handle to use with Category 9 IOCTLs
:{|
3
!FUNCTION||DATALEN||RETURNED INFORMATION
        Release a handle for a partitionable disk.  
|-
 
|1||2||Total number of partitionable disks in the system, 1-based.
; DataPtr (PBYTE) - output : Address of the buffer where the returned information is placed.  
|-
 
|2||2||Handle for the specified partitionable disk for the category 9 IOCTLs.
; DataLen (USHORT) - input : Length of the data buffer. The output data for each function is described below.
|-
 
|3||0||None. Pointer must be zero.
          FUNCTION   DATALEN         RETURNED INFORMATION
|}
          1         2               Total number of partitionable disks in
:All lengths are in bytes.
                                    the system, 1-based.
;ParmPtr (PBYTE) - input : Address of the buffer used for input parameters.
;ParmLen (USHORT) - input : Length of the parameter buffer.
          2         2               Handle for the specified partitionable
:The input parameters required for each function are:
                                    disk for the category 9 IOCTLs.
:{|
!FUNCTION||DATALEN||RETURNED INFORMATION
          3         0               None. Pointer must be zero.
|-
 
|1||0||None. Must be set to zero.
All lengths are in bytes.  
|-
 
|2||String length||ASCIIZ string that specifies the partitionable disk.
; ParmPtr (PBYTE) - input : Address of the buffer used for input parameters.  
|-
 
|3||2||Handle obtained from function 2.
; ParmLen (USHORT) - input : Length of the parameter buffer.  
|}
 
:;Note: All lengths are in bytes.
The input parameters required for each function are:
 
          FUNCTION   PARMLEN        INPUT PARAMETERS
 
          1         0               None. Must be set to zero.
 
          2         String length   ASCIIZ string that specifies the
                                    partitionable disk.
 
          3         2               Handle obtained from function 2.
 
Note: All lengths are in bytes.


==Return Code==
==Return Code==
rc (USHORT) - return
;rc (USHORT) - return:Return code descriptions are:
 
*0 NO_ERROR
Return code descriptions are:
*1 ERROR_INVALID_FUNCTION
 
*5 ERROR_ACCESS_DENIED
* 0     NO_ERROR
*6 ERROR_INVALID_HANDLE
*     ERROR_INVALID_FUNCTION
*33 ERROR_LOCK_VIOLATION
*     ERROR_ACCESS_DENIED
*87 ERROR_INVALID_PARAMETER
*     ERROR_INVALID_HANDLE
* 33       ERROR_LOCK_VIOLATION  
* 87       ERROR_INVALID_PARAMETER


==Remarks==
==Remarks==
The ASCIIZ string used to specify the partitionable disk must be of the following format:
The ASCIIZ string used to specify the partitionable disk must be of the following format:
  number : <null byte>
  number : <null byte>
Where:
Where:
  number
  number
 
specifies the partitionable disk (1-based) number in ASCII
specifies the partitionable disk (1-based) number in ASCII  
 
  :
  :
 
must be present
must be present  
 
  <null byte>
  <null byte>
the byte of 0 for the ASCIIZ string


the byte of 0 for the ASCIIZ string
The handle returned for the specified partitionable disk can only be used with the DosDevIOCtl call for the Category 9 Generic IOCTL. Use of the handle for a physical partitionable disk is not permitted for handle-based file system function calls, such as DosRead or DosClose.
 
The handle returned for the specified partitionable disk can only be used with the DosDevIOCtl call for the Category 9 Generic IOCTL. Use of the handle for a physical partitionable disk is not permitted for handle-based file system function calls, such as DosRead or DosClose.  


==Example Code==
==Bindings==
===C Binding===
===C===
<PRE>
<PRE>
#define INCL_DOSDEVICES
#define INCL_DOSDEVICES
Line 91: Line 64:
USHORT  rc = DosPhysicalDisk(Function, DataPtr, DataLen, ParmPtr, ParmLen);
USHORT  rc = DosPhysicalDisk(Function, DataPtr, DataLen, ParmPtr, ParmLen);


USHORT           Function;      /* Type of information */
USHORT Function;      /* Type of information */
PBYTE           DataPtr;      /* Pointer to return buffer */
PBYTE   DataPtr;      /* Pointer to return buffer */
USHORT           DataLen;      /* Return buffer length */
USHORT DataLen;      /* Return buffer length */
PBYTE           ParmPtr;      /* Pointer to user-supplied information */
PBYTE   ParmPtr;      /* Pointer to user-supplied information */
USHORT           ParmLen;      /* Length of user-supplied information */
USHORT ParmLen;      /* Length of user-supplied information */


USHORT           rc;            /* return code */
USHORT rc;            /* return code */
</PRE>
</PRE>


===MASM Binding===
===MASM===
<PRE>
<PRE>
EXTRN  DosPhysicalDisk:FAR
EXTRN  DosPhysicalDisk:FAR
Line 114: Line 87:
Returns WORD
Returns WORD
</PRE>
</PRE>
==Related Functions==
*


[[Category:The OS/2 API Project]]
[[Category:Dos16]]

Latest revision as of 13:50, 10 July 2020

This call obtains information about partitionable disks.

Syntax

DosPhysicalDisk (Function, DataPtr, DataLen, ParmPtr, ParmLen)

Parameters

Function (USHORT) - input
The functions supported are:
1 - Obtain total number of partitionable disks
2 - Obtain a handle to use with Category 9 IOCTLs
3 - Release a handle for a partitionable disk.
DataPtr (PBYTE) - output
Address of the buffer where the returned information is placed.
DataLen (USHORT) - input
Length of the data buffer. The output data for each function is described below.
FUNCTION DATALEN RETURNED INFORMATION
1 2 Total number of partitionable disks in the system, 1-based.
2 2 Handle for the specified partitionable disk for the category 9 IOCTLs.
3 0 None. Pointer must be zero.
All lengths are in bytes.
ParmPtr (PBYTE) - input
Address of the buffer used for input parameters.
ParmLen (USHORT) - input
Length of the parameter buffer.
The input parameters required for each function are:
FUNCTION DATALEN RETURNED INFORMATION
1 0 None. Must be set to zero.
2 String length ASCIIZ string that specifies the partitionable disk.
3 2 Handle obtained from function 2.
Note
All lengths are in bytes.

Return Code

rc (USHORT) - return
Return code descriptions are:
  • 0 NO_ERROR
  • 1 ERROR_INVALID_FUNCTION
  • 5 ERROR_ACCESS_DENIED
  • 6 ERROR_INVALID_HANDLE
  • 33 ERROR_LOCK_VIOLATION
  • 87 ERROR_INVALID_PARAMETER

Remarks

The ASCIIZ string used to specify the partitionable disk must be of the following format:

number : <null byte>

Where:

number

specifies the partitionable disk (1-based) number in ASCII

:

must be present

<null byte>

the byte of 0 for the ASCIIZ string

The handle returned for the specified partitionable disk can only be used with the DosDevIOCtl call for the Category 9 Generic IOCTL. Use of the handle for a physical partitionable disk is not permitted for handle-based file system function calls, such as DosRead or DosClose.

Bindings

C

#define INCL_DOSDEVICES

USHORT  rc = DosPhysicalDisk(Function, DataPtr, DataLen, ParmPtr, ParmLen);

USHORT  Function;      /* Type of information */
PBYTE   DataPtr;       /* Pointer to return buffer */
USHORT  DataLen;       /* Return buffer length */
PBYTE   ParmPtr;       /* Pointer to user-supplied information */
USHORT  ParmLen;       /* Length of user-supplied information */

USHORT  rc;            /* return code */

MASM

EXTRN  DosPhysicalDisk:FAR
INCL_DOSDEVICES     EQU 1

PUSH   WORD    Function      ;Type of information
PUSH@  OTHER   DataPtr       ;Return buffer (returned)
PUSH   WORD    DataLen       ;Return buffer length
PUSH@  OTHER   ParmPtr       ;User-supplied information
PUSH   WORD    ParmLen       ;Length of user-supplied information
CALL   DosPhysicalDisk

Returns WORD