- Timestamp:
- Oct 3, 2000, 7:28:32 PM (25 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/HandleManager.cpp
r4285 r4407 1 /* $Id: HandleManager.cpp,v 1.5 0 2000-09-20 21:32:50 hughExp $ */1 /* $Id: HandleManager.cpp,v 1.51 2000-10-03 17:28:26 sandervl Exp $ */ 2 2 3 3 /* … … 1377 1377 PHMHANDLE pHMHandle; /* pointer to the handle structure in the table */ 1378 1378 1379 //Must return FILE_TYPE_CHAR here; (used to fail index check) 1380 if((hFile == GetStdHandle(STD_INPUT_HANDLE)) || 1381 (hFile == GetStdHandle(STD_OUTPUT_HANDLE)) || 1382 (hFile == GetStdHandle(STD_ERROR_HANDLE))) 1383 { 1384 return FILE_TYPE_CHAR; 1385 } 1379 1386 /* validate handle */ 1380 1387 iIndex = _HMHandleQuery(hFile); /* get the index */ -
trunk/src/kernel32/conin.cpp
r3978 r4407 1 /* $Id: conin.cpp,v 1.1 1 2000-08-10 16:54:23 phallerExp $ */1 /* $Id: conin.cpp,v 1.12 2000-10-03 17:28:28 sandervl Exp $ */ 2 2 3 3 /* … … 993 993 994 994 995 DWORD HMDeviceConsoleInClass::GetFileType (PHMHANDLEDATA pHMHandleData) 996 { 997 return FILE_TYPE_CHAR; 998 } -
trunk/src/kernel32/conin.h
r2050 r4407 1 /* $Id: conin.h,v 1. 2 1999-12-09 19:08:26sandervl Exp $ */1 /* $Id: conin.h,v 1.3 2000-10-03 17:28:28 sandervl Exp $ */ 2 2 3 3 /* … … 139 139 LPDWORD lpcWritten); 140 140 141 /* this is a handler method for calls to GetFileType() */ 142 virtual DWORD GetFileType (PHMHANDLEDATA pHMHandleData); 143 141 144 }; 142 145 -
trunk/src/kernel32/conout.cpp
r2984 r4407 1 /* $Id: conout.cpp,v 1. 7 2000-03-03 11:15:57sandervl Exp $ */1 /* $Id: conout.cpp,v 1.8 2000-10-03 17:28:28 sandervl Exp $ */ 2 2 3 3 /* … … 317 317 } 318 318 319 320 DWORD HMDeviceConsoleOutClass::GetFileType (PHMHANDLEDATA pHMHandleData) 321 { 322 return FILE_TYPE_CHAR; 323 } -
trunk/src/kernel32/conout.h
r111 r4407 1 /* $Id: conout.h,v 1. 1 1999-06-17 18:21:39 phallerExp $ */1 /* $Id: conout.h,v 1.2 2000-10-03 17:28:29 sandervl Exp $ */ 2 2 3 3 /* … … 60 60 61 61 /* this is a handler method for calls to ReadFile() */ 62 virtual DWORDReadFile (PHMHANDLEDATA pHMHandleData,62 virtual BOOL ReadFile (PHMHANDLEDATA pHMHandleData, 63 63 LPCVOID lpBuffer, 64 64 DWORD nNumberOfBytesToRead, … … 67 67 68 68 /* this is a handler method for calls to WriteFile() */ 69 virtual DWORDWriteFile (PHMHANDLEDATA pHMHandleData,69 virtual BOOL WriteFile (PHMHANDLEDATA pHMHandleData, 70 70 LPCVOID lpBuffer, 71 71 DWORD nNumberOfBytesToWrite, … … 81 81 ULONG arg3, 82 82 ULONG arg4); 83 84 /* this is a handler method for calls to GetFileType() */ 85 virtual DWORD GetFileType (PHMHANDLEDATA pHMHandleData); 86 83 87 }; 84 88 -
trunk/src/kernel32/cpu.cpp
r4074 r4407 1 /* $Id: cpu.cpp,v 1.1 0 2000-08-23 18:03:33sandervl Exp $ */1 /* $Id: cpu.cpp,v 1.11 2000-10-03 17:28:29 sandervl Exp $ */ 2 2 /* 3 3 * Odin win32 CPU apis … … 139 139 GetCPUVendorString(buf); 140 140 RegSetValueExA(xhkey,"VendorIdentifier",0,REG_SZ,(LPBYTE)buf,strlen(buf)); 141 } 142 141 #ifdef __WIN32OS2__ 142 if(i==0) { 143 DWORD mhz; 144 features = GetCPUFeatures(); 145 if(features & CPUID_TIME_STAMP_COUNTER) { 146 LARGE_INTEGER tsc1, tsc2, freq, time1, time2; 147 double clockticks, millisec, frequency, tmp, tmp1, mhertz; 148 149 QueryPerformanceFrequency(&freq); 150 151 GetTSC((LONG *)&tsc1.LowPart, &tsc1.HighPart); 152 QueryPerformanceCounter(&time1); 153 154 Sleep(32); //sleep for about 32 ms 155 156 GetTSC((LONG *)&tsc2.LowPart, &tsc2.HighPart); 157 QueryPerformanceCounter(&time2); 158 tmp = (double)time2.LowPart + (double)time2.HighPart*4.0*1024.0*1024.0; 159 tmp1 = (double)time1.LowPart + (double)time1.HighPart*4.0*1024.0*1024.0; 160 millisec = tmp - tmp1; 161 frequency= (double)freq.LowPart; 162 frequency= frequency / 1000.0; 163 millisec = millisec / frequency; 164 165 tmp = (double)tsc2.LowPart + (double)tsc2.HighPart*4.0*1024.0*1024.0; 166 tmp1 = (double)tsc1.LowPart + (double)tsc1.HighPart*4.0*1024.0*1024.0; 167 clockticks = tmp - tmp1; 168 169 tmp = 1000 / millisec; 170 clockticks = clockticks * tmp; //ticks per second 171 mhertz = clockticks / 1000000.0; 172 mhz = (DWORD)mhertz; 173 } 174 else mhz = 100; 175 RegSetValueExA(xhkey,"~Mhz",0,REG_DWORD, (LPBYTE)&mhz, sizeof(DWORD)); 176 } 177 #endif 178 } 143 179 //TODO: FPU fdiv bug 144 180 #if 0 -
trunk/src/kernel32/cpuhlp.asm
r2798 r4407 1 ; $Id: cpuhlp.asm,v 1. 3 2000-02-15 19:06:12sandervl Exp $1 ; $Id: cpuhlp.asm,v 1.4 2000-10-03 17:28:29 sandervl Exp $ 2 2 3 3 ;/* … … 109 109 110 110 111 _GetTSC proc near 112 push ebp 113 mov ebp, esp 114 push edx 115 push esi 116 push edi 117 rdtsc 118 119 mov esi, [ebp+8] ;ptr to low dword 120 mov edi, [ebp+12] ;ptr to high dword 121 mov [esi], eax 122 mov [edi], edx 123 124 pop edi 125 pop esi 126 pop edx 127 pop ebp 128 ret 129 _GetTSC endp 130 111 131 CODE32 ENDS 112 132 -
trunk/src/kernel32/hmopen32.cpp
r4285 r4407 1 /* $Id: hmopen32.cpp,v 1.2 6 2000-09-20 21:32:52 hughExp $ */1 /* $Id: hmopen32.cpp,v 1.27 2000-10-03 17:28:30 sandervl Exp $ */ 2 2 3 3 /* … … 154 154 pHMHandleData)); 155 155 156 //TODO: return FILE_TYPE_UNKNOWN for standard in/out handles; correct??157 156 return O32_GetFileType(pHMHandleData->hHMHandle); 158 157 } -
trunk/src/kernel32/initsystem.cpp
r4256 r4407 1 /* $Id: initsystem.cpp,v 1.1 6 2000-09-13 21:10:59sandervl Exp $ */1 /* $Id: initsystem.cpp,v 1.17 2000-10-03 17:28:30 sandervl Exp $ */ 2 2 /* 3 3 * Odin system initialization (registry, directories & environment) … … 81 81 #define ODIN_WINMM_RECORD "OS/2 Dart Audio Record" 82 82 83 #define KEY_DEVICE_TYPE "Type" 84 #define KEY_DEVICE_START "Start" 85 #define KEY_DEVICE_GROUP "Group" 86 #define KEY_DEVICE_ERRORCONTROL "ErrorControl" 87 #define KEY_DEVICE_AUTORUN "Autorun" 88 #define KEY_DEVICE_TAG "Tag" 89 #define DEVICE_GROUP_FILESYSTEM "File system" 90 #define DEVICE_GROUP_SCSICDROM "SCSI CDROM Class" 91 83 92 //****************************************************************************** 84 93 //****************************************************************************** … … 492 501 RegCloseKey(hkey); 493 502 #endif 503 504 // [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdfs] 505 // "Type"=dword:00000002 506 // "Start"=dword:00000004 507 // "Group"="File system" 508 // "ErrorControl"=dword:00000001 509 // "DependOnGroup"=hex(7):53,43,53,49,20,43,44,52,4f,4d,20,43,6c,61,73,73,00,00 510 511 if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"SYSTEM\\CurrentControlSet\\Services\\Cdfs",&hkey)!=ERROR_SUCCESS) { 512 goto initreg_error; 513 } 514 val = 0x2; 515 RegSetValueExA(hkey, KEY_DEVICE_TYPE,0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD)); 516 val = 0x4; 517 RegSetValueExA(hkey, KEY_DEVICE_START,0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD)); 518 val = 0x1; 519 RegSetValueExA(hkey, KEY_DEVICE_ERRORCONTROL,0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD)); 520 RegSetValueExA(hkey, KEY_DEVICE_GROUP,0,REG_SZ, (LPBYTE)DEVICE_GROUP_FILESYSTEM, sizeof(DEVICE_GROUP_FILESYSTEM)); 521 //todo dependongroup 522 RegCloseKey(hkey); 523 524 525 /* 526 // [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdfs\Enum] 527 // "0"="Root\\LEGACY_CDFS\\0000" 528 // "Count"=dword:00000001 529 // "NextInstance"=dword:00000001 530 */ 531 // [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdrom] 532 // "Type"=dword:00000001 533 // "Start"=dword:00000001 534 // "Group"="SCSI CDROM Class" 535 // "ErrorControl"=dword:00000000 536 // "Tag"=dword:00000002 537 // "DependOnGroup"=hex(7):53,43,53,49,20,6d,69,6e,69,70,6f,72,74,00,00 538 // "Autorun"=dword:00000001 539 540 if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"SYSTEM\\CurrentControlSet\\Services\\Cdrom",&hkey)!=ERROR_SUCCESS) { 541 goto initreg_error; 542 } 543 val = 0x1; 544 RegSetValueExA(hkey, KEY_DEVICE_TYPE,0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD)); 545 val = 0x1; 546 RegSetValueExA(hkey, KEY_DEVICE_START,0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD)); 547 val = 0x0; 548 RegSetValueExA(hkey, KEY_DEVICE_ERRORCONTROL,0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD)); 549 val = 0x2; 550 RegSetValueExA(hkey, KEY_DEVICE_TAG,0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD)); 551 val = 0x0; 552 RegSetValueExA(hkey, KEY_DEVICE_AUTORUN,0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD)); 553 RegSetValueExA(hkey, KEY_DEVICE_GROUP,0,REG_SZ, (LPBYTE)DEVICE_GROUP_SCSICDROM, sizeof(DEVICE_GROUP_SCSICDROM)); 554 //todo dependongroup 555 RegCloseKey(hkey); 556 557 /* 558 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdrom\Enum] 559 "0"="Root\\LEGACY_CDROM\\0000" 560 "Count"=dword:00000001 561 "NextInstance"=dword:00000001 562 */ 563 494 564 return TRUE; 495 565 -
trunk/src/kernel32/windlllx.cpp
r4003 r4407 1 /* $Id: windlllx.cpp,v 1.1 4 2000-08-12 16:58:39sandervl Exp $ */1 /* $Id: windlllx.cpp,v 1.15 2000-10-03 17:28:31 sandervl Exp $ */ 2 2 3 3 /* … … 179 179 } 180 180 //****************************************************************************** 181 //Returns reference count or -1 if load failed (PE loader only!) 181 182 //****************************************************************************** 182 183 #ifdef DEBUG … … 216 217 item = loadedDlls.getNext(item); 217 218 } 218 if(attachProcess() == 0) 219 return 0; 219 if(attachProcess() == 0) { 220 dprintf(("WARNING: Dll %s refused to be loaded; aborting", getName())); 221 return -1; 222 } 220 223 } 221 224 return ret; -
trunk/src/kernel32/winimagepeldr.cpp
r4015 r4407 1 /* $Id: winimagepeldr.cpp,v 1.5 3 2000-08-14 19:15:37sandervl Exp $ */1 /* $Id: winimagepeldr.cpp,v 1.54 2000-10-03 17:28:31 sandervl Exp $ */ 2 2 3 3 /* … … 1405 1405 } 1406 1406 lxdll->setDllHandleOS2(hInstanceNewDll); 1407 lxdll->AddRef(); 1407 if(lxdll->AddRef() == -1) {//-1 -> load failed (attachProcess) 1408 dprintf((LOG, "Dll %s refused to be loaded; aborting", modname)); 1409 delete lxdll; 1410 errorState = ERROR_INTERNAL; 1411 return(FALSE); 1412 } 1408 1413 WinDll = (Win32DllBase*)lxdll; 1409 1414 } … … 1423 1428 if(pedll->init(0) == FALSE) { 1424 1429 dprintf((LOG, "Internal WinDll error ", pedll->getError() )); 1430 delete pedll; 1425 1431 return(FALSE); 1426 1432 } -
trunk/src/kernel32/wprocess.cpp
r4372 r4407 1 /* $Id: wprocess.cpp,v 1.9 8 2000-10-02 13:38:58sandervl Exp $ */1 /* $Id: wprocess.cpp,v 1.99 2000-10-03 17:28:32 sandervl Exp $ */ 2 2 3 3 /* … … 788 788 if(pModule->isLxDll()) 789 789 { 790 ((Win32LxDll *)pModule)->setDllHandleOS2(hDll); 791 if (fPeLoader) 792 pModule->AddRef(); 790 ((Win32LxDll *)pModule)->setDllHandleOS2(hDll); 791 if(fPeLoader) 792 { 793 if(pModule->AddRef() == -1) {//-1 -> load failed (attachProcess) 794 dprintf(("Dll %s refused to be loaded; aborting", szModname)); 795 delete pModule; 796 return 0; 797 } 798 } 793 799 } 794 800 pModule->incDynamicLib(); … … 796 802 else 797 803 return hDll; //happens when LoadLibrary is called in kernel32's initterm (nor harmful) 804 798 805 dprintf(("KERNEL32: LoadLibraryExA(%s, 0x%x, 0x%x): returns 0x%x. Loaded %s using O32_LoadLibrary.", 799 806 lpszLibFile, hFile, dwFlags, hDll, szModname)); … … 902 909 SetLastError(ERROR_DLL_INIT_FAILED); 903 910 delete peldrDll; 911 return NULL; 904 912 } 905 913 } … … 910 918 SetLastError(ERROR_INVALID_EXE_SIGNATURE); 911 919 delete peldrDll; 920 return NULL; 912 921 } 913 922 } … … 917 926 lpszLibFile, hFile, dwFlags, szModname, fPE)); 918 927 SetLastError(fPE); 928 return NULL; 919 929 } 920 930 … … 1100 1110 return ERROR_NOT_ENOUGH_MEMORY; 1101 1111 } 1102 1112 strcpy((char *)pszCmdLineA, pszPeExe); 1113 1103 1114 rc = NO_ERROR; 1104 1115 }
Note:
See TracChangeset
for help on using the changeset viewer.