]> git.cworth.org Git - apitrace/blobdiff - trace_write.cpp
Large chunk of showing the replay errors.
[apitrace] / trace_write.cpp
index 15d1d1fd06fc18e8428ebcf52a4bc2024dffd5c9..3187b9972ab1ab125fad58f87199de81a8bc9547 100644 (file)
@@ -148,10 +148,6 @@ void Open(void) {
     }
 }
 
-void Close(void) {
-    _Close();
-}
-
 static unsigned call_no = 0;
 
 inline bool lookup(std::vector<bool> &map, size_t index) {
@@ -169,6 +165,15 @@ static std::vector<bool> enums;
 static std::vector<bool> bitmasks;
 
 
+void Close(void) {
+    _Close();
+    call_no = 0;
+    functions = std::vector<bool>();
+    structs = std::vector<bool>();
+    enums = std::vector<bool>();
+    bitmasks = std::vector<bool>();
+}
+
 unsigned BeginEnter(const FunctionSig &function) {
     OS::AcquireMutex();
     Open();
@@ -315,6 +320,9 @@ void LiteralBitmask(const BitmaskSig &bitmask, unsigned long long value) {
     if (!lookup(bitmasks, bitmask.id)) {
         WriteUInt(bitmask.count);
         for (unsigned i = 0; i < bitmask.count; ++i) {
+            if (i != 0 && bitmask.values[i].value == 0) {
+                OS::DebugMessage("apitrace: bitmask %s is zero but is not first flag\n", bitmask.values[i].name);
+            }
             WriteString(bitmask.values[i].name);
             WriteUInt(bitmask.values[i].value);
         }
@@ -344,7 +352,7 @@ void Abort(void) {
 } /* namespace Trace */
 
 
-#ifdef WIN32
+#ifdef _WIN32
 
 #if 0
 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {