Biswa96/hvtool

Is HcsCreateOperation needed?

Closed this issue · 6 comments

hvtool uses HcsCreateOperation(NULL, NULL).

e.g. here:

    hcsOperation = HcsCreateOperation(NULL, NULL);
    hRes = HcsEnumerateComputeSystems(NULL, hcsOperation);
    hRes = HcsWaitForOperationResult(hcsOperation, INFINITE, &result);

Is it needed? Why?

This is just a experimental project and I got the information from WSL's LxssManager.dll. I didn't dive into the haystack of HCS functions. Are you going to use it in any project?

I got the information from WSL's LxssManager.dll

How did you get it from that DLL? Did you check the native code? We can continue this on a E-mail or IRC (are you on FreeNode?).

How did you get it from that DLL?

It's complicated 😈 If the discussion is temporary I can go with IRC. If the discussion is for a serious project I would like to be in a public discussion, not email.

Please catch me on FreeNode, channel #hvtool.

Answering to the main question: Yes, HcsCreateOperation() is needed. Internally, it allocates HCS_OPERATION, a reference counted lifetime object (a opaque structure), like a big chunk of buffer and returns it. It calls an internal function MakeClientOperationHandle() which is called for every VM operations.

The details is found in computecore.dll and may not be fully correct.

OK. The main question is answered!