• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Mach-O app calling CFM plug-in?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mach-O app calling CFM plug-in?


  • Subject: Mach-O app calling CFM plug-in?
  • From: Philippe Casgrain <email@hidden>
  • Date: Mon, 28 Aug 2006 16:06:08 -0400

Hello,

We have a large legacy application that was CFM-based. It is now Universal (meaning, Mach-O) and we ran into a plug-in problem.

Is it possible for a Mach-O PPC application to call a CFM plug-in? We know how to do the opposite (CFM calling Mach-O), because that's how we use Cocoa technologies in our CFM app.

We believe this is possible because Adobe Photoshop CS2 is a Mach-O application, yet it supports CFM plugins (the vast majority of PS plugins out there are CFM).

For us, we crash right when we call the plugin. Here are some excerpts from our code. Basically, we find the disk fragment and we load it, then we try to execute it (and crash). There are no errors, we get a disk fragment and a pointer to some data, but we can't execute it.

Any clues?

Thanks,
Philippe

------------------------------------------------------------------------------------------

typedef pascal void (*PIProcPtr)(int16, void*, int32*, int16 *);
class PluginInfo {
	CFragConnectionID	piConnID;
	PIProcPtr* MainAddr;
};
PluginInfo* aPluginInfo;
/* ... */
aPluginInfo->piConnID == NULL;
aPluginInfo->MainAddr == NULL;

Str255 myErrName;
Str255 myEntryName;

OSErr err = ::GetDiskFragment(
&(aPluginInfo->piCFS), // identifies the disk-based fragment to load.
aPluginInfo->fContainerOffset, // The number of bytes from the beginning of the
// file's data fork at which the beginning of
// the fragment is located.
aPluginInfo->fContainerLength, // The length (in bytes) of the fragment.
// Specify the constant kWholeFork for this
// parameter if the fragment extends to the
// end-of-file of the data fork.
// Specify a nonzero value for the exact length of
// the fragment.
myEntryName, // An optional name of the fragment.
// (This information is used primarily to allow you
// to identify the fragment during debugging.)
kPrivateCFragCopy, // A bool that specifies the operation to perform on the fragment.
// See the description below for the values you can pass in this parameter.
&(aPluginInfo->piConnID), // On exit, the connection ID that identifies the connection to the fragment.
// You can pass this ID to other Code Fragment Manager routines.
(Ptr*)&(aPluginInfo->MainAddr), // On exit, the main address of the fragment.
// The value returned is specific
// to the fragment itself.
myErrName // On exit, the name of the fragment that could not successfully be loaded.
); // This parameter is meaningful only if the call to GetDiskFragment fails.
if (err == noErr && aPluginInfo->fEntryName.Length() > 0)
{
CFragSymbolClass symclass;
err = ::FindSymbol(aPluginInfo->piConnID, myEntryName, (Ptr*)& (aPluginInfo->MainAddr), &symclass);
}


/* ... */
(*(PIProcPtr)aPluginInfo->MainAddr)(selector, apiPB, apluginData, aresult); // Crashes here


------------------------------------------------------------------------------------------

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Mach-O app calling CFM plug-in?
      • From: Dave Thorup <email@hidden>
    • Re: Mach-O app calling CFM plug-in?
      • From: Rosyna <email@hidden>
  • Prev by Date: Re: Template trouble
  • Next by Date: Re: Mach-O app calling CFM plug-in?
  • Previous by thread: Letterbox Fer Xcode?
  • Next by thread: Re: Mach-O app calling CFM plug-in?
  • Index(es):
    • Date
    • Thread