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 BOOL32 WINAPI WOW32_1(SEGPTR segptr,LPLDT_ENTRY ldtent)
39 return GetThreadSelectorEntry(GetCurrentThreadId(),segptr>>16,ldtent);
43 /***********************************************************************
44 * _KERNEL32_18 (KERNEL32.18)
45 * 'Of course you cannot directly access Windows internal structures'
48 DWORD WINAPI _KERNEL32_18(DWORD processid,DWORD action)
54 fprintf(stderr,"KERNEL32_18(%ld,%ld+0x38)\n",processid,action);
58 process=pCurrentProcess;
59 /* check if valid process */
61 process=(PDB32*)pCurrentProcess; /* decrypt too, if needed */
63 case 0: /* return app compat flags */
64 pTask = (TDB*)GlobalLock16(process->task);
67 return pTask->compat_flags;
68 case 4: /* returns offset 0xb8 of process struct... dunno what it is */
70 case 8: /* return hinstance16 */
71 pTask = (TDB*)GlobalLock16(process->task);
74 return pTask->hInstance;
75 case 12:/* return expected windows version */
76 pTask = (TDB*)GlobalLock16(process->task);
79 return pTask->version;
80 case 16:/* return uncrypted pointer to current thread */
81 return (DWORD)pCurrentThread;
82 case 20:/* return uncrypted pointer to process */
83 return (DWORD)process;
84 case 24:/* return stdoutput handle from startupinfo */
85 return (DWORD)(process->env_db->startup_info->hStdOutput);
86 case 28:/* return stdinput handle from startupinfo */
87 return (DWORD)(process->env_db->startup_info->hStdInput);
88 case 32:/* get showwindow flag from startupinfo */
89 return (DWORD)(process->env_db->startup_info->wShowWindow);
90 case 36:{/* return startup x and y sizes */
91 LPSTARTUPINFO32A si = process->env_db->startup_info;
94 x=si->dwXSize;if (x==0x80000000) x=0x8000;
95 y=si->dwYSize;if (y==0x80000000) y=0x8000;
98 case 40:{/* return startup x and y */
99 LPSTARTUPINFO32A si = process->env_db->startup_info;
102 x=si->dwX;if (x==0x80000000) x=0x8000;
103 y=si->dwY;if (y==0x80000000) y=0x8000;
106 case 44:/* return startup flags */
107 return process->env_db->startup_info->dwFlags;
108 case 48:/* return uncrypted pointer to parent process (if any) */
109 return (DWORD)process->parent;
110 case 52:/* return process flags */
111 return process->flags;
112 case 56:/* unexplored */
115 fprintf(stderr,"_KERNEL32_18:unknown offset (%ld)\n",action);
118 /* shouldn't come here */
122 /***********************************************************************
124 * Returns some internal value.... probably the default environment database?
126 DWORD WINAPI _KERNEL32_34()
128 fprintf(stderr,"KERNEL32_34(), STUB returning 0\n");
132 BOOL32 WINAPI _KERNEL32_99(HANDLE32 threadid,DWORD exitcode,DWORD x) {
133 fprintf(stderr,"KERNEL32_99(%d,%ld,0x%08lx),stub\n",threadid,exitcode,x);
137 DWORD WINAPI _KERNEL32_98(DWORD x) {
138 fprintf(stderr,"KERNEL32_98(0x%08lx),stub\n",x);