- Timestamp:
- Jun 10, 2020 9:09:15 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kWorker/kWorker.c
r3374 r3376 2172 2172 { 2173 2173 fRc = VirtualProtect(pbProtRange, cbProtRange, fOldProt, NULL /*pfOldProt*/); 2174 kHlpAssert(fRc );2174 kHlpAssert(fRc || GetLastError() == ERROR_NOACCESS /*tinderwin2*/); 2175 2175 fOldProt = 0; 2176 2176 } … … 2886 2886 default: 2887 2887 rc = KERR_GENERAL_FAILURE; 2888 kwErrPrintf("kwLdrModuleCreateNonNative: Unsupported module type %d (%s)!\n", pLdrMod->enmType, pszPath); 2888 2889 break; 2889 2890 } … … 2987 2988 continue; 2988 2989 } 2990 kwErrPrintf("Error getting import '%s' for '%s': %d\n", szName, pMod->pszPath); 2989 2991 break; 2990 2992 } … … 3044 3046 return pMod; 3045 3047 } 3048 kwErrPrintf("kwLdrModuleCreateNonNativeSetupTls failed with %d for %s\n", rc, pMod->pszPath); 3046 3049 } 3047 3050 else … … 3062 3065 kwErrPrintf("Failed to allocate %#x bytes\n", pMod->cbImage); 3063 3066 } 3064 } 3067 else 3068 kwErrPrintf("kwLdrModuleCreateNonNative: out of memory!\n"); 3069 } 3070 else 3071 kwErrPrintf("kwLdrModuleCreateNonNative: kLdrModNumberOfImports failed for '%s'\n", pszPath); 3065 3072 } 3066 3073 kLdrModClose(pLdrMod); … … 4086 4093 { 4087 4094 KBOOL fRc; 4095 wchar_t wcSaved; 4096 wchar_t *pwcEnd; 4088 4097 pTool->pwszPath = (wchar_t const *)(pTool + 1); 4089 4098 fRc = kFsCacheObjGetFullPathW(pToolFsObj, (wchar_t *)pTool->pwszPath, cwcPath, '\\'); … … 4094 4103 kHlpAssert(fRc); 4095 4104 4105 /* HACK ALERT! This is to help the loader search the application directory. */ 4106 pwcEnd = (wchar_t *)&pTool->pwszPath[pToolFsObj->cwcParent]; 4107 wcSaved = *pwcEnd; 4108 *pwcEnd = '\0'; 4109 if (!SetDllDirectoryW(pTool->pwszPath)) 4110 kwErrPrintf("SetDllDirectoryW(tool) failed: %u\n", GetLastError()); 4111 *pwcEnd = wcSaved; 4112 4096 4113 pTool->enmType = KWTOOLTYPE_SANDBOXED; 4097 4114 pTool->u.Sandboxed.pExe = kwLdrModuleCreateNonNative(pTool->pszPath, kwStrHash(pTool->pszPath), K_TRUE /*fExe*/, 4098 NULL /*pE exeMod*/, pszSearchPath);4115 NULL /*pExeMod*/, pszSearchPath); 4099 4116 if (pTool->u.Sandboxed.pExe) 4100 4117 { … … 4119 4136 } 4120 4137 else 4138 { 4139 kwErrPrintf("kwLdrModuleCreateNonNative failed!\n"); 4121 4140 pTool->enmType = KWTOOLTYPE_EXEC; 4141 } 4122 4142 4123 4143 kFsCacheObjRelease(g_pFsCache, pToolFsObj); … … 4125 4145 return pTool; 4126 4146 } 4147 kwErrPrintf("kFsCacheObjAddUserData failed!\n"); 4127 4148 kFsCacheObjRelease(g_pFsCache, pToolFsObj); 4128 4149 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.