Forum > macOS / Mac OS X
need to access DADiskCreateFromVolumePath function from DADisk
(1/1)
inferno:
Hi all,
I need to use DADiskCreateFromVolumePath on macOS platform: https://developer.apple.com/documentation/diskarbitration/1401858-dadiskcreatefromvolumepath?language=objc
It persists in /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/DiskArbitration.framework/Versions/A/Headers/DADisk.h
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---/*! * @function DADiskCreateFromVolumePath * @abstract Creates a new disk object. * @param allocator The allocator object to be used to allocate memory. * @param session The DASession in which to contact Disk Arbitration. * @param path The BSD mount point. * @result A reference to a new DADisk. * @discussion * The caller of this function receives a reference to the returned object. The * caller also implicitly retains the object and is responsible for releasing it * with CFRelease(). */ extern DADiskRef __nullable DADiskCreateFromVolumePath( CFAllocatorRef __nullable allocator, DASessionRef session, CFURLRef path );
but no in the translated Pascal unit: /fpcbuild-3.2.2/fpcsrc/packages/univint/src/DADisk.pas
I tried to add it myself without success:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function DADiskCreateFromVolumePath(allocator: CFAllocatorRef; session: DASessionRef; path: CFURLRef ): DADiskRef; external name '_DADiskCreateFromVolumePath';
The compiler returns: Error: Identifier not found "DADiskCreateFromVolumePath".
Any idea how to access this call?
Best regards,
Inferno
Jonas Maebe:
Where did you add this declaration?
inferno:
To the DADisk.pas file.
Jonas Maebe:
An installed FPC uses the pre-compiled units that come with it, so adding something to the sources indeed won't change anything. Better add it to a utility unit of your own. Don't forget to add mwpascal;`at the end of the declaration though, because that calling convention is the default in the universal interfaces units.
inferno:
This was the cause. I already had my own DADisk unit version, but I missed to add it to the project, so compiler used original fpc unit where I also tried to add the DADiskCreateFromVolumePath declaration. Too much mess during experiments...
Thank you Jonas!
Best regards,
Inferno
Navigation
[0] Message Index