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

_GetProvisionedAppxPackages throws a 'FatalExecutionEngineError' #58

Closed
Sherulez opened this issue Jun 22, 2018 · 1 comment
Closed
Labels

Comments

@Sherulez
Copy link

Sherulez commented Jun 22, 2018

Hello,

I have an exception when I call this method DismApi._GetProvisionedAppxPackages(DismSession)
Other methods of the API seem to work. Even though I have not tried everything.
Since I'm really bad at managed code any help would be appreciated :)

Environnement :

VS - 2017(As Administrator) / WPF
.NET 4.6.1
Non-English W10 - 1803

Code :

DismApi.Initialize(DismLogLevel.LogErrors);
try
{
	using (DismSession onlineSession = DismApi.OpenOnlineSession())
	{
		DismApi._GetProvisionedAppxPackages(onlineSession)
	}
}
finally
{
	DismApi.Shutdown();
}

Thrown exception :

Thrown on : DismApi._GetProvisionedAppxPackages(onlineSession);

Managed Debugging Assistant 'FatalExecutionEngineError' :
Additional Information: The runtime has encountered a fatal error. The address of the error was at 0x7363c430, on thread 0x3ff8.
The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code.
Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

dism.log :

[18092] [0x8007007b] FIOReadFileIntoBuffer:(1381): La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte. | >> English <<: The syntax of the file, directory, or volume name is incorrect
[18092] [0xc142011c] UnmarshallImageHandleFromDirectory:(641)
[18092] [0xc142011c] WIMGetMountedImageHandle:(2897)

Edit :
I built the last master and I used the Nuget package in prerelease v.1.7.0-g and the same exeption is thrown in the ExtensionMethods.cs Class here :

public static T ToStructure<T>(this IntPtr ptr)
{
  return (T)Marshal.PtrToStructure(ptr, typeof(T));
}
@jeffkl jeffkl added the bug label Jun 26, 2018
@jeffkl
Copy link
Owner

jeffkl commented Jun 26, 2018

I was able to repro this. I'll work on a fix.

jeffkl added a commit that referenced this issue Jun 26, 2018
This was causing fatal errors when marshalling the struct because the size was off.  Also added a unit test.

Fixes #58
jeffkl added a commit that referenced this issue Jun 26, 2018
* Add missing Regions field to DismAppxPackage_

This was causing fatal errors when marshalling the struct because the size was off.  Also added a unit test.

Fixes #58

* Update test because AppVeyor machine has no packages installed :(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants