| 1 | 
 | 
|---|
| 2 | /*
 | 
|---|
| 3 |  * Win32 KERNEL32 Subsystem for OS/2
 | 
|---|
| 4 |  *
 | 
|---|
| 5 |  * 2000/11/10 PH Patrick Haller (patrick.haller@innotek.de)
 | 
|---|
| 6 |  *
 | 
|---|
| 7 |  * Project Odin Software License can be found in LICENSE.TXT
 | 
|---|
| 8 |  *
 | 
|---|
| 9 |  */
 | 
|---|
| 10 | 
 | 
|---|
| 11 | /*****************************************************************************
 | 
|---|
| 12 |  * Includes                                                                  *
 | 
|---|
| 13 |  *****************************************************************************/
 | 
|---|
| 14 | #include <os2win.h>
 | 
|---|
| 15 | #include <winnls.h>
 | 
|---|
| 16 | #include "unicode.h"
 | 
|---|
| 17 | #include "handlemanager.h"
 | 
|---|
| 18 | #include <string.h>
 | 
|---|
| 19 | 
 | 
|---|
| 20 | #include "stubs.h"
 | 
|---|
| 21 | 
 | 
|---|
| 22 | #define DBG_LOCALLOG    DBG_stubs
 | 
|---|
| 23 | #include "dbglocal.h"
 | 
|---|
| 24 | 
 | 
|---|
| 25 | 
 | 
|---|
| 26 | /*****************************************************************************
 | 
|---|
| 27 |  * Defines                                                                   *
 | 
|---|
| 28 |  *****************************************************************************/
 | 
|---|
| 29 | 
 | 
|---|
| 30 | /*****************************************************************************
 | 
|---|
| 31 |  * Structures                                                                *
 | 
|---|
| 32 |  *****************************************************************************/
 | 
|---|
| 33 | 
 | 
|---|
| 34 | 
 | 
|---|
| 35 | 
 | 
|---|
| 36 | /*****************************************************************************
 | 
|---|
| 37 |  * Prototypes                                                                *
 | 
|---|
| 38 |  *****************************************************************************/
 | 
|---|
| 39 | 
 | 
|---|
| 40 | /*****************************************************************************
 | 
|---|
| 41 |  * Name      : ???
 | 
|---|
| 42 |  * Purpose   : Unknown (used by explorer.exe)
 | 
|---|
| 43 |  * Parameters: Unknown (wrong)
 | 
|---|
| 44 |  * Variables :
 | 
|---|
| 45 |  * Result    : Unknown
 | 
|---|
| 46 |  * Remark    :
 | 
|---|
| 47 |  * Status    : UNTESTED STUB
 | 
|---|
| 48 |  *
 | 
|---|
| 49 |  * Author    : Christoph Bratschi [Wed, 2000/03/29 19:47]
 | 
|---|
| 50 |  *****************************************************************************/
 | 
|---|
| 51 | 
 | 
|---|
| 52 | DWORD WIN32API KERNEL32_99(DWORD x)
 | 
|---|
| 53 | {
 | 
|---|
| 54 |   dprintf(("KERNEL32: Unknown API KERNEL32.99\n"));
 | 
|---|
| 55 |   return 1;
 | 
|---|
| 56 | }
 | 
|---|
| 57 | 
 | 
|---|
| 58 | /**********************************************************************
 | 
|---|
| 59 |  *              _KERNEL32_100
 | 
|---|
| 60 |  */
 | 
|---|
| 61 | BOOL WINAPI KERNEL32_100(HANDLE threadid,DWORD exitcode,DWORD x)
 | 
|---|
| 62 | {
 | 
|---|
| 63 |         dprintf(("_KERNEL32_100 (%d,%ld,0x%08lx): STUB",threadid,exitcode,x));
 | 
|---|
| 64 |         return TRUE;
 | 
|---|
| 65 | }
 | 
|---|
| 66 | 
 | 
|---|
| 67 | 
 | 
|---|
| 68 | /*****************************************************************************
 | 
|---|
| 69 |  * Name      : NullFunction
 | 
|---|
| 70 |  * Purpose   : Empty function. Such exports actually exist. (.42 .47)
 | 
|---|
| 71 |  * Parameters: Unknown (wrong)
 | 
|---|
| 72 |  * Variables :
 | 
|---|
| 73 |  * Result    : Unknown
 | 
|---|
| 74 |  * Remark    :
 | 
|---|
| 75 |  * Status    : UNTESTED STUB
 | 
|---|
| 76 |  *
 | 
|---|
| 77 |  * Author    : Patrick Haller [Wed, 2000/11/10 19:47]
 | 
|---|
| 78 |  *****************************************************************************/
 | 
