OSDN Git Service

Add work around to vista explore crash.
authorFrank Li <lznuaa@gmail.com>
Sat, 7 Feb 2009 07:08:54 +0000 (15:08 +0800)
committerFrank Li <lznuaa@gmail.com>
Sat, 7 Feb 2009 07:08:54 +0000 (15:08 +0800)
vista will don't show file overlay.

Signed-off-by: Frank Li <lznuaa@gmail.com>
src/Git/Git.cpp
src/Git/Git.h
src/TortoiseShell/ShellCache.h

index febd592..3b9ad9a 100644 (file)
@@ -126,11 +126,32 @@ BOOL wgEnumFiles_safe(const char *pszProjectPath, const char *pszSubPath, unsign
                return FALSE;\r
 }\r
 \r
                return FALSE;\r
 }\r
 \r
+BOOL CGit::IsVista()\r
+{\r
+       OSVERSIONINFO osvi;\r
+    BOOL bIsWindowsXPorLater;\r
+\r
+    ZeroMemory(&osvi, sizeof(OSVERSIONINFO));\r
+    osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);\r
+\r
+    GetVersionEx(&osvi);\r
+       \r
+       if(osvi.dwMajorVersion >= 6)\r
+               return TRUE;\r
+       else\r
+               return FALSE;\r
+}\r
+\r
 static void InitWinGitDll()\r
 {\r
        __try\r
        {\r
 \r
 static void InitWinGitDll()\r
 {\r
        __try\r
        {\r
 \r
+               if( CGit::IsVista () )\r
+               {\r
+                       g_IsWingitDllload=FALSE;\r
+                       return;\r
+               }\r
                if ( !wgInit() )\r
                {\r
                                // TODO\r
                if ( !wgInit() )\r
                {\r
                                // TODO\r
index 8249a00..97bf1b6 100644 (file)
@@ -70,6 +70,7 @@ public:
        static void StringAppend(CString *str,BYTE *p,int code=CP_UTF8,int length=-1);\r
 \r
        BOOL IsInitRepos();\r
        static void StringAppend(CString *str,BYTE *p,int code=CP_UTF8,int length=-1);\r
 \r
        BOOL IsInitRepos();\r
+       static BOOL IsVista();\r
        \r
 };\r
 extern void GetTempPath(CString &path);\r
        \r
 };\r
 extern void GetTempPath(CString &path);\r
index 593a0fa..761202b 100644 (file)
@@ -20,6 +20,7 @@
 #include "registry.h"\r
 #include "Globals.h"\r
 #include "GitAdminDir.h"\r
 #include "registry.h"\r
 #include "Globals.h"\r
 #include "GitAdminDir.h"\r
+#include "Git.h"\r
 \r
 #define REGISTRYTIMEOUT 2000\r
 #define EXCLUDELISTTIMEOUT 5000\r
 \r
 #define REGISTRYTIMEOUT 2000\r
 #define EXCLUDELISTTIMEOUT 5000\r
@@ -152,7 +153,10 @@ public:
                        cachetype.read();\r
                }\r
                //return CacheType(DWORD((cachetype)));\r
                        cachetype.read();\r
                }\r
                //return CacheType(DWORD((cachetype)));\r
-               /*TEMP: until TGitCache done*/return CacheType(DWORD((cachetype))) == exe ? dll : CacheType(DWORD((cachetype)));\r
+               /*TEMP: until TGitCache done*/\r
+               if(CGit::IsVista())\r
+                       return none;\r
+               return CacheType(DWORD((cachetype))) == exe ? dll : CacheType(DWORD((cachetype)));\r
        }\r
        DWORD BlockStatus()\r
        {\r
        }\r
        DWORD BlockStatus()\r
        {\r