Yet another small self-loader fix.
[wine/multimedia.git] / win32 / ordinals.c
blob97209dff4286d1112518d56d9831c94869a5e5a9
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 "debug.h"
19 /**********************************************************************
20 * WOWGetDescriptor (KERNEL32.88) (WOW32.1)
22 BOOL32 WINAPI WOWGetDescriptor(SEGPTR segptr,LPLDT_ENTRY ldtent)
24 return GetThreadSelectorEntry(GetCurrentThreadId(),segptr>>16,ldtent);
28 /***********************************************************************
29 * GetProcessDword (KERNEL32.18) (KERNEL.485)
30 * 'Of course you cannot directly access Windows internal structures'
32 DWORD WINAPI GetProcessDword(DWORD processid,DWORD action)
34 PDB32 *process = processid? PROCESS_IdToPDB( processid )
35 : PROCESS_Current();
36 TDB *pTask;
38 action+=56;
39 TRACE(win32,"(%ld,%ld+0x38)\n",processid,action);
40 if (!process || action>56)
41 return 0;
42 switch (action) {
43 case 0: /* return app compat flags */
44 pTask = (TDB*)GlobalLock16(process->task);
45 if (!pTask)
46 return 0;
47 return pTask->compat_flags;
48 case 4: /* returns offset 0xb8 of process struct... dunno what it is */
49 return 0;
50 case 8: /* return hinstance16 */
51 pTask = (TDB*)GlobalLock16(process->task);
52 if (!pTask)
53 return 0;
54 return pTask->hInstance;
55 case 12:/* return expected windows version */
56 pTask = (TDB*)GlobalLock16(process->task);
57 if (!pTask)
58 return 0;
59 return pTask->version;
60 case 16:/* return uncrypted pointer to current thread */
61 return (DWORD)THREAD_Current();
62 case 20:/* return uncrypted pointer to process */
63 return (DWORD)process;
64 case 24:/* return stdoutput handle from startupinfo */
65 return (DWORD)(process->env_db->startup_info->hStdOutput);
66 case 28:/* return stdinput handle from startupinfo */
67 return (DWORD)(process->env_db->startup_info->hStdInput);
68 case 32:/* get showwindow flag from startupinfo */
69 return (DWORD)(process->env_db->startup_info->wShowWindow);
70 case 36:{/* return startup x and y sizes */
71 LPSTARTUPINFO32A si = process->env_db->startup_info;
72 DWORD x,y;
74 x=si->dwXSize;if (x==0x80000000) x=0x8000;
75 y=si->dwYSize;if (y==0x80000000) y=0x8000;
76 return (y<<16)+x;
78 case 40:{/* return startup x and y */
79 LPSTARTUPINFO32A si = process->env_db->startup_info;
80 DWORD x,y;
82 x=si->dwX;if (x==0x80000000) x=0x8000;
83 y=si->dwY;if (y==0x80000000) y=0x8000;
84 return (y<<16)+x;
86 case 44:/* return startup flags */
87 return process->env_db->startup_info->dwFlags;
88 case 48:/* return uncrypted pointer to parent process (if any) */
89 return (DWORD)process->parent;
90 case 52:/* return process flags */
91 return process->flags;
92 case 56:/* unexplored */
93 return 0;
94 default:
95 WARN(win32,"Unknown offset (%ld)\n",action);
96 return 0;
98 /* shouldn't come here */
101 /***********************************************************************
102 * SetProcessDword (KERNEL.484)
103 * 'Of course you cannot directly access Windows internal structures'
105 VOID WINAPI SetProcessDword(DWORD processid,DWORD action,DWORD value)
107 PDB32 *process = processid? PROCESS_IdToPDB( processid )
108 : PROCESS_Current();
110 action+=56;
111 TRACE(win32,"(%ld,%ld+0x38)\n",processid,action);
112 if (!process || action>56) return;
114 switch (action) {
115 default:
116 FIXME(win32,"Unknown offset (%ld)\n",action);
117 break;
121 /***********************************************************************
122 * GetWin16DOSEnv (KERNEL32.34)
123 * Returns some internal value.... probably the default environment database?
125 DWORD WINAPI GetWin16DOSEnv()
127 FIXME(dosmem,"stub, returning 0\n");
128 return 0;
131 /**********************************************************************
132 * GetPK16SysVar (KERNEL32.92)
134 LPVOID WINAPI GetPK16SysVar(void)
136 static BYTE PK16SysVar[128];
138 FIXME(win32, "()\n");
139 return PK16SysVar;
143 BOOL32 WINAPI _KERNEL32_100(HANDLE32 threadid,DWORD exitcode,DWORD x) {
144 FIXME(thread,"(%d,%ld,0x%08lx): stub\n",threadid,exitcode,x);
145 return TRUE;
148 DWORD WINAPI _KERNEL32_99(DWORD x) {
149 FIXME(win32,"(0x%08lx): stub\n",x);
150 return 1;