google / glazier

A tool for automating the installation of the Microsoft Windows operating system on various device platforms.
Apache License 2.0
1.22k stars 90 forks source link

DISM: `EnableFeature` returns error on Windows Server 2019 although enablement works #459

Closed lippertmarkus closed 2 years ago

lippertmarkus commented 2 years ago

Consider the following example:

package main

import (
    "errors"
    "fmt"
    "github.com/google/glazier/go/dism"
    "golang.org/x/sys/windows"
    "syscall"
)

func main() {
    dismSession, err := dism.OpenSession(dism.DISM_ONLINE_IMAGE, "", "", dism.DismLogErrorsWarningsInfo, "", "")
    if err != nil {
        panic(err)
    }
    defer dismSession.Close()

    if err := dismSession.EnableFeature("Containers", "", nil, true, nil, nil); err != nil {
        if errors.Is(err, windows.ERROR_SUCCESS_REBOOT_REQUIRED) {
            fmt.Printf("Please reboot!")
        } else if e, ok := err.(syscall.Errno); ok && int(e) == 1 {
            fmt.Printf("error code %d with message \"%s\"", int(e), err)
            panic(err)
        } else {
            panic(err)
        }
    }

    fmt.Print("Feature enabled")
}

When running it on Windows 10 (10.0.19042.1348) or Windows Server 2022 (10.0.20348.350) it works without an error. On Windows Server 2019 (10.0.17763.2300) however

error code 1 with message "Incorrect function."panic: Incorrect function.

goroutine 1 [running]:
main.main()
        C:/tmp/testgodism/main.go:23 +0x265

But despite the error on Windows Server 2019 the feature still gets enabled. When enabling via PowerShell Enable-WindowsOptionalFeature there is no error.

When looking at the DISM logs both the working PowerShell and the not working example path show:

DISM has detected a DISM component change. Requesting a shutdown.
The image session needs to be closed and re-opened before any servicing operations can be performed.

Afterwards DISM gets shut down, but with the example application the log apruptly ends at

Info                  DISM   API:  Leave DismCloseSessionInternal - DismCloseSessionInternal

while the log of the PowerShell run continues and shows that it actual does that reload and ends gracefully:

Info                  DISM   API:  GetReferenceCount hr: 0x0 - CSessionTable::RemoveSession
Info                  DISM   API:  Refcount for DismSession= 1s 0 - CSessionTable::RemoveSession
Info                  DISM   API:  Successfully enqueued command object - CCommandThread::EnqueueCommandObject
Info                  DISM   API:  ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop
Info                  DISM   API:  Successfully dequeued command object - CCommandThread::DequeueCommandObject
Info                  DISM   API:  ExecuteLoop: Cancel signaled - CCommandThread::ExecuteLoop
Info                  DISM   API:  Leave CCommandThread::ExecuteLoop - CCommandThread::ExecuteLoop
Info                  DISM    Temporarily setting the scratch directory. This may be overridden by user later. - CDISMManager::FinalConstruct
Info                  DISM    Scratch directory set to 'C:\Users\markus\AppData\Local\Temp\2\'. - CDISMManager::put_ScratchDir
Info                  DISM    DismCore.dll version: 10.0.17763.1697 - CDISMManager::FinalConstruct
Info                  DISM   Initialized Panther logging at C:\Windows\Logs\DISM\dism.log
Info                  DISM   API:  Leave CCommandThread::CommandThreadProcedureStub - CCommandThread::CommandThreadProcedureStub
Info                  DISM   API:  Deleted g_internalDismSession - DismShutdownInternal
Info                  DISM   API:  Shutdown SessionTable - DismShutdownInternal
Info                  DISM   API:  Leave DismShutdownInternal - DismShutdownInternal
Info                  DISM   API:  DismApi.dll:                                          - DismShutdownInternal
Info                  DISM   API:  DismApi.dll: <----- Ending DismApi.dll session -----> - DismShutdownInternal
Info                  DISM   API:  DismApi.dll:

In the logs on Windows Server 2022 and Windows 10 there isn't an entry about a needed DISM reload, which is likely the reason why the example app works there.

I also noticed that with the example app an older API version is used (red) when comparing it to one from the PowerShell run (green):

- DismApi.dll: API Version 6.2.17763.1697 - DismInitializeInternal
+ DismApi.dll: API Version 10.0.17763.1697 - DismInitializeInternal

When looking at the DLLs on Windows Server 2019, there doesn't seem to be such an old version:

PS C:\> (Get-ChildItem . -Recurse -Force -Filter 'dismapi.dll' -ErrorAction SilentlyContinue) | % { Write-Host $_.FullName; Write-Host (get-command $_.FullName).Version }
C:\Windows\System32\DismApi.dll
10.0.17763.1697
C:\Windows\SysWOW64\DismApi.dll
10.0.17763.1697
C:\Windows\WinSxS\amd64_microsoft-windows-d..cing-management-api_31bf3856ad364e35_10.0.17763.1697_none_f436cf4c312ced73\DismApi.dll
10.0.17763.1697
C:\Windows\WinSxS\amd64_microsoft-windows-d..cing-management-api_31bf3856ad364e35_10.0.17763.1697_none_f436cf4c312ced73\n\DismApi.dll
0.0.0.0
C:\Windows\WinSxS\wow64_microsoft-windows-d..cing-management-api_31bf3856ad364e35_10.0.17763.1697_none_fe8b799e658daf6e\DismApi.dll
10.0.17763.1697
C:\Windows\WinSxS\wow64_microsoft-windows-d..cing-management-api_31bf3856ad364e35_10.0.17763.1697_none_fe8b799e658daf6e\f\DismApi.dll
0.0.0.0
C:\Windows\WinSxS\wow64_microsoft-windows-d..cing-management-api_31bf3856ad364e35_10.0.17763.1697_none_fe8b799e658daf6e\r\DismApi.dll
0.0.0.0

So I guessed that the API version to use is somewhere set during DismInitialize but I didn't find anything about that in the API reference.

Full DISM logs:

DISM Log Windows Server 2019 when running example and getting error ``` 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 DismApi.dll: - DismInitializeInternal 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 DismApi.dll: <----- Starting DismApi.dll session -----> - DismInitializeInternal 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 DismApi.dll: - DismInitializeInternal 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 DismApi.dll: Host machine information: OS Version=10.0.17763, Running architecture=amd64, Number of processors=4 - DismInitializeInternal 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 DismApi.dll: API Version 6.2.17763.1697 - DismInitializeInternal 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 DismApi.dll: Parent process command line: t.exe - DismInitializeInternal 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 Enter DismInitializeInternal - DismInitializeInternal 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 Input parameters: LogLevel: 2, LogFilePath: (null), ScratchDirectory: (null) - DismInitializeInternal 2021-12-10 15:20:49, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 Initialized GlobalConfig - DismInitializeInternal 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 Initialized SessionTable - DismInitializeInternal 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 Lookup in table by path failed for: DummyPath-2BA51B78-C7F7-4910-B99D-BB7345357CDC - CTransactionalImageTable::LookupImagePath 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 Waiting for m_pInternalThread to start - CCommandThread::Start 2021-12-10 15:20:49, Info DISM API: PID=924 TID=3712 Enter CCommandThread::CommandThreadProcedureStub - CCommandThread::CommandThreadProcedureStub 2021-12-10 15:20:49, Info DISM API: PID=924 TID=3712 Enter CCommandThread::ExecuteLoop - CCommandThread::ExecuteLoop 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 CommandThread StartupEvent signaled - CCommandThread::WaitForStartup 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 m_pInternalThread started - CCommandThread::Start 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 Created g_internalDismSession - DismInitializeInternal 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 Leave DismInitializeInternal - DismInitializeInternal 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 Enter DismOpenSessionInternal - DismOpenSessionInternal 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 Input parameters: ImagePath: DISM_{53BFAE52-B167-4E2F-A258-0A37B57FF845}, WindowsDirectory: (null), SystemDrive: (null) - DismOpenSessionInternal 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 Lookup in table by path failed for: DRIVE_C - CTransactionalImageTable::LookupImagePath 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 Waiting for m_pInternalThread to start - CCommandThread::Start 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4212 Enter CCommandThread::CommandThreadProcedureStub - CCommandThread::CommandThreadProcedureStub 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4212 Enter CCommandThread::ExecuteLoop - CCommandThread::ExecuteLoop 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 CommandThread StartupEvent signaled - CCommandThread::WaitForStartup 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 m_pInternalThread started - CCommandThread::Start 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4232 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4212 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2021-12-10 15:20:49, Info DISM API: PID=924 TID=4212 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2021-12-10 15:20:49, Info DISM PID=924 TID=4212 Scratch directory set to 'C:\Users\markus\AppData\Local\Temp\2\'. - CDISMManager::put_ScratchDir 2021-12-10 15:20:49, Info DISM PID=924 TID=4212 DismCore.dll version: 6.2.17763.1697 - CDISMManager::FinalConstruct 2021-12-10 15:20:49, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:20:49, Info DISM PID=924 TID=4212 Successfully loaded the ImageSession at "C:\Windows\SYSTEM32\Dism" - CDISMManager::LoadLocalImageSession 2021-12-10 15:20:49, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:20:49, Info DISM DISM Provider Store: PID=924 TID=4212 Found and Initialized the DISM Logger. - CDISMProviderStore::Internal_InitializeLogger 2021-12-10 15:20:49, Info DISM DISM Provider Store: PID=924 TID=4212 Failed to get and initialize the PE Provider. Continuing by assuming that it is not a WinPE image. - CDISMProviderStore::Final_OnConnect 2021-12-10 15:20:49, Info DISM DISM Provider Store: PID=924 TID=4212 Finished initializing the Provider Map. - CDISMProviderStore::Final_OnConnect 2021-12-10 15:20:49, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:20:49, Info DISM DISM Manager: PID=924 TID=4212 Successfully created the local image session and provider store. - CDISMManager::CreateLocalImageSession 2021-12-10 15:20:49, Info DISM DISM Provider Store: PID=924 TID=4212 Getting the collection of providers from a local provider store type. - CDISMProviderStore::GetProviderCollection 2021-12-10 15:20:49, Info DISM DISM Provider Store: PID=924 TID=4212 Connecting to the provider located at C:\Windows\SYSTEM32\Dism\FolderProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:20:49, Warning DISM DISM Provider Store: PID=924 TID=4212 Failed to load the provider: C:\Windows\SYSTEM32\Dism\SiloedPackageProvider.dll. - CDISMProviderStore::Internal_GetProvider(hr:0x8007007e) 2021-12-10 15:20:49, Info DISM DISM Provider Store: PID=924 TID=4212 Connecting to the provider located at C:\Windows\SYSTEM32\Dism\FfuProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:20:49, Info DISM DISM Provider Store: PID=924 TID=4212 Connecting to the provider located at C:\Windows\SYSTEM32\Dism\WimProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:20:49, Info DISM DISM Provider Store: PID=924 TID=4212 Connecting to the provider located at C:\Windows\SYSTEM32\Dism\VHDProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:20:49, Info DISM DISM Provider Store: PID=924 TID=4212 Connecting to the provider located at C:\Windows\SYSTEM32\Dism\ImagingProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:20:49, Info DISM DISM Provider Store: PID=924 TID=4212 Connecting to the provider located at C:\Windows\SYSTEM32\Dism\CompatProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:20:49, Warning DISM DISM Provider Store: PID=924 TID=4212 Failed to load the provider: C:\Windows\SYSTEM32\Dism\MetaDeployProvider.dll. - CDISMProviderStore::Internal_GetProvider(hr:0x8007007e) 2021-12-10 15:20:49, Info DISM DISM FFU Provider: PID=924 TID=4212 [C:\] is not recognized by the DISM FFU provider. - CFfuImage::Initialize [924] [0x8007007b] FIOReadFileIntoBuffer:(1381): The filename, directory name, or volume label syntax is incorrect. [924] [0xc142011c] UnmarshallImageHandleFromDirectory:(641) [924] [0xc142011c] WIMGetMountedImageHandle:(2897) 2021-12-10 15:20:50, Info DISM DISM WIM Provider: PID=924 TID=4212 [C:\] is not a WIM mount point. - CWimMountedImageInfo::Initialize 2021-12-10 15:20:50, Info DISM DISM VHD Provider: PID=924 TID=4212 [C:\] is not recognized by the DISM VHD provider. - CVhdImage::Initialize 2021-12-10 15:20:50, Info DISM DISM FFU Provider: PID=924 TID=4212 [C:\] is not recognized by the DISM FFU provider. - CFfuImage::Initialize 2021-12-10 15:20:50, Info DISM DISM Imaging Provider: PID=924 TID=4212 The provider FfuManager does not support CreateDismImage on C:\ - CGenericImagingManager::CreateDismImage 2021-12-10 15:20:50, Info DISM DISM VHD Provider: PID=924 TID=4212 [C:\] is not recognized by the DISM VHD provider. - CVhdImage::Initialize 2021-12-10 15:20:50, Info DISM DISM Imaging Provider: PID=924 TID=4212 The provider VHDManager does not support CreateDismImage on C:\ - CGenericImagingManager::CreateDismImage [924] [0x8007007b] FIOReadFileIntoBuffer:(1381): The filename, directory name, or volume label syntax is incorrect. [924] [0xc142011c] UnmarshallImageHandleFromDirectory:(641) [924] [0xc142011c] WIMGetMountedImageHandle:(2897) 2021-12-10 15:20:50, Info DISM DISM WIM Provider: PID=924 TID=4212 [C:\] is not a WIM mount point. - CWimMountedImageInfo::Initialize 2021-12-10 15:20:50, Info DISM DISM Imaging Provider: PID=924 TID=4212 The provider WimManager does not support CreateDismImage on C:\ - CGenericImagingManager::CreateDismImage 2021-12-10 15:20:50, Info DISM DISM Imaging Provider: PID=924 TID=4212 No imaging provider supported CreateDismImage for this path - CGenericImagingManager::CreateDismImage 2021-12-10 15:20:50, Info DISM DISM Manager: PID=924 TID=4212 physical location path: C:\ - CDISMManager::CreateImageSession 2021-12-10 15:20:50, Info DISM DISM Manager: PID=924 TID=4212 Event name for current DISM session is Global\{27ACAE16-0CB0-4329-9DF3-53CDCD66EF04} - CDISMManager::CheckSessionAndLock 2021-12-10 15:20:50, Info DISM DISM Manager: PID=924 TID=4212 Create session event 0x370 for current DISM session and event name is Global\{27ACAE16-0CB0-4329-9DF3-53CDCD66EF04} - CDISMManager::CheckSessionAndLock 2021-12-10 15:20:50, Info DISM DISM Manager: PID=924 TID=4212 Copying DISM from "C:\Windows\System32\Dism" - CDISMManager::CreateImageSessionFromLocation 2021-12-10 15:20:50, Info DISM DISM Manager: PID=924 TID=4212 Successfully loaded the ImageSession at "C:\Users\markus\AppData\Local\Temp\2\62FEBD37-FF1C-461A-8A4A-082F04B328E2" - CDISMManager::LoadRemoteImageSession 2021-12-10 15:20:50, Info DISM DISM Image Session: PID=2464 TID=3764 Instantiating the Provider Store. - CDISMImageSession::get_ProviderStore 2021-12-10 15:20:50, Info DISM DISM Provider Store: PID=2464 TID=3764 Initializing a provider store for the IMAGE session type. - CDISMProviderStore::Final_OnConnect 2021-12-10 15:20:50, Info DISM DISM Provider Store: PID=2464 TID=3764 Connecting to the provider located at C:\Users\markus\AppData\Local\Temp\2\62FEBD37-FF1C-461A-8A4A-082F04B328E2\OSProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:20:50, Info DISM DISM OS Provider: PID=2464 TID=3764 Defaulting SystemPath to C:\ - CDISMOSServiceManager::Final_OnConnect 2021-12-10 15:20:50, Info DISM DISM OS Provider: PID=2464 TID=3764 Defaulting Windows folder to C:\Windows - CDISMOSServiceManager::Final_OnConnect 2021-12-10 15:20:50, Info DISM DISM Provider Store: PID=2464 TID=3764 Attempting to initialize the logger from the Image Session. - CDISMProviderStore::Final_OnConnect 2021-12-10 15:20:50, Info DISM DISM Provider Store: PID=2464 TID=3764 Connecting to the provider located at C:\Users\markus\AppData\Local\Temp\2\62FEBD37-FF1C-461A-8A4A-082F04B328E2\LogProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:20:50, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:20:50, Info DISM DISM Provider Store: PID=2464 TID=3764 Found and Initialized the DISM Logger. - CDISMProviderStore::Internal_InitializeLogger 2021-12-10 15:20:50, Warning DISM DISM Provider Store: PID=2464 TID=3764 Failed to load the provider: C:\Users\markus\AppData\Local\Temp\2\62FEBD37-FF1C-461A-8A4A-082F04B328E2\PEProvider.dll. - CDISMProviderStore::Internal_GetProvider(hr:0x8007007e) 2021-12-10 15:20:50, Info DISM DISM Provider Store: PID=2464 TID=3764 Failed to get and initialize the PE Provider. Continuing by assuming that it is not a WinPE image. - CDISMProviderStore::Final_OnConnect 2021-12-10 15:20:50, Info DISM DISM Provider Store: PID=2464 TID=3764 Finished initializing the Provider Map. - CDISMProviderStore::Final_OnConnect 2021-12-10 15:20:50, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:20:50, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:20:50, Info DISM DISM Manager: PID=924 TID=4212 Image session successfully loaded from the temporary location: C:\Users\markus\AppData\Local\Temp\2\62FEBD37-FF1C-461A-8A4A-082F04B328E2 - CDISMManager::CreateImageSession 2021-12-10 15:20:50, Info DISM API: PID=924 TID=4212 Target image information: OS Version=10.0.17763.2300, Image architecture=amd64 - CDismCore::LogImageSessionDetails 2021-12-10 15:20:50, Info DISM API: PID=924 TID=4232 Leave DismOpenSessionInternal - DismOpenSessionInternal 2021-12-10 15:20:50, Info DISM API: PID=924 TID=4232 Session id is: 2 - DismOpenSessionInternal 2021-12-10 15:20:50, Info DISM API: PID=924 TID=4232 Enter DismEnableFeatureInternal - DismEnableFeatureInternal 2021-12-10 15:20:50, Info DISM API: PID=924 TID=4232 Enter DismEnableDisableFeatureInternal - DismEnableDisableFeatureInternal 2021-12-10 15:20:50, Info DISM API: PID=924 TID=4232 Input parameters: Session: 2, EnableFeatureName: Microsoft-Hyper-V-Management-PowerShell, DisableFeatureName: (null), Identifier: (null), PackageIdentifier: 0, LimitAccess: 0, SourcePathCount: 0, EnableAll: 1, CancelEvent: 0x0000000000000000, Progress: 0x0000000000000000, UserData: 0x0000000000000000 - DismEnableDisableFeatureInternal 2021-12-10 15:20:50, Info DISM API: PID=924 TID=4232 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2021-12-10 15:20:50, Info DISM API: PID=924 TID=4212 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2021-12-10 15:20:50, Info DISM API: PID=924 TID=4212 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2021-12-10 15:20:50, Info DISM DISM Provider Store: PID=2464 TID=3764 Connecting to the provider located at C:\Users\markus\AppData\Local\Temp\2\62FEBD37-FF1C-461A-8A4A-082F04B328E2\CbsProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:20:50, Info DISM DISM Provider Store: PID=2464 TID=3764 Encountered a servicing provider, performing additional servicing initializations. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:20:50, Info CSI 00000001 Shim considered [l:126]'\??\C:\Windows\Servicing\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.17763.2262_none_56fd0ad3990d068d\wcp.dll' : got STATUS_OBJECT_PATH_NOT_FOUND 2021-12-10 15:20:50, Info CSI 00000002 Shim considered [l:123]'\??\C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.17763.2262_none_56fd0ad3990d068d\wcp.dll' : got STATUS_SUCCESS 2021-12-10 15:20:50, Info DISM DISM Package Manager: PID=2464 TID=3764 Finished initializing the CbsConUI Handler. - CCbsConUIHandler::Initialize 2021-12-10 15:20:50, Info CSI 00000001 Shim considered [l:126]'\??\C:\Windows\Servicing\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.17763.2262_none_56fd0ad3990d068d\wcp.dll' : got STATUS_OBJECT_PATH_NOT_FOUND 2021-12-10 15:20:50, Info CSI 00000002 Shim considered [l:123]'\??\C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.17763.2262_none_56fd0ad3990d068d\wcp.dll' : got STATUS_SUCCESS 2021-12-10 15:20:50, Info DISM DISM Package Manager: PID=2464 TID=3764 CBS is being initialized for online use. More information about CBS actions can be located at: %windir%\logs\cbs\cbs.log - CDISMPackageManager::Initialize 2021-12-10 15:20:50, Info DISM DISM Package Manager: PID=2464 TID=3764 Loaded servicing stack for online use only. - CDISMPackageManager::CreateCbsSession 2021-12-10 15:20:50, Info DISM DISM Package Manager: PID=2464 TID=3764 Feature RSAT-Hyper-V-Tools-Feature with CBS state 4(CbsInstallStateStaged) being mapped to dism state 4(DISM_INSTALL_STATE_STAGED) - CDISMPackageFeature::LogInstallStateMapping 2021-12-10 15:20:50, Info DISM DISM Package Manager: PID=2464 TID=3764 Feature ServerManager-Core-RSAT-Role-Tools with CBS state 4(CbsInstallStateStaged) being mapped to dism state 4(DISM_INSTALL_STATE_STAGED) - CDISMPackageFeature::LogInstallStateMapping 2021-12-10 15:20:50, Info DISM DISM Package Manager: PID=2464 TID=3764 Feature ServerManager-Core-RSAT with CBS state 4(CbsInstallStateStaged) being mapped to dism state 4(DISM_INSTALL_STATE_STAGED) - CDISMPackageFeature::LogInstallStateMapping 2021-12-10 15:20:50, Info DISM DISM Package Manager: PID=2464 TID=3764 Initiating Changes on Package with values: 5, 7 - CDISMPackage::Internal_ChangePackageState 2021-12-10 15:20:50, Info DISM DISM Package Manager: PID=2464 TID=3764 CBS session options=0x40100! - CDISMPackageManager::Internal_Finalize 2021-12-10 15:20:57, Info CSI 00000001 Shim considered [l:126]'\??\C:\Windows\Servicing\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.17763.2262_none_56fd0ad3990d068d\wcp.dll' : got STATUS_OBJECT_PATH_NOT_FOUND 2021-12-10 15:20:57, Info CSI 00000002 Shim considered [l:123]'\??\C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.17763.2262_none_56fd0ad3990d068d\wcp.dll' : got STATUS_SUCCESS 2021-12-10 15:20:57, Info DISM DISM Package Manager: PID=2464 TID=3764 DISM has detected a DISM component change. Requesting a shutdown. - CDISMPackageManager::Internal_Finalize 2021-12-10 15:20:57, Info DISM DISM Image Session: PID=2464 TID=3764 The image session needs to be closed and re-opened before any servicing operations can be performed. - CDISMImageSession::put_ImageState 2021-12-10 15:20:57, Info DISM DISM Package Manager: PID=2464 TID=3764 Loaded servicing stack for online use only. - CDISMPackageManager::CreateCbsSession 2021-12-10 15:20:57, Info DISM DISM Package Manager: PID=2464 TID=3764 Feature Microsoft-Hyper-V-Management-PowerShell with CBS state 7(CbsInstallStateInstalled) being mapped to dism state 7(DISM_INSTALL_STATE_INSTALLED) - CDISMPackageFeature::LogInstallStateMapping 2021-12-10 15:20:57, Info DISM API: PID=924 TID=4232 Exit DismEnableDisableFeatureInternal - DismEnableDisableFeatureInternal 2021-12-10 15:20:57, Info DISM API: PID=924 TID=4232 Exit DismEnableFeatureInternal - DismEnableFeatureInternal 2021-12-10 15:20:57, Info DISM API: PID=924 TID=4232 Enter DismCloseSessionInternal - DismCloseSessionInternal 2021-12-10 15:20:57, Info DISM API: PID=924 TID=4232 Input parameters: Session: 2 - DismCloseSessionInternal 2021-12-10 15:20:57, Info DISM API: PID=924 TID=4232 GetReferenceCount hr: 0x0 - CSessionTable::RemoveSession 2021-12-10 15:20:57, Info DISM API: PID=924 TID=4232 Refcount for DismSession= 2s 0 - CSessionTable::RemoveSession 2021-12-10 15:20:57, Info DISM API: PID=924 TID=4212 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2021-12-10 15:20:57, Info DISM API: PID=924 TID=4232 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2021-12-10 15:20:57, Info DISM API: PID=924 TID=4212 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2021-12-10 15:20:57, Info DISM API: PID=924 TID=4212 ExecuteLoop: Cancel signaled - CCommandThread::ExecuteLoop 2021-12-10 15:20:57, Info DISM API: PID=924 TID=4212 Leave CCommandThread::ExecuteLoop - CCommandThread::ExecuteLoop 2021-12-10 15:20:57, Info DISM DISM Provider Store: PID=2464 TID=3764 Found the OSServices. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect 2021-12-10 15:20:57, Info DISM DISM Provider Store: PID=2464 TID=3764 Found the OSServices. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect 2021-12-10 15:20:57, Info DISM DISM Provider Store: PID=2464 TID=3764 Found the PE Provider. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect 2021-12-10 15:20:57, Info DISM DISM Provider Store: PID=2464 TID=3764 Finalizing the servicing provider(DISM Package Manager) - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:20:57, Info DISM DISM Package Manager: PID=2464 TID=3764 Finalizing CBS core. - CDISMPackageManager::Finalize 2021-12-10 15:20:57, Info DISM DISM Provider Store: PID=2464 TID=3764 Disconnecting Provider: DISM Package Manager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:20:57, Info DISM DISM Provider Store: PID=2464 TID=3764 Releasing the local reference to OSServices. - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:20:57, Info DISM DISM Provider Store: PID=2464 TID=3764 Disconnecting Provider: OSServices - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:20:57, Info DISM DISM Provider Store: PID=2464 TID=3764 Releasing the local reference to DISMLogger. Stop logging. - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:20:57, Info DISM DISM Manager: PID=924 TID=4212 Closing session event handle 0x370 - CDISMManager::CleanupImageSessionEntry 2021-12-10 15:20:57, Info DISM DISM Provider Store: PID=924 TID=4212 Found the OSServices. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect 2021-12-10 15:20:57, Info DISM DISM Provider Store: PID=924 TID=4212 Disconnecting Provider: FolderManager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:20:57, Info DISM DISM Provider Store: PID=924 TID=4212 Disconnecting Provider: FfuManager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:20:57, Info DISM DISM Provider Store: PID=924 TID=4212 Disconnecting Provider: WimManager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:20:57, Info DISM DISM Provider Store: PID=924 TID=4212 Disconnecting Provider: VHDManager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:20:57, Info DISM DISM Provider Store: PID=924 TID=4212 Disconnecting Provider: GenericImagingManager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:20:57, Info DISM DISM Provider Store: PID=924 TID=4212 Disconnecting Provider: Compatibility Manager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:20:57, Info DISM DISM Provider Store: PID=924 TID=4212 Releasing the local reference to DISMLogger. Stop logging. - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:20:57, Info DISM API: PID=924 TID=4212 Leave CCommandThread::CommandThreadProcedureStub - CCommandThread::CommandThreadProcedureStub 2021-12-10 15:20:57, Info DISM API: PID=924 TID=4232 Leave DismCloseSessionInternal - DismCloseSessionInternal ```
DISM Log Windows Server 2019 when running successfully via PowerShell Enable-WindowsOptionalFeature ``` 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 DismApi.dll: - DismInitializeInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 DismApi.dll: <----- Starting DismApi.dll session -----> - DismInitializeInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 DismApi.dll: - DismInitializeInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 DismApi.dll: Host machine information: OS Version=10.0.17763, Running architecture=amd64, Number of processors=4 - DismInitializeInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 DismApi.dll: API Version 10.0.17763.1697 - DismInitializeInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 DismApi.dll: Parent process command line: "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" - DismInitializeInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Enter DismInitializeInternal - DismInitializeInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Input parameters: LogLevel: 2, LogFilePath: C:\Windows\Logs\DISM\dism.log, ScratchDirectory: (null) - DismInitializeInternal 2021-12-10 16:20:11, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Initialized GlobalConfig - DismInitializeInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Initialized SessionTable - DismInitializeInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Lookup in table by path failed for: DummyPath-2BA51B78-C7F7-4910-B99D-BB7345357CDC - CTransactionalImageTable::LookupImagePath 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Waiting for m_pInternalThread to start - CCommandThread::Start 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=2396 Enter CCommandThread::CommandThreadProcedureStub - CCommandThread::CommandThreadProcedureStub 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=2396 Enter CCommandThread::ExecuteLoop - CCommandThread::ExecuteLoop 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 CommandThread StartupEvent signaled - CCommandThread::WaitForStartup 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 m_pInternalThread started - CCommandThread::Start 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Created g_internalDismSession - DismInitializeInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Leave DismInitializeInternal - DismInitializeInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Enter DismOpenSessionInternal - DismOpenSessionInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Input parameters: ImagePath: DISM_{53BFAE52-B167-4E2F-A258-0A37B57FF845}, WindowsDirectory: (null), SystemDrive: (null) - DismOpenSessionInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Lookup in table by path failed for: DRIVE_C - CTransactionalImageTable::LookupImagePath 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Waiting for m_pInternalThread to start - CCommandThread::Start 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=3356 Enter CCommandThread::CommandThreadProcedureStub - CCommandThread::CommandThreadProcedureStub 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=3356 Enter CCommandThread::ExecuteLoop - CCommandThread::ExecuteLoop 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 CommandThread StartupEvent signaled - CCommandThread::WaitForStartup 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 m_pInternalThread started - CCommandThread::Start 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=3356 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=3356 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2021-12-10 16:20:11, Info DISM PID=7044 TID=3356 Scratch directory set to 'C:\Users\markus\AppData\Local\Temp\2\'. - CDISMManager::put_ScratchDir 2021-12-10 16:20:11, Info DISM PID=7044 TID=3356 DismCore.dll version: 10.0.17763.1697 - CDISMManager::FinalConstruct 2021-12-10 16:20:11, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 16:20:11, Info DISM PID=7044 TID=3356 Successfully loaded the ImageSession at "C:\Windows\SYSTEM32\Dism" - CDISMManager::LoadLocalImageSession 2021-12-10 16:20:11, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=7044 TID=3356 Found and Initialized the DISM Logger. - CDISMProviderStore::Internal_InitializeLogger 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=7044 TID=3356 Failed to get and initialize the PE Provider. Continuing by assuming that it is not a WinPE image. - CDISMProviderStore::Final_OnConnect 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=7044 TID=3356 Finished initializing the Provider Map. - CDISMProviderStore::Final_OnConnect 2021-12-10 16:20:11, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 16:20:11, Info DISM DISM Manager: PID=7044 TID=3356 Successfully created the local image session and provider store. - CDISMManager::CreateLocalImageSession 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=7044 TID=3356 Getting the collection of providers from a local provider store type. - CDISMProviderStore::GetProviderCollection 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=7044 TID=3356 Connecting to the provider located at C:\Windows\SYSTEM32\Dism\FolderProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 16:20:11, Warning DISM DISM Provider Store: PID=7044 TID=3356 Failed to load the provider: C:\Windows\SYSTEM32\Dism\SiloedPackageProvider.dll. - CDISMProviderStore::Internal_GetProvider(hr:0x8007007e) 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=7044 TID=3356 Connecting to the provider located at C:\Windows\SYSTEM32\Dism\FfuProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=7044 TID=3356 Connecting to the provider located at C:\Windows\SYSTEM32\Dism\WimProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=7044 TID=3356 Connecting to the provider located at C:\Windows\SYSTEM32\Dism\VHDProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=7044 TID=3356 Connecting to the provider located at C:\Windows\SYSTEM32\Dism\ImagingProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=7044 TID=3356 Connecting to the provider located at C:\Windows\SYSTEM32\Dism\CompatProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 16:20:11, Warning DISM DISM Provider Store: PID=7044 TID=3356 Failed to load the provider: C:\Windows\SYSTEM32\Dism\MetaDeployProvider.dll. - CDISMProviderStore::Internal_GetProvider(hr:0x8007007e) 2021-12-10 16:20:11, Info DISM DISM FFU Provider: PID=7044 TID=3356 [C:\] is not recognized by the DISM FFU provider. - CFfuImage::Initialize [7044] [0x8007007b] FIOReadFileIntoBuffer:(1381): The filename, directory name, or volume label syntax is incorrect. [7044] [0xc142011c] UnmarshallImageHandleFromDirectory:(641) [7044] [0xc142011c] WIMGetMountedImageHandle:(2897) 2021-12-10 16:20:11, Info DISM DISM WIM Provider: PID=7044 TID=3356 [C:\] is not a WIM mount point. - CWimMountedImageInfo::Initialize 2021-12-10 16:20:11, Info DISM DISM VHD Provider: PID=7044 TID=3356 [C:\] is not recognized by the DISM VHD provider. - CVhdImage::Initialize 2021-12-10 16:20:11, Info DISM DISM FFU Provider: PID=7044 TID=3356 [C:\] is not recognized by the DISM FFU provider. - CFfuImage::Initialize 2021-12-10 16:20:11, Info DISM DISM Imaging Provider: PID=7044 TID=3356 The provider FfuManager does not support CreateDismImage on C:\ - CGenericImagingManager::CreateDismImage 2021-12-10 16:20:11, Info DISM DISM VHD Provider: PID=7044 TID=3356 [C:\] is not recognized by the DISM VHD provider. - CVhdImage::Initialize 2021-12-10 16:20:11, Info DISM DISM Imaging Provider: PID=7044 TID=3356 The provider VHDManager does not support CreateDismImage on C:\ - CGenericImagingManager::CreateDismImage [7044] [0x8007007b] FIOReadFileIntoBuffer:(1381): The filename, directory name, or volume label syntax is incorrect. [7044] [0xc142011c] UnmarshallImageHandleFromDirectory:(641) [7044] [0xc142011c] WIMGetMountedImageHandle:(2897) 2021-12-10 16:20:11, Info DISM DISM WIM Provider: PID=7044 TID=3356 [C:\] is not a WIM mount point. - CWimMountedImageInfo::Initialize 2021-12-10 16:20:11, Info DISM DISM Imaging Provider: PID=7044 TID=3356 The provider WimManager does not support CreateDismImage on C:\ - CGenericImagingManager::CreateDismImage 2021-12-10 16:20:11, Info DISM DISM Imaging Provider: PID=7044 TID=3356 No imaging provider supported CreateDismImage for this path - CGenericImagingManager::CreateDismImage 2021-12-10 16:20:11, Info DISM DISM Manager: PID=7044 TID=3356 physical location path: C:\ - CDISMManager::CreateImageSession 2021-12-10 16:20:11, Info DISM DISM Manager: PID=7044 TID=3356 Event name for current DISM session is Global\{28174EC0-12DE-42E2-AA58-EAD70C6313C9} - CDISMManager::CheckSessionAndLock 2021-12-10 16:20:11, Info DISM DISM Manager: PID=7044 TID=3356 Create session event 0xfe4 for current DISM session and event name is Global\{28174EC0-12DE-42E2-AA58-EAD70C6313C9} - CDISMManager::CheckSessionAndLock 2021-12-10 16:20:11, Info DISM DISM Manager: PID=7044 TID=3356 Copying DISM from "C:\Windows\System32\Dism" - CDISMManager::CreateImageSessionFromLocation 2021-12-10 16:20:11, Info DISM DISM Manager: PID=7044 TID=3356 Successfully loaded the ImageSession at "C:\Users\markus\AppData\Local\Temp\2\FB76A7E9-B682-45CC-9521-E76448D019A4" - CDISMManager::LoadRemoteImageSession 2021-12-10 16:20:11, Info DISM DISM Image Session: PID=2936 TID=4768 Instantiating the Provider Store. - CDISMImageSession::get_ProviderStore 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=2936 TID=4768 Initializing a provider store for the IMAGE session type. - CDISMProviderStore::Final_OnConnect 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=2936 TID=4768 Connecting to the provider located at C:\Users\markus\AppData\Local\Temp\2\FB76A7E9-B682-45CC-9521-E76448D019A4\OSProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 16:20:11, Info DISM DISM OS Provider: PID=2936 TID=4768 Defaulting SystemPath to C:\ - CDISMOSServiceManager::Final_OnConnect 2021-12-10 16:20:11, Info DISM DISM OS Provider: PID=2936 TID=4768 Defaulting Windows folder to C:\Windows - CDISMOSServiceManager::Final_OnConnect 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=2936 TID=4768 Attempting to initialize the logger from the Image Session. - CDISMProviderStore::Final_OnConnect 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=2936 TID=4768 Connecting to the provider located at C:\Users\markus\AppData\Local\Temp\2\FB76A7E9-B682-45CC-9521-E76448D019A4\LogProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 16:20:11, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=2936 TID=4768 Found and Initialized the DISM Logger. - CDISMProviderStore::Internal_InitializeLogger 2021-12-10 16:20:11, Warning DISM DISM Provider Store: PID=2936 TID=4768 Failed to load the provider: C:\Users\markus\AppData\Local\Temp\2\FB76A7E9-B682-45CC-9521-E76448D019A4\PEProvider.dll. - CDISMProviderStore::Internal_GetProvider(hr:0x8007007e) 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=2936 TID=4768 Failed to get and initialize the PE Provider. Continuing by assuming that it is not a WinPE image. - CDISMProviderStore::Final_OnConnect 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=2936 TID=4768 Finished initializing the Provider Map. - CDISMProviderStore::Final_OnConnect 2021-12-10 16:20:11, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 16:20:11, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 16:20:11, Info DISM DISM Manager: PID=7044 TID=3356 Image session successfully loaded from the temporary location: C:\Users\markus\AppData\Local\Temp\2\FB76A7E9-B682-45CC-9521-E76448D019A4 - CDISMManager::CreateImageSession 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=3356 Target image information: OS Version=10.0.17763.2300, Image architecture=amd64 - CDismCore::LogImageSessionDetails 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Leave DismOpenSessionInternal - DismOpenSessionInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Session id is: 2 - DismOpenSessionInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Enter DismGetOsInfoInternal - DismGetOsInfoInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Input parameters: Session: 2 - DismGetOsInfoInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Initialized default cancel event - DismGetOsInfoInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=3356 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=3356 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Leave DismGetOsInfoInternal - DismGetOsInfoInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Enter DismDeleteInternal - DismDeleteInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Leave DismDeleteInternal - DismDeleteInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Enter DismEnableFeatureInternal - DismEnableFeatureInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Enter DismEnableDisableFeatureInternal - DismEnableDisableFeatureInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Input parameters: Session: 2, EnableFeatureName: Microsoft-Hyper-V-Management-PowerShell, DisableFeatureName: (null), Identifier: (null), PackageIdentifier: 0, LimitAccess: 0, SourcePathCount: 0, EnableAll: 0, CancelEvent: 0x0000000000000FF4, Progress: 0x000001DC429176DC, UserData: 0x0000000000000000 - DismEnableDisableFeatureInternal 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=6360 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=3356 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2021-12-10 16:20:11, Info DISM API: PID=7044 TID=3356 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=2936 TID=4768 Connecting to the provider located at C:\Users\markus\AppData\Local\Temp\2\FB76A7E9-B682-45CC-9521-E76448D019A4\CbsProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 16:20:11, Info DISM DISM Provider Store: PID=2936 TID=4768 Encountered a servicing provider, performing additional servicing initializations. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 16:20:11, Info CSI 00000001 Shim considered [l:126]'\??\C:\Windows\Servicing\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.17763.2262_none_56fd0ad3990d068d\wcp.dll' : got STATUS_OBJECT_PATH_NOT_FOUND 2021-12-10 16:20:11, Info CSI 00000002 Shim considered [l:123]'\??\C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.17763.2262_none_56fd0ad3990d068d\wcp.dll' : got STATUS_SUCCESS 2021-12-10 16:20:11, Info DISM DISM Package Manager: PID=2936 TID=4768 Finished initializing the CbsConUI Handler. - CCbsConUIHandler::Initialize 2021-12-10 16:20:11, Info CSI 00000001 Shim considered [l:126]'\??\C:\Windows\Servicing\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.17763.2262_none_56fd0ad3990d068d\wcp.dll' : got STATUS_OBJECT_PATH_NOT_FOUND 2021-12-10 16:20:11, Info CSI 00000002 Shim considered [l:123]'\??\C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.17763.2262_none_56fd0ad3990d068d\wcp.dll' : got STATUS_SUCCESS 2021-12-10 16:20:11, Info DISM DISM Package Manager: PID=2936 TID=4768 CBS is being initialized for online use. More information about CBS actions can be located at: %windir%\logs\cbs\cbs.log - CDISMPackageManager::Initialize 2021-12-10 16:20:11, Info DISM DISM Package Manager: PID=2936 TID=4768 Loaded servicing stack for online use only. - CDISMPackageManager::CreateCbsSession 2021-12-10 16:20:11, Info DISM DISM Package Manager: PID=2936 TID=4768 Initiating Changes on Package with values: 5, 7 - CDISMPackage::Internal_ChangePackageState 2021-12-10 16:20:11, Info DISM DISM Package Manager: PID=2936 TID=4768 CBS session options=0x40100! - CDISMPackageManager::Internal_Finalize 2021-12-10 16:20:15, Info CSI 00000001 Shim considered [l:126]'\??\C:\Windows\Servicing\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.17763.2262_none_56fd0ad3990d068d\wcp.dll' : got STATUS_OBJECT_PATH_NOT_FOUND 2021-12-10 16:20:15, Info CSI 00000002 Shim considered [l:123]'\??\C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.17763.2262_none_56fd0ad3990d068d\wcp.dll' : got STATUS_SUCCESS 2021-12-10 16:20:15, Info DISM DISM Package Manager: PID=2936 TID=4768 DISM has detected a DISM component change. Requesting a shutdown. - CDISMPackageManager::Internal_Finalize 2021-12-10 16:20:15, Info DISM DISM Image Session: PID=2936 TID=4768 The image session needs to be closed and re-opened before any servicing operations can be performed. - CDISMImageSession::put_ImageState 2021-12-10 16:20:15, Info DISM DISM Package Manager: PID=2936 TID=4768 Loaded servicing stack for online use only. - CDISMPackageManager::CreateCbsSession 2021-12-10 16:20:15, Info DISM DISM Package Manager: PID=2936 TID=4768 Feature Microsoft-Hyper-V-Management-PowerShell with CBS state 7(CbsInstallStateInstalled) being mapped to dism state 7(DISM_INSTALL_STATE_INSTALLED) - CDISMPackageFeature::LogInstallStateMapping 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 Exit DismEnableDisableFeatureInternal - DismEnableDisableFeatureInternal 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 Exit DismEnableFeatureInternal - DismEnableFeatureInternal 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 Enter DismCloseSessionInternal - DismCloseSessionInternal 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 Input parameters: Session: 2 - DismCloseSessionInternal 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 GetReferenceCount hr: 0x0 - CSessionTable::RemoveSession 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 Refcount for DismSession= 2s 0 - CSessionTable::RemoveSession 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=3356 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=3356 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=3356 ExecuteLoop: Cancel signaled - CCommandThread::ExecuteLoop 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=3356 Leave CCommandThread::ExecuteLoop - CCommandThread::ExecuteLoop 2021-12-10 16:20:15, Info DISM DISM Provider Store: PID=2936 TID=4768 Found the OSServices. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect 2021-12-10 16:20:15, Info DISM DISM Provider Store: PID=2936 TID=4768 Found the OSServices. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect 2021-12-10 16:20:15, Info DISM DISM Provider Store: PID=2936 TID=4768 Found the PE Provider. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect 2021-12-10 16:20:15, Info DISM DISM Provider Store: PID=2936 TID=4768 Finalizing the servicing provider(DISM Package Manager) - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 16:20:15, Info DISM DISM Package Manager: PID=2936 TID=4768 Finalizing CBS core. - CDISMPackageManager::Finalize 2021-12-10 16:20:15, Info DISM DISM Provider Store: PID=2936 TID=4768 Disconnecting Provider: DISM Package Manager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 16:20:15, Info DISM DISM Provider Store: PID=2936 TID=4768 Releasing the local reference to OSServices. - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 16:20:15, Info DISM DISM Provider Store: PID=2936 TID=4768 Disconnecting Provider: OSServices - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 16:20:15, Info DISM DISM Provider Store: PID=2936 TID=4768 Releasing the local reference to DISMLogger. Stop logging. - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 16:20:15, Info DISM DISM Manager: PID=7044 TID=3356 Closing session event handle 0xfe4 - CDISMManager::CleanupImageSessionEntry 2021-12-10 16:20:15, Info DISM DISM Provider Store: PID=7044 TID=3356 Found the OSServices. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect 2021-12-10 16:20:15, Info DISM DISM Provider Store: PID=7044 TID=3356 Disconnecting Provider: FolderManager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 16:20:15, Info DISM DISM Provider Store: PID=7044 TID=3356 Disconnecting Provider: FfuManager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 16:20:15, Info DISM DISM Provider Store: PID=7044 TID=3356 Disconnecting Provider: WimManager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 16:20:15, Info DISM DISM Provider Store: PID=7044 TID=3356 Disconnecting Provider: VHDManager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 16:20:15, Info DISM DISM Provider Store: PID=7044 TID=3356 Disconnecting Provider: GenericImagingManager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 16:20:15, Info DISM DISM Provider Store: PID=7044 TID=3356 Disconnecting Provider: Compatibility Manager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 16:20:15, Info DISM DISM Provider Store: PID=7044 TID=3356 Releasing the local reference to DISMLogger. Stop logging. - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=3356 Leave CCommandThread::CommandThreadProcedureStub - CCommandThread::CommandThreadProcedureStub 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 Leave DismCloseSessionInternal - DismCloseSessionInternal 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 Enter DismShutdownInternal - DismShutdownInternal 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 GetReferenceCount hr: 0x0 - CSessionTable::RemoveSession 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 Refcount for DismSession= 1s 0 - CSessionTable::RemoveSession 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=2396 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=2396 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=2396 ExecuteLoop: Cancel signaled - CCommandThread::ExecuteLoop 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=2396 Leave CCommandThread::ExecuteLoop - CCommandThread::ExecuteLoop 2021-12-10 16:20:15, Info DISM PID=7044 TID=2396 Temporarily setting the scratch directory. This may be overridden by user later. - CDISMManager::FinalConstruct 2021-12-10 16:20:15, Info DISM PID=7044 TID=2396 Scratch directory set to 'C:\Users\markus\AppData\Local\Temp\2\'. - CDISMManager::put_ScratchDir 2021-12-10 16:20:15, Info DISM PID=7044 TID=2396 DismCore.dll version: 10.0.17763.1697 - CDISMManager::FinalConstruct 2021-12-10 16:20:15, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=2396 Leave CCommandThread::CommandThreadProcedureStub - CCommandThread::CommandThreadProcedureStub 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 Deleted g_internalDismSession - DismShutdownInternal 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 Shutdown SessionTable - DismShutdownInternal 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 Leave DismShutdownInternal - DismShutdownInternal 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 DismApi.dll: - DismShutdownInternal 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 DismApi.dll: <----- Ending DismApi.dll session -----> - DismShutdownInternal 2021-12-10 16:20:15, Info DISM API: PID=7044 TID=6360 DismApi.dll: - DismShutdownInternal ```
DISM Log Windows 10 when successfully running example ``` 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 DismApi.dll: - DismInitializeInternal 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 DismApi.dll: <----- Starting DismApi.dll session -----> - DismInitializeInternal 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 DismApi.dll: - DismInitializeInternal 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 DismApi.dll: Host machine information: OS Version=10.0.19042, Running architecture=amd64, Number of processors=4 - DismInitializeInternal 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 DismApi.dll: API Version 6.2.19041.844 - DismInitializeInternal 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 DismApi.dll: Parent process command line: "C:\Users\markus\t.exe" - DismInitializeInternal 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 Enter DismInitializeInternal - DismInitializeInternal 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 Input parameters: LogLevel: 2, LogFilePath: (null), ScratchDirectory: (null) - DismInitializeInternal 2021-12-10 15:46:46, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 Initialized GlobalConfig - DismInitializeInternal 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 Initialized SessionTable - DismInitializeInternal 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 Lookup in table by path failed for: DummyPath-2BA51B78-C7F7-4910-B99D-BB7345357CDC - CTransactionalImageTable::LookupImagePath 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 Waiting for m_pInternalThread to start - CCommandThread::Start 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=9132 Enter CCommandThread::CommandThreadProcedureStub - CCommandThread::CommandThreadProcedureStub 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=9132 Enter CCommandThread::ExecuteLoop - CCommandThread::ExecuteLoop 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 CommandThread StartupEvent signaled - CCommandThread::WaitForStartup 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 m_pInternalThread started - CCommandThread::Start 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 Created g_internalDismSession - DismInitializeInternal 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 Leave DismInitializeInternal - DismInitializeInternal 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 Enter DismOpenSessionInternal - DismOpenSessionInternal 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 Input parameters: ImagePath: DISM_{53BFAE52-B167-4E2F-A258-0A37B57FF845}, WindowsDirectory: (null), SystemDrive: (null) - DismOpenSessionInternal 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 Lookup in table by path failed for: DRIVE_C - CTransactionalImageTable::LookupImagePath 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 Waiting for m_pInternalThread to start - CCommandThread::Start 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=6260 Enter CCommandThread::CommandThreadProcedureStub - CCommandThread::CommandThreadProcedureStub 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=6260 Enter CCommandThread::ExecuteLoop - CCommandThread::ExecuteLoop 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 CommandThread StartupEvent signaled - CCommandThread::WaitForStartup 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 m_pInternalThread started - CCommandThread::Start 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=7636 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=6260 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2021-12-10 15:46:46, Info DISM API: PID=8228 TID=6260 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2021-12-10 15:46:46, Info DISM PID=8228 TID=6260 Scratch directory set to 'C:\Users\markus\AppData\Local\Temp\'. - CDISMManager::put_ScratchDir 2021-12-10 15:46:46, Info DISM PID=8228 TID=6260 DismCore.dll version: 6.2.19041.746 - CDISMManager::FinalConstruct 2021-12-10 15:46:46, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:46:46, Info DISM PID=8228 TID=6260 Successfully loaded the ImageSession at "C:\Windows\SYSTEM32\Dism" - CDISMManager::LoadLocalImageSession 2021-12-10 15:46:46, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:46:46, Info DISM DISM Provider Store: PID=8228 TID=6260 Found and Initialized the DISM Logger. - CDISMProviderStore::Internal_InitializeLogger 2021-12-10 15:46:46, Info DISM DISM Provider Store: PID=8228 TID=6260 Failed to get and initialize the PE Provider. Continuing by assuming that it is not a WinPE image. - CDISMProviderStore::Final_OnConnect 2021-12-10 15:46:46, Info DISM DISM Provider Store: PID=8228 TID=6260 Finished initializing the Provider Map. - CDISMProviderStore::Final_OnConnect 2021-12-10 15:46:46, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:46:46, Info DISM DISM Manager: PID=8228 TID=6260 Successfully created the local image session and provider store. - CDISMManager::CreateLocalImageSession 2021-12-10 15:46:46, Info DISM DISM Provider Store: PID=8228 TID=6260 Getting the collection of providers from a local provider store type. - CDISMProviderStore::GetProviderCollection 2021-12-10 15:46:46, Info DISM DISM Provider Store: PID=8228 TID=6260 Connecting to the provider located at C:\Windows\SYSTEM32\Dism\FolderProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:46:46, Warning DISM DISM Provider Store: PID=8228 TID=6260 Failed to load the provider: C:\Windows\SYSTEM32\Dism\SiloedPackageProvider.dll. - CDISMProviderStore::Internal_GetProvider(hr:0x8007007e) 2021-12-10 15:46:46, Info DISM DISM Provider Store: PID=8228 TID=6260 Connecting to the provider located at C:\Windows\SYSTEM32\Dism\FfuProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:46:46, Info DISM DISM Provider Store: PID=8228 TID=6260 Connecting to the provider located at C:\Windows\SYSTEM32\Dism\WimProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:46:46, Info DISM DISM Provider Store: PID=8228 TID=6260 Connecting to the provider located at C:\Windows\SYSTEM32\Dism\VHDProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:46:46, Info DISM DISM Provider Store: PID=8228 TID=6260 Connecting to the provider located at C:\Windows\SYSTEM32\Dism\ImagingProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:46:46, Warning DISM DISM Provider Store: PID=8228 TID=6260 Failed to load the provider: C:\Windows\SYSTEM32\Dism\MetaDeployProvider.dll. - CDISMProviderStore::Internal_GetProvider(hr:0x8007007e) 2021-12-10 15:46:46, Info DISM DISM FFU Provider: PID=8228 TID=6260 [C:\] is not recognized by the DISM FFU provider. - CFfuImage::Initialize [8228] [0x8007007b] FIOReadFileIntoBuffer:(1452): The filename, directory name, or volume label syntax is incorrect. [8228] [0xc142011c] UnmarshallImageHandleFromDirectory:(641) [8228] [0xc142011c] WIMGetMountedImageHandle:(2906) 2021-12-10 15:46:46, Info DISM DISM WIM Provider: PID=8228 TID=6260 [C:\] is not a WIM mount point. - CWimMountedImageInfo::Initialize 2021-12-10 15:46:46, Info DISM DISM VHD Provider: PID=8228 TID=6260 [C:\] is not recognized by the DISM VHD provider. - CVhdImage::Initialize 2021-12-10 15:46:46, Info DISM DISM FFU Provider: PID=8228 TID=6260 [C:\] is not recognized by the DISM FFU provider. - CFfuImage::Initialize 2021-12-10 15:46:46, Info DISM DISM Imaging Provider: PID=8228 TID=6260 The provider FfuManager does not support CreateDismImage on C:\ - CGenericImagingManager::CreateDismImage 2021-12-10 15:46:46, Info DISM DISM VHD Provider: PID=8228 TID=6260 [C:\] is not recognized by the DISM VHD provider. - CVhdImage::Initialize 2021-12-10 15:46:46, Info DISM DISM Imaging Provider: PID=8228 TID=6260 The provider VHDManager does not support CreateDismImage on C:\ - CGenericImagingManager::CreateDismImage [8228] [0x8007007b] FIOReadFileIntoBuffer:(1452): The filename, directory name, or volume label syntax is incorrect. [8228] [0xc142011c] UnmarshallImageHandleFromDirectory:(641) [8228] [0xc142011c] WIMGetMountedImageHandle:(2906) 2021-12-10 15:46:46, Info DISM DISM WIM Provider: PID=8228 TID=6260 [C:\] is not a WIM mount point. - CWimMountedImageInfo::Initialize 2021-12-10 15:46:46, Info DISM DISM Imaging Provider: PID=8228 TID=6260 The provider WimManager does not support CreateDismImage on C:\ - CGenericImagingManager::CreateDismImage 2021-12-10 15:46:46, Info DISM DISM Imaging Provider: PID=8228 TID=6260 No imaging provider supported CreateDismImage for this path - CGenericImagingManager::CreateDismImage 2021-12-10 15:46:46, Info DISM DISM Manager: PID=8228 TID=6260 physical location path: C:\ - CDISMManager::CreateImageSession 2021-12-10 15:46:46, Info DISM DISM Manager: PID=8228 TID=6260 Event name for current DISM session is Global\{22D63F9E-6256-498C-8C9D-AC08425EB2AE} - CDISMManager::CheckSessionAndLock 2021-12-10 15:46:46, Info DISM DISM Manager: PID=8228 TID=6260 Create session event 0x36c for current DISM session and event name is Global\{22D63F9E-6256-498C-8C9D-AC08425EB2AE} - CDISMManager::CheckSessionAndLock 2021-12-10 15:46:46, Info DISM DISM Manager: PID=8228 TID=6260 Copying DISM from "C:\Windows\System32\Dism" - CDISMManager::CreateImageSessionFromLocation 2021-12-10 15:46:47, Info DISM DISM Manager: PID=8228 TID=6260 Successfully loaded the ImageSession at "C:\Users\markus\AppData\Local\Temp\9EBDE89A-650B-439E-9D06-402C0D5D41D9" - CDISMManager::LoadRemoteImageSession 2021-12-10 15:46:47, Info DISM DISM Image Session: PID=6148 TID=7900 Instantiating the Provider Store. - CDISMImageSession::get_ProviderStore 2021-12-10 15:46:47, Info DISM DISM Provider Store: PID=6148 TID=7900 Initializing a provider store for the IMAGE session type. - CDISMProviderStore::Final_OnConnect 2021-12-10 15:46:47, Info DISM DISM Provider Store: PID=6148 TID=7900 Connecting to the provider located at C:\Users\markus\AppData\Local\Temp\9EBDE89A-650B-439E-9D06-402C0D5D41D9\OSProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:46:47, Info DISM DISM OS Provider: PID=6148 TID=7900 Defaulting SystemPath to C:\ - CDISMOSServiceManager::Final_OnConnect 2021-12-10 15:46:47, Info DISM DISM OS Provider: PID=6148 TID=7900 Defaulting Windows folder to C:\Windows - CDISMOSServiceManager::Final_OnConnect 2021-12-10 15:46:47, Info DISM DISM Provider Store: PID=6148 TID=7900 Attempting to initialize the logger from the Image Session. - CDISMProviderStore::Final_OnConnect 2021-12-10 15:46:47, Info DISM DISM Provider Store: PID=6148 TID=7900 Connecting to the provider located at C:\Users\markus\AppData\Local\Temp\9EBDE89A-650B-439E-9D06-402C0D5D41D9\LogProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:46:47, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:46:47, Info DISM DISM Provider Store: PID=6148 TID=7900 Found and Initialized the DISM Logger. - CDISMProviderStore::Internal_InitializeLogger 2021-12-10 15:46:47, Warning DISM DISM Provider Store: PID=6148 TID=7900 Failed to load the provider: C:\Users\markus\AppData\Local\Temp\9EBDE89A-650B-439E-9D06-402C0D5D41D9\PEProvider.dll. - CDISMProviderStore::Internal_GetProvider(hr:0x8007007e) 2021-12-10 15:46:47, Info DISM DISM Provider Store: PID=6148 TID=7900 Failed to get and initialize the PE Provider. Continuing by assuming that it is not a WinPE image. - CDISMProviderStore::Final_OnConnect 2021-12-10 15:46:47, Info DISM DISM Provider Store: PID=6148 TID=7900 Finished initializing the Provider Map. - CDISMProviderStore::Final_OnConnect 2021-12-10 15:46:47, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:46:47, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:46:47, Info DISM DISM Manager: PID=8228 TID=6260 Image session successfully loaded from the temporary location: C:\Users\markus\AppData\Local\Temp\9EBDE89A-650B-439E-9D06-402C0D5D41D9 - CDISMManager::CreateImageSession 2021-12-10 15:46:47, Info DISM API: PID=8228 TID=6260 Target image information: OS Version=10.0.19042.1348, Image architecture=amd64 - CDismCore::LogImageSessionDetails 2021-12-10 15:46:47, Info DISM API: PID=8228 TID=7636 Leave DismOpenSessionInternal - DismOpenSessionInternal 2021-12-10 15:46:47, Info DISM API: PID=8228 TID=7636 Session id is: 2 - DismOpenSessionInternal 2021-12-10 15:46:47, Info DISM API: PID=8228 TID=7636 Enter DismEnableFeatureInternal - DismEnableFeatureInternal 2021-12-10 15:46:47, Info DISM API: PID=8228 TID=7636 Enter DismEnableDisableFeatureInternal - DismEnableDisableFeatureInternal 2021-12-10 15:46:47, Info DISM API: PID=8228 TID=7636 Input parameters: Session: 2, EnableFeatureName: Microsoft-Hyper-V-Management-PowerShell, DisableFeatureName: (null), Identifier: (null), PackageIdentifier: 0, LimitAccess: 0, SourcePathCount: 0, EnableAll: 1, CancelEvent: 0x0000000000000000, Progress: 0x0000000000000000, UserData: 0x0000000000000000 - DismEnableDisableFeatureInternal 2021-12-10 15:46:47, Info DISM API: PID=8228 TID=7636 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2021-12-10 15:46:47, Info DISM API: PID=8228 TID=6260 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2021-12-10 15:46:47, Info DISM API: PID=8228 TID=6260 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2021-12-10 15:46:47, Info DISM DISM Provider Store: PID=6148 TID=7900 Connecting to the provider located at C:\Users\markus\AppData\Local\Temp\9EBDE89A-650B-439E-9D06-402C0D5D41D9\CbsProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:46:47, Info DISM DISM Provider Store: PID=6148 TID=7900 Encountered a servicing provider, performing additional servicing initializations. - CDISMProviderStore::Internal_LoadProvider 2021-12-10 15:46:47, Info CSI 00000001 Shim considered [l:126]'\??\C:\Windows\Servicing\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.19041.1310_none_7e15ec207c87d405\wcp.dll' : got STATUS_OBJECT_PATH_NOT_FOUND 2021-12-10 15:46:47, Info CSI 00000002 Shim considered [l:123]'\??\C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.19041.1310_none_7e15ec207c87d405\wcp.dll' : got STATUS_SUCCESS 2021-12-10 15:46:47, Info DISM DISM OS Provider: PID=6148 TID=7900 Determined System directory to be C:\Windows\System32 - CDISMOSServiceManager::get_SystemDirectory 2021-12-10 15:46:47, Info DISM DISM Package Manager: PID=6148 TID=7900 Finished initializing the CbsConUI Handler. - CCbsConUIHandler::Initialize 2021-12-10 15:46:47, Info CSI 00000001 Shim considered [l:126]'\??\C:\Windows\Servicing\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.19041.1310_none_7e15ec207c87d405\wcp.dll' : got STATUS_OBJECT_PATH_NOT_FOUND 2021-12-10 15:46:47, Info CSI 00000002 Shim considered [l:123]'\??\C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.19041.1310_none_7e15ec207c87d405\wcp.dll' : got STATUS_SUCCESS 2021-12-10 15:46:47, Info DISM DISM Package Manager: PID=6148 TID=7900 CBS is being initialized for online use. More information about CBS actions can be located at: %windir%\logs\cbs\cbs.log - CDISMPackageManager::Initialize 2021-12-10 15:46:47, Info DISM DISM Package Manager: PID=6148 TID=7900 Loaded servicing stack for online use only. - CDISMPackageManager::CreateCbsSession 2021-12-10 15:46:47, Info DISM DISM Package Manager: PID=6148 TID=7900 Feature Microsoft-Hyper-V-Tools-All with CBS state 7(CbsInstallStateInstalled) being mapped to dism state 7(DISM_INSTALL_STATE_INSTALLED) - CDISMPackageFeature::LogInstallStateMapping 2021-12-10 15:46:47, Info DISM DISM Package Manager: PID=6148 TID=7900 Initiating Changes on Package with values: 5, 7 - CDISMPackage::Internal_ChangePackageState 2021-12-10 15:46:47, Info DISM DISM Package Manager: PID=6148 TID=7900 CBS session options=0x40100! - CDISMPackageManager::Internal_Finalize 2021-12-10 15:46:49, Info CSI 00000001 Shim considered [l:126]'\??\C:\Windows\Servicing\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.19041.1310_none_7e15ec207c87d405\wcp.dll' : got STATUS_OBJECT_PATH_NOT_FOUND 2021-12-10 15:46:49, Info CSI 00000002 Shim considered [l:123]'\??\C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.19041.1310_none_7e15ec207c87d405\wcp.dll' : got STATUS_SUCCESS 2021-12-10 15:46:49, Info DISM DISM Package Manager: PID=6148 TID=7900 Loaded servicing stack for online use only. - CDISMPackageManager::CreateCbsSession 2021-12-10 15:46:49, Info DISM DISM Package Manager: PID=6148 TID=7900 Feature Microsoft-Hyper-V-Management-PowerShell with CBS state 7(CbsInstallStateInstalled) being mapped to dism state 7(DISM_INSTALL_STATE_INSTALLED) - CDISMPackageFeature::LogInstallStateMapping 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 Exit DismEnableDisableFeatureInternal - DismEnableDisableFeatureInternal 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 Exit DismEnableFeatureInternal - DismEnableFeatureInternal 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 Enter DismCloseSessionInternal - DismCloseSessionInternal 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 Input parameters: Session: 2 - DismCloseSessionInternal 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 GetReferenceCount hr: 0x0 - CSessionTable::RemoveSession 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 Refcount for DismSession= 2s 0 - CSessionTable::RemoveSession 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=6260 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=6260 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=6260 ExecuteLoop: Cancel signaled - CCommandThread::ExecuteLoop 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=6260 Leave CCommandThread::ExecuteLoop - CCommandThread::ExecuteLoop 2021-12-10 15:46:49, Info DISM DISM Provider Store: PID=6148 TID=7900 Found the OSServices. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect 2021-12-10 15:46:49, Info DISM DISM Provider Store: PID=6148 TID=7900 Found the OSServices. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect 2021-12-10 15:46:49, Info DISM DISM Provider Store: PID=6148 TID=7900 Found the PE Provider. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect 2021-12-10 15:46:49, Info DISM DISM Provider Store: PID=6148 TID=7900 Finalizing the servicing provider(DISM Package Manager) - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:46:49, Info DISM DISM Package Manager: PID=6148 TID=7900 Finalizing CBS core. - CDISMPackageManager::Finalize 2021-12-10 15:46:49, Info DISM DISM Provider Store: PID=6148 TID=7900 Disconnecting Provider: DISM Package Manager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:46:49, Info DISM DISM Provider Store: PID=6148 TID=7900 Releasing the local reference to OSServices. - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:46:49, Info DISM DISM Provider Store: PID=6148 TID=7900 Disconnecting Provider: OSServices - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:46:49, Info DISM DISM Provider Store: PID=6148 TID=7900 Releasing the local reference to DISMLogger. Stop logging. - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:46:49, Info DISM DISM Manager: PID=8228 TID=6260 Closing session event handle 0x36c - CDISMManager::CleanupImageSessionEntry 2021-12-10 15:46:49, Info DISM DISM Provider Store: PID=8228 TID=6260 Found the OSServices. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect 2021-12-10 15:46:49, Info DISM DISM Provider Store: PID=8228 TID=6260 Disconnecting Provider: FolderManager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:46:49, Info DISM DISM Provider Store: PID=8228 TID=6260 Disconnecting Provider: FfuManager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:46:49, Info DISM DISM Provider Store: PID=8228 TID=6260 Disconnecting Provider: WimManager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:46:49, Info DISM DISM Provider Store: PID=8228 TID=6260 Disconnecting Provider: VHDManager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:46:49, Info DISM DISM Provider Store: PID=8228 TID=6260 Disconnecting Provider: GenericImagingManager - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:46:49, Info DISM DISM Provider Store: PID=8228 TID=6260 Releasing the local reference to DISMLogger. Stop logging. - CDISMProviderStore::Internal_DisconnectProvider 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=6260 Leave CCommandThread::CommandThreadProcedureStub - CCommandThread::CommandThreadProcedureStub 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 Leave DismCloseSessionInternal - DismCloseSessionInternal 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 Enter DismShutdownInternal - DismShutdownInternal 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 GetReferenceCount hr: 0x0 - CSessionTable::RemoveSession 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 Refcount for DismSession= 1s 0 - CSessionTable::RemoveSession 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=9132 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=9132 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=9132 ExecuteLoop: Cancel signaled - CCommandThread::ExecuteLoop 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=9132 Leave CCommandThread::ExecuteLoop - CCommandThread::ExecuteLoop 2021-12-10 15:46:49, Info DISM PID=8228 TID=9132 Temporarily setting the scratch directory. This may be overridden by user later. - CDISMManager::FinalConstruct 2021-12-10 15:46:49, Info DISM PID=8228 TID=9132 Scratch directory set to 'C:\Users\markus\AppData\Local\Temp\'. - CDISMManager::put_ScratchDir 2021-12-10 15:46:49, Info DISM PID=8228 TID=9132 DismCore.dll version: 6.2.19041.746 - CDISMManager::FinalConstruct 2021-12-10 15:46:49, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=9132 Leave CCommandThread::CommandThreadProcedureStub - CCommandThread::CommandThreadProcedureStub 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 Deleted g_internalDismSession - DismShutdownInternal 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 Shutdown SessionTable - DismShutdownInternal 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 Leave DismShutdownInternal - DismShutdownInternal 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 DismApi.dll: - DismShutdownInternal 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 DismApi.dll: <----- Ending DismApi.dll session -----> - DismShutdownInternal 2021-12-10 15:46:49, Info DISM API: PID=8228 TID=7636 DismApi.dll: - DismShutdownInternal ```
DISM Log Windows Server 2022 when successfully running example ``` 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 DismApi.dll: - DismInitializeInternal 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 DismApi.dll: <----- Starting DismApi.dll session -----> - DismInitializeInternal 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 DismApi.dll: - DismInitializeInternal 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 DismApi.dll: Host machine information: OS Version=10.0.20348, Running architecture=amd64, Number of processors=4 - DismInitializeInternal 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 DismApi.dll: API Version 6.2.20348.1 - DismInitializeInternal 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 DismApi.dll: Parent process command line: "C:\Users\markus\t.exe" - DismInitializeInternal 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 Input parameters: LogLevel: 2, LogFilePath: (null), ScratchDirectory: (null) - DismInitializeInternal 2021-12-10 15:51:12, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 Initialized GlobalConfig - DismInitializeInternal 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 Initialized SessionTable - DismInitializeInternal 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 Lookup in table by path failed for: DummyPath-2BA51B78-C7F7-4910-B99D-BB7345357CDC - CTransactionalImageTable::LookupImagePath 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 Waiting for m_pInternalThread to start - CCommandThread::Start 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=2436 Enter CCommandThread::CommandThreadProcedureStub - CCommandThread::CommandThreadProcedureStub 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=2436 Enter CCommandThread::ExecuteLoop - CCommandThread::ExecuteLoop 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 CommandThread StartupEvent signaled - CCommandThread::WaitForStartup 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 m_pInternalThread started - CCommandThread::Start 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 Created g_internalDismSession - DismInitializeInternal 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 Input parameters: ImagePath: DISM_{53BFAE52-B167-4E2F-A258-0A37B57FF845}, WindowsDirectory: (null), SystemDrive: (null) - DismOpenSessionInternal 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 Lookup in table by path failed for: DRIVE_C - CTransactionalImageTable::LookupImagePath 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 Waiting for m_pInternalThread to start - CCommandThread::Start 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=6848 Enter CCommandThread::CommandThreadProcedureStub - CCommandThread::CommandThreadProcedureStub 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=6848 Enter CCommandThread::ExecuteLoop - CCommandThread::ExecuteLoop 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 CommandThread StartupEvent signaled - CCommandThread::WaitForStartup 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 m_pInternalThread started - CCommandThread::Start 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=6848 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=6848 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2021-12-10 15:51:12, Info DISM PID=7936 TID=6848 Scratch directory set to 'C:\Users\markus\AppData\Local\Temp\2\'. - CDISMManager::put_ScratchDir 2021-12-10 15:51:12, Info DISM PID=7936 TID=6848 DismCore.dll version: 6.2.20348.1 - CDISMManager::FinalConstruct 2021-12-10 15:51:12, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:51:12, Info DISM PID=7936 TID=6848 Successfully loaded the ImageSession at "C:\Windows\SYSTEM32\Dism" - CDISMManager::LoadLocalImageSession 2021-12-10 15:51:12, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:51:12, Info DISM DISM Provider Store: PID=7936 TID=6848 Found and Initialized the DISM Logger. - CDISMProviderStore::Internal_InitializeLogger 2021-12-10 15:51:12, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:51:12, Info DISM DISM Manager: PID=7936 TID=6848 Successfully created the local image session and provider store. - CDISMManager::CreateLocalImageSession 2021-12-10 15:51:12, Info DISM DISM FFU Provider: PID=7936 TID=6848 [C:\] is not recognized by the DISM FFU provider. - CFfuImage::Initialize 2021-12-10 15:51:12, Info DISM DISM Imaging Provider: PID=7936 TID=6848 The provider FfuManager does not support CreateDismImage on C:\ - CGenericImagingManager::CreateDismImage 2021-12-10 15:51:12, Info DISM DISM VHD Provider: PID=7936 TID=6848 [C:\] is not recognized by the DISM VHD provider. - CVhdImage::Initialize 2021-12-10 15:51:12, Info DISM DISM Imaging Provider: PID=7936 TID=6848 The provider VHDManager does not support CreateDismImage on C:\ - CGenericImagingManager::CreateDismImage [7936.6848] [0x8007007b] FIOReadFileIntoBuffer:(1458): The filename, directory name, or volume label syntax is incorrect. [7936.6848] [0xc142011c] UnmarshallImageHandleFromDirectory:(641) [7936.6848] [0xc142011c] WIMGetMountedImageHandle:(2910) 2021-12-10 15:51:12, Info DISM DISM WIM Provider: PID=7936 TID=6848 [C:\] is not a WIM mount point. - CWimMountedImageInfo::Initialize 2021-12-10 15:51:12, Info DISM DISM Imaging Provider: PID=7936 TID=6848 The provider WimManager does not support CreateDismImage on C:\ - CGenericImagingManager::CreateDismImage 2021-12-10 15:51:12, Info DISM DISM Imaging Provider: PID=7936 TID=6848 No imaging provider supported CreateDismImage for this path - CGenericImagingManager::CreateDismImage [7936.6848] [0x8007007b] FIOReadFileIntoBuffer:(1458): The filename, directory name, or volume label syntax is incorrect. [7936.6848] [0xc142011c] UnmarshallImageHandleFromDirectory:(641) [7936.6848] [0xc142011c] WIMGetMountedImageHandle:(2910) 2021-12-10 15:51:12, Info DISM DISM WIM Provider: PID=7936 TID=6848 [C:\] is not a WIM mount point. - CWimMountedImageInfo::Initialize 2021-12-10 15:51:12, Info DISM DISM FFU Provider: PID=7936 TID=6848 [C:\] is not recognized by the DISM FFU provider. - CFfuImage::Initialize 2021-12-10 15:51:12, Info DISM DISM VHD Provider: PID=7936 TID=6848 [C:\] is not recognized by the DISM VHD provider. - CVhdImage::Initialize 2021-12-10 15:51:12, Info DISM DISM Manager: PID=7936 TID=6848 physical location path: C:\ - CDISMManager::CreateImageSession 2021-12-10 15:51:12, Info DISM DISM Manager: PID=7936 TID=6848 Event name for current DISM session is Global\{E90277EC-DCE2-4D05-8540-76BDA4696D73} - CDISMManager::CheckSessionAndLock 2021-12-10 15:51:12, Info DISM DISM Manager: PID=7936 TID=6848 Create session event 0x38c for current DISM session and event name is Global\{E90277EC-DCE2-4D05-8540-76BDA4696D73} - CDISMManager::CheckSessionAndLock 2021-12-10 15:51:12, Info DISM DISM Manager: PID=7936 TID=6848 Copying DISM from "C:\Windows\System32\Dism" - CDISMManager::CreateImageSessionFromLocation 2021-12-10 15:51:12, Info DISM DISM Manager: PID=7936 TID=6848 Successfully loaded the ImageSession at "C:\Users\markus\AppData\Local\Temp\2\7E34588A-0DD4-4F02-8387-DD6649C1D33E" - CDISMManager::LoadRemoteImageSession 2021-12-10 15:51:12, Info DISM DISM Image Session: PID=3896 TID=7012 Instantiating the Provider Store. - CDISMImageSession::get_ProviderStore 2021-12-10 15:51:12, Info DISM DISM OS Provider: PID=3896 TID=7012 Defaulting SystemPath to C:\ - CDISMOSServiceManager::Final_OnConnect 2021-12-10 15:51:12, Info DISM DISM OS Provider: PID=3896 TID=7012 Defaulting Windows folder to C:\Windows - CDISMOSServiceManager::Final_OnConnect 2021-12-10 15:51:12, Info DISM DISM Provider Store: PID=3896 TID=7012 Attempting to initialize the logger from the Image Session. - CDISMProviderStore::Final_OnConnect 2021-12-10 15:51:12, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:51:12, Info DISM DISM Provider Store: PID=3896 TID=7012 Found and Initialized the DISM Logger. - CDISMProviderStore::Internal_InitializeLogger 2021-12-10 15:51:12, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:51:12, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:51:12, Info DISM DISM Manager: PID=7936 TID=6848 Image session successfully loaded from the temporary location: C:\Users\markus\AppData\Local\Temp\2\7E34588A-0DD4-4F02-8387-DD6649C1D33E - CDISMManager::CreateImageSession 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=6848 Target image information: OS Version=10.0.20348.350, Image architecture=amd64 - CDismCore::LogImageSessionDetails 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 Session id is: 2 - DismOpenSessionInternal 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 Input parameters: Session: 2, EnableFeatureName: Microsoft-Hyper-V-Management-PowerShell, DisableFeatureName: (null), Identifier: (null), PackageIdentifier: 0, LimitAccess: 0, SourcePathCount: 0, EnableAll: 1, CancelEvent: 0x0000000000000000, Progress: 0x0000000000000000, UserData: 0x0000000000000000 - DismEnableDisableFeatureInternal 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=7956 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=6848 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2021-12-10 15:51:12, Info DISM API: PID=7936 TID=6848 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2021-12-10 15:51:12, Info CSI 00000001 Shim considered [l:125]'\??\C:\Windows\Servicing\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.20348.314_none_f215e9be5141eaf6\wcp.dll' : got STATUS_OBJECT_PATH_NOT_FOUND 2021-12-10 15:51:12, Info CSI 00000002 Shim considered [l:122]'\??\C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.20348.314_none_f215e9be5141eaf6\wcp.dll' : got STATUS_SUCCESS 2021-12-10 15:51:12, Info DISM DISM OS Provider: PID=3896 TID=7012 Determined System directory to be C:\Windows\System32 - CDISMOSServiceManager::get_SystemDirectory 2021-12-10 15:51:12, Info DISM DISM Package Manager: PID=3896 TID=7012 Finished initializing the CbsConUI Handler. - CCbsConUIHandler::Initialize 2021-12-10 15:51:12, Info CSI 00000001 Shim considered [l:125]'\??\C:\Windows\Servicing\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.20348.314_none_f215e9be5141eaf6\wcp.dll' : got STATUS_OBJECT_PATH_NOT_FOUND 2021-12-10 15:51:12, Info CSI 00000002 Shim considered [l:122]'\??\C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.20348.314_none_f215e9be5141eaf6\wcp.dll' : got STATUS_SUCCESS 2021-12-10 15:51:12, Info DISM DISM Package Manager: PID=3896 TID=7012 CBS is being initialized for online use. More information about CBS actions can be located at: %windir%\logs\cbs\cbs.log - CDISMPackageManager::Initialize 2021-12-10 15:51:12, Info DISM DISM Package Manager: PID=3896 TID=7012 Loaded servicing stack for online use only. - CDISMPackageManager::CreateCbsSession 2021-12-10 15:51:13, Info DISM DISM Package Manager: PID=3896 TID=7012 Feature RSAT-Hyper-V-Tools-Feature with CBS state 4(CbsInstallStateStaged) being mapped to dism state 4(DISM_INSTALL_STATE_STAGED) - CDISMPackageFeature::LogInstallStateMapping 2021-12-10 15:51:13, Info DISM DISM Package Manager: PID=3896 TID=7012 Feature ServerManager-Core-RSAT-Role-Tools with CBS state 4(CbsInstallStateStaged) being mapped to dism state 4(DISM_INSTALL_STATE_STAGED) - CDISMPackageFeature::LogInstallStateMapping 2021-12-10 15:51:13, Info DISM DISM Package Manager: PID=3896 TID=7012 Feature ServerManager-Core-RSAT with CBS state 4(CbsInstallStateStaged) being mapped to dism state 4(DISM_INSTALL_STATE_STAGED) - CDISMPackageFeature::LogInstallStateMapping 2021-12-10 15:51:13, Info DISM DISM Package Manager: PID=3896 TID=7012 Initiating Changes on Package with values: 5, 7 - CDISMPackage::Internal_ChangePackageState 2021-12-10 15:51:13, Info DISM DISM Package Manager: PID=3896 TID=7012 CBS session options=0x40100! - CDISMPackageManager::Internal_Finalize 2021-12-10 15:51:23, Info DISM API: PID=4940 TID=4996 GetReferenceCount hr: 0x0 - CSessionTable::RemoveSession 2021-12-10 15:51:23, Info DISM API: PID=4940 TID=4996 Refcount for DismSession= 1s 0 - CSessionTable::RemoveSession 2021-12-10 15:51:23, Info DISM API: PID=4940 TID=4996 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2021-12-10 15:51:23, Info DISM API: PID=4940 TID=8004 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2021-12-10 15:51:23, Info DISM API: PID=4940 TID=8004 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2021-12-10 15:51:23, Info DISM API: PID=4940 TID=8004 ExecuteLoop: Cancel signaled - CCommandThread::ExecuteLoop 2021-12-10 15:51:23, Info DISM API: PID=4940 TID=8004 Leave CCommandThread::ExecuteLoop - CCommandThread::ExecuteLoop 2021-12-10 15:51:23, Info DISM PID=4940 TID=8004 Temporarily setting the scratch directory. This may be overridden by user later. - CDISMManager::FinalConstruct 2021-12-10 15:51:23, Info DISM PID=4940 TID=8004 Scratch directory set to 'C:\Windows\TEMP\'. - CDISMManager::put_ScratchDir 2021-12-10 15:51:23, Info DISM PID=4940 TID=8004 DismCore.dll version: 10.0.20348.1 - CDISMManager::FinalConstruct 2021-12-10 15:51:23, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:51:23, Info DISM API: PID=4940 TID=8004 Leave CCommandThread::CommandThreadProcedureStub - CCommandThread::CommandThreadProcedureStub 2021-12-10 15:51:23, Info DISM API: PID=4940 TID=4996 Deleted g_internalDismSession - DismShutdownInternal 2021-12-10 15:51:23, Info DISM API: PID=4940 TID=4996 Shutdown SessionTable - DismShutdownInternal 2021-12-10 15:51:23, Info DISM API: PID=4940 TID=4996 DismApi.dll: - DismShutdownInternal 2021-12-10 15:51:23, Info DISM API: PID=4940 TID=4996 DismApi.dll: <----- Ending DismApi.dll session -----> - DismShutdownInternal 2021-12-10 15:51:23, Info DISM API: PID=4940 TID=4996 DismApi.dll: - DismShutdownInternal 2021-12-10 15:51:24, Info CSI 00000001 Shim considered [l:125]'\??\C:\Windows\Servicing\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.20348.314_none_f215e9be5141eaf6\wcp.dll' : got STATUS_OBJECT_PATH_NOT_FOUND 2021-12-10 15:51:24, Info CSI 00000002 Shim considered [l:122]'\??\C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.20348.314_none_f215e9be5141eaf6\wcp.dll' : got STATUS_SUCCESS 2021-12-10 15:51:24, Info DISM DISM Package Manager: PID=3896 TID=7012 Loaded servicing stack for online use only. - CDISMPackageManager::CreateCbsSession 2021-12-10 15:51:24, Info DISM DISM Package Manager: PID=3896 TID=7012 Feature Microsoft-Hyper-V-Management-PowerShell with CBS state 7(CbsInstallStateInstalled) being mapped to dism state 7(DISM_INSTALL_STATE_INSTALLED) - CDISMPackageFeature::LogInstallStateMapping 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=7956 Input parameters: Session: 2 - DismCloseSessionInternal 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=7956 GetReferenceCount hr: 0x0 - CSessionTable::RemoveSession 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=7956 Refcount for DismSession= 2s 0 - CSessionTable::RemoveSession 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=7956 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=6848 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=6848 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=6848 ExecuteLoop: Cancel signaled - CCommandThread::ExecuteLoop 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=6848 Leave CCommandThread::ExecuteLoop - CCommandThread::ExecuteLoop 2021-12-10 15:51:24, Info DISM DISM Package Manager: PID=3896 TID=7012 Finalizing CBS core. - CDISMPackageManager::Finalize 2021-12-10 15:51:24, Info DISM DISM Manager: PID=7936 TID=6848 Closing session event handle 0x38c - CDISMManager::CleanupImageSessionEntry 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=6848 Leave CCommandThread::CommandThreadProcedureStub - CCommandThread::CommandThreadProcedureStub 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=7956 GetReferenceCount hr: 0x0 - CSessionTable::RemoveSession 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=7956 Refcount for DismSession= 1s 0 - CSessionTable::RemoveSession 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=7956 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=2436 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=2436 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=2436 ExecuteLoop: Cancel signaled - CCommandThread::ExecuteLoop 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=2436 Leave CCommandThread::ExecuteLoop - CCommandThread::ExecuteLoop 2021-12-10 15:51:24, Info DISM PID=7936 TID=2436 Temporarily setting the scratch directory. This may be overridden by user later. - CDISMManager::FinalConstruct 2021-12-10 15:51:24, Info DISM PID=7936 TID=2436 Scratch directory set to 'C:\Users\markus\AppData\Local\Temp\2\'. - CDISMManager::put_ScratchDir 2021-12-10 15:51:24, Info DISM PID=7936 TID=2436 DismCore.dll version: 6.2.20348.1 - CDISMManager::FinalConstruct 2021-12-10 15:51:24, Info DISM Initialized Panther logging at C:\Windows\Logs\DISM\dism.log 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=2436 Leave CCommandThread::CommandThreadProcedureStub - CCommandThread::CommandThreadProcedureStub 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=7956 Deleted g_internalDismSession - DismShutdownInternal 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=7956 Shutdown SessionTable - DismShutdownInternal 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=7956 DismApi.dll: - DismShutdownInternal 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=7956 DismApi.dll: <----- Ending DismApi.dll session -----> - DismShutdownInternal 2021-12-10 15:51:24, Info DISM API: PID=7936 TID=7956 DismApi.dll: - DismShutdownInternal ```
ItsMattL commented 2 years ago

