Changed CONTEXT into CONTEXT86 everywhere we really want an i386
[wine] / win32 / ordinals.c
1 /*
2  * Win32 ordinal only exported functions that can't be stuffed somehwere else.
3  *
4  * Copyright 1997 Marcus Meissner
5  */
6
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 "debugtools.h"
19
20 DECLARE_DEBUG_CHANNEL(dosmem)
21 DECLARE_DEBUG_CHANNEL(thread)
22 DECLARE_DEBUG_CHANNEL(win)
23 DECLARE_DEBUG_CHANNEL(win32)
24
25 /**********************************************************************
26  *           WOWGetDescriptor        (KERNEL32.88) (WOW32.1)
27  */
28 BOOL WINAPI WOWGetDescriptor(SEGPTR segptr,LPLDT_ENTRY ldtent)
29 {
30     return GetThreadSelectorEntry(GetCurrentThreadId(),segptr>>16,ldtent);
31 }
32
33 /***********************************************************************
34  *              GetWin16DOSEnv                  (KERNEL32.34)
35  * Returns some internal value.... probably the default environment database?
36  */
37 DWORD WINAPI GetWin16DOSEnv()
38 {
39         FIXME_(dosmem)("stub, returning 0\n");
40         return 0;
41 }
42
43 /**********************************************************************
44  *           GetPK16SysVar    (KERNEL32.92)
45  */
46 LPVOID WINAPI GetPK16SysVar(void)
47 {
48     static BYTE PK16SysVar[128];
49
50     FIXME_(win32)("()\n");
51     return PK16SysVar;
52 }
53
54 /**********************************************************************
55  *           CommonUnimpStub    (KERNEL32.17)
56  */
57 void WINAPI REGS_FUNC(CommonUnimpStub)( CONTEXT *context )
58 {
59 #ifdef __i386__
60     if (EAX_reg(context))
61         MESSAGE( "*** Unimplemented Win32 API: %s\n", (LPSTR)EAX_reg(context) );
62
63     switch ((ECX_reg(context) >> 4) & 0x0f)
64     {
65     case 15:  EAX_reg(context) = -1;   break;
66     case 14:  EAX_reg(context) = 0x78; break;
67     case 13:  EAX_reg(context) = 0x32; break;
68     case 1:   EAX_reg(context) = 1;    break;
69     default:  EAX_reg(context) = 0;    break;
70     }
71
72     ESP_reg(context) += (ECX_reg(context) & 0x0f) * 4;
73 #endif
74 }
75
76 /**********************************************************************
77  *           HouseCleanLogicallyDeadHandles    (KERNEL32.33)
78  */
79 void WINAPI HouseCleanLogicallyDeadHandles(void)
80 {
81     /* Whatever this is supposed to do, our handles probably
82        don't need it :-) */
83 }
84
85
86 BOOL WINAPI _KERNEL32_100(HANDLE threadid,DWORD exitcode,DWORD x) {
87         FIXME_(thread)("(%d,%ld,0x%08lx): stub\n",threadid,exitcode,x);
88         return TRUE;
89 }
90
91 DWORD WINAPI _KERNEL32_99(DWORD x) {
92         FIXME_(win32)("(0x%08lx): stub\n",x);
93         return 1;
94 }
95 /***********************************************************************
96  *           PrivateExtractIconExA                      [USER32.442]
97  */
98 HRESULT WINAPI PrivateExtractIconExA ( DWORD u, DWORD v, DWORD w, DWORD x ,DWORD y )
99 {       FIXME_(win)("0x%08lx 0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",u,v,w,x,y);
100         return 0;
101         
102 }
103 /***********************************************************************
104  *           PrivateExtractIconExW                      [USER32.443]
105  */
106 HRESULT WINAPI PrivateExtractIconExW ( DWORD u, DWORD v, DWORD w, DWORD x ,DWORD y )
107 {       FIXME_(win)("0x%08lx 0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",u,v,w,x,y);
108         return 0;
109         
110 }
111 /***********************************************************************
112  *           PrivateExtractIconsW                       [USER32.445]
113  */
114 HRESULT WINAPI PrivateExtractIconsW ( DWORD r, DWORD s, DWORD t, DWORD u, DWORD v, DWORD w, DWORD x, DWORD y )
115 {       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 );
116         return 0;
117         
118 }
119 /***********************************************************************
120  *           RegisterShellHookWindow                    [USER32.459]
121  */
122 HRESULT WINAPI RegisterShellHookWindow ( DWORD u )
123 {       FIXME_(win)("0x%08lx stub\n",u);
124         return 0;
125         
126 }
127 /***********************************************************************
128  *           DeregisterShellHookWindow                  [USER32.132]
129  */
130 HRESULT WINAPI DeregisterShellHookWindow ( DWORD u )
131 {       FIXME_(win)("0x%08lx stub\n",u);
132         return 0;
133         
134 }
135 /***********************************************************************
136  *           RegisterTaskList32                         [USER23.436]
137  */
138 DWORD WINAPI RegisterTaskList (DWORD x)
139 {       FIXME_(win)("0x%08lx\n",x);
140         return TRUE;
141 }
142