Disable Error Detection Profiling for calls to Third Party libraries

Disable Error Detection Profiling for calls to Third Party libraries

Problem:

When a module is called under Error Dectection, all code within the module, including calls to third party modules are profiled. At times this can present a problem with time sensitive calls to these modules, whereby an attempted call will terminate if not completed within a specific time period.

Resolution:

There is a undocumented method to temporarily disable profiling on  code segments that make this call.

In the source file which calls the third-party extension, add the following code:

// Numega Extension Library #include <NMAPILIB.h> #pragma comment(lib,"NMAPILIB.lib")

Modify the project settings to include this in the list of additional INCLUDE and LIB directories.  Alter as appropriate if you install DevPartner to a non-default directory or drive.

"C:\Program Files (x86)\Micro Focus\DevPartner Studio\BoundsChecker\ERptApi\"

Finally, wrap the call to the third party code with the following:

      // Turn off BoundsChecker API pre and post processing.       bool fPreviousMode = Numega::NMSetHookMode ( false ) ;

      // Call the third party code here.

      // Restore BoundsChecker API processing to what it was before.       Numega::NMSetHookMode ( fPreviousMode ) ;

This does not disable all Error Detection profiling and if during that third-party processing DLLs are loaded, performance may still be slow.

This should be used infrequently, as it deprives Error Detection of the profiling data information needed for accurate reporting.

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2016-05-11 20:36
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.