From 866f5911417e2f1752a7883d15023c140dc3c26b Mon Sep 17 00:00:00 2001 From: midipix Date: Jun 29 2020 18:09:35 +0000 Subject: driver: toks_get_driver_ctx(): properly handle --sysroot and no rtdata->hroot. --- diff --git a/src/driver/toks_driver_ctx.c b/src/driver/toks_driver_ctx.c index 2b6d0ef..1a8c53d 100644 --- a/src/driver/toks_driver_ctx.c +++ b/src/driver/toks_driver_ctx.c @@ -770,6 +770,8 @@ int toks_get_driver_ctx( if (ctx->rtdata->hroot && cctx.sysroot) { ntapi->zw_close(ctx->rtdata->hroot); ctx->rtdata->hroot = cctx.hroot; + } else if (cctx.sysroot) { + ctx->rtdata->hroot = cctx.hroot; } else { cctx.hroot = ctx->rtdata->hroot; } @@ -865,8 +867,6 @@ int toks_get_driver_ctx( ctx->ctx.program = program; ctx->ctx.cctx = &ctx->cctx; ctx->cctx.uuid = &ctx->uuid; - - ctx->rtdata->hroot = cctx.hroot; ctx->rtdata->hlog = hlog ? hlog : ctx->rtdata->hlog; toks_set_driver_refstr(&ctx->ctx,refstr);