Changeset 21732 for branches/gcc-kmk/src
- Timestamp:
- Oct 21, 2011, 5:13:04 PM (14 years ago)
- Location:
- branches/gcc-kmk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gcc-kmk/src/kernel32/hmparport.cpp
r8404 r21732 60 60 61 61 #define MAX_PARALLEL_PORTS_CONFIGURATION 3 62 static PARALLELPORTCONFIGURATION arrParallelPorts[MAX_PARALLEL_PORTS_CONFIGURATION] = 62 static PARALLELPORTCONFIGURATION arrParallelPorts[MAX_PARALLEL_PORTS_CONFIGURATION] = 63 63 { 64 64 {1, 0x378, 8, 0x778, 3}, … … 71 71 { 72 72 ULONG ulMagic; 73 73 74 74 // Win32 Device Control Block 75 75 COMMCONFIG CommCfg; 76 76 77 77 // hardware configuration block 78 78 PPARALLELPORTCONFIGURATION pHardwareConfiguration; … … 83 83 static VOID *CreateDevData() 84 84 { 85 HFILE hfFileHandle = 0L; 86 UCHAR uchParms[2] = {0, RM_COMMAND_PHYS}; 87 ULONG ulParmLen = 0; 85 HFILE hfFileHandle = 0L; 86 UCHAR uchParms[2] = {0, RM_COMMAND_PHYS}; 87 ULONG ulParmLen = 0; 88 88 UCHAR uchDataArea[MAX_ENUM_SIZE] = {0}; 89 UCHAR uchDataArea2[MAX_RM_NODE_SIZE] = {0}; 90 ULONG ulDataLen = 0; 89 UCHAR uchDataArea2[MAX_RM_NODE_SIZE] = {0}; 90 ULONG ulDataLen = 0; 91 91 int rc,portCount = 0; 92 92 93 93 PRM_ENUMNODES_DATA enumData; 94 94 PNODEENTRY pNode; … … 105 105 } 106 106 else 107 { 107 { 108 108 dprintf(("HMDeviceParPortClass: Succesfully opened Resource Manager")); 109 109 … … 114 114 CAT_RM,FUNC_RM_ENUM_NODES, uchParms, sizeof(uchParms), 115 115 &ulParmLen, 116 uchDataArea, 117 sizeof(uchDataArea), 118 &ulDataLen); 119 116 uchDataArea, 117 sizeof(uchDataArea), 118 &ulDataLen); 119 120 120 if (rc) 121 121 { 122 dprintf(("HMDeviceParPortClass: Failed to get resource list (IOCTL)")); 122 dprintf(("HMDeviceParPortClass: Failed to get resource list (IOCTL)")); 123 123 goto resourceLoopEnd; 124 124 } 125 125 126 126 enumData = (PRM_ENUMNODES_DATA)uchDataArea; 127 127 128 128 inputData.RMHandle = enumData->NodeEntry[0].RMHandle; 129 129 inputData.Linaddr = (ULONG)&uchDataArea2[0]; 130 130 131 131 for (int i=0;i<enumData->NumEntries;i++) 132 132 { 133 133 ulParmLen = sizeof(inputData); /* Length of input parameters */ 134 134 ulDataLen = sizeof(uchDataArea2); /* Length of data */ 135 135 136 136 rc = OSLibDosDevIOCtl(hfFileHandle, /* Handle to device */ 137 137 CAT_RM,FUNC_RM_GET_NODEINFO, … … 146 146 if (rc) 147 147 { 148 dprintf(("HMDeviceParPortClass: Failed to get resource node (IOCTL)")); 149 break; 148 dprintf(("HMDeviceParPortClass: Failed to get resource node (IOCTL)")); 149 break; 150 150 } 151 151 inputData.RMHandle = enumData->NodeEntry[i].RMHandle; … … 163 163 // @@PF Hack, but what to do no ECP info from Resource Manager! 164 164 if (arrParallelPorts[portCount].ulPortBase == 0x378) 165 { 165 { 166 166 arrParallelPorts[portCount].ulEcpPortBase = 0x778; 167 167 arrParallelPorts[portCount].ulEcpPortSpan = 3; 168 168 } 169 else 169 else 170 170 if (arrParallelPorts[portCount].ulPortBase == 0x278) 171 { 171 { 172 172 arrParallelPorts[portCount].ulEcpPortBase = 0x678; 173 173 arrParallelPorts[portCount].ulEcpPortSpan = 3; … … 178 178 arrParallelPorts[portCount].ulEcpPortSpan = 0; 179 179 dprintf(("HMDeviceParPortClass: Found and registered LPT%d with Base I/O: 0x%x",portCount,arrParallelPorts[portCount].ulPortBase)); 180 portCount ++ ; 180 portCount ++ ; 181 181 } 182 182 } 183 183 } 184 184 resourceLoopEnd: 185 OSLibDosClose(hfFileHandle); 185 OSLibDosClose(hfFileHandle); 186 186 187 187 pData = new HMDEVPARPORTDATA(); … … 194 194 pData->CommCfg.dwProviderSubType = PST_PARALLELPORT; 195 195 } 196 196 197 197 return pData; 198 198 } 199 199 //****************************************************************************** 200 200 //****************************************************************************** 201 HMDeviceParPortClass::HMDeviceParPortClass(LPCSTR lpDeviceName) : 201 HMDeviceParPortClass::HMDeviceParPortClass(LPCSTR lpDeviceName) : 202 202 HMDeviceHandler(lpDeviceName) 203 203 { 204 204 dprintf(("HMDeviceParPortClass::HMDevParPortClass(%s)\n", 205 205 lpDeviceName)); 206 206 207 207 #ifndef DEVINFO_PRINTER 208 208 #define DEVINFO_PRINTER 0 209 209 #endif 210 210 211 211 // first, we determine the number of parallel port devices available 212 212 213 213 // PH 2001-12-04 Note: 214 214 // This call will not return any information about redirected LPT ports. … … 223 223 if (0 == bNumberOfParallelPorts) 224 224 return; 225 225 226 226 VOID *pData; 227 227 dprintf(("HMDeviceParPortClass: Registering LPTs with Handle Manager\n")); 228 228 229 229 pData = CreateDevData(); 230 230 if(pData!= NULL) 231 231 HMDeviceRegisterEx("LPT1", this, pData); 232 232 233 233 // add symbolic links to the "real name" of the device 234 234 if (bNumberOfParallelPorts > 0) … … 246 246 free(pszLPT); 247 247 free(pszLPT2); 248 248 249 249 // add "PRN" device 250 250 HandleNamesAddSymbolicLink("PRN", "LPT1"); … … 272 272 if (bNumberOfParallelPorts == 0) 273 273 return FALSE; 274 274 275 275 // can be both, "LPT1" and "LPT1:" 276 276 if(namelength > 5) … … 283 283 if(namelength == 5 && lpDeviceName[4] != ':') 284 284 return FALSE; 285 285 286 286 // can support up tp LPT9 287 287 if ( (lpDeviceName[3] >= '1') && … … 305 305 lpSecurityAttributes, 306 306 pHMHandleDataTemplate)); 307 307 308 308 char lptname[6]; 309 309 310 310 dprintf(("HMDeviceParPortClass: Parallel port %s open request\n", lpFileName)); 311 311 312 312 // Don't accept any name if no parallel ports have been detected 313 313 if (bNumberOfParallelPorts == 0) … … 315 315 return ERROR_DEV_NOT_EXIST; 316 316 } 317 317 318 318 strcpy(lptname, lpFileName); 319 319 lptname[4] = 0; //get rid of : (if present) (eg LPT1:) … … 326 326 OSLIB_ACCESS_SHAREDENYWRITE); 327 327 SetErrorMode(oldmode); 328 328 329 329 // check if handle could be opened properly 330 330 if (0 == pHMHandleData->hHMHandle) … … 337 337 APIRET rc; 338 338 pHMHandleData->lpHandlerData = new HMDEVPARPORTDATA(); 339 339 340 340 // Init The handle instance with the default default device config 341 341 memcpy( pHMHandleData->lpHandlerData, 342 342 pHMHandleData->lpDeviceData, 343 343 sizeof(HMDEVPARPORTDATA)); 344 344 345 345 // determine which port was opened 346 346 ULONG ulPortNo = lptname[3] - '1'; 347 347 348 348 // safety check (device no 0..8 -> LPT1..9) 349 349 if (ulPortNo > MAX_PARALLEL_PORTS_CONFIGURATION) … … 352 352 return ERROR_DEV_NOT_EXIST; 353 353 } 354 354 355 355 // and save the hardware information 356 356 PHMDEVPARPORTDATA pPPD = (PHMDEVPARPORTDATA)pHMHandleData->lpHandlerData; 357 357 pPPD->pHardwareConfiguration = &arrParallelPorts[ulPortNo]; 358 358 359 359 return NO_ERROR; 360 360 } … … 387 387 dprintf(("HMDeviceParPortClass: Parallel port close request(%08xh)\n", 388 388 pHMHandleData)); 389 390 delete pHMHandleData->lpHandlerData;389 390 delete (PHMDEVPARPORTDATA)pHMHandleData->lpHandlerData; 391 391 return OSLibDosClose(pHMHandleData->hHMHandle); 392 392 } … … 511 511 //****************************************************************************** 512 512 //****************************************************************************** 513 BOOL HMDeviceParPortClass::DeviceIoControl(PHMHANDLEDATA pHMHandleData, 513 BOOL HMDeviceParPortClass::DeviceIoControl(PHMHANDLEDATA pHMHandleData, 514 514 DWORD dwIoControlCode, 515 LPVOID lpInBuffer, 515 LPVOID lpInBuffer, 516 516 DWORD nInBufferSize, 517 LPVOID lpOutBuffer, 517 LPVOID lpOutBuffer, 518 518 DWORD nOutBufferSize, 519 LPDWORD lpBytesReturned, 519 LPDWORD lpBytesReturned, 520 520 LPOVERLAPPED lpOverlapped) 521 521 { … … 528 528 msg = "IOCTL_INTERNAL_GET_PARALLEL_PORT_INFO"; 529 529 break; 530 530 531 531 case IOCTL_INTERNAL_GET_PARALLEL_PNP_INFO: 532 532 msg = "IOCTL_INTERNAL_GET_PARALLEL_PNP_INFO"; 533 533 break; 534 534 } 535 535 536 536 if(msg) { 537 537 dprintf(("HMDeviceParPortClass::DeviceIoControl %s %x %d %x %d %x %x", msg, lpInBuffer, nInBufferSize, … … 545 545 { 546 546 PPARALLEL_PORT_INFORMATION pPPI = (PPARALLEL_PORT_INFORMATION)lpOutBuffer; 547 548 if(nOutBufferSize < sizeof(PARALLEL_PORT_INFORMATION) || !pPPI) 547 548 if(nOutBufferSize < sizeof(PARALLEL_PORT_INFORMATION) || !pPPI) 549 549 { 550 550 SetLastError(ERROR_INSUFFICIENT_BUFFER); 551 551 return FALSE; 552 552 } 553 553 554 554 if(lpBytesReturned) 555 555 *lpBytesReturned = sizeof(PARALLEL_PORT_INFORMATION); 556 556 557 557 // fill in the data values 558 558 PHMDEVPARPORTDATA pPPD = (PHMDEVPARPORTDATA)pHMHandleData->lpHandlerData; 559 559 560 560 // @@@PH 561 561 // Specifies the bus relative base I/O address of the parallel port registers. 562 562 pPPI->OriginalController.LowPart = pPPD->pHardwareConfiguration->ulPortBase; 563 563 pPPI->OriginalController.HighPart = 0; 564 564 565 565 // Pointer to the system-mapped base I/O location of the parallel port registers. 566 566 pPPI->Controller = NULL; 567 567 568 568 // Specifies the size, in bytes, of the I/O space, allocated to the parallel port. 569 569 pPPI->SpanOfController = pPPD->pHardwareConfiguration->ulPortSpan; 570 570 571 571 // Pointer to a callback routine that a kernel-mode driver can use to try to allocate the parallel port. 572 572 pPPI->TryAllocatePort = NULL; 573 573 574 574 // Pointer to a callback routine that a kernel-mode driver can use to free the parallel port. 575 575 pPPI->FreePort = NULL; 576 576 577 577 // Pointer to a callback routine that a kernel-mode driver can use to determine the number of requests on the work queue of the parallel port. 578 578 pPPI->QueryNumWaiters = NULL; 579 579 580 580 // Pointer to the device extension of parallel port. 581 581 pPPI->Context = NULL; … … 583 583 return TRUE; 584 584 } 585 586 585 586 587 587 case IOCTL_INTERNAL_GET_PARALLEL_PNP_INFO: 588 588 { 589 589 PPARALLEL_PNP_INFORMATION pPPI = (PPARALLEL_PNP_INFORMATION)lpOutBuffer; 590 590 591 591 if(nOutBufferSize < sizeof(PARALLEL_PNP_INFORMATION) || !pPPI) 592 592 { … … 594 594 return FALSE; 595 595 } 596 596 597 597 if(lpBytesReturned) 598 598 *lpBytesReturned = sizeof(PARALLEL_PNP_INFORMATION); 599 599 600 600 // fill in the data values 601 601 PHMDEVPARPORTDATA pPPD = (PHMDEVPARPORTDATA)pHMHandleData->lpHandlerData; 602 602 603 603 // @@@PH 604 // Specifies the base physical address that the system-supplied 605 // function driver for parallel ports uses to control the ECP 604 // Specifies the base physical address that the system-supplied 605 // function driver for parallel ports uses to control the ECP 606 606 // operation of the parallel port. 607 607 pPPI->OriginalEcpController.LowPart = pPPD->pHardwareConfiguration->ulEcpPortBase; 608 608 pPPI->OriginalEcpController.HighPart = 0; 609 610 // Pointer to the I/O port resource that is used to control the 609 610 // Pointer to the I/O port resource that is used to control the 611 611 // port in ECP mode. 612 612 pPPI->EcpController = NULL; 613 613 614 614 // Specifies the size, in bytes, of the I/O port resource. 615 615 pPPI->SpanOfEcpController = pPPD->pHardwareConfiguration->ulEcpPortSpan; 616 616 617 617 // Not used. 618 618 pPPI->PortNumber = 0; 619 619 620 620 // Specifies the hardware capabilities of the parallel port. The following capabilities can be set using a bitwise OR of the following constants: 621 621 pPPI->HardwareCapabilities = 0; … … 626 626 // PPT_EPP_PRESENT 627 627 // PT_NO_HARDWARE_PRESENT 628 628 629 629 // Pointer to a callback routine that a kernel-mode driver can use to change the operating mode of the parallel port. 630 630 pPPI->TrySetChipMode = 0; 631 631 632 632 // Pointer to a callback routine that a kernel-mode driver can use to clear the operating mode of the parallel port. 633 633 pPPI->ClearChipMode = 0; 634 634 635 635 // Specifies the size, in words, of the hardware first in/first out (FIFO) buffer. The FIFO word size, in bits, is the value of FifoWidth. 636 636 pPPI->FifoDepth = 0; 637 637 638 638 // Specifies the FIFO word size, in bits, which is the number of bits handled in parallel. 639 639 pPPI->FifoWidth = 0; 640 640 641 641 // Not used. 642 642 pPPI->EppControllerPhysicalAddress.LowPart = 0; 643 643 pPPI->EppControllerPhysicalAddress.HighPart = 0; 644 644 645 645 // Not used. 646 646 pPPI->SpanOfEppController = 0; 647 647 648 648 // Specifies the number of daisy-chain devices currently attached to a parallel port. In Microsoftÿ Windowsÿ XP, from zero to two devices can be simultaneously connected to a 649 649 // parallel port. In Windows 2000, from zero to four devices can be simultaneously connected to a parallel port. 650 650 pPPI->Ieee1284_3DeviceCount = 0; 651 651 652 652 // Pointer to a callback routine that a kernel-mode driver can use to try to select an IEEE 1284.3 device. 653 653 pPPI->TrySelectDevice = 0; 654 654 655 655 // Pointer to a callback routine that a kernel-mode driver can use to deselect an IEEE 1284.3 device. 656 656 pPPI->DeselectDevice = 0; 657 657 658 658 // Pointer to the device extension of a parallel port's function device object (FDO). 659 659 pPPI->Context = 0; 660 660 661 661 // The current operating mode of the parallel port. 662 662 pPPI->CurrentMode = 0; 663 663 664 664 // The symbolic link name of the parallel port. 665 665 pPPI->PortName = 0; 666 666 667 667 return TRUE; 668 668 } -
branches/gcc-kmk/src/kernel32/mmap.cpp
r21720 r21732 50 50 51 51 52 static char *pszMMapSemName = MEMMAP_CRITSECTION_NAME;52 static LPCSTR pszMMapSemName = MEMMAP_CRITSECTION_NAME; 53 53 54 54 //****************************************************************************** -
branches/gcc-kmk/src/kernel32/oslibdos.cpp
r21675 r21732 98 98 static ULONG crc32str(const char *psz); 99 99 100 char* ODINHelperStripUNC(char*strUNC)101 { 102 char *retStr = strUNC;100 LPCSTR ODINHelperStripUNC(LPCSTR strUNC) 101 { 102 LPCSTR retStr = strUNC; 103 103 104 104 if (!strUNC) return NULL; … … 460 460 //****************************************************************************** 461 461 //****************************************************************************** 462 DWORD OSLibDosOpen( char *lpszFileName, DWORD flags)462 DWORD OSLibDosOpen(LPCSTR lpszFileName, DWORD flags) 463 463 { 464 464 APIRET rc; … … 721 721 //****************************************************************************** 722 722 //****************************************************************************** 723 BOOL OSLibDosDelete( char *lpszFileName)723 BOOL OSLibDosDelete(LPCSTR lpszFileName) 724 724 { 725 725 APIRET rc; … … 850 850 DWORD WIN32API GetEnvironmentVariableA(LPCSTR, LPSTR, DWORD ); 851 851 //****************************************************************************** 852 DWORD OSLibDosSearchPath(DWORD cmd, char *path, char *name, char *full_name,853 DWORD length_fullname)852 DWORD OSLibDosSearchPath(DWORD cmd, LPCSTR path, LPCSTR name, 853 LPSTR full_name, DWORD length_fullname) 854 854 { 855 855 switch(cmd) { … … 947 947 APIRET rc = ERROR_NOT_ENOUGH_MEMORY; 948 948 949 CHAR*lpszFileLoc = ODINHelperStripUNC(lpszFile);949 LPCSTR lpszFileLoc = ODINHelperStripUNC(lpszFile); 950 950 951 951 //TODO: lpSecurityAttributes (inheritance) -
branches/gcc-kmk/src/kernel32/oslibdos.h
r21564 r21732 17 17 #endif 18 18 19 char* ODINHelperStripUNC(char*strUNC);19 LPCSTR ODINHelperStripUNC(LPCSTR strUNC); 20 20 21 21 #ifdef OS2_INCLUDED … … 46 46 #define OSLIB_ACCESS_SHAREDENYWRITE 16 47 47 48 DWORD OSLibDosOpen( char *lpszFileName, DWORD flags);48 DWORD OSLibDosOpen(LPCSTR lpszFileName, DWORD flags); 49 49 BOOL OSLibDosClose(DWORD hFile); 50 BOOL OSLibDosDelete( char *lpszFileName);50 BOOL OSLibDosDelete(LPCSTR lpszFileName); 51 51 BOOL OSLibDosCopyFile(LPCSTR lpszOldFile, LPCSTR lpszNewFile, BOOL fFailIfExist); 52 52 BOOL OSLibDosMoveFile(LPCSTR lpszOldFile, LPCSTR lpszNewFile); … … 65 65 #define OSLIB_SEARCHENV 4 66 66 67 DWORD OSLibDosSearchPath(DWORD cmd, char *path, char *name, char *full_name, DWORD length_fullname); 67 DWORD OSLibDosSearchPath(DWORD cmd, LPCSTR path, LPCSTR name, 68 LPSTR full_name, DWORD length_fullname); 68 69 69 70 #ifndef FIL_QUERYFULLNAME -
branches/gcc-kmk/src/kernel32/time.cpp
r21302 r21732 40 40 //File time (UTC) to MS-DOS date & time values (also UTC) 41 41 //****************************************************************************** 42 BOOL WIN32API FileTimeToDosDateTime(const FILETIME *lpFileTime, LPWORD lpDosDate, 42 BOOL WIN32API FileTimeToDosDateTime(const FILETIME *lpFileTime, LPWORD lpDosDate, 43 43 LPWORD lpDosTime) 44 44 { … … 60 60 return FALSE; 61 61 } 62 return O32_FileTimeToLocalFileTime(lpFileTime, lpLocalTime); 62 return O32_FileTimeToLocalFileTime(lpFileTime, lpLocalTime); 63 63 } 64 64 //****************************************************************************** 65 65 //Local time to File time (UTC) 66 66 //****************************************************************************** 67 BOOL WIN32API LocalFileTimeToFileTime(const FILETIME *lpLocalFileTime, 67 BOOL WIN32API LocalFileTimeToFileTime(const FILETIME *lpLocalFileTime, 68 68 LPFILETIME lpFileTime) 69 69 { … … 98 98 } 99 99 //****************************************************************************** 100 //MS-DOS date & time values (UTC) to File time (also UTC) 100 //MS-DOS date & time values (UTC) to File time (also UTC) 101 101 //****************************************************************************** 102 102 BOOL WIN32API DosDateTimeToFileTime(WORD wDosDate, WORD wDosTime, LPFILETIME pFileTime) 103 103 { 104 104 dprintf(("%x %x", wDosDate, wDosTime)); 105 105 106 106 if(pFileTime == NULL) { 107 107 SetLastError(ERROR_INVALID_PARAMETER); … … 117 117 } 118 118 //****************************************************************************** 119 //The GetLocalTime function retrieves the current local date and time. 119 //The GetLocalTime function retrieves the current local date and time. 120 120 //(in local time) 121 121 //****************************************************************************** … … 130 130 } 131 131 //****************************************************************************** 132 //The SetLocalTime function sets the current local time and date. 132 //The SetLocalTime function sets the current local time and date. 133 133 //(in local time) 134 134 //****************************************************************************** … … 143 143 } 144 144 //****************************************************************************** 145 //The GetSystemTime function retrieves the current system date and time. 145 //The GetSystemTime function retrieves the current system date and time. 146 146 //The system time is expressed in Coordinated Universal Time (UTC). 147 147 //****************************************************************************** … … 157 157 } 158 158 //****************************************************************************** 159 //The SetSystemTime function sets the current system time and date. 159 //The SetSystemTime function sets the current system time and date. 160 160 //The system time is expressed in Coordinated Universal Time (UCT). 161 161 //****************************************************************************** … … 185 185 } 186 186 //****************************************************************************** 187 static const LP STR szTZBias = "Bias";188 static const LP STR szTZActiveTimeBias = "ActiveTimeBias";189 190 static const LP WSTR szTZStandardName = (LPWSTR)L"StandardName";191 static const LP STR szTZStandardBias = "StandardBias";192 static const LP STR szTZStandardStart = "StandardStart";193 194 static const LP WSTR szTZDaylightName = (LPWSTR)L"DaylightName";195 static const LP STR szTZDaylightBias = "DaylightBias";196 static const LP STR szTZDaylightStart = "DaylightStart";197 static const LP STR KEY_WINDOWS_TZ = "SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation";187 static const LPCSTR szTZBias = "Bias"; 188 static const LPCSTR szTZActiveTimeBias = "ActiveTimeBias"; 189 190 static const LPCWSTR szTZStandardName = (LPCWSTR)L"StandardName"; 191 static const LPCSTR szTZStandardBias = "StandardBias"; 192 static const LPCSTR szTZStandardStart = "StandardStart"; 193 194 static const LPCWSTR szTZDaylightName = (LPCWSTR)L"DaylightName"; 195 static const LPCSTR szTZDaylightBias = "DaylightBias"; 196 static const LPCSTR szTZDaylightStart = "DaylightStart"; 197 static const LPCSTR KEY_WINDOWS_TZ = "SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation"; 198 198 //****************************************************************************** 199 199 DWORD WIN32API GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZone) -
branches/gcc-kmk/src/kernel32/windllpe2lx.h
r21716 r21732 25 25 public: 26 26 /** @cat Constructor/Destructor */ 27 Win32Pe2LxDll(HINSTANCE hinstance, BOOL fWin32k) throw(ULONG);27 Win32Pe2LxDll(HINSTANCE hinstance, BOOL fWin32k); 28 28 virtual ~Win32Pe2LxDll(); 29 29 DWORD init(); -
branches/gcc-kmk/src/kernel32/winimagepe2lx.cpp
r10397 r21732 440 440 + strlen((char*)pLrec->pName) + 1 /* size of the filename */ 441 441 + 3) & ~3)); /* the size is align on 4 bytes boundrary */ 442 #ifdef __INNOTEK_LIBC__ 443 pLrec->pNextRec = (void **)(qsLrec_t*)((char*)pLrec->pObjInfo 444 + sizeof(qsLObjrec_t) * pLrec->ctObj); 445 #else 442 446 pLrec->pNextRec = (qsLrec_t*)((char*)pLrec->pObjInfo 443 447 + sizeof(qsLObjrec_t) * pLrec->ctObj); 448 #endif 444 449 } 445 450 if (pLrec->hmte == hmod) … … 549 554 550 555 /* loop thru the PE sections */ 551 for (int i = 0; i < pNtHdrs->FileHeader.NumberOfSections; i++) 556 int i; 557 for (i = 0; i < pNtHdrs->FileHeader.NumberOfSections; i++) 552 558 { 553 559 if (paSections[0].cbVirtual < paPESections[i].VirtualAddress) -
branches/gcc-kmk/src/odincrt/critsect.cpp
r10580 r21732 35 35 return NO_ERROR; 36 36 } 37 37 38 38 return ERROR_INVALID_PARAMETER; 39 39 } … … 101 101 */ 102 102 ULONG WIN32API DosInitializeCriticalSection(CRITICAL_SECTION_OS2 *crit, 103 P SZ pszSemName, BOOL fShared)103 PCSZ pszSemName, BOOL fShared) 104 104 { 105 105 APIRET rc; … … 125 125 * DosAccessCriticalSection 126 126 */ 127 ULONG WIN32API DosAccessCriticalSection(CRITICAL_SECTION_OS2 *crit, P SZ pszSemName)127 ULONG WIN32API DosAccessCriticalSection(CRITICAL_SECTION_OS2 *crit, PCSZ pszSemName) 128 128 { 129 129 APIRET rc = NO_ERROR; 130 131 // Increment creation counter to prevent the section to be destroyed while 130 131 // Increment creation counter to prevent the section to be destroyed while 132 132 // we are checking it. Assume that an unitialized section has the counter == 0 133 133 DosInterlockedIncrement(&crit->CreationCount); 134 134 135 135 if (DosValidateCriticalSection (crit) == NO_ERROR) 136 136 { 137 137 // the section already initialized, use it 138 138 HEV hevLock = NULLHANDLE; 139 139 140 140 if (pszSemName == NULL) 141 141 { … … 155 155 rc = DosInitializeCriticalSection (crit, pszSemName, TRUE); 156 156 } 157 157 158 158 return NO_ERROR; 159 159 }
Note:
See TracChangeset
for help on using the changeset viewer.