Added winebrowser app that launches a Unix browser.
[wine/testsucceed.git] / dlls / winedos / module.c
blob0326082150bbb60ddbec9b110e4a354f0b0c47a3
1 /*
2 * DOS (MZ) loader
4 * Copyright 1998 Ove Kåven
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * Note: This code hasn't been completely cleaned up yet.
23 #include "config.h"
24 #include "wine/port.h"
26 #include <stdarg.h>
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <string.h>
30 #include <fcntl.h>
31 #include <signal.h>
32 #ifdef HAVE_UNISTD_H
33 # include <unistd.h>
34 #endif
35 #include <sys/types.h>
36 #include <sys/stat.h>
37 #ifdef HAVE_SYS_TIME_H
38 # include <sys/time.h>
39 #endif
40 #include "windef.h"
41 #include "winbase.h"
42 #include "wine/winbase16.h"
43 #include "wingdi.h"
44 #include "winuser.h"
45 #include "winerror.h"
46 #include "wine/debug.h"
47 #include "dosexe.h"
48 #include "dosvm.h"
49 #include "vga.h"
51 WINE_DEFAULT_DEBUG_CHANNEL(module);
53 static BOOL DOSVM_isdosexe;
55 /**********************************************************************
56 * DOSVM_IsWin16
58 * Return TRUE if we are in Windows process.
60 BOOL DOSVM_IsWin16(void)
62 return DOSVM_isdosexe ? FALSE : TRUE;
65 #ifdef MZ_SUPPORTED
67 #ifdef HAVE_SYS_MMAN_H
68 # include <sys/mman.h>
69 #endif
71 /* define this to try mapping through /proc/pid/mem instead of a temp file,
72 but Linus doesn't like mmapping /proc/pid/mem, so it doesn't work for me */
73 #undef MZ_MAPSELF
75 #define BIOS_DATA_SEGMENT 0x40
76 #define PSP_SIZE 0x10
78 #define SEG16(ptr,seg) ((LPVOID)((BYTE*)ptr+((DWORD)(seg)<<4)))
79 #define SEGPTR16(ptr,segptr) ((LPVOID)((BYTE*)ptr+((DWORD)SELECTOROF(segptr)<<4)+OFFSETOF(segptr)))
81 /* structures for EXEC */
83 typedef struct {
84 WORD env_seg;
85 DWORD cmdline WINE_PACKED;
86 DWORD fcb1 WINE_PACKED;
87 DWORD fcb2 WINE_PACKED;
88 WORD init_sp;
89 WORD init_ss;
90 WORD init_ip;
91 WORD init_cs;
92 } ExecBlock;
94 typedef struct {
95 WORD load_seg;
96 WORD rel_seg;
97 } OverlayBlock;
99 /* global variables */
101 pid_t dosvm_pid;
103 static WORD init_cs,init_ip,init_ss,init_sp;
104 static HANDLE dosvm_thread, loop_thread;
105 static DWORD dosvm_tid, loop_tid;
107 static void MZ_Launch( LPCSTR cmdtail, int length );
108 static BOOL MZ_InitTask(void);
110 static void MZ_CreatePSP( LPVOID lpPSP, WORD env, WORD par )
112 PDB16*psp=lpPSP;
114 psp->int20=0x20CD; /* int 20 */
115 /* some programs use this to calculate how much memory they need */
116 psp->nextParagraph=0x9FFF; /* FIXME: use a real value */
117 /* FIXME: dispatcher */
118 psp->savedint22 = DOSVM_GetRMHandler(0x22);
119 psp->savedint23 = DOSVM_GetRMHandler(0x23);
120 psp->savedint24 = DOSVM_GetRMHandler(0x24);
121 psp->parentPSP=par;
122 psp->environment=env;
123 /* FIXME: more PSP stuff */
126 static void MZ_FillPSP( LPVOID lpPSP, LPCSTR cmdtail, int length )
128 PDB16 *psp = lpPSP;
130 if(length > 127)
132 WARN( "Command tail truncated! (length %d)\n", length );
133 length = 126;
136 psp->cmdLine[0] = length;
139 * Length of exactly 127 bytes means that full command line is
140 * stored in environment variable CMDLINE and PSP contains
141 * command tail truncated to 126 bytes.
143 if(length == 127)
144 length = 126;
146 if(length > 0)
147 memmove(psp->cmdLine+1, cmdtail, length);
149 psp->cmdLine[length+1] = '\r';
151 /* FIXME: more PSP stuff */
154 static WORD MZ_InitEnvironment( LPCSTR env, LPCSTR name )
156 unsigned sz=0;
157 WORD seg;
158 LPSTR envblk;
160 if (env) {
161 /* get size of environment block */
162 while (env[sz++]) sz+=strlen(env+sz)+1;
163 } else sz++;
164 /* allocate it */
165 envblk=DOSMEM_GetBlock(sz+sizeof(WORD)+strlen(name)+1,&seg);
166 /* fill it */
167 if (env) {
168 memcpy(envblk,env,sz);
169 } else envblk[0]=0;
170 /* DOS 3.x: the block contains 1 additional string */
171 *(WORD*)(envblk+sz)=1;
172 /* being the program name itself */
173 strcpy(envblk+sz+sizeof(WORD),name);
174 return seg;
177 static BOOL MZ_InitMemory(void)
179 /* initialize the memory */
180 TRACE("Initializing DOS memory structures\n");
181 DOSMEM_Init(TRUE);
182 DOSDEV_InstallDOSDevices();
184 return TRUE;
187 static BOOL MZ_DoLoadImage( HANDLE hFile, LPCSTR filename, OverlayBlock *oblk )
189 IMAGE_DOS_HEADER mz_header;
190 DWORD image_start,image_size,min_size,max_size,avail;
191 BYTE*psp_start,*load_start,*oldenv;
192 int x, old_com=0, alloc;
193 SEGPTR reloc;
194 WORD env_seg, load_seg, rel_seg, oldpsp_seg;
195 DWORD len;
197 if (DOSVM_psp) {
198 /* DOS process already running, inherit from it */
199 PDB16* par_psp = (PDB16*)((DWORD)DOSVM_psp << 4);
200 alloc=0;
201 oldenv = (LPBYTE)((DWORD)par_psp->environment << 4);
202 oldpsp_seg = DOSVM_psp;
203 } else {
204 /* allocate new DOS process, inheriting from Wine environment */
205 alloc=1;
206 oldenv = GetEnvironmentStringsA();
207 oldpsp_seg = 0;
210 SetFilePointer(hFile,0,NULL,FILE_BEGIN);
211 if ( !ReadFile(hFile,&mz_header,sizeof(mz_header),&len,NULL)
212 || len != sizeof(mz_header)
213 || mz_header.e_magic != IMAGE_DOS_SIGNATURE) {
214 char *p = strrchr( filename, '.' );
215 if (!p || strcasecmp( p, ".com" )) /* check for .COM extension */
217 SetLastError(ERROR_BAD_FORMAT);
218 goto load_error;
220 old_com=1; /* assume .COM file */
221 image_start=0;
222 image_size=GetFileSize(hFile,NULL);
223 min_size=0x10000; max_size=0x100000;
224 mz_header.e_crlc=0;
225 mz_header.e_ss=0; mz_header.e_sp=0xFFFE;
226 mz_header.e_cs=0; mz_header.e_ip=0x100;
227 } else {
228 /* calculate load size */
229 image_start=mz_header.e_cparhdr<<4;
230 image_size=mz_header.e_cp<<9; /* pages are 512 bytes */
231 if ((mz_header.e_cblp!=0)&&(mz_header.e_cblp!=4)) image_size-=512-mz_header.e_cblp;
232 image_size-=image_start;
233 min_size=image_size+((DWORD)mz_header.e_minalloc<<4)+(PSP_SIZE<<4);
234 max_size=image_size+((DWORD)mz_header.e_maxalloc<<4)+(PSP_SIZE<<4);
237 if (alloc) MZ_InitMemory();
239 if (oblk) {
240 /* load overlay into preallocated memory */
241 load_seg=oblk->load_seg;
242 rel_seg=oblk->rel_seg;
243 load_start=(LPBYTE)((DWORD)load_seg<<4);
244 } else {
245 /* allocate environment block */
246 env_seg=MZ_InitEnvironment(oldenv, filename);
248 /* allocate memory for the executable */
249 TRACE("Allocating DOS memory (min=%ld, max=%ld)\n",min_size,max_size);
250 avail=DOSMEM_Available();
251 if (avail<min_size) {
252 ERR("insufficient DOS memory\n");
253 SetLastError(ERROR_NOT_ENOUGH_MEMORY);
254 goto load_error;
256 if (avail>max_size) avail=max_size;
257 psp_start=DOSMEM_GetBlock(avail,&DOSVM_psp);
258 if (!psp_start) {
259 ERR("error allocating DOS memory\n");
260 SetLastError(ERROR_NOT_ENOUGH_MEMORY);
261 goto load_error;
263 load_seg=DOSVM_psp+(old_com?0:PSP_SIZE);
264 rel_seg=load_seg;
265 load_start=psp_start+(PSP_SIZE<<4);
266 MZ_CreatePSP(psp_start, env_seg, oldpsp_seg);
269 /* load executable image */
270 TRACE("loading DOS %s image, %08lx bytes\n",old_com?"COM":"EXE",image_size);
271 SetFilePointer(hFile,image_start,NULL,FILE_BEGIN);
272 if (!ReadFile(hFile,load_start,image_size,&len,NULL) || len != image_size) {
273 SetLastError(ERROR_BAD_FORMAT);
274 goto load_error;
277 if (mz_header.e_crlc) {
278 /* load relocation table */
279 TRACE("loading DOS EXE relocation table, %d entries\n",mz_header.e_crlc);
280 /* FIXME: is this too slow without read buffering? */
281 SetFilePointer(hFile,mz_header.e_lfarlc,NULL,FILE_BEGIN);
282 for (x=0; x<mz_header.e_crlc; x++) {
283 if (!ReadFile(hFile,&reloc,sizeof(reloc),&len,NULL) || len != sizeof(reloc)) {
284 SetLastError(ERROR_BAD_FORMAT);
285 goto load_error;
287 *(WORD*)SEGPTR16(load_start,reloc)+=rel_seg;
291 if (!oblk) {
292 init_cs = load_seg+mz_header.e_cs;
293 init_ip = mz_header.e_ip;
294 init_ss = load_seg+mz_header.e_ss;
295 init_sp = mz_header.e_sp;
297 TRACE("entry point: %04x:%04x\n",init_cs,init_ip);
300 if (alloc && !MZ_InitTask()) {
301 SetLastError(ERROR_GEN_FAILURE);
302 return FALSE;
305 return TRUE;
307 load_error:
308 DOSVM_psp = oldpsp_seg;
310 return FALSE;
313 /***********************************************************************
314 * wine_load_dos_exe (WINEDOS.@)
316 * Called from WineVDM when a new real-mode DOS process is started.
317 * Loads DOS program into memory and executes the program.
319 void WINAPI wine_load_dos_exe( LPCSTR filename, LPCSTR cmdline )
321 char dos_cmdtail[126];
322 int dos_length = 0;
324 HANDLE hFile = CreateFileA( filename, GENERIC_READ, FILE_SHARE_READ,
325 NULL, OPEN_EXISTING, 0, 0 );
326 if (hFile == INVALID_HANDLE_VALUE) return;
327 DOSVM_isdosexe = TRUE;
329 if(cmdline && *cmdline)
331 dos_length = strlen(cmdline);
332 memmove( dos_cmdtail + 1, cmdline,
333 (dos_length < 125) ? dos_length : 125 );
335 /* Non-empty command tail always starts with at least one space. */
336 dos_cmdtail[0] = ' ';
337 dos_length++;
340 * If command tail is longer than 126 characters,
341 * set tail length to 127 and fill CMDLINE environment variable
342 * with full command line (this includes filename).
344 if (dos_length > 126)
346 char *cmd = HeapAlloc( GetProcessHeap(), 0,
347 dos_length + strlen(filename) + 4 );
348 char *ptr = cmd;
350 if (!cmd)
351 return;
354 * Append filename. If path includes spaces, quote the path.
356 if (strchr(filename, ' '))
358 *ptr++ = '\"';
359 strcpy( ptr, filename );
360 ptr += strlen(filename);
361 *ptr++ = '\"';
363 else
365 strcpy( ptr, filename );
366 ptr += strlen(filename);
370 * Append command tail.
372 if (cmdline[0] != ' ')
373 *ptr++ = ' ';
374 strcpy( ptr, cmdline );
377 * Set environment variable. This will be passed to
378 * new DOS process.
380 if (!SetEnvironmentVariableA( "CMDLINE", cmd ))
382 HeapFree(GetProcessHeap(), 0, cmd );
383 return;
386 HeapFree(GetProcessHeap(), 0, cmd );
387 dos_length = 127;
391 if (MZ_DoLoadImage( hFile, filename, NULL ))
392 MZ_Launch( dos_cmdtail, dos_length );
395 /***********************************************************************
396 * MZ_Exec
398 * this may only be called from existing DOS processes
400 BOOL WINAPI MZ_Exec( CONTEXT86 *context, LPCSTR filename, BYTE func, LPVOID paramblk )
402 DWORD binType;
403 STARTUPINFOA st;
404 PROCESS_INFORMATION pe;
405 HANDLE hFile;
407 BOOL ret = FALSE;
409 if(!GetBinaryTypeA(filename, &binType)) /* determine what kind of binary this is */
411 return FALSE; /* binary is not an executable */
414 /* handle non-dos executables */
415 if(binType != SCS_DOS_BINARY)
417 if(func == 0) /* load and execute */
419 LPBYTE fullCmdLine;
420 WORD fullCmdLength;
421 LPBYTE psp_start = (LPBYTE)((DWORD)DOSVM_psp << 4);
422 PDB16 *psp = (PDB16 *)psp_start;
423 ExecBlock *blk = (ExecBlock *)paramblk;
424 LPBYTE cmdline = PTR_REAL_TO_LIN(SELECTOROF(blk->cmdline),OFFSETOF(blk->cmdline));
425 LPBYTE envblock = PTR_REAL_TO_LIN(psp->environment, 0);
426 int cmdLength = cmdline[0];
429 * If cmdLength is 127, command tail is truncated and environment
430 * variable CMDLINE should contain full command line
431 * (this includes filename).
433 if (cmdLength == 127)
435 FIXME( "CMDLINE argument passing is unimplemented.\n" );
436 cmdLength = 126; /* FIXME */
439 fullCmdLength = (strlen(filename) + 1) + cmdLength + 1; /* filename + space + cmdline + terminating null character */
441 fullCmdLine = HeapAlloc(GetProcessHeap(), 0, fullCmdLength);
442 if(!fullCmdLine) return FALSE; /* return false on memory alloc failure */
444 /* build the full command line from the executable file and the command line being passed in */
445 snprintf(fullCmdLine, fullCmdLength, "%s ", filename); /* start off with the executable filename and a space */
446 memcpy(fullCmdLine + strlen(fullCmdLine), cmdline + 1, cmdLength); /* append cmdline onto the end */
447 fullCmdLine[fullCmdLength - 1] = 0; /* null terminate string */
449 ZeroMemory (&st, sizeof(STARTUPINFOA));
450 st.cb = sizeof(STARTUPINFOA);
451 ret = CreateProcessA (NULL, fullCmdLine, NULL, NULL, TRUE, 0, envblock, NULL, &st, &pe);
453 /* wait for the app to finish and clean up PROCESS_INFORMATION handles */
454 if(ret)
456 WaitForSingleObject(pe.hProcess, INFINITE); /* wait here until the child process is complete */
457 CloseHandle(pe.hProcess);
458 CloseHandle(pe.hThread);
461 HeapFree(GetProcessHeap(), 0, fullCmdLine); /* free the memory we allocated */
463 else
465 FIXME("EXEC type of %d not implemented for non-dos executables\n", func);
466 ret = FALSE;
469 return ret;
470 } /* if(binType != SCS_DOS_BINARY) */
473 /* handle dos executables */
475 hFile = CreateFileA( filename, GENERIC_READ, FILE_SHARE_READ,
476 NULL, OPEN_EXISTING, 0, 0);
477 if (hFile == INVALID_HANDLE_VALUE) return FALSE;
479 switch (func) {
480 case 0: /* load and execute */
481 case 1: /* load but don't execute */
483 /* save current process's return SS:SP now */
484 LPBYTE psp_start = (LPBYTE)((DWORD)DOSVM_psp << 4);
485 PDB16 *psp = (PDB16 *)psp_start;
486 psp->saveStack = (DWORD)MAKESEGPTR(context->SegSs, LOWORD(context->Esp));
488 ret = MZ_DoLoadImage( hFile, filename, NULL );
489 if (ret) {
490 /* MZ_LoadImage created a new PSP and loaded new values into it,
491 * let's work on the new values now */
492 LPBYTE psp_start = (LPBYTE)((DWORD)DOSVM_psp << 4);
493 ExecBlock *blk = (ExecBlock *)paramblk;
494 LPBYTE cmdline = PTR_REAL_TO_LIN(SELECTOROF(blk->cmdline),OFFSETOF(blk->cmdline));
496 /* First character contains the length of the command line. */
497 MZ_FillPSP(psp_start, cmdline + 1, cmdline[0]);
499 /* the lame MS-DOS engineers decided that the return address should be in int22 */
500 DOSVM_SetRMHandler(0x22, (FARPROC16)MAKESEGPTR(context->SegCs, LOWORD(context->Eip)));
501 if (func) {
502 /* don't execute, just return startup state */
503 blk->init_cs = init_cs;
504 blk->init_ip = init_ip;
505 blk->init_ss = init_ss;
506 blk->init_sp = init_sp;
507 } else {
508 /* execute by making us return to new process */
509 context->SegCs = init_cs;
510 context->Eip = init_ip;
511 context->SegSs = init_ss;
512 context->Esp = init_sp;
513 context->SegDs = DOSVM_psp;
514 context->SegEs = DOSVM_psp;
515 context->Eax = 0;
518 break;
519 case 3: /* load overlay */
521 OverlayBlock *blk = (OverlayBlock *)paramblk;
522 ret = MZ_DoLoadImage( hFile, filename, blk );
524 break;
525 default:
526 FIXME("EXEC load type %d not implemented\n", func);
527 SetLastError(ERROR_INVALID_FUNCTION);
528 break;
530 CloseHandle(hFile);
531 return ret;
534 /***********************************************************************
535 * MZ_AllocDPMITask
537 void WINAPI MZ_AllocDPMITask( void )
539 MZ_InitMemory();
540 MZ_InitTask();
543 /***********************************************************************
544 * MZ_RunInThread
546 void WINAPI MZ_RunInThread( PAPCFUNC proc, ULONG_PTR arg )
548 if (loop_thread) {
549 DOS_SPC spc;
550 HANDLE event;
552 spc.proc = proc;
553 spc.arg = arg;
554 event = CreateEventA(NULL, TRUE, FALSE, NULL);
555 PostThreadMessageA(loop_tid, WM_USER, (WPARAM)event, (LPARAM)&spc);
556 WaitForSingleObject(event, INFINITE);
557 CloseHandle(event);
558 } else
559 proc(arg);
562 static DWORD WINAPI MZ_DOSVM( LPVOID lpExtra )
564 CONTEXT context;
565 DWORD ret;
567 dosvm_pid = getpid();
569 memset( &context, 0, sizeof(context) );
570 context.SegCs = init_cs;
571 context.Eip = init_ip;
572 context.SegSs = init_ss;
573 context.Esp = init_sp;
574 context.SegDs = DOSVM_psp;
575 context.SegEs = DOSVM_psp;
576 context.EFlags = V86_FLAG | VIF_MASK;
577 DOSVM_SetTimer(0x10000);
578 ret = DOSVM_Enter( &context );
580 dosvm_pid = 0;
581 return ret;
584 static BOOL MZ_InitTask(void)
586 if (!DuplicateHandle(GetCurrentProcess(), GetCurrentThread(),
587 GetCurrentProcess(), &loop_thread,
588 0, FALSE, DUPLICATE_SAME_ACCESS))
589 return FALSE;
590 dosvm_thread = CreateThread(NULL, 0, MZ_DOSVM, NULL, CREATE_SUSPENDED, &dosvm_tid);
591 if (!dosvm_thread) {
592 CloseHandle(loop_thread);
593 loop_thread = 0;
594 return FALSE;
596 loop_tid = GetCurrentThreadId();
597 return TRUE;
600 static void MZ_Launch( LPCSTR cmdtail, int length )
602 TDB *pTask = GlobalLock16( GetCurrentTask() );
603 BYTE *psp_start = PTR_REAL_TO_LIN( DOSVM_psp, 0 );
604 DWORD rv;
605 SYSLEVEL *lock;
607 MZ_FillPSP(psp_start, cmdtail, length);
608 pTask->flags |= TDBF_WINOLDAP;
610 /* DTA is set to PSP:0080h when a program is started. */
611 pTask->dta = MAKESEGPTR( DOSVM_psp, 0x80 );
613 GetpWin16Lock( &lock );
614 _LeaveSysLevel( lock );
616 ResumeThread(dosvm_thread);
617 rv = DOSVM_Loop(dosvm_thread);
619 CloseHandle(dosvm_thread);
620 dosvm_thread = 0; dosvm_tid = 0;
621 CloseHandle(loop_thread);
622 loop_thread = 0; loop_tid = 0;
624 VGA_Clean();
625 ExitProcess(rv);
628 /***********************************************************************
629 * MZ_Exit
631 void WINAPI MZ_Exit( CONTEXT86 *context, BOOL cs_psp, WORD retval )
633 if (DOSVM_psp) {
634 WORD psp_seg = cs_psp ? context->SegCs : DOSVM_psp;
635 LPBYTE psp_start = (LPBYTE)((DWORD)psp_seg << 4);
636 PDB16 *psp = (PDB16 *)psp_start;
637 WORD parpsp = psp->parentPSP; /* check for parent DOS process */
638 if (parpsp) {
639 /* retrieve parent's return address */
640 FARPROC16 retaddr = DOSVM_GetRMHandler(0x22);
641 /* restore interrupts */
642 DOSVM_SetRMHandler(0x22, psp->savedint22);
643 DOSVM_SetRMHandler(0x23, psp->savedint23);
644 DOSVM_SetRMHandler(0x24, psp->savedint24);
645 /* FIXME: deallocate file handles etc */
646 /* free process's associated memory
647 * FIXME: walk memory and deallocate all blocks owned by process */
648 DOSMEM_FreeBlock( PTR_REAL_TO_LIN(psp->environment,0) );
649 DOSMEM_FreeBlock( PTR_REAL_TO_LIN(DOSVM_psp,0) );
650 /* switch to parent's PSP */
651 DOSVM_psp = parpsp;
652 psp_start = (LPBYTE)((DWORD)parpsp << 4);
653 psp = (PDB16 *)psp_start;
654 /* now return to parent */
655 DOSVM_retval = retval;
656 context->SegCs = SELECTOROF(retaddr);
657 context->Eip = OFFSETOF(retaddr);
658 context->SegSs = SELECTOROF(psp->saveStack);
659 context->Esp = OFFSETOF(psp->saveStack);
660 return;
661 } else
662 TRACE("killing DOS task\n");
664 ExitThread( retval );
668 /***********************************************************************
669 * MZ_Current
671 BOOL WINAPI MZ_Current( void )
673 return (dosvm_pid != 0); /* FIXME: do a better check */
676 #else /* !MZ_SUPPORTED */
678 /***********************************************************************
679 * wine_load_dos_exe (WINEDOS.@)
681 void WINAPI wine_load_dos_exe( LPCSTR filename, LPCSTR cmdline )
683 WARN("DOS executables not supported on this platform\n");
684 SetLastError(ERROR_BAD_FORMAT);
687 /***********************************************************************
688 * MZ_Exec
690 BOOL WINAPI MZ_Exec( CONTEXT86 *context, LPCSTR filename, BYTE func, LPVOID paramblk )
692 /* can't happen */
693 SetLastError(ERROR_BAD_FORMAT);
694 return FALSE;
697 /***********************************************************************
698 * MZ_AllocDPMITask
700 void WINAPI MZ_AllocDPMITask( void )
702 ERR("Actual real-mode calls not supported on this platform!\n");
705 /***********************************************************************
706 * MZ_RunInThread
708 void WINAPI MZ_RunInThread( PAPCFUNC proc, ULONG_PTR arg )
710 proc(arg);
713 /***********************************************************************
714 * MZ_Exit
716 void WINAPI MZ_Exit( CONTEXT86 *context, BOOL cs_psp, WORD retval )
718 ExitThread( retval );
721 /***********************************************************************
722 * MZ_Current
724 BOOL WINAPI MZ_Current( void )
726 return FALSE;
729 #endif /* !MZ_SUPPORTED */