HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_NTFileTracer.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: Utility Library (C++)
7  *
8  * COMMENTS:
9  * Functions for logging all files that Houdini opens, attempts
10  * to open, or tests for existance. Can be extended to handle
11  * any Windows SDK calls.
12  *
13  * This is useful for debugging--in particular, figuring out
14  * why Houdini won't run or takes a long time to load on a
15  * given system.
16  */
17 
18 #ifndef __UT_NTSysTracer_H__
19 #define __UT_NTSysTracer_H__
20 
21 #include "UT_API.h"
22 #include "UT_Defines.h"
23 #include "UT_SysClone.h"
24 #include <stdio.h>
25 
26 
29 
40 
41  UT_SYSTRACE_ALL = 0xfffffff
42 };
43 
44 
46 {
47 public:
48  // Checks for the environment variable HOUDINI_SYSTRACE, and
49  // if set, calls installSysTracer(). Output goes by default
50  // to stdout (the Houdini console), but can be redirected to
51  // a file by setting the environment variable HOUDINI_SYSTRACE_FILENAME.
52  static bool initTracer( int targets );
53 
54  // This should only be called once (when Houdini terminates).
55  // (It's registered as a UT_Exit callback, so you don't have to
56  // call it explicitly.)
57  static void terminateTracer();
58 
59  // Installs tracing functions for the specified system functions.
60  //
61  // 'targets' can be a combination of one or more of the flags
62  // in UT_SysTraceTargets.
63  //
64  // Returns true on success, false otherwise.
65  //
66  // There is currently no way to uninstall these tracing functions,
67  // however something along those lines would also be easy to
68  // write (the code in UT_NTHooking.h already does this).
69  static bool installSysTracer( int targets, FILE *toFile );
70 
71 private:
72  static bool theTracerInitialized;
73 };
74 
75 
76 #endif // __UT_NTSysTracer_H__
#define UT_API
Definition: UT_API.h:14
UT_SysTraceTargets