1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00
wine/kernel.c
Alexandre Julliard 121bd98c16 Release 0.1.0
WHAT'S NEW with version 0.1.0:
    - Integrated patches from Alexandre.
    - Minor bug fix in if1632.S

WHAT'S NEW with version 0.0.5:
    - Patches from Alexandre Julliard.  Some integration with Tcl.
    - Generic interface for callback procedures.  This will allow
      callbacks into DLLs.
    - MakeProcInstance() has been implemented but untested.

WHAT'S NEW with version 0.0.4:
    - Eric Youngdale modified wine.c and selector.c to allow loading
      of Windows DLLs.
    - Added global memory allocation routines (GlobalAlloc, GlobalFree,
      and GlobalLock)
    - Bitmap resource loading into global memory.
1993-07-08 17:37:25 +00:00

109 lines
2.2 KiB
C

static char RCSId[] = "$Id: kernel.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <stdio.h>
#include <stdlib.h>
#include "prototypes.h"
extern unsigned short *Stack16Frame;
/**********************************************************************
* KERNEL_GetVersion
*
* Return the version of Windows that we emulate.
*/
int
KERNEL_GetVersion(void)
{
return 0x0301;
}
/**********************************************************************
* KERNEL_LockSegment
*/
int
KERNEL_LockSegment(int segment)
{
if (segment == -1)
segment = *(Stack16Frame + 6);
#ifdef RELAY_DEBUG
printf("LockSegment: segment %x\n", segment);
#endif
return segment;
}
/**********************************************************************
* KERNEL_UnlockSegment
*/
int
KERNEL_UnlockSegment(int segment)
{
if (segment == -1)
segment = *(Stack16Frame + 6);
#ifdef RELAY_DEBUG
printf("UnlockSegment: segment %x\n", segment);
#endif
return segment;
}
/**********************************************************************
* KERNEL_WaitEvent
*/
int
KERNEL_WaitEvent(int task)
{
#ifdef RELAY_DEBUG
printf("WaitEvent: task %d\n", task);
#endif
return 0;
}
/**********************************************************************
* KERNEL_GetModuleFileName
*/
int
KERNEL_GetModuleFileName(int module, char *filename, int bytes)
{
#ifdef RELAY_DEBUG
printf("GetModuleFileName: module %d, filename %x, bytes %d\n",
module, filename, bytes);
#endif
strcpy(filename, "TEST.EXE");
return strlen(filename);
}
/**********************************************************************
* KERNEL_DOS3Call
*/
int
KERNEL_DOS3Call(int ax, int cx, int dx, int bx, int sp, int bp,
int si, int di, int ds, int es)
{
switch ((ax >> 8) & 0xff)
{
case 0x30:
return 0x0303;
case 0x25:
case 0x35:
return 0;
case 0x4c:
exit(ax & 0xff);
default:
fprintf(stderr, "DOS: AX %04x, BX %04x, CX %04x, DX %04x\n",
ax, bx, cx, dx);
fprintf(stderr, " SP %04x, BP %04x, SI %04x, DI %04x\n",
sp, bp, si, di);
fprintf(stderr, " DS %04x, ES %04x\n",
ds, es);
}
return 0;
}