From a830d37ce2d2fce76e66c539a7afd0946f894f36 Mon Sep 17 00:00:00 2001 From: midipix Date: Jun 21 2020 10:13:53 +0000 Subject: driver: toks_get_driver_ctx(): enhanced runtime-data sysroot inheritance. --- diff --git a/src/driver/toks_driver_ctx.c b/src/driver/toks_driver_ctx.c index 718829b..b885453 100644 --- a/src/driver/toks_driver_ctx.c +++ b/src/driver/toks_driver_ctx.c @@ -550,9 +550,11 @@ int toks_get_driver_ctx( if (!(ctx = toks_driver_ctx_alloc(meta,&cctx))) return toks_get_driver_ctx_fail(meta); - if (ctx->rtdata->hroot && cctx.hroot) { + if (ctx->rtdata->hroot && cctx.sysroot) { ntapi->zw_close(ctx->rtdata->hroot); ctx->rtdata->hroot = cctx.hroot; + } else { + cctx.hroot = ctx->rtdata->hroot; } if (cctx.logfile && toks_open_log_file(&hlog,ctx->rtdata->hroot,cctx.logfile,false)) {