Jump to content
Sign in to follow this  
Trolleule

DLLCall Function Definition need help

Recommended Posts

Trolleule

Hi peoplez,

can someone help me to define the DLLCall for this function:

BOOL
WINAPI
WIMGetMountedImageInfo(
MOUNTED_IMAGE_INFO_LEVELS fInfoLevelId,
PDWORD pdwImageCount,
PVOID pMountInfo,
DWORD cbMountInfoLength,
PDWORD pcbReturnLength
);

Link: http://msdn.microsoft.com/en-us/library/windows/desktop/dd851928.aspx

Used DLL is wimgapi.dll

I have tried this:

; #STRUCTURE# ===================================================================================================================
; Name...........: $tagWIM_MOUNT_INFO_LEVEL1
; Description ...: Contains information retrieved by the _WIM_GetMountedImageList function.
; Fields ........: WimPath - Specifies the full path to the .wim file.
; MountPath - Specifies the full path to the directory where the image is mounted.
; ImageIndex - Specifies the image index within the .wim file specified in WimPath.
; MountFlags - Specifies the current state of the mount point.
; | $WIM_MOUNT_FLAG_MOUNTED - The image is actively mounted.
; | $WIM_MOUNT_FLAG_MOUNTING - The image is in the process of mounting.
; | $WIM_MOUNT_FLAG_REMOUNTABLE - The image is not mounted, but is capable of being remounted.
; | $WIM_MOUNT_FLAG_INVALID - The image mount point is no longer valid.
; | $WIM_MOUNT_FLAG_NO_WIM - TThe WIM file backing the mount point is missing or inaccessible.
; | $WIM_MOUNT_FLAG_NO_MOUNTDIR - The image mount point has been removed or replaced.
; | $WIM_MOUNT_FLAG_MOUNTDIR_REPLACED - The mount point has been replaced with by a different mounted image.
; | $WIM_MOUNT_FLAG_READWRITE - The image has been mounted with read-write access.
; Author ........: Jonathan Holmgren (Homes32)
; Remarks .......:
; ===============================================================================================================================
Global Const $tagWIM_MOUNT_INFO_LEVEL1 = "WCHAR WimPath[260];WCHAR MountPath[260];DWORD ImageIndex;DWORD MountFlags"


Local $MOUNTED_IMAGE_INFO_LEVELS = DllStructCreate($tagWIM_MOUNT_INFO_LEVEL1)
local $pdwImageCount = DllStructCreate("ptr")
Local $pMountInfo = DllStructCreate("ptr")
Local $pcbReturnLength = DllStructCreate("ptr")
;~ Local $cbMountInfoLength = DllStructCreate("int") ; Size of buffer in bytes


Local $aResult2 = DllCall($ghwimgapi, "bool", "WIMGetMountedImageInfo", _
"ptr", DllStructGetPtr($MOUNTED_IMAGE_INFO_LEVELS), _
"ptr", DllStructGetPtr($pdwImageCount), _ ; [out] A pointer to a DWORD that receives the number of mounted images.
"ptr", DllStructGetPtr($pMountInfo), _ ; [out opt] Pointer to a variable that receives the array of mounted image structures. The size of the information written varies depending on the type of structured defined by the fInfoLevelId parameter.
"dword", DllStructGetSize($pMountInfo), _ ; [in] The size of the buffer pointed to by the pMountInfo parameter, in bytes.
"ptr", DllStructGetPtr($pcbReturnLength)) ; [out] A pointer to a variable in which the function returns the size of the requested information.

Has Someone an idea, how to get this function work please?

Edited by Trolleule

Share this post


Link to post
Share on other sites
Trolleule

I work with this UDF and the author has not added this function :(

Share this post


Link to post
Share on other sites
hvandrie

Trolleule,

For whatever it's worth, I've written myself one...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×