localspl: Add unixname port extension.
[wine.git] / dlls / w32sys.dll16 / w32sys.c
blobbab0a83604ededff5144048529ba0ed32409633d
1 /*
2 * W32SYS
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
22 #include <stdarg.h>
23 #include <stdio.h>
25 #include "windef.h"
26 #include "winbase.h"
27 #include "wine/windef16.h"
28 #include "wine/winbase16.h"
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(dll);
33 typedef struct
35 BYTE bMajor;
36 BYTE bMinor;
37 WORD wBuildNumber;
38 BOOL16 fDebug;
39 } WIN32SINFO, *LPWIN32SINFO;
41 /***********************************************************************
42 * GetWin32sInfo (W32SYS.12)
43 * RETURNS
44 * 0 on success, 1 on failure
46 WORD WINAPI GetWin32sInfo16(
47 LPWIN32SINFO lpInfo /* [out] Win32S special information */
48 ) {
49 lpInfo->bMajor = 1;
50 lpInfo->bMinor = 3;
51 lpInfo->wBuildNumber = 0;
52 lpInfo->fDebug = FALSE;
54 return 0;
57 /***********************************************************************
58 * GetW32SysVersion (W32SYS.5)
60 WORD WINAPI GetW32SysVersion16(void)
62 return 0x100;
65 /***********************************************************************
66 * GetPEResourceTable (W32SYS.7)
67 * retrieves the resourcetable from the passed filedescriptor
68 * RETURNS
69 * dunno what.
71 WORD WINAPI GetPEResourceTable16(
72 HFILE16 hf /* [in] Handle of executable file */
73 ) {
74 return 0;
77 /***********************************************************************
78 * LoadPeResource (W32SYS.11)
80 DWORD WINAPI LoadPeResource16(WORD x,SEGPTR y) {
81 FIXME("(0x%04x,0x%08lx),stub!\n",x,y);
82 return 0;
86 /**********************************************************************
87 * IsPeFormat (W32SYS.2)
88 * Check if a file is a PE format executable.
89 * RETURNS
90 * TRUE, if it is.
91 * FALSE if not.
93 BOOL16 WINAPI IsPeFormat16( LPSTR fn, /* [in] filename of executable */
94 HFILE16 hf16 ) /* [in] open file, if filename is NULL */
96 BOOL16 ret = FALSE;
97 IMAGE_DOS_HEADER mzh;
98 OFSTRUCT ofs;
99 DWORD xmagic;
100 HFILE hf;
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);
111 done:
112 if (fn) _lclose(hf);
113 return ret;