2 * Win32 ordinal only exported functions that can't be stuffed somehwere else.
4 * Copyright 1997 Marcus Meissner
11 #include "selectors.h"
20 static CRITICAL_SECTION Win16Mutex
;
22 /***********************************************
23 * GetPWinLock (KERNEL32)
24 * Return the infamous Win16Mutex.
26 VOID WINAPI
GetPWinLock(CRITICAL_SECTION
**lock
)
28 fprintf(stderr
,"GetPWinlock(%p)\n",lock
);
32 /**********************************************************************
35 BOOL32 WINAPI
WOW32_1(SEGPTR segptr
,LPLDT_ENTRY ldtent
)
37 return GetThreadSelectorEntry(GetCurrentThreadId(),segptr
>>16,ldtent
);
41 /***********************************************************************
42 * _KERNEL32_18 (KERNEL32.18)
43 * 'Of course you cannot directly access Windows internal structures'
46 DWORD WINAPI
_KERNEL32_18(DWORD processid
,DWORD action
)
52 fprintf(stderr
,"KERNEL32_18(%ld,%ld+0x38)\n",processid
,action
);
56 process
=pCurrentProcess
;
57 /* check if valid process */
59 process
=(PDB32
*)pCurrentProcess
; /* decrypt too, if needed */
61 case 0: /* return app compat flags */
62 pTask
= (TDB
*)GlobalLock16(process
->task
);
65 return pTask
->compat_flags
;
66 case 4: /* returns offset 0xb8 of process struct... dunno what it is */
68 case 8: /* return hinstance16 */
69 pTask
= (TDB
*)GlobalLock16(process
->task
);
72 return pTask
->hInstance
;
73 case 12:/* return expected windows version */
74 pTask
= (TDB
*)GlobalLock16(process
->task
);
77 return pTask
->version
;
78 case 16:/* return uncrypted pointer to current thread */
79 return (DWORD
)THREAD_Current();
80 case 20:/* return uncrypted pointer to process */
81 return (DWORD
)process
;
82 case 24:/* return stdoutput handle from startupinfo */
83 return (DWORD
)(process
->env_db
->startup_info
->hStdOutput
);
84 case 28:/* return stdinput handle from startupinfo */
85 return (DWORD
)(process
->env_db
->startup_info
->hStdInput
);
86 case 32:/* get showwindow flag from startupinfo */
87 return (DWORD
)(process
->env_db
->startup_info
->wShowWindow
);
88 case 36:{/* return startup x and y sizes */
89 LPSTARTUPINFO32A si
= process
->env_db
->startup_info
;
92 x
=si
->dwXSize
;if (x
==0x80000000) x
=0x8000;
93 y
=si
->dwYSize
;if (y
==0x80000000) y
=0x8000;
96 case 40:{/* return startup x and y */
97 LPSTARTUPINFO32A si
= process
->env_db
->startup_info
;
100 x
=si
->dwX
;if (x
==0x80000000) x
=0x8000;
101 y
=si
->dwY
;if (y
==0x80000000) y
=0x8000;
104 case 44:/* return startup flags */
105 return process
->env_db
->startup_info
->dwFlags
;
106 case 48:/* return uncrypted pointer to parent process (if any) */
107 return (DWORD
)process
->parent
;
108 case 52:/* return process flags */
109 return process
->flags
;
110 case 56:/* unexplored */
113 fprintf(stderr
,"_KERNEL32_18:unknown offset (%ld)\n",action
);
116 /* shouldn't come here */
120 /***********************************************************************
122 * Returns some internal value.... probably the default environment database?
124 DWORD WINAPI
_KERNEL32_34()
126 fprintf(stderr
,"KERNEL32_34(), STUB returning 0\n");
130 BOOL32 WINAPI
_KERNEL32_99(HANDLE32 threadid
,DWORD exitcode
,DWORD x
) {
131 fprintf(stderr
,"KERNEL32_99(%d,%ld,0x%08lx),stub\n",threadid
,exitcode
,x
);
135 DWORD WINAPI
_KERNEL32_98(DWORD x
) {
136 fprintf(stderr
,"KERNEL32_98(0x%08lx),stub\n",x
);