Fixed CHECK_STRING display.
[wine/multimedia.git] / win32 / ordinals.c
blob01a76ef5cbb364aea599e25e57b6574fda96ec66
1 /*
2 * Win32 ordinal only exported functions that can't be stuffed somehwere else.
4 * Copyright 1997 Marcus Meissner
5 */
7 #include "thread.h"
8 #include "winerror.h"
9 #include "heap.h"
10 #include "selectors.h"
11 #include "miscemu.h"
12 #include "winnt.h"
13 #include "process.h"
14 #include "module.h"
15 #include "task.h"
16 #include "callback.h"
17 #include "stackframe.h"
18 #include "debug.h"
20 /**********************************************************************
21 * WOWGetDescriptor (KERNEL32.88) (WOW32.1)
23 BOOL32 WINAPI WOWGetDescriptor(SEGPTR segptr,LPLDT_ENTRY ldtent)
25 return GetThreadSelectorEntry(GetCurrentThreadId(),segptr>>16,ldtent);
29 /***********************************************************************
30 * GetProcessDword (KERNEL32.18) (KERNEL.485)
31 * 'Of course you cannot directly access Windows internal structures'
33 DWORD WINAPI GetProcessDword(DWORD processid,DWORD action)
35 PDB32 *process = processid? PROCESS_IdToPDB( processid )
36 : PROCESS_Current();
37 TDB *pTask;
39 action+=56;
40 TRACE(win32,"(%ld,%ld+0x38)\n",processid,action);
41 if (!process || action>56)
42 return 0;
43 switch (action) {
44 case 0: /* return app compat flags */
45 pTask = (TDB*)GlobalLock16(process->task);
46 if (!pTask)
47 return 0;
48 return pTask->compat_flags;
49 case 4: /* returns offset 0xb8 of process struct... dunno what it is */
50 return 0;
51 case 8: /* return hinstance16 */
52 pTask = (TDB*)GlobalLock16(process->task);
53 if (!pTask)
54 return 0;
55 return pTask->hInstance;
56 case 12:/* return expected windows version */
57 pTask = (TDB*)GlobalLock16(process->task);
58 if (!pTask)
59 return 0;
60 return pTask->version;
61 case 16:/* return uncrypted pointer to current thread */
62 return (DWORD)THREAD_Current();
63 case 20:/* return uncrypted pointer to process */
64 return (DWORD)process;
65 case 24:/* return stdoutput handle from startupinfo */
66 return (DWORD)(process->env_db->startup_info->hStdOutput);
67 case 28:/* return stdinput handle from startupinfo */
68 return (DWORD)(process->env_db->startup_info->hStdInput);
69 case 32:/* get showwindow flag from startupinfo */
70 return (DWORD)(process->env_db->startup_info->wShowWindow);
71 case 36:{/* return startup x and y sizes */
72 LPSTARTUPINFO32A si = process->env_db->startup_info;
73 DWORD x,y;
75 x=si->dwXSize;if (x==0x80000000) x=0x8000;
76 y=si->dwYSize;if (y==0x80000000) y=0x8000;
77 return (y<<16)+x;
79 case 40:{/* return startup x and y */
80 LPSTARTUPINFO32A si = process->env_db->startup_info;
81 DWORD x,y;
83 x=si->dwX;if (x==0x80000000) x=0x8000;
84 y=si->dwY;if (y==0x80000000) y=0x8000;
85 return (y<<16)+x;
87 case 44:/* return startup flags */
88 return process->env_db->startup_info->dwFlags;
89 case 48:/* return uncrypted pointer to parent process (if any) */
90 return (DWORD)process->parent;
91 case 52:/* return process flags */
92 return process->flags;
93 case 56:/* unexplored */
94 return process->process_dword;
95 default:
96 WARN(win32,"Unknown offset (%ld)\n",action);
97 return 0;
99 /* shouldn't come here */
102 /***********************************************************************
103 * SetProcessDword (KERNEL.484)
104 * 'Of course you cannot directly access Windows internal structures'
106 VOID WINAPI SetProcessDword(DWORD processid,DWORD action,DWORD value)
108 PDB32 *process = processid? PROCESS_IdToPDB( processid )
109 : PROCESS_Current();
111 action+=56;
112 TRACE(win32,"(%ld,%ld+0x38)\n",processid,action);
113 if (!process || action>56) return;
115 switch (action) {
116 case 56: process->process_dword = value; break;
117 default:
118 FIXME(win32,"Unknown offset (%ld)\n",action);
119 break;
123 /***********************************************************************
124 * GetWin16DOSEnv (KERNEL32.34)
125 * Returns some internal value.... probably the default environment database?
127 DWORD WINAPI GetWin16DOSEnv()
129 FIXME(dosmem,"stub, returning 0\n");
130 return 0;
133 /**********************************************************************
134 * GetPK16SysVar (KERNEL32.92)
136 LPVOID WINAPI GetPK16SysVar(void)
138 static BYTE PK16SysVar[128];
140 FIXME(win32, "()\n");
141 return PK16SysVar;
144 /**********************************************************************
145 * CommonUnimpStub (KERNEL32.17)
147 REGS_ENTRYPOINT(CommonUnimpStub)
149 if (EAX_reg(context))
150 MSG( "*** Unimplemented Win32 API: %s\n", (LPSTR)EAX_reg(context) );
152 switch ((ECX_reg(context) >> 4) & 0x0f)
154 case 15: EAX_reg(context) = -1; break;
155 case 14: EAX_reg(context) = 0x78; break;
156 case 13: EAX_reg(context) = 0x32; break;
157 case 1: EAX_reg(context) = 1; break;
158 default: EAX_reg(context) = 0; break;
161 ESP_reg(context) += (ECX_reg(context) & 0x0f) * 4;
164 /**********************************************************************
165 * HouseCleanLogicallyDeadHandles (KERNEL32.33)
167 void WINAPI HouseCleanLogicallyDeadHandles(void)
169 /* Whatever this is supposed to do, our handles probably
170 don't need it :-) */
174 BOOL32 WINAPI _KERNEL32_100(HANDLE32 threadid,DWORD exitcode,DWORD x) {
175 FIXME(thread,"(%d,%ld,0x%08lx): stub\n",threadid,exitcode,x);
176 return TRUE;
179 DWORD WINAPI _KERNEL32_99(DWORD x) {
180 FIXME(win32,"(0x%08lx): stub\n",x);
181 return 1;
183 /***********************************************************************
184 * PrivateExtractIconExA [USER32.442]
186 HRESULT WINAPI PrivateExtractIconExA ( DWORD u, DWORD v, DWORD w, DWORD x ,DWORD y )
187 { FIXME(win,"0x%08lx 0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",u,v,w,x,y);
188 return 0;
191 /***********************************************************************
192 * PrivateExtractIconExW [USER32.443]
194 HRESULT WINAPI PrivateExtractIconExW ( DWORD u, DWORD v, DWORD w, DWORD x ,DWORD y )
195 { FIXME(win,"0x%08lx 0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",u,v,w,x,y);
196 return 0;
199 /***********************************************************************
200 * PrivateExtractIconsW [USER32.445]
202 HRESULT WINAPI PrivateExtractIconsW ( DWORD r, DWORD s, DWORD t, DWORD u, DWORD v, DWORD w, DWORD x, DWORD y )
203 { FIXME(win,"0x%08lx 0x%08lx 0x%08lx 0x%08lx 0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",r,s,t,u,v,w,x,y );
204 return 0;
207 /***********************************************************************
208 * RegisterShellHookWindow [USER32.459]
210 HRESULT WINAPI RegisterShellHookWindow ( DWORD u )
211 { FIXME(win,"0x%08lx stub\n",u);
212 return 0;
215 /***********************************************************************
216 * DeregisterShellHookWindow [USER32.132]
218 HRESULT WINAPI DeregisterShellHookWindow ( DWORD u )
219 { FIXME(win,"0x%08lx stub\n",u);
220 return 0;
223 /***********************************************************************
224 * RegisterTaskList32 [USER23.436]
226 DWORD WINAPI RegisterTaskList32 (DWORD x)
227 { FIXME(win,"0x%08lx\n",x);
228 return TRUE;