Please enable JavaScript to view this site.

Bug Validator Help

Navigation: Native API

Native API Reference

Scroll Prev Top Next More

 

Unicode or ANSI?

 

All the API functions are provided in Unicode and ANSI variants where strings are used. We've also provided a character width neutral #define in the same fashion that the Windows.h header files do.

 

For example the function for naming a heap is provided as bvSetHeapNameA(), bvSetHeapNameW() with the character width neutral bvSetHeapName() mapping to bvSetHeapNameW() for unicode and bvSetHeapNameA() for ANSI.

 

In this document we're going to use TCHAR like the Window.h header files do.

 

All the API functions are declared as extern "C", so they can be used by C users and C++ users.

 

To use these functions #include svlBVAPI.h into your code.

 

 

bvLoadProfiler

 

Loads the profiler DLL into memory, but does not start the profiler.

 

For most use cases won't need to load the profiler, as the profiler will have been loaded when your launched your program from Bug Validator, or when you injected into your program using Inject or Wait For Application.

 

However if you're running your program from outside of Bug Validator and want to load the profiler from inside your program you can use bvLoadProfiler() to do that. You'll then need to call bvStartProfiler() to start it.

 

extern "C" 

void bvLoadProfiler();

 

Do not use this function if you are working with services, use the NT Service API.

 

 

bvStartProfiler

 

To start the profiler from your API code you need to call the function "startProfiler" from your code before you call any API functions. Ideally you should call this function as early in your program as possible.

 

extern "C" 

void bvStartProfiler();

 

If you prefer to start the profiler from the user interface or command line you can omit the startProfiler() call. You can leave it present if you wish to start Bug Validator from your program.

 

Do not use this function if you are working with services, use the NT Service API.

 

 

bvSetThreadName()

 

Sets the name of a thread.

 

extern "C" 
void bvSetThreadName(DWORD                threadID

                     const TCHAR        *name);

 

 

bvSetThreadNameA()

 

Sets the name of a thread.

 

extern "C" 
void bvSetThreadNameA(DWORD                threadID

                      const char        *name);

 

 

bvSetThreadNameW()

 

Sets the name of a thread.

 

extern "C" 
void bvSetThreadNameW(DWORD                threadID

                      const wchar_t        *name);

 

 

bvSetCollect()

 

Enables or disables data collection - i.e. whether data is sent to Bug Validator from your target application.

 

extern "C" 
void bvSetCollect(int enable); // TRUE to enable, FALSE to disable

 

 

bvGetCollect()

 

Returns whether data collection is on.

 

extern "C" 
int bvGetCollect();                 // Returns TRUE or FALSE