Skip to content

Sample Code doesn't works, help me #41

@kmu0123

Description

@kmu0123

I tried the sample code at https://github.com/jeffkl/ManagedWimgApi/wiki/Message-Callbacks but doesn7t works. I simply copy & pasted that code.

    private void applywim(string source,string destination)
    {
        var targetPath = destination;
        var imageIndex = 1;
        using (var wimHandle = WimgApi.CreateFile(
            source,
            WimFileAccess.Read,
            WimCreationDisposition.OpenExisting,
            WimCreateFileOptions.None,
            WimCompressionType.None))
        {
            WimgApi.SetTemporaryPath(wimHandle, Environment.GetEnvironmentVariable("TEMP"));
            WimgApi.RegisterMessageCallback(wimHandle, MyCallbackMethod);
            try
            {
                using (var imageHandle = WimgApi.LoadImage(wimHandle, imageIndex))
                {
                    WimgApi.ApplyImage(imageHandle, targetPath, WimApplyImageOptions.None);
                }
            }
            finally
            {
                WimgApi.UnregisterMessageCallback(wimHandle, MyCallbackMethod);
            }
        }

    }

I executed the sample code, but nothing happens. The read / write rate of the disk remains 0, and it seems that it is frozen. The restore destination directory was restored in an incomplete state. We thought that there was a problem with the WIM file itself, restored manually with the DISM command, but using the DISM command it was possible to restore it exactly.

Please tell me how to solve. Help me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions