[Java] Volume Shadow Copy COM Interface translation

Tanya Kogan 21 Reputation points
2020-07-26T18:18:12.967+00:00

I am trying to write the Volume Shadow Copy script in Java. As far as I understand I need to download vss.h, vswriter.h and vsbackup.h and convert their data to Java in the form of

 // Called to set the context for subsequent snapshot-related operations
public int SetContext(WinDef.LONG lContext){
    return _invokeNativeInt( 32, new Object[] { getPointer(), lContext });
}

from the C style for of

// Called to set the context for subsequent snapshot-related operations
STDMETHOD(SetContext)
    (
    _In_ LONG lContext
    ) = 0;

But I've constantly getting errors like "method not found" since I am guessing the id of the method and "wrong argument" since I converted parameters wrongly or again guessed the id of the method wrongly.
Maybe there is a simple way to call this methods or somebody already adapted this interface to Java or similar and can share it with me?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,335 questions
0 comments No comments
{count} votes

Accepted answer
  1. Daisy Zhou 24,126 Reputation points Microsoft Vendor
    2020-07-28T03:23:29.257+00:00

    Hello,

    Thank you for posting here.

    We mainly focus on the issues or questions about Active Directory. I am sorry, we are not faimlar with Java and how to write script with Java.

    I suggest we post our question on Java forum so that the engineers from Java can provide the further help to you.

    Meanwhile, if there is any question in future, we warmly welcome you to post in this forum.

    Thank you for your understanding and support.

    Best Regards,
    Daisy Zhou

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.