[fpc-pascal] Missing functions in FPCMacOSAll.pas

Paul Ishenin webpirat at mail.ru
Sun Jul 19 15:25:02 CEST 2009


Tobias Giesen wrote:
> frequently I need to use a function that is missing in FPCMacOSAll.pas.
> Trying to declare it myself usually results in successful compilation
> and linking, but most of the time the functions crash at run time. So
> I wonder if these are not implemented or if I declare them wrong.
>
> Today I need the function FSMountServerVolumeSync and I declared it
> like this:
> function FSMountServerVolumeSync(const url:CFURLRef;
>      const mountDir:CFURLRef;
>      const user:CFStringRef;
>      const password:CFStringRef;
>      const mountedVolumeRefNum:FSVolumeRefNumPtr):OSStatus;
>   external name '_FSMountServerVolumeSync';
>
> It compiles and links but it crashes (access violation).
>
> What am I doing wrong? Is this only for Cocoa? How can I make it
> available?
>   
I think you foget to use correct calling conventon modifier. As I know 
you should use 'mwpascal' modifier.

Best regards,
Paul Ishenin.



More information about the fpc-pascal mailing list