Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get and set Windows Editions #94

Open
DrEmpiricism opened this issue May 5, 2020 · 2 comments
Open

Get and set Windows Editions #94

DrEmpiricism opened this issue May 5, 2020 · 2 comments

Comments

@DrEmpiricism
Copy link

Any ideas how Dism does this? There is no DismApi documentation on it whatsoever.

One of the PowerShell scripts I use with this (and WimgApi) converts one offline Windows Image edition to another supported edition (i.e. Windows Home to Windows Pro for Workstations). WimgApi can be easily used to change the XML metadata of the image to the new edition's values; however, the DismApi documentations provides no details on how to natively return and/or set Windows Editions so one must use either the Dism command-line or PowerShell Dism cmdlet to do it.

Perhaps I'm missing something?

@jeffkl
Copy link
Owner

jeffkl commented May 7, 2020

I looked at the source code to dism.exe and this API does not seem to be exposed in a public way. Its made available to dism.exe as sort of an extension. The implementation is in %WinDir%\System32\Dism\TransmogProvider.dll

C:\>dumpbin /exports C:\Windows\System32\Dism\TransmogProvider.dll
Microsoft (R) COFF/PE Dumper Version 14.27.28826.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file C:\Windows\System32\Dism\TransmogProvider.dll

File Type: DLL

  Section contains the following exports for TransmogProvider.DLL

    00000000 characteristics
    AB7A6446 time date stamp
        0.00 version
           1 ordinal base
           5 number of functions
           5 number of names

    ordinal hint RVA      name

          1    0 0001CA10 DLLGetDISMProviderCLSID
          2    1 0001CA40 DllCanUnloadNow
          3    2 0001CA80 DllGetClassObject
          4    3 0001CBC0 DllRegisterServer
          5    4 0001CD00 DllUnregisterServer

  Summary

        3000 .data
        3000 .pdata
       D8000 .rdata
        4000 .reloc
        5000 .rsrc
       5C000 .text

@DrEmpiricism
Copy link
Author

Sorry for the delay in my response, but it appears from additional logs I have that DISM uses the TransmogProvider to 'ValidateTransmogrify' any commands that include getting or setting image index editions. Moreover, your dump clearly shows the functions that can be passed to the library.

When I have some free time I am going to toy around with that a bit and see if I can isolate code that can do anything with edition 'transmogrification' natively and will report back if I get anywhere with it.

Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants