From 80fd717092ea421d0b410e07b1962873227557bd Mon Sep 17 00:00:00 2001 From: midipix Date: Tue, 5 Jun 2018 08:46:50 -0400 Subject: ldso: runtime data block: support inheritance of an alternate loader handle. --- src/ldso/pe_find_framework_loader.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/ldso') diff --git a/src/ldso/pe_find_framework_loader.c b/src/ldso/pe_find_framework_loader.c index c138d32..10513c0 100644 --- a/src/ldso/pe_find_framework_loader.c +++ b/src/ldso/pe_find_framework_loader.c @@ -119,8 +119,12 @@ int32_t pe_find_framework_loader( OS_FILE_NON_DIRECTORY_FILE))) return status; + if (rtdata->hloader) + zw_close(hloader); + else + rtdata->hloader = hloader; + rtdata->hdsodir = hdsodir; - rtdata->hloader = hloader; rtdata->himage = himage; return OS_STATUS_SUCCESS; @@ -156,8 +160,12 @@ int32_t pe_find_framework_loader( OS_FILE_NON_DIRECTORY_FILE))) return status; + if (rtdata->hloader) + zw_close(hloader); + else + rtdata->hloader = hloader; + rtdata->hdsodir = 0; - rtdata->hloader = hloader; return OS_STATUS_SUCCESS; } @@ -261,8 +269,12 @@ int32_t pe_find_framework_loader( zw_close(hprevious); } + if (rtdata->hloader) + zw_close(hloader); + else + rtdata->hloader = hloader; + rtdata->hdsodir = 0; - rtdata->hloader = hloader; rtdata->himage = himage; rtdata->hroot = hparent; -- cgit v1.2.3