win32s16.c 3.77 KB
Newer Older
Alexandre Julliard's avatar
Alexandre Julliard committed
1 2 3 4 5
/*
 * WIN32S16
 * DLL for Win32s
 *
 * Copyright (c) 1997 Andreas Mohr
6 7 8 9 10 11 12 13 14 15 16 17 18
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * 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
Alexandre Julliard's avatar
Alexandre Julliard committed
20 21
 */

22
#include <stdarg.h>
Alexandre Julliard's avatar
Alexandre Julliard committed
23 24
#include <string.h>
#include <stdlib.h>
25
#include "windef.h"
26
#include "winbase.h"
27
#include "wine/winbase16.h"
28
#include "wine/debug.h"
Alexandre Julliard's avatar
Alexandre Julliard committed
29

30
WINE_DEFAULT_DEBUG_CHANNEL(dll);
31

32
/***********************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
33
 *		BootTask (WIN32S16.2)
34
 */
35
void WINAPI BootTask16(void)
Alexandre Julliard's avatar
Alexandre Julliard committed
36
{
37
	MESSAGE("BootTask(): should only be used by WIN32S.EXE.\n");
Alexandre Julliard's avatar
Alexandre Julliard committed
38
}
Alexandre Julliard's avatar
Alexandre Julliard committed
39 40 41 42 43 44

/***********************************************************************
 *           StackLinearToSegmented       (WIN32S16.43)
 *
 * Written without any docu.
 */
45
SEGPTR WINAPI StackLinearToSegmented16(WORD w1, WORD w2)
Alexandre Julliard's avatar
Alexandre Julliard committed
46
{
47
	FIXME("(%d,%d):stub.\n",w1,w2);
48
	return 0;
Alexandre Julliard's avatar
Alexandre Julliard committed
49
}
50 51 52


/***********************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
53
 *           UTSelectorOffsetToLinear       (WIN32S16.48)
54 55 56 57 58
 *
 * rough guesswork, but seems to work (I had no "reasonable" docu)
 */
LPVOID WINAPI UTSelectorOffsetToLinear16(SEGPTR sptr)
{
59
        return MapSL(sptr);
60 61 62
}

/***********************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
63
 *           UTLinearToSelectorOffset       (WIN32S16.49)
64 65 66 67 68 69 70
 *
 * FIXME: I don't know if that's the right way to do linear -> segmented
 */
SEGPTR WINAPI UTLinearToSelectorOffset16(LPVOID lptr)
{
    return (SEGPTR)lptr;
}
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85

/***********************************************************************
 *           ContinueDebugEvent       (WIN32S16.5)
 */
BOOL WINAPI ContinueDebugEvent16(DWORD pid, DWORD tid, DWORD status)
{
    return ContinueDebugEvent(pid, tid, status);
}

/***********************************************************************
 *           ReadProcessMemory       (WIN32S16.6)
 */
BOOL WINAPI ReadProcessMemory16(HANDLE process, LPCVOID addr, LPVOID buffer,
				DWORD size, LPDWORD bytes_read)
{
86
    return ReadProcessMemory(process, addr, buffer, size, (SIZE_T *)bytes_read);
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
}

/***********************************************************************
 *           GetLastError       (WIN32S16.10)
 */
DWORD WINAPI GetLastError16(void)
{
    return GetLastError();
}

/***********************************************************************
 *           CloseHandle	(WIN32S16.11)
 */
BOOL WINAPI CloseHandle16(HANDLE handle)
{
    return CloseHandle(handle);
}

/***********************************************************************
 *           GetExitCodeThread	(WIN32S16.13)
 */
BOOL WINAPI GetExitCodeThread16(HANDLE hthread, LPDWORD exitcode)
{
    return GetExitCodeThread(hthread, exitcode);
}

/***********************************************************************
 *           VirtualQueryEx	(WIN32S16.18)
 */
DWORD WINAPI VirtualQueryEx16(HANDLE handle, LPCVOID addr,
117
			      PMEMORY_BASIC_INFORMATION info, DWORD len)
118 119 120 121 122 123 124 125 126 127 128 129
{
    return VirtualQueryEx(handle, addr, info, len);
}

/***********************************************************************
 *           VirtualProtectEx	(WIN32S16.19)
 */
BOOL WINAPI VirtualProtectEx16(HANDLE handle, LPVOID addr, DWORD size,
			       DWORD new_prot, LPDWORD old_prot)
{
    return VirtualProtectEx(handle, addr, size, new_prot, old_prot);
}