Improve error handling for shared handles in wddm.

Change-Id: I93d33d89cb4b6333924c362b54e0638174e44091
This commit is contained in:
Zdunowski, Piotr
2017-12-21 17:28:17 +01:00
committed by sys_ocldev
parent aba7dc637d
commit b006972d07
6 changed files with 57 additions and 6 deletions

View File

@@ -695,6 +695,10 @@ bool Wddm::openSharedHandle(D3DKMT_HANDLE handle, WddmAllocation *alloc) {
auto status = gdi->queryResourceInfo(&QueryResourceInfo);
DEBUG_BREAK_IF(status != STATUS_SUCCESS);
if (QueryResourceInfo.NumAllocations == 0) {
return false;
}
std::unique_ptr<char[]> allocPrivateData(new char[QueryResourceInfo.TotalPrivateDriverDataSize]);
std::unique_ptr<char[]> resPrivateData(new char[QueryResourceInfo.ResourcePrivateDriverDataSize]);
std::unique_ptr<char[]> resPrivateRuntimeData(new char[QueryResourceInfo.PrivateRuntimeDataSize]);
@@ -721,7 +725,7 @@ bool Wddm::openSharedHandle(D3DKMT_HANDLE handle, WddmAllocation *alloc) {
alloc->gmm = Gmm::create((PGMM_RESOURCE_INFO)(allocationInfo[0].pPrivateDriverData));
return STATUS_SUCCESS;
return true;
}
bool Wddm::openNTHandle(HANDLE handle, WddmAllocation *alloc) {
@@ -757,7 +761,7 @@ bool Wddm::openNTHandle(HANDLE handle, WddmAllocation *alloc) {
alloc->gmm = Gmm::create((PGMM_RESOURCE_INFO)(allocationInfo2[0].pPrivateDriverData));
return STATUS_SUCCESS;
return true;
}
void *Wddm::lockResource(WddmAllocation *wddmAllocation) {