Is it safe to use multithreading with DISM APIs to remove multiple items from an image simultaneously?

Masa Yuilki 40 Reputation points
2024-12-15T22:58:37.62+00:00

I didn't find anything on the documentation if its safe to perform multithreaded calls to DismRemovePackage, DismRemoveCapability, DismDisableFeature, i mean, remove multiple "things" from the image at once.

Also, i tried to follow the DismGetPackages and DismGetFeatures examples from the documentation, but it doesn't compile and it also has a small typing error.

DismFeature* features; and DismPackage* packages; is returning just a single value instead of an array:

#include <Windows.h>
#include <dismapi.h>

int main(int argc, char *argv[])
{
    DismLogLevel dwLogLevel = DismLogLevel::DismLogErrors;
    HRESULT hr = DismInitialize(dwLogLevel, NULL, NULL);

    DismSession session = NULL;
	hr = DismOpenSession(L"V:\\", NULL, NULL, &session);

	DismFeature* features;
    UINT featuresCount = 0;
	hr = DismGetFeatures(session, NULL, DismPackageIdentifier::DismPackageNone, &features, &featuresCount);

	DismPackage* packages;
	UINT packageCount = 0;
	hr = DismGetPackages(session, &packages, &packageCount);
}
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,804 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.