OpenFile

include vmm.inc

mov     edx, OFFSET32 Filename  ; address of name of file to open
mov     edi, OFFSET32 Buffer    ; buffer to receive full path
VMMCall OpenFile

jc      not_found               ; carry set if file not found
mov     [Handle], eax           ; MS-DOS file handle
 

Opens the specified file for reading (in compatibility mode). For Windows 95, this service can be called during or following initialization. Uses EAX, Flags.

Filename
Address of a null-terminated string specifying the name of the file to open.
Buffer
Address of a buffer that receives the full path of the file, if found. If this service is called during initialization, the buffer must be at least 128 bytes. If this service is called following initialization, the buffer size, in bytes, must be at least VMM_OPENFILE_BUF_SIZE.

If the specified filename includes a drive letter or path, the service looks for the file only in the specified drive and directory. Otherwise, the service searches for the file in the directories specified by the following:

Otherwise, the service does not search for the file. In either case, the service attempts to opens the file for reading (in compatibility mode), and returns the MS-DOS file handle if it is successful.

If WINDIR and PATH environment variables are not well formed, this service cannot guarantee that the full path copied to the Buffer parameter will be well formed.

This service fails if the current virtual machine cannot support a call to the Exec_Int service.

This service fails during initialization if the virtual machine has already used the _Allocate_Temp_V86_Data_Area service to allocate the temporary buffer.

See Also

_Allocate_Temp_V86_Data_Area, Exec_Int