|---|
| 79 | 
 | 
|---|
| 80 | VOID WIN32API NullFunction(void)
 | 
|---|
| 81 | {
 | 
|---|
| 82 |   // it does actually NOTHING
 | 
|---|
| 83 | }
 | 
|---|
| 84 | 
 | 
|---|
| 85 | 
 | 
|---|
| 86 | /*****************************************************************************
 | 
|---|
| 87 |  * Name      : KERNEL32_17
 | 
|---|
| 88 |  * Purpose   : Some function dispatcher
 | 
|---|
| 89 |  * Parameters: Unknown (wrong)
 | 
|---|
| 90 |  * Variables :
 | 
|---|
| 91 |  * Result    : Unknown
 | 
|---|
| 92 |  * Remark    : The function table has 16 32-bit function pointer entries
 | 
|---|
| 93 |  *             The function is selected by the CL register.
 | 
|---|
| 94 |  * Status    : UNTESTED STUB
 | 
|---|
| 95 |  *
 | 
|---|
| 96 |  * Author    : Patrick Haller [Wed, 2000/11/10 19:47]
 | 
|---|
| 97 |  *****************************************************************************/
 | 
|---|
| 98 | 
 | 
|---|
| 99 | VOID WIN32API KERNEL32_17(DWORD *pFunctionTable)
 | 
|---|
| 100 | {
 | 
|---|
| 101 |   // it's some function dispatcher
 | 
|---|
| 102 |   SetLastError(0x78);
 | 
|---|
| 103 |   
 | 
|---|
| 104 |   //@@@PH we should now get the correct CL value */
 | 
|---|
| 105 |   BYTE CL;
 | 
|---|
| 106 |   int  ret;
 | 
|---|
| 107 | 
 | 
|---|
| 108 |   switch( (CL >> 4) & 0x0f)
 | 
|---|
| 109 |   {
 | 
|---|
| 110 |     case 0x0f: ret = -1; break;
 | 
|---|
| 111 |     case 0x0e: ret = 0x78; break;
 | 
|---|
| 112 |     case 0x0d: ret = 0x32; break;
 | 
|---|
| 113 |     case 0x01: ret = 1; break;
 | 
|---|
| 114 |     default: ret = 0; break;
 | 
|---|
| 115 |   }
 | 
|---|
| 116 |   
 | 
|---|
| 117 |   // select jump function
 | 
|---|
| 118 |   VOID* pfn = (VOID*)pFunctionTable[CL & 0x0F];
 | 
|---|
| 119 |   //@@@PH we'd now jump ...
 | 
|---|
| 120 | }
 | 
|---|
| 121 | 
 | 
|---|
| 122 | 
 | 
|---|
| 123 | /*****************************************************************************
 | 
|---|
| 124 |  * Name      : KERNEL32_16
 | 
|---|
| 125 |  * Purpose   : Unknown
 | 
|---|
| 126 |  * Parameters: Unknown (wrong)
 | 
|---|
| 127 |  * Variables :
 | 
|---|
| 128 |  * Result    : Unknown
 | 
|---|
| 129 |  * Remark    : 
 | 
|---|
| 130 |  * Status    : UNTESTED STUB
 | 
|---|
| 131 |  *
 | 
|---|
| 132 |  * Author    : Patrick Haller [Wed, 2000/11/10 19:47]
 | 
|---|
| 133 |  *****************************************************************************/
 | 
|---|
| 134 | 
 | 
|---|
| 135 | VOID WIN32API KERNEL32_16(DWORD arg1,
 | 
|---|
| 136 |                           DWORD arg2,
 | 
|---|
| 137 |                           DWORD arg3)
 | 
|---|
| 138 | {
 | 
|---|
| 139 |   dprintf(("KERNEL32: KERNEL32_16 (%08xh,%08xh,%08xh) not implemented\n",
 | 
|---|
| 140 |            arg1,
 | 
|---|
| 141 |            arg2,
 | 
|---|
| 142 |            arg3));
 | 
|---|
| 143 | }
 | 
|---|