Changeset 2501 for trunk/src/win32k/ldr/myldrOpen.cpp
- Timestamp:
- Jan 22, 2000, 7:21:03 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/ldr/myldrOpen.cpp
r1678 r2501 1 /* $Id: myldrOpen.cpp,v 1. 5 1999-11-10 01:45:36bird Exp $1 /* $Id: myldrOpen.cpp,v 1.6 2000-01-22 18:21:02 bird Exp $ 2 2 * 3 * myldrOpen - _ldrOpen.3 * myldrOpen - ldrOpen. 4 4 * 5 5 * Copyright (c) 1998-1999 knut st. osmundsen … … 39 39 40 40 /** 41 * _ldrOpen override.41 * ldrOpen override. 42 42 * @returns Return code. 43 43 * @param phFile Pointer to file handler. Holds filehandle on output. … … 48 48 { 49 49 ULONG rc; 50 int i;51 50 52 rc = _ldrOpen(phFile, pszFilename, param3);51 rc = ldrOpen(phFile, pszFilename, param3); 53 52 54 53 if (rc == NO_ERROR) 55 kprintf((" _ldrOpen: phFile=%#.4x, flags=%#.8x, pszFn=%s\n", *phFile, param3, pszFilename));54 kprintf(("ldrOpen: phFile=%#.4x, flags=%#.8x, pszFn=%s\n", *phFile, param3, pszFilename)); 56 55 57 56 if (rc == NO_ERROR && (options.fElf || options.fPE != FLAGS_PE_NOT || options.fScript)) … … 66 65 * This costs up to two disk reads! 67 66 */ 68 rc = _ldrRead(*phFile, 0UL, pMzHdr, 0UL, sizeof(IMAGE_DOS_HEADER), NULL);67 rc = ldrRead(*phFile, 0UL, pMzHdr, 0UL, sizeof(IMAGE_DOS_HEADER), NULL); 69 68 if (rc == NO_ERROR) 70 69 { … … 77 76 78 77 if (*(PULONG)pach != IMAGE_NT_SIGNATURE) 79 rc = _ldrRead(*phFile, pMzHdr->e_lfanew, pach, 0UL, sizeof(achBuffer), NULL);78 rc = ldrRead(*phFile, pMzHdr->e_lfanew, pach, 0UL, sizeof(achBuffer), NULL); 80 79 81 80 if (rc == NO_ERROR && *(PULONG)pach == IMAGE_NT_SIGNATURE) 82 81 { /* PE signature found */ 83 kprintf((" _ldrOpen: PE executable...\n"));82 kprintf(("ldrOpen: PE executable...\n")); 84 83 if (options.fPE == FLAGS_PE_PE2LX 85 84 || (options.fPE == FLAGS_PE_MIXED … … 96 95 if (rc == NO_ERROR) 97 96 { 98 kprintf((" _ldrOpen: Successfully init of Pe2Lx object.\n"));97 kprintf(("ldrOpen: Successfully init of Pe2Lx object.\n")); 99 98 rc = addModule(*phFile, NULL, MOD_TYPE_PE2LX, pPe2Lx); 100 99 if (rc == NO_ERROR) 100 #pragma info(notrd) 101 101 SetState(*phFile, HSTATE_OUR); 102 #pragma info(restore) 102 103 else 103 kprintf((" _ldrOpen: Failed to add the module. rc=%d\n"));104 kprintf(("ldrOpen: Failed to add the module. rc=%d\n")); 104 105 } 105 106 else 106 kprintf((" _ldrOpen: Failed to init Pe2Lx object. rc=%d\n"));107 kprintf(("ldrOpen: Failed to init Pe2Lx object. rc=%d\n")); 107 108 if (rc != NO_ERROR) 108 109 delete pPe2Lx; 109 110 } 110 111 else 111 kprintf((" _ldrOpen: Failed to allocate Pe2Lx object.\n"));112 kprintf(("ldrOpen: Failed to allocate Pe2Lx object.\n")); 112 113 } 113 114 else 114 115 if (options.fPE == FLAGS_PE_PE || options.fPE == FLAGS_PE_MIXED) 115 116 { /* pe.exe */ 116 kprintf((" _ldrOpen: pe.exe - opening\n"));117 _ldrClose(*phFile);118 rc = _ldrOpen(phFile, "pe.exe", param3); /* path....! problems! */119 kprintf((" _ldrOpen: pe.exe - open returned with rc = %d\n", rc));117 kprintf(("ldrOpen: pe.exe - opening\n")); 118 ldrClose(*phFile); 119 rc = ldrOpen(phFile, "pe.exe", param3); /* path....! problems! */ 120 kprintf(("ldrOpen: pe.exe - open returned with rc = %d\n", rc)); 120 121 return rc; 121 122 } … … 128 129 { 129 130 /* ELF signature found */ 130 kprintf((" _ldrOpen: ELF executable! - not implemented yet!\n"));131 kprintf(("ldrOpen: ELF executable! - not implemented yet!\n")); 131 132 } 132 133 else … … 136 137 char *pszStart = pach+2; 137 138 char *pszEnd; 138 kprintf((" _ldrOpen: unix script?\n"));139 kprintf(("ldrOpen: unix script?\n")); 139 140 140 141 achBuffer[sizeof(achBuffer)-1] = '\0'; /* just to make sure we don't read to much... */ … … 152 153 { 153 154 *pszEnd = '\0'; 154 kprintf((" _ldrOpen: unix script - opening %s\n", pszStart));155 _ldrClose(*phFile);156 rc = _ldrOpen(phFile, pszStart, param3);157 kprintf((" _ldrOpen: unix script - open returned with rc = %d\n", rc));155 kprintf(("ldrOpen: unix script - opening %s\n", pszStart)); 156 ldrClose(*phFile); 157 rc = ldrOpen(phFile, pszStart, param3); 158 kprintf(("ldrOpen: unix script - open returned with rc = %d\n", rc)); 158 159 } 159 160 } 160 161 else 161 kprintf((" _ldrOpen: unix script - unexpected end of line/file. (line: %.10s\n", pach));162 kprintf(("ldrOpen: unix script - unexpected end of line/file. (line: %.10s\n", pach)); 162 163 } 163 164 } … … 165 166 else 166 167 { 167 kprintf((" _ldrOpen: _ldrRead failed with rc=%d when reading DosHdr.\n", rc));168 kprintf(("ldrOpen: ldrRead failed with rc=%d when reading DosHdr.\n", rc)); 168 169 rc = NO_ERROR; 169 170 }
Note:
See TracChangeset
for help on using the changeset viewer.