- Use appropriate per-platform NDR_LOCAL Data Representation.
[wine] / dlls / win32s / win32s16.c
1 /*
2  * WIN32S16
3  * DLL for Win32s
4  *
5  * Copyright (c) 1997 Andreas Mohr
6  *
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.
11  *
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.
16  *
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  */
21
22 #include <string.h>
23 #include <stdlib.h>
24 #include "windef.h"
25 #include "wine/winbase16.h"
26 #include "wine/debug.h"
27
28 WINE_DEFAULT_DEBUG_CHANNEL(dll);
29
30 /***********************************************************************
31  *              BootTask (WIN32S16.2)
32  */
33 void WINAPI BootTask16()
34 {
35         MESSAGE("BootTask(): should only be used by WIN32S.EXE.\n");
36 }
37
38 /***********************************************************************
39  *           StackLinearToSegmented       (WIN32S16.43)
40  *
41  * Written without any docu.
42  */
43 SEGPTR WINAPI StackLinearToSegmented16(WORD w1, WORD w2)
44 {
45         FIXME("(%d,%d):stub.\n",w1,w2);
46         return (SEGPTR)NULL;
47 }
48
49
50 /***********************************************************************
51  *           UTSelectorOffsetToLinear       (WIN32S16.48)
52  *
53  * rough guesswork, but seems to work (I had no "reasonable" docu)
54  */
55 LPVOID WINAPI UTSelectorOffsetToLinear16(SEGPTR sptr)
56 {
57         return MapSL(sptr);
58 }
59
60 /***********************************************************************
61  *           UTLinearToSelectorOffset       (WIN32S16.49)
62  *
63  * FIXME: I don't know if that's the right way to do linear -> segmented
64  */
65 SEGPTR WINAPI UTLinearToSelectorOffset16(LPVOID lptr)
66 {
67     return (SEGPTR)lptr;
68 }
69
70 /***********************************************************************
71  *           ContinueDebugEvent       (WIN32S16.5)
72  */
73 BOOL WINAPI ContinueDebugEvent16(DWORD pid, DWORD tid, DWORD status)
74 {
75     return ContinueDebugEvent(pid, tid, status);
76 }
77
78 /***********************************************************************
79  *           ReadProcessMemory       (WIN32S16.6)
80  */
81 BOOL WINAPI ReadProcessMemory16(HANDLE process, LPCVOID addr, LPVOID buffer,
82                                 DWORD size, LPDWORD bytes_read)
83 {
84     return ReadProcessMemory(process, addr, buffer, size, bytes_read);
85 }
86
87 /***********************************************************************
88  *           GetLastError       (WIN32S16.10)
89  */
90 DWORD WINAPI GetLastError16(void)
91 {
92     return GetLastError();
93 }
94
95 /***********************************************************************
96  *           CloseHandle        (WIN32S16.11)
97  */
98 BOOL WINAPI CloseHandle16(HANDLE handle)
99 {
100     return CloseHandle(handle);
101 }
102
103 /***********************************************************************
104  *           GetExitCodeThread  (WIN32S16.13)
105  */
106 BOOL WINAPI GetExitCodeThread16(HANDLE hthread, LPDWORD exitcode)
107 {
108     return GetExitCodeThread(hthread, exitcode);
109 }
110
111 /***********************************************************************
112  *           VirtualQueryEx     (WIN32S16.18)
113  */
114 DWORD WINAPI VirtualQueryEx16(HANDLE handle, LPCVOID addr,
115                               LPMEMORY_BASIC_INFORMATION info, DWORD len)
116 {
117     return VirtualQueryEx(handle, addr, info, len);
118 }
119
120 /***********************************************************************
121  *           VirtualProtectEx   (WIN32S16.19)
122  */
123 BOOL WINAPI VirtualProtectEx16(HANDLE handle, LPVOID addr, DWORD size,
124                                DWORD new_prot, LPDWORD old_prot)
125 {
126     return VirtualProtectEx(handle, addr, size, new_prot, old_prot);
127 }