
Sun Oct 13 15:32:32 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [Make.rules.in] [*/Makefile.in] Made it possible to compile from a directory other than the source directory. * [graphics/metafiledrv/init.c] [include/metafiledrv.h] [objects/metafile.c] [objects/dc.c] New graphics driver for metafiles. * [if1632/thunk.c] Added thunks for SetWindowsHook and SetDCHook. * [windows/dialog.c] Fixed GetNextDlgGroupItem and GetNextDlgTabItem to skip disabled items. * [*/*] Removed non Win32-clean types HANDLE, HBITMAP, HBRUSH, HFONT, HINSTANCE, HMENU, HRGN and HTASK. Wed Oct 9 14:59:45 1996 Frans van Dorsselaer <dorssel@rulhm1.LeidenUniv.nl> * [controls/edit.c] Fixed EditWndProc() to fall back to DefWndProc() when the edit state structure is not available. Wed Oct 2 14:00:34 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [windows/nonclient.c] [windows/mdi.c] AdjustWindowRectEx16() should only take notice of the styles WS_DLGFRAME, WS_BORDER, WS_THICKFRAME and WS_EX_DLGMODALFRAME. Thanks to Alex Korobka. * [controls/scroll.c] Fixed typo in ShowScrollBar32(). Sun Aug 25 20:18:56 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [if1632/user32.spec] [if1632/winmm.spec] Added SetParent and sndPlaySoundA.
114 lines
2.9 KiB
C
114 lines
2.9 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;
|
|
}
|
|
|
|
/***********************************************************************
|
|
* GetModuleFileNameA (KERNEL32.235)
|
|
*/
|
|
DWORD GetModuleFileNameA(HMODULE32 hModule, LPSTR lpFilename, DWORD nSize)
|
|
{
|
|
strcpy(lpFilename, "c:\\dummy");
|
|
return 8;
|
|
}
|
|
|
|
/***********************************************************************
|
|
* 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;
|
|
}
|
|
|
|
/* 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;
|
|
}
|