Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
I have written a small program that do p/invoke to obtain the pointer to the EWFProtected volume or disk.

The operating system in windows embedded standard.

The c: is a protected volume. Type is RAM<REG>

When i make a function call  EwfMgrOpenProtected("C:"); return value is -1 and error value is 5 which is access denied.

How to obtain an handle to the protected volume?


C#
static void Main(string[] args)
       {
           // HANDLE EwfMgrOpenProtected(LPCWSTR lpVolume);
           IntPtr ptr = EwfMgrOpenProtected("C:");
           int error = Marshal.GetLastWin32Error();

           Console.WriteLine("error " + error);
           Console.WriteLine(ptr);
           Console.ReadLine();
       }

       [DllImport("ewfapi.dll", SetLastError = true, CharSet = CharSet.Unicode)]
       public static extern IntPtr EwfMgrOpenProtected(string volume);
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900