Hey, thank you for the detailed report! I ran a quick test using your example code on a 2019 instance I had running. The first run actually succeeded as expected with no panic, and the feature installed. After reboot, rerunning the same code produced the exact error you provided. I took this to mean this error might result from calling EnableFeature if the feature is already enabled, but of course there are a lot of variables with DISM. Can you confirm your 2019 image definitely doesn't have the feature in question prior to you running the reproduction?

ItsMattL commented 2 years ago

The other thing I notice from the logs is that the Go version is specifying EnableAll, which is pulling in two other items that the Powershell version is not:

2021-12-10 16:20:15, Info DISM DISM Package Manager: PID=2936 TID=4768 Feature Microsoft-Hyper-V-Management-PowerShell with CBS state 7(CbsInstallStateInstalled) being mapped to dism state 7(DISM_INSTALL_STATE_INSTALLED) - CDISMPackageFeature::LogInstallStateMapping

vs

2021-12-10 15:20:50, Info DISM DISM Package Manager: PID=2464 TID=3764 Feature RSAT-Hyper-V-Tools-Feature with CBS state 4(CbsInstallStateStaged) being mapped to dism state 4(DISM_INSTALL_STATE_STAGED) - CDISMPackageFeature::LogInstallStateMapping 2021-12-10 15:20:50, Info DISM DISM Package Manager: PID=2464 TID=3764 Feature ServerManager-Core-RSAT-Role-Tools with CBS state 4(CbsInstallStateStaged) being mapped to dism state 4(DISM_INSTALL_STATE_STAGED) - CDISMPackageFeature::LogInstallStateMapping 2021-12-10 15:20:50, Info DISM DISM Package Manager: PID=2464 TID=3764 Feature ServerManager-Core-RSAT with CBS state 4(CbsInstallStateStaged) being mapped to dism state 4(DISM_INSTALL_STATE_STAGED) - CDISMPackageFeature::LogInstallStateMapping

