473,473 Members | 4,297 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

error on calling DISMMountImage function from c#

1 New Member
hello,
I wanted to call dismapi.dll function in c# code.
when I call function DismInitialize() its working fine.
next step I want to mount .Wim image file using DismMountImage() function.I got error 122,unable to mount image
Expand|Select|Wrap|Line Numbers
  1. int hr="Marshal.GetLastWin32Error()"
  2.  
  3.  
  4. I am calling DismMountImage as-
  5.  
  6.  [DllImport(@"C:\Windows\System32\CompatTel\dismapi.dll", CharSet = CharSet.Unicode, SetLastError = true)]
  7.  
  8.  [return: MarshalAs(UnmanagedType.Error)]
  9.  
  10.   public static extern int DismMountImage(
  11.   [MarshalAs(UnmanagedType.LPWStr)] string ImageFilePath,
  12.   [MarshalAs(UnmanagedType.LPWStr)] string MountPath,
  13.   UInt32 ImageIndex,
  14.   [MarshalAs(UnmanagedType.LPWStr)] string ImageName,
  15.   DismImageIdentifier ImageIdentifier,
  16.    UInt32 Flags
  17.  
  18.             );
  19.  
what is wrong in this???
any help appreciated..
Thank You
Sep 14 '15 #1
0 1375

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ken | last post by:
hello, I would to know if it is possible to call an object in a function within a class. Meaning , In a class, A function X calling onto a function Y, and function Y we want one of the two...
6
by: jacob ya | last post by:
Hi, I'm working on a project that requires us to call some mathematical functions that are in a Fortran dll. I'm trying to call the function using P/Invoke, but I keep getting a null reference...
1
by: Maverick | last post by:
I'm trying to call on a function I created as follows. The stored functions is saved as : Public Function GetCaps(masterkey As String, id As String) ---All the code End Function I am calling...
1
by: Abhishek | last post by:
Hello All I am able to call the function exported by Exe from a dll file im getting the address of the function but whille calling that function im getting access violation Error as bellow my code...
0
by: Abhishek | last post by:
Hello All I am able to call the function exported by Exe from a dll file im getting the address of the function but whille calling that function im getting access violation Error as bellow my code...
1
by: Mayur | last post by:
Hello All I am able to call the function exported by Exe from a dll file im getting the address of the function but whille calling that function im getting access violation Error as bellow my code...
1
by: Mayur | last post by:
Hello All I am able to call the function exported by Exe from a dll file im getting the address of the function but whille calling that function im getting access violation Error as bellow my code...
6
by: Soorali | last post by:
Hi I am a newbie to VC++ and this is my first independent project so please pardon my ignorance!! My project compiles and runs perfectly fine in Debug mode. However, when I try to compile it...
6
Slaxer13
by: Slaxer13 | last post by:
I have the code that is calling a function named Get_Reg: Private Sub Form_BeforeUpdate(Cancel As Integer) Dim strMsg As String Dim strResult As String strMsg = "O Registo mudou."...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.