mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
75d86e1f06
Sun Nov 17 15:01:45 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [graphics/bitblt.c] [graphics/x11drv/bitblt.c] Moved BitBlt operations to the new graphics driver interface. Implemented PatBlt32, BitBlt32 and StretchBlt32. * [memory/global.c] Unified MemManInfo() and GlobalMemoryStatus(). * [objects/text.c] Fixed ExtTextOut() to always use physical coords for clip rect. * [windows/dialog.c] Implemented DlgDirSelectEx() and Win32 version of DlgDirSelect*. * [windows/event.c] Avoid busy-looping in EVENT_WaitXEvent when no timer is pending (thanks to Thomas Koenig). * [windows/painting.c] Moved update region clipping for CS_PARENTDC windows to BeginPaint(). * [windows/scroll.c] Implemented Win32 version of ScrollWindow() and ScrollDC(). Tue Nov 12 09:52:17 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/*.c] [win32/file.c] Some win32 filetime conversion functions added. Fixed behaviour with DOS drives pointing to UNIX / SetCurrentDirectory() may also get X:\xxx paths. Fixed FILE_Open when called from CreateFile(). Added GetFileSize(), MapViewOfFile(), SetFileTime(), GetFileTime(). * [misc/crtdll.c] [if1632/crtdll.spec] Added some new functions. * [if1632/user32.spec] Some thunks into win16 code added. * [win32/init.c] Added GetSystemInfo(), removed GetModuleFileName() stub. * [win32/code_page.c] [if1632/thunk.c] Added EnumSystemCodePages* (untested). * [objects/font.c] [if1632/thunk.c] Added EnumFontFamilies32*. Mon Nov 11 14:50:24 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [controls/menu.c] [windows/mdi.c] Don't delete the MDI `windows' menu if it's already been deleted. * [misc/exec.c] Notepad always calls WinHelp(.., HELP_QUIT, ...) at termination and complains if it returns FALSE. * [windows/winpos.c] Get maximized MDI child's nonclient area redrawn after resize. Thu Nov 7 13:32:34 1996 Lee Jaekil <juria@seodu.co.kr> * [memory/global.c] Use /proc filesystem for GlobalMemoryStatus() on Linux. Mon Nov 4 18:30:00 1996 Alex Korobka <alex@trantor.pharm.sunysb.edu> * [windows/event.c] Added OffiX-style file drop handling. File paths must be DOS-mappable by Wine (via wine.conf). * [controls/combo.c] Added WM_GETTEXT handler. * [objects/palette.c] Added ResizePalette() (untested). * [objects/cursoricon.c] Implemented icon to cursor conversion. * [objects/color.c] Fixed crash on startup when no colorcells are writeable. Mon Nov 4 00:49:41 1996 Ulrich Schmid <uschmid@mail.hh.provi.de> * [rc/winerc.c] Added support for win32 output. * [library/libres.c] [include/libres.h] [loader/resource.c] Renamed LIBRES_FindResource to LIBRES_FindResource16. Added LIBRES_FindResource32. Sun Nov 3 21:21:45 1996 Robert Pouliot <krynos@clic.net> * [loader/builtin.c] [if1632/Makefile.in] [if1632/wing.spec] Added the spec file for WinG, it's only stub for now, but it should be easy to do by someone with Windows programming knowledge. See: ftp.microsoft.com/SoftLib/MSLFILES/wing10.exe. * [if1632/crtdll.spec] Added some string and memory functions to make sfxed95.exe (of Warcraft 2) almost work.
124 lines
3.2 KiB
C
124 lines
3.2 KiB
C
/*
|
|
* Win32 kernel functions
|
|
*
|
|
* Copyright 1995 Martin von Loewis and Cameron Heide
|
|
*/
|
|
|
|
#include <string.h>
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include "windows.h"
|
|
#include "winerror.h"
|
|
#include "handle32.h"
|
|
#include "except.h"
|
|
#include "task.h"
|
|
#include "stddebug.h"
|
|
#define DEBUG_WIN32
|
|
#include "debug.h"
|
|
|
|
/* The global error value
|
|
*/
|
|
int WIN32_LastError;
|
|
|
|
/*********************************************************************
|
|
* CloseHandle (KERNEL32.23)
|
|
*/
|
|
BOOL CloseHandle(KERNEL_OBJECT *handle)
|
|
{
|
|
if(ValidateKernelObject(handle) != 0)
|
|
{
|
|
SetLastError(ERROR_INVALID_HANDLE);
|
|
return 0;
|
|
}
|
|
|
|
if (handle<0x1000) /* FIXME: hack */
|
|
return CloseFileHandle(handle);
|
|
switch(handle->magic)
|
|
{
|
|
case KERNEL_OBJECT_UNUSED:
|
|
SetLastError(ERROR_INVALID_HANDLE);
|
|
return 0;
|
|
/* FIXME
|
|
case KERNEL_OBJECT_FILE:
|
|
rc = CloseFileHandle((FILE_OBJECT *)handle);
|
|
break;
|
|
*/
|
|
|
|
default:
|
|
dprintf_win32(stddeb, "CloseHandle: type %ld not implemented yet.\n",
|
|
handle->magic);
|
|
break;
|
|
}
|
|
|
|
ReleaseKernelObject(handle);
|
|
return 0;
|
|
}
|
|
|
|
/***********************************************************************
|
|
* GetModuleHandle (KERNEL32.237)
|
|
*/
|
|
HMODULE32 WIN32_GetModuleHandle(char *module)
|
|
{
|
|
HMODULE32 hModule;
|
|
|
|
dprintf_win32(stddeb, "GetModuleHandle: %s\n", module ? module : "NULL");
|
|
/* Freecell uses the result of GetModuleHandleA(0) as the hInstance in
|
|
all calls to e.g. CreateWindowEx. */
|
|
if (module == NULL) {
|
|
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
|
|
hModule = pTask->hInstance;
|
|
} else
|
|
hModule = GetModuleHandle(module);
|
|
dprintf_win32(stddeb, "GetModuleHandle: returning %d\n", hModule );
|
|
return hModule;
|
|
}
|
|
|
|
/***********************************************************************
|
|
* GetStartupInfoA (KERNEL32.273)
|
|
*/
|
|
VOID GetStartupInfoA(LPSTARTUPINFO lpStartupInfo)
|
|
{
|
|
lpStartupInfo->cb = sizeof(STARTUPINFO);
|
|
lpStartupInfo->lpReserved = NULL;
|
|
lpStartupInfo->lpDesktop = "Desktop";
|
|
lpStartupInfo->lpTitle = "Title";
|
|
|
|
lpStartupInfo->cbReserved2 = 0;
|
|
lpStartupInfo->lpReserved2 = NULL; /* must be NULL for VC runtime */
|
|
lpStartupInfo->hStdInput = (HANDLE32)0;
|
|
lpStartupInfo->hStdOutput = (HANDLE32)1;
|
|
lpStartupInfo->hStdError = (HANDLE32)2;
|
|
}
|
|
|
|
/***********************************************************************
|
|
* GetStartupInfoA (KERNEL32.284)
|
|
* FIXME: perhaps supply better values.
|
|
*/
|
|
VOID
|
|
GetSystemInfo(LPSYSTEM_INFO si) {
|
|
si->dwOemId = 0x12345678;
|
|
si->dwPageSize = 4096; /* 4K */
|
|
si->lpMinimumApplicationAddress = 0x40000000;
|
|
si->lpMaximumApplicationAddress = 0x80000000;
|
|
si->dwActiveProcessorMask = 1;
|
|
si->dwNumberOfProcessors = 1;
|
|
#ifdef WINELIB
|
|
si->dwProcessorType = 3;
|
|
#else
|
|
si->dwProcessorType = runtime_cpu();
|
|
#endif
|
|
si->dwAllocationGranularity = 8; /* hmm? */
|
|
}
|
|
|
|
/* Initialize whatever internal data structures we need.
|
|
*
|
|
* Returns 1 on success, 0 on failure.
|
|
*/
|
|
int KERN32_Init(void)
|
|
{
|
|
#ifndef WINELIB
|
|
/* Initialize exception handling */
|
|
EXC_Init();
|
|
#endif
|
|
return 1;
|
|
}
|