I'm not sure why this would matter, but pointing out they're not apples to apples in the test.

lippertmarkus commented 2 years ago

I had that same behavior like you (no error when not enabled yet) yesteday. But today, also with a fresh 2019 VM I do also get the error when not enabled before:

PS C:\> Get-WindowsOptionalFeature -FeatureName "Microsoft-Hyper-V-Management-PowerShell" -Online

FeatureName      : Microsoft-Hyper-V-Management-PowerShell
DisplayName      : Hyper-V PowerShell cmdlets
Description      : Hyper-V PowerShell cmdlets
RestartRequired  : Possible
State            : Disabled
CustomProperties :
                   ServerComponent\Description : Hyper-V Module for Windows PowerShell includes Windows PowerShell cmdlets for managing Hyper-V.
                   ServerComponent\DisplayName : Hyper-V Module for Windows PowerShell
                   ServerComponent\Id : 457
                   ServerComponent\InstallWithParentByDefault : true
                   ServerComponent\Parent : RSAT-Hyper-V-Tools
                   ServerComponent\Type : Feature
                   ServerComponent\UniqueName : Hyper-V-PowerShell
                   ServerComponent\Version\Major : 1
                   ServerComponent\Version\Minor : 0
                   ServerComponent\Deploys\Update\Name : Microsoft-Hyper-V-Management-PowerShell
                   ServerComponent\Relationships\OptionalCompanionFor\Type : RSAT
                   ServerComponent\Relationships\OptionalCompanionFor\UniqueName : Hyper-V

PS C:\> .\test.exe
error code 1 with message "Incorrect function."
panic: Incorrect function.

goroutine 1 [running]:
main.main()
        C:/tmp/testgodism/main.go:25 +0x2d3

On Windows 10 / Server 2022 also when running with the feature already enabled before doesn't lead to the error.

I also tried with enableAll=false but that didn't fix the error (and also doesn't explain why it works on Windows 10 / Windows Server 2022 with enableAll=true).

Do you need any more information to help you debugging?

ItsMattL commented 2 years ago

Upon further investigation, this might be a non-issue of sorts. According to dismapi.h, there are three potential success codes: 0 (implicitly), ERROR_SUCCESS_REBOOT_REQUIRED (3010L), and DISMAPI_S_RELOAD_IMAGE_SESSION_REQUIRED (0x00000001). For the latter, the documentation just states "The DISM session needs to be reloaded." So in essence, the event was successful, but the session needs to be reloaded before continuing.

Assuming, as you said, the feature is getting enabled as desired, then the only real issue is that the error being returned is not properly conveying what's going on.