DosQAppType

From EDM2
Revision as of 04:00, 26 January 2020 by Ak120 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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

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