From: Frank Li Date: Sat, 7 Feb 2009 07:08:54 +0000 (+0800) Subject: Add work around to vista explore crash. X-Git-Url: http://git.sourceforge.jp/view?p=tortoisegit%2FTortoiseGitJp.git;a=commitdiff_plain;h=739d387ce95f84b30a6ff10505e2793076d9aec7;ds=sidebyside Add work around to vista explore crash. vista will don't show file overlay. Signed-off-by: Frank Li --- diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index febd592..3b9ad9a 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -126,11 +126,32 @@ BOOL wgEnumFiles_safe(const char *pszProjectPath, const char *pszSubPath, unsign return FALSE; } +BOOL CGit::IsVista() +{ + OSVERSIONINFO osvi; + BOOL bIsWindowsXPorLater; + + ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + + GetVersionEx(&osvi); + + if(osvi.dwMajorVersion >= 6) + return TRUE; + else + return FALSE; +} + static void InitWinGitDll() { __try { + if( CGit::IsVista () ) + { + g_IsWingitDllload=FALSE; + return; + } if ( !wgInit() ) { // TODO diff --git a/src/Git/Git.h b/src/Git/Git.h index 8249a00..97bf1b6 100644 --- a/src/Git/Git.h +++ b/src/Git/Git.h @@ -70,6 +70,7 @@ public: static void StringAppend(CString *str,BYTE *p,int code=CP_UTF8,int length=-1); BOOL IsInitRepos(); + static BOOL IsVista(); }; extern void GetTempPath(CString &path); diff --git a/src/TortoiseShell/ShellCache.h b/src/TortoiseShell/ShellCache.h index 593a0fa..761202b 100644 --- a/src/TortoiseShell/ShellCache.h +++ b/src/TortoiseShell/ShellCache.h @@ -20,6 +20,7 @@ #include "registry.h" #include "Globals.h" #include "GitAdminDir.h" +#include "Git.h" #define REGISTRYTIMEOUT 2000 #define EXCLUDELISTTIMEOUT 5000 @@ -152,7 +153,10 @@ public: cachetype.read(); } //return CacheType(DWORD((cachetype))); - /*TEMP: until TGitCache done*/return CacheType(DWORD((cachetype))) == exe ? dll : CacheType(DWORD((cachetype))); + /*TEMP: until TGitCache done*/ + if(CGit::IsVista()) + return none; + return CacheType(DWORD((cachetype))) == exe ? dll : CacheType(DWORD((cachetype))); } DWORD BlockStatus() {