DosQAppType: Difference between revisions
Appearance
mNo edit summary |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
This call returns the application type of an executable file. | This call returns the application type of an executable file. | ||
Line 11: | Line 6: | ||
==Parameters== | ==Parameters== | ||
;ExecutableFileName (PSZ) - input : Address of the ASCIIZ string containing the filename of the executable file where the flags are returned. | ;ExecutableFileName (PSZ) - input : Address of the ASCIIZ string containing the filename of the executable file where the flags are returned. | ||
:If the string appears to be a fully qualified path (contains a ":" in the second position and/or contains a "\"), only the indicated drive:directory is searched. If the string is not a fully qualified path, the current directory is searched. If the filename is not found in the current directory, each drive:directory specification in the PATH defined in the current program's environment is searched for this file. Note that any extension (.xxx) is acceptable for the executable filename. If no extension is specified, a default extension of ".exe" is used. AppType is a word that contains flags denoting the application type, as determined by reading the executable file header specified by ExecutableFileName. Note that the call sequence passes a pointer to a location in application memory to return the application type flags. | |||
If the string appears to be a fully qualified path (contains a ":" in the second position and/or contains a "\"), only the indicated drive:directory is searched. If the string is not a fully qualified path, the current directory is searched. If the filename is not found in the current directory, each drive:directory specification in the PATH defined in the current program's environment is searched for this file. Note that any extension (.xxx) is acceptable for the executable filename. If no extension is specified, a default extension of ".exe" is used. AppType is a word that contains flags denoting the application type, as determined by reading the executable file header specified by ExecutableFileName. Note that the call sequence passes a pointer to a location in application memory to return the application type flags. | |||
;AppType (PUSHORT) - output : Address of the application type defined as follows: | ;AppType (PUSHORT) - output : Address of the application type defined as follows: | ||
::15-6 Reserved. | ::15-6 Reserved. | ||
Line 20: | Line 13: | ||
::3 Set to 1 if executable has been "bound" (BIND command) as a Family API application. Bits 0, 1 and 2 still apply. | ::3 Set to 1 if executable has been "bound" (BIND command) as a Family API application. Bits 0, 1 and 2 still apply. | ||
::2-0 Bits 2, 1 and 0 indicate application type, as specified in the header of the executable file. | ::2-0 Bits 2, 1 and 0 indicate application type, as specified in the header of the executable file. | ||
:::Values: | |||
Values: | ::::000 Application type is not specified in executable header. | ||
::::001 Application is NOTWINDOWCOMPAT | |||
::::010 Application type is WINDOWCOMPAT | |||
::::011 Application type is WINDOWAPI | |||
==Return Code== | ==Return Code== | ||
;rc (USHORT) - return:Return code descriptions are: | |||
Return code descriptions are: | * 0 NO_ERROR | ||
* 0 | * 2 ERROR_FILE_NOT_FOUND | ||
* 2 | * 3 ERROR_PATH_NOT_FOUND | ||
* 3 | * 4 ERROR_TOO_MANY_OPEN_FILES | ||
* 4 | *11 ERROR_BAD_FORMAT | ||
* 11 | *15 ERROR_INVALID_DRIVE | ||
* 15 | *32 ERROR_SHARING_VIOLATION | ||
* 32 | *108 ERROR_DRIVE_LOCKED | ||
* 108 ERROR_DRIVE_LOCKED | *110 ERROR_OPEN_FAILED | ||
* 110 ERROR_OPEN_FAILED | *191 ERROR_INVALID_EXE_SIGNATURE | ||
* 191 ERROR_INVALID_EXE_SIGNATURE | *192 ERROR_EXE_MARKED_INVALID | ||
* 192 ERROR_EXE_MARKED_INVALID | |||
==Remarks== | ==Remarks== | ||
This function is used by the Presentation Manager shell to determine the application type being executed. The application type is specified at link time in the module definition file. | This function is used by the Presentation Manager shell to determine the application type being executed. The application type is specified at link time in the module definition file. | ||
== | ==Bindings== | ||
=== C | ===C=== | ||
<PRE> | <PRE> | ||
#define INCL_DOSSESMGR | #define INCL_DOSSESMGR | ||
Line 57: | Line 48: | ||
</PRE> | </PRE> | ||
===MASM | ===MASM=== | ||
<PRE> | <PRE> | ||
EXTRN DosQAppType:FAR | EXTRN DosQAppType:FAR | ||
Line 69: | Line 60: | ||
</PRE> | </PRE> | ||
[[Category: | [[Category:Dos16]] |
Latest revision as of 06:00, 26 January 2020
This call returns the application type of an executable file.
Syntax
DosQAppType (ExecutableFileName, AppType)
Parameters
- ExecutableFileName (PSZ) - input
- Address of the ASCIIZ string containing the filename of the executable file where the flags are returned.
- If the string appears to be a fully qualified path (contains a ":" in the second position and/or contains a "\"), only the indicated drive:directory is searched. If the string is not a fully qualified path, the current directory is searched. If the filename is not found in the current directory, each drive:directory specification in the PATH defined in the current program's environment is searched for this file. Note that any extension (.xxx) is acceptable for the executable filename. If no extension is specified, a default extension of ".exe" is used. AppType is a word that contains flags denoting the application type, as determined by reading the executable file header specified by ExecutableFileName. Note that the call sequence passes a pointer to a location in application memory to return the application type flags.
- AppType (PUSHORT) - output
- Address of the application type defined as follows:
- 15-6 Reserved.
- 5 Set to 1 if executable file is PC DOS format. Bits 0, 1, 2, 3, and 4 are set to zero.
- 4 Set to 1 if executable file is a dynamic link module. Bits 0, 1, 2, 3, and 5 are set to 0.
- 3 Set to 1 if executable has been "bound" (BIND command) as a Family API application. Bits 0, 1 and 2 still apply.
- 2-0 Bits 2, 1 and 0 indicate application type, as specified in the header of the executable file.
- Values:
- 000 Application type is not specified in executable header.
- 001 Application is NOTWINDOWCOMPAT
- 010 Application type is WINDOWCOMPAT
- 011 Application type is WINDOWAPI
- Values:
Return Code
- rc (USHORT) - return
- Return code descriptions are:
- 0 NO_ERROR
- 2 ERROR_FILE_NOT_FOUND
- 3 ERROR_PATH_NOT_FOUND
- 4 ERROR_TOO_MANY_OPEN_FILES
- 11 ERROR_BAD_FORMAT
- 15 ERROR_INVALID_DRIVE
- 32 ERROR_SHARING_VIOLATION
- 108 ERROR_DRIVE_LOCKED
- 110 ERROR_OPEN_FAILED
- 191 ERROR_INVALID_EXE_SIGNATURE
- 192 ERROR_EXE_MARKED_INVALID
Remarks
This function is used by the Presentation Manager shell to determine the application type being executed. The application type is specified at link time in the module definition file.
Bindings
C
#define INCL_DOSSESMGR USHORT rc = DosQAppType(ExecutableFileName, AppType); PSZ ExecutableFileName; /* Address of executable file path name string */ PUSHORT AppType; /* Address to put application type flags */ USHORT rc; /* return code */
MASM
EXTRN DosQAppType:FAR INCL_DOSSESMGR EQU 1 PUSH@ ASCIIZ ExecutableFileName ;Executable file path name string PUSH@ WORD AppType; ;Application type flags (returned) CALL DosQAppType Returns WORD