3 * helper DLL for Win32s
5 * Copyright (c) 1996 Anand Kumria
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #include "wine/windef16.h"
28 #include "wine/winbase16.h"
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(dll
);
39 } WIN32SINFO
, *LPWIN32SINFO
;
41 /***********************************************************************
42 * GetWin32sInfo (W32SYS.12)
44 * 0 on success, 1 on failure
46 WORD WINAPI
GetWin32sInfo16(
47 LPWIN32SINFO lpInfo
/* [out] Win32S special information */
51 lpInfo
->wBuildNumber
= 0;
52 lpInfo
->fDebug
= FALSE
;
57 /***********************************************************************
58 * GetW32SysVersion (W32SYS.5)
60 WORD WINAPI
GetW32SysVersion16(void)
65 /***********************************************************************
66 * GetPEResourceTable (W32SYS.7)
67 * retrieves the resourcetable from the passed filedescriptor
71 WORD WINAPI
GetPEResourceTable16(
72 HFILE16 hf
/* [in] Handle of executable file */
77 /***********************************************************************
78 * LoadPeResource (W32SYS.11)
80 DWORD WINAPI
LoadPeResource16(WORD x
,SEGPTR y
) {
81 FIXME("(0x%04x,0x%08lx),stub!\n",x
,y
);
86 /**********************************************************************
87 * IsPeFormat (W32SYS.2)
88 * Check if a file is a PE format executable.
93 BOOL16 WINAPI
IsPeFormat16( LPSTR fn
, /* [in] filename of executable */
94 HFILE16 hf16
) /* [in] open file, if filename is NULL */
102 if (fn
) hf
= OpenFile(fn
,&ofs
,OF_READ
);
103 else hf
= (HFILE
)DosFileHandleToWin32Handle( hf16
);
104 if (hf
== HFILE_ERROR
) return FALSE
;
105 _llseek(hf
,0,SEEK_SET
);
106 if (sizeof(mzh
)!=_lread(hf
,&mzh
,sizeof(mzh
))) goto done
;
107 if (mzh
.e_magic
!=IMAGE_DOS_SIGNATURE
) goto done
;
108 _llseek(hf
,mzh
.e_lfanew
,SEEK_SET
);
109 if (sizeof(DWORD
)!=_lread(hf
,&xmagic
,sizeof(DWORD
))) goto done
;
110 ret
= (xmagic
== IMAGE_NT_SIGNATURE
);