1996-04-21 16:57:41 +02:00
|
|
|
/*
|
|
|
|
* W32SYS
|
|
|
|
* helper DLL for Win32s
|
|
|
|
*
|
|
|
|
* Copyright (c) 1996 Anand Kumria
|
|
|
|
*/
|
|
|
|
|
2000-11-27 23:03:23 +01:00
|
|
|
#include <unistd.h>
|
|
|
|
|
1999-03-14 17:35:05 +01:00
|
|
|
#include "windef.h"
|
2000-09-27 00:20:14 +02:00
|
|
|
#include "wine/windef16.h"
|
2000-11-27 23:03:23 +01:00
|
|
|
#include "wine/winbase16.h"
|
1999-09-10 15:51:11 +02:00
|
|
|
#include "debugtools.h"
|
|
|
|
|
2000-08-09 02:54:58 +02:00
|
|
|
DEFAULT_DEBUG_CHANNEL(dll);
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
BYTE bMajor;
|
|
|
|
BYTE bMinor;
|
|
|
|
WORD wBuildNumber;
|
|
|
|
BOOL16 fDebug;
|
|
|
|
} WIN32SINFO, *LPWIN32SINFO;
|
1999-09-10 15:51:11 +02:00
|
|
|
|
1996-04-21 16:57:41 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* GetWin32sInfo (W32SYS.12)
|
1998-03-29 21:44:57 +02:00
|
|
|
* RETURNS
|
|
|
|
* 0 on success, 1 on failure
|
1996-04-21 16:57:41 +02:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
WORD WINAPI GetWin32sInfo16(
|
1998-03-29 21:44:57 +02:00
|
|
|
LPWIN32SINFO lpInfo /* [out] Win32S special information */
|
|
|
|
) {
|
1996-04-21 16:57:41 +02:00
|
|
|
lpInfo->bMajor = 1;
|
|
|
|
lpInfo->bMinor = 3;
|
|
|
|
lpInfo->wBuildNumber = 0;
|
|
|
|
lpInfo->fDebug = FALSE;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
1998-03-29 21:44:57 +02:00
|
|
|
|
1999-07-11 19:20:01 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* GetW32SysVersion16 (W32SYS.5)
|
|
|
|
*/
|
1999-07-24 12:28:37 +02:00
|
|
|
WORD WINAPI GetW32SysVersion16(void)
|
1999-07-11 19:20:01 +02:00
|
|
|
{
|
|
|
|
return 0x100;
|
|
|
|
}
|
|
|
|
|
1998-03-29 21:44:57 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* GetPEResourceTable (W32SYS.7)
|
|
|
|
* retrieves the resourcetable from the passed filedescriptor
|
|
|
|
* RETURNS
|
|
|
|
* dunno what.
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
WORD WINAPI GetPEResourceTable16(
|
1998-03-29 21:44:57 +02:00
|
|
|
HFILE16 hf /* [in] filedescriptor to opened executeable */
|
|
|
|
) {
|
|
|
|
return 0;
|
|
|
|
}
|
1999-09-10 15:51:11 +02:00
|
|
|
|
2000-04-06 22:21:16 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* LoadPeResource
|
|
|
|
*/
|
1999-09-10 15:51:11 +02:00
|
|
|
DWORD WINAPI LoadPeResource16(WORD x,SEGPTR y) {
|
|
|
|
FIXME("(0x%04x,0x%08lx),stub!\n",x,y);
|
|
|
|
return 0;
|
|
|
|
}
|
2000-11-27 23:03:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* IsPeFormat16 (W32SYS.2)
|
|
|
|
* Checks the passed filename if it is a PE format executeable
|
|
|
|
* RETURNS
|
|
|
|
* TRUE, if it is.
|
|
|
|
* FALSE if not.
|
|
|
|
*/
|
|
|
|
BOOL16 WINAPI IsPeFormat16( LPSTR fn, /* [in] filename to executeable */
|
|
|
|
HFILE16 hf16 ) /* [in] open file, if filename is NULL */
|
|
|
|
{
|
|
|
|
BOOL16 ret = FALSE;
|
|
|
|
IMAGE_DOS_HEADER mzh;
|
|
|
|
OFSTRUCT ofs;
|
|
|
|
DWORD xmagic;
|
|
|
|
HFILE hf;
|
|
|
|
|
|
|
|
if (fn) hf = OpenFile(fn,&ofs,OF_READ);
|
|
|
|
else hf = DosFileHandleToWin32Handle( hf16 );
|
|
|
|
if (hf == HFILE_ERROR) return FALSE;
|
|
|
|
_llseek(hf,0,SEEK_SET);
|
|
|
|
if (sizeof(mzh)!=_lread(hf,&mzh,sizeof(mzh))) goto done;
|
|
|
|
if (mzh.e_magic!=IMAGE_DOS_SIGNATURE) goto done;
|
|
|
|
_llseek(hf,mzh.e_lfanew,SEEK_SET);
|
|
|
|
if (sizeof(DWORD)!=_lread(hf,&xmagic,sizeof(DWORD))) goto done;
|
|
|
|
ret = (xmagic == IMAGE_NT_SIGNATURE);
|
|
|
|
done:
|
|
|
|
if (fn) _lclose(hf);
|
|
|
|
return ret;
|
|
|
|
}
|