DosQHandType: Difference between revisions
Appearance
No edit summary |
mNo edit summary |
||
Line 23: | Line 23: | ||
==Return Code== | ==Return Code== | ||
;rc (USHORT) - return:Return code descriptions are: | |||
Return code descriptions are: | * 0 NO_ERROR | ||
* 0 | * 6 ERROR_INVALID_HANDLE | ||
* 6 | |||
==Remarks== | ==Remarks== | ||
This function allows programs that are interactive or file-oriented to determine the source of their input. For example, CMD.EXE suppresses writing prompts if the input is from a disk file. | This function allows programs that are interactive or file-oriented to determine the source of their input. For example, CMD.EXE suppresses writing prompts if the input is from a disk file. | ||
== | ==Bindings== | ||
=== C | === C === | ||
<PRE> | <PRE> | ||
#define INCL_DOSFILEMGR | #define INCL_DOSFILEMGR | ||
Line 38: | Line 37: | ||
USHORT rc = DosQHandType(FileHandle, HandType, FlagWord); | USHORT rc = DosQHandType(FileHandle, HandType, FlagWord); | ||
HFILE | HFILE FileHandle; /* File handle */ | ||
PUSHORT | PUSHORT HandType; /* Handle type (returned) */ | ||
PUSHORT | PUSHORT FlagWord; /* Device driver attribute (returned) */ | ||
USHORT | USHORT rc; /* return code */ | ||
</PRE> | </PRE> | ||
===MASM | ===MASM=== | ||
<PRE> | <PRE> | ||
EXTRN DosQHandType:FAR | EXTRN DosQHandType:FAR | ||
Line 57: | Line 56: | ||
Returns WORD | Returns WORD | ||
</PRE> | </PRE> | ||
[[Category:Dos]] | [[Category:Dos]] |
Revision as of 12:59, 24 November 2019
![]() | |
---|---|
It is recommended to use a newer replacement for this function. | |
Replacement: | DosQueryHType |
Remarks: | This function was renamed to DosQueryHType on OS/2 2.0. |
This call determines whether a handle references a file or a device.
Syntax
DosQHandType (FileHandle, HandType, FlagWord)
Parameters
- FileHandle (HFILE) - input
- File handle.
- HandType (PUSHORT) - output
- Address of the value indicating the handle type. HandType is composed of two bytes:
- 15 - Network bit:
- 0 = The handle refers to a local file, device, or pipe.
- 1 = Means that the handle refers to a remote file, device, or pipe.
- 14-8 - Reserved.
- 7-0 - HandleClass describes the handle class. It may take on the following values in the low byte of HandleType:
- 0 - Handle is for a disk file
- 1 - Handle is for a character device
- 2 - Handle is for a pipe.
- Values greater than 2 are reserved.
- FlagWord (PUSHORT) - output
- Address of the device driver's attribute word if HandleType indicates a local character device.
Return Code
- rc (USHORT) - return
- Return code descriptions are:
- 0 NO_ERROR
- 6 ERROR_INVALID_HANDLE
Remarks
This function allows programs that are interactive or file-oriented to determine the source of their input. For example, CMD.EXE suppresses writing prompts if the input is from a disk file.
Bindings
C
#define INCL_DOSFILEMGR USHORT rc = DosQHandType(FileHandle, HandType, FlagWord); HFILE FileHandle; /* File handle */ PUSHORT HandType; /* Handle type (returned) */ PUSHORT FlagWord; /* Device driver attribute (returned) */ USHORT rc; /* return code */
MASM
EXTRN DosQHandType:FAR INCL_DOSFILEMGR EQU 1 PUSH WORD FileHandle ;File handle PUSH@ WORD HandType ;Handle type (returned) PUSH@ WORD FlagWord ;Device driver attribute (returned) CALL DosQHandType Returns WORD