2 * Win32 ordinal only exported functions that can't be stuffed somehwere else.
4 * Copyright 1997 Marcus Meissner
11 #include "selectors.h"
19 extern THDB
*pCurrentThread
;
20 extern PDB32
*pCurrentProcess
;
22 static CRITICAL_SECTION Win16Mutex
;
24 /***********************************************
25 * GetPWinLock (KERNEL32)
26 * Return the infamous Win16Mutex.
28 VOID WINAPI
GetPWinLock(CRITICAL_SECTION
**lock
)
30 fprintf(stderr
,"GetPWinlock(%p)\n",lock
);
34 /**********************************************************************
37 DWORD WINAPI
WOW32_1(DWORD x
,DWORD y
)
39 fprintf(stderr
,"WOW32_1(0x%08lx,0x%08lx), stub!\n",x
,y
);
44 /***********************************************************************
45 * _KERNEL32_18 (KERNEL32.18)
46 * 'Of course you cannot directly access Windows internal structures'
49 DWORD WINAPI
_KERNEL32_18(DWORD processid
,DWORD action
)
55 fprintf(stderr
,"KERNEL32_18(%ld,%ld+0x38)\n",processid
,action
);
59 process
=pCurrentProcess
;
60 /* check if valid process */
62 process
=(PDB32
*)pCurrentProcess
; /* decrypt too, if needed */
64 case 0: /* return app compat flags */
65 pTask
= (TDB
*)GlobalLock16(process
->task
);
68 return pTask
->compat_flags
;
69 case 4: /* returns offset 0xb8 of process struct... dunno what it is */
71 case 8: /* return hinstance16 */
72 pTask
= (TDB
*)GlobalLock16(process
->task
);
75 return pTask
->hInstance
;
76 case 12:/* return expected windows version */
77 pTask
= (TDB
*)GlobalLock16(process
->task
);
80 return pTask
->version
;
81 case 16:/* return uncrypted pointer to current thread */
82 return (DWORD
)pCurrentThread
;
83 case 20:/* return uncrypted pointer to process */
84 return (DWORD
)process
;
85 case 24:/* return stdoutput handle from startupinfo */
86 return (DWORD
)(process
->env_db
->startup_info
->hStdOutput
);
87 case 28:/* return stdinput handle from startupinfo */
88 return (DWORD
)(process
->env_db
->startup_info
->hStdInput
);
89 case 32:/* get showwindow flag from startupinfo */
90 return (DWORD
)(process
->env_db
->startup_info
->wShowWindow
);
91 case 36:{/* return startup x and y sizes */
92 LPSTARTUPINFO32A si
= process
->env_db
->startup_info
;
95 x
=si
->dwXSize
;if (x
==0x80000000) x
=0x8000;
96 y
=si
->dwYSize
;if (y
==0x80000000) y
=0x8000;
99 case 40:{/* return startup x and y */
100 LPSTARTUPINFO32A si
= process
->env_db
->startup_info
;
103 x
=si
->dwX
;if (x
==0x80000000) x
=0x8000;
104 y
=si
->dwY
;if (y
==0x80000000) y
=0x8000;
107 case 44:/* return startup flags */
108 return process
->env_db
->startup_info
->dwFlags
;
109 case 48:/* return uncrypted pointer to parent process (if any) */
110 return (DWORD
)process
->parent
;
111 case 52:/* return process flags */
112 return process
->flags
;
113 case 56:/* unexplored */
116 fprintf(stderr
,"_KERNEL32_18:unknown offset (%ld)\n",action
);
119 /* shouldn't come here */
123 /***********************************************************************
125 * Returns some internal value.... probably the default environment database?
127 DWORD WINAPI
_KERNEL32_34()
129 fprintf(stderr
,"KERNEL32_34(), STUB returning 0\n");