Changeset 2883 for trunk/kLdr/kLdrModNative.c
- Timestamp:
- Nov 18, 2006, 12:21:33 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kLdr/kLdrModNative.c
r2878 r2883 33 33 #include "kLdrInternal.h" 34 34 #ifdef __OS2__ 35 # define INCL_BASE 35 36 # include <os2.h> 36 37 38 # ifndef LIBPATHSTRICT 39 # define LIBPATHSTRICT 3 40 # endif 41 extern APIRET DosQueryHeaderInfo(HMODULE hmod, ULONG ulIndex, PVOID pvBuffer, ULONG cbBuffer, ULONG ulSubFunction); 42 # define QHINF_EXEINFO 1 /* NE exeinfo. */ 43 # define QHINF_READRSRCTBL 2 /* Reads from the resource table. */ 44 # define QHINF_READFILE 3 /* Reads from the executable file. */ 45 # define QHINF_LIBPATHLENGTH 4 /* Gets the libpath length. */ 46 # define QHINF_LIBPATH 5 /* Gets the entire libpath. */ 47 # define QHINF_FIXENTRY 6 /* NE only */ 48 # define QHINF_STE 7 /* NE only */ 49 # define QHINF_MAPSEL 8 /* NE only */ 50 37 51 #elif defined(__WIN__) 38 //# include "kLdrModPE.h"39 52 # undef IMAGE_NT_SIGNATURE 40 53 # undef IMAGE_DOS_SIGNATURE … … 42 55 # ifndef IMAGE_SCN_TYPE_NOLOAD 43 56 # define IMAGE_SCN_TYPE_NOLOAD 0x00000002 44 #endif 45 57 # endif 46 58 47 59 /*#elif defined(__NT__) … … 162 174 HMODULE hmod; 163 175 164 rc = DosLoadModule(NULL, 0, pszFilename, &hmod);176 rc = DosLoadModule(NULL, 0, (PCSZ)pszFilename, &hmod); 165 177 if (rc) 166 178 return rc; … … 213 225 214 226 /* get the filename. */ 215 rc = DosQueryModuleName( hmod, sizeof(szFilename), szFilename);227 rc = DosQueryModuleName((HMODULE)uHandle, sizeof(szFilename), szFilename); 216 228 if (rc) 217 229 { … … 308 320 */ 309 321 #ifdef __OS2__ 310 pModNative->hmod = hmod;322 pModNative->hmod = (HMODULE)uHandle; 311 323 312 324 /* just fake a segment for now. */ … … 514 526 rc = DosQueryProcAddr(pModNative->hmod, 515 527 pszSymbol ? 0 : iSymbol, 516 pszSymbol,528 (PCSZ)pszSymbol, 517 529 &pfn); 518 530 if (rc) … … 525 537 rc = DosQueryProcType(pModNative->hmod, 526 538 pszSymbol ? 0 : iSymbol, 527 pszSymbol,539 (PCSZ)pszSymbol, 528 540 &ulProcType); 529 541 if (rc) … … 567 579 568 580 /** @todo implement export enumeration on OS/2. */ 581 (void)pModNative; 569 582 return ERROR_NOT_SUPPORTED; 570 583 … … 653 666 654 667 /** @todo implement export enumeration on OS/2. */ 668 (void)pModNative; 655 669 return ERROR_NOT_SUPPORTED; 656 670 … … 675 689 const IMAGE_IMPORT_DESCRIPTOR *); 676 690 pszImportName = KLDRMODNATIVE_RVA2TYPE(pModNative->hmod, pImpDesc->Name, const char *); 677 cchImportName = strlen(pszImportName);691 cchImportName = kLdrHlpStrLen(pszImportName); 678 692 if (cchImportName < cchName) 679 693 { … … 704 718 705 719 /** @todo implement export enumeration on OS/2. */ 720 (void)pModNative; 706 721 return -1; 707 722 … … 743 758 744 759 /** @todo implement export enumeration on OS/2. */ 760 (void)pModNative; 745 761 return ERROR_NOT_SUPPORTED; 746 762 … … 765 781 766 782 /** @todo implement export enumeration on OS/2. */ 783 (void)pModNative; 767 784 return ERROR_NOT_SUPPORTED; 768 785 … … 789 806 790 807 /** @todo implement export enumeration on OS/2. */ 808 (void)pModNative; 791 809 return ERROR_NOT_SUPPORTED; 792 810 … … 820 838 case IMAGE_DEBUG_TYPE_UNKNOWN: 821 839 case IMAGE_DEBUG_TYPE_FPO: 822 case IMAGE_DEBUG_TYPE_COFF: / /stabs dialect??840 case IMAGE_DEBUG_TYPE_COFF: /*stabs dialect??*/ 823 841 case IMAGE_DEBUG_TYPE_MISC: 824 842 case IMAGE_DEBUG_TYPE_EXCEPTION: … … 863 881 864 882 /** @todo implement export enumeration on OS/2. */ 883 (void)pModNative; 865 884 return KLDR_ERR_NO_DEBUG_INFO; 866 885
Note:
See TracChangeset
for help on using the changeset viewer.