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
32 #include "wine/windef16.h"
33 #include "wine/winbase16.h"
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(dll
);
44 } WIN32SINFO
, *LPWIN32SINFO
;
46 /***********************************************************************
47 * GetWin32sInfo (W32SYS.12)
49 * 0 on success, 1 on failure
51 WORD WINAPI
GetWin32sInfo16(
52 LPWIN32SINFO lpInfo
/* [out] Win32S special information */
56 lpInfo
->wBuildNumber
= 0;
57 lpInfo
->fDebug
= FALSE
;
62 /***********************************************************************
63 * GetW32SysVersion (W32SYS.5)
65 WORD WINAPI
GetW32SysVersion16(void)
70 /***********************************************************************
71 * GetPEResourceTable (W32SYS.7)
72 * retrieves the resourcetable from the passed filedescriptor
76 WORD WINAPI
GetPEResourceTable16(
77 HFILE16 hf
/* [in] Handle of executable file */
82 /***********************************************************************
83 * LoadPeResource (W32SYS.11)
85 DWORD WINAPI
LoadPeResource16(WORD x
,SEGPTR y
) {
86 FIXME("(0x%04x,0x%08lx),stub!\n",x
,y
);
91 /**********************************************************************
92 * IsPeFormat (W32SYS.2)
93 * Check if a file is a PE format executable.
98 BOOL16 WINAPI
IsPeFormat16( LPSTR fn
, /* [in] filename of executable */
99 HFILE16 hf16
) /* [in] open file, if filename is NULL */
102 IMAGE_DOS_HEADER mzh
;
107 if (fn
) hf
= OpenFile(fn
,&ofs
,OF_READ
);
108 else hf
= (HFILE
)DosFileHandleToWin32Handle( hf16
);
109 if (hf
== HFILE_ERROR
) return FALSE
;
110 _llseek(hf
,0,SEEK_SET
);
111 if (sizeof(mzh
)!=_lread(hf
,&mzh
,sizeof(mzh
))) goto done
;
112 if (mzh
.e_magic
!=IMAGE_DOS_SIGNATURE
) goto done
;
113 _llseek(hf
,mzh
.e_lfanew
,SEEK_SET
);
114 if (sizeof(DWORD
)!=_lread(hf
,&xmagic
,sizeof(DWORD
))) goto done
;
115 ret
= (xmagic
== IMAGE_NT_SIGNATURE
);