Copy link to clipboard
Copied
In the "SampleExtn" plugin that demonstrates how to write a plugin to work when Acrobat is running in protected mode, the plugin does not attempt to start the broker by calling
sandboxpisdk::InitSandboxPIBrokerIPCChannel(L"SamplePIBroker.exe")
until Adobe Acrobat has fully started, the SampleExtn plugin has been loaded, and the user selects an item from the menu for the SampleExtn plugin.
For my company's Acrobat plugin, we require our users to sign into a server to enable the plugin's features.
Until now, our plugin has never been made to work when Acrobat is in protected mode. Now we are enhancing it to do so.
Until now, our plugin has always automatically signed the user into our server when the plugin is loaded, when Acrobat starts, if the user's login and password was saved from a previous login.
Here is what is happening now that we have modified our plugin to work when Acrobat is in protected mode:
START OF EVENT CHAIN
Our plugin's PluginInit() method is called and registers a callback function "myNotificationCallback" to be called after PluginInit() returns and afer all Acrobat plugins have been initalized. Here is the call:
//Register for an event notification
AVAppRegisterNotification(AVAppDidInitExtensionsNSEL, gExtensionID, ASCallbackCreateNotification(AVAppDidInitExtensions, &myNotificationCallback), NULL);
Our plugin's PluginInit() method returns.
myNotificationCallback() is called.
During myNotificationCallback, we try to call sandboxpisdk::InitSandboxPIBrokerIPCChannel(L"<our broker name>"), to start our plugin's broker. We want to start our plugin's broker so that the login request can be sent through the IPC channel to the broker and then out from the broker over the network.
The call to sandboxpisdk::InitSandboxPIBrokerIPCChannel(L"<our broker name>") crashes. The error is
Exception thrown at 0x000000006D0C8F13 (Acrobat.dll) in Acrobat.exe: 0xC0000005: Access violation reading location 0x0000000000000008.
The entire Acrobat application fails to start because this exception happened in our plugin's code.
END OF EVENT CHAIN
If we change the code to wait until the user selects a menu item to sign in from our plugin's menu, Acrobat starts normally, our plugin gets loaded, and the user can sign in to our plugin's service.
I think we just need a place that happens later in the Acrobat start-up process where we can hook in and automatically sign the user in. I think it would need to happen after Acrobat has finished initializing its sandbox process.
I tried calling
ASCallbackCreateNotification() with "AVAppDidInitExtensions" and I tried calling it with "AVAppDidInitialize" so that our "myNotificationCallback()" function would be called at different times. In both cases, when "myNotificationCallback()" tried to call sandboxpisdk::InitSandboxPIBrokerIPCChannel(L"<our broker name>") , it crashed in the same way.
There look to be scores of notification hooks listed in PIPokes.h. Each one is a different event you can register a callback for. Is there a hook in PIPokes.h that is called afer it is safe to call sandboxpisdk::InitSandboxPIBrokerIPCChannel() ?
How are you signing into the Server? Is it happening silently with the plug-in performing only HTTP operations? Or is there some UI? Is the plug-in directing the user to web page?
If there is no local system interaction needed, i.e., if signing onto the server means performing only HTTP operations, then the broker isn't needed. Pure HTTP ops are not blocked by protected mode.
Copy link to clipboard
Copied
How are you signing into the Server? Is it happening silently with the plug-in performing only HTTP operations? Or is there some UI? Is the plug-in directing the user to web page?
If there is no local system interaction needed, i.e., if signing onto the server means performing only HTTP operations, then the broker isn't needed. Pure HTTP ops are not blocked by protected mode.
Copy link to clipboard
Copied
During a discussion in an SDK community thread for a different question I had asked, it became clear that my company does not need to create a broker to make our Acrobat plugin work when Acrobat is in protected mode.
Because of that, we had no need to continue investigating the original question in this thread, whether there is a hook that can be used to register a function that is called during Acrobat startup after a point in time where it is safe to call InitSandboxPIBrokerIPCChannel() to init a broker for our plugin.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now