顯示具有 Visual Studio 標籤的文章。 顯示所有文章
顯示具有 Visual Studio 標籤的文章。 顯示所有文章

LLVM for Windows Visual Studio 2010/2012

Chandler Caruth 在 GoingNative 2013 上宣布了一個好消息,LLVM 3.4 (開發中)正在如火如荼地移植到 Windows 上,目前初步的成果已經可以使用 Visual Studio 2010/2012 作為 IDE 了,對於習慣 Visual Studio 的人來講應該是個好消息。

alpha 版本可以在這邊下載到:

  • SVN Snapshot: http://llvm.org/builds/
  • 設定上也非常簡單,在 Project > Properties > General > Platform Toolset 改成 LLVM-vs2010 即可。
    llvm_on_windows

試玩了一下發現:

Visual C++ Directories/Inherited Properties Changes

前言

在 Visual C++ 裡頭,C++ Directories 定義了 Visual C++ 這個 IDE 要去哪些路徑下找尋 header files/library files/sources files ,在 2005/2008 裡頭,全域的設定可以在 Tools > Options > Projects and Solutions > VC++ Directories 下找到。

image

圖一、VC++ 2005 下的 VC++ Directories Dialog

這個 dialog 在 VC++ 2010 不復存在了,取而代之的是請使用者使用 property sheet 以及 per-project 的設定。

image

如果好奇為什麼做了這樣的更動,可以參考 [2] 的文章,主要是因為:

  1. 這樣全域的設定太過強大,當使用者有許多 projects 在同一台機器上 build 時,容易混淆出錯。
  2. 因為這個全域的設定檔,是存放在 %LOCALAPPDATA%\Microsoft\VisualStudio\8.0\VCComponents.dat (8.0 為 VC++ 2005,9.0 則是 2008) 這個檔案裡頭,而不是跟著每個專案檔。因此當使用者使用 source control system 時,不會把設定跟著同步到 server 上,check-out 的人也因此無法正確建置專案了。
  3. VCComponents.dat 是給 VCBuild.exe 讀的 INI 檔,而 VC++ 2010 開始改用 MSBuild.exe 來作為統一的 build utility [3] ,因此竟然要改,就連同格式一起換掉吧。

按編:這三個理由實在都很說不過去,不過既然這是 Visual C++ team 的決定,我們也只能接受了 :~

UI 變動

從 2010 之後,變動後的 VC++ Directories 不再放在 Tools > Options > Projects and Solutions > VC++ Directories ,而是以 per-project 方式存在,使用者可以:

  • 對 project 按右鍵,選擇 properties > Configuration Properties > VC++ Directories
  • 或是,從工具列:Project > <your-project-name> properties > Configuration Properties > VC++ Directories

選取 VC++ Directories 。

image

很快地,妳/你會發現,新的 dialog 跟原有的沒什麼差別,而實際上也是,只是現在的變更都是 per-project 的,不再對所有的專案有效,因此若是妳/你想將 Boost library 作為所有 VC++ project 都會使用的函式庫,就沒辦法從這裡完成;也或是,妳/你更新了 Boost 版本,每個已經使用 Boost 又想升級的 projects ,就得手動來更改。

檔案位置與格式變化

說完了使用上的變動,接著是檔案位置的更動,存放的位置從:

%LOCALAPPDATA%\Microsoft\VisualStudio\8.0\VCComponents.dat

換到了:

%LOCALAPPDATA%\Microsoft\MSBuild\v4.0\

下,並且以 Microsoft.Cpp.<Platform>.user 命名:

  • Microsoft.Cpp.ARM.user
  • Microsoft.Cpp.Itanium.user
  • Microsoft.Cpp.Win32.user
  • Microsoft.Cpp.x64.user

image

新的檔案格式稱作:Property sheet ,附檔名 props 。有了這個檔案,我們還是有機會可以做到 2005 & 2008 時的全域設定。先前提到了:為了迎接 MSBuild 的來臨,VC++ 將 INI 格式變成了 XML 格式,所以客製化上還是很簡單的,任選一個 platform 的檔案打開:

image

所以一種修改方式,就是直接用編輯器修改 XML ,看想修改哪些就可以改,值得一提的是,以往在 2005 & 2008 裡頭,路徑名不可以是 Visual C++ 裡頭的 Macro ,現在反倒是可以了,因為 IDE 是將檔案中的值讀入後才做解析。另外一種方式則是透過 Visual C++ 內建的 Property Manager 修改,我們放到下一節介紹。

Inherited Values

wdk803

當 Visual C++ 將 property sheet 讀入後,會當做 Inherited values ,對於當前 project 來說,是不可編輯的,我們必須繞到 props 檔去,或是使用 property manager 編輯。property manager 可以從工具列 > View > Property Manager 找到:

image

叫起 Property Manager 後,可以看到目前 project configuration 所涵蓋的 platform 的設定。 Double click 後,可以看到跳出一個視窗,

image

跳出來的視窗長得很像 project properties ,不過仔細看會發現 Configuration 和 Platform 已經被鎖死成對應的 property sheet 檔所代表的設定,接著,直接編輯,然後存檔,這樣就完成了修改全域 property sheet 了。

VC++ 2010 & VC++2012

值得注意的是,property sheet 放在 MSBuild 的 local app data 下,而目前 2010 和 2012 所使用的 MSBuild 都是 4.0 [4],因此一旦我們修改了 property sheet ,可是會同時影響到 2010 跟 2012 的 ... Orz ...

Reference

  1. Inherited Properties and Property Sheets: http://blogs.msdn.com/b/vsproject/archive/2009/06/23/inherited-properties-and-property-sheets.aspx
  2. VC++ Directories: http://blogs.msdn.com/b/vsproject/archive/2009/07/07/vc-directories.aspx
  3. VCBuild vs. C++ MSBuild on the Command Line: http://blogs.msdn.com/b/vcblog/archive/2010/01/11/vcbuild-vs-c-msbuild-on-the-command-line.aspx
  4. MSBuild Toolset: http://msdn.microsoft.com/en-us/library/bb383796.aspx

VC++ 2012 Can't Build Driver Project

這幾天終於趁著聽課的空檔,把電腦裝了 VC++ 2012 ,這版的一大特色:整合了 device driver 的開發。很快地試玩了一下它的 project wizard :

wdk801

結果,很不幸地失敗 ...

1>C:\Program Files (x86)\Windows Kits\8.0\Include\KM\wdm.h(10920): fatal error C1003: error count exceeds 100; stopping compilation

再看一下 Error list:

Error    1    error C2220: warning treated as error - no 'object' file generated    C:\Program Files (x86)\Windows Kits\8.0\Include\shared\sal.h    2884
Error    4    error C2054: expected '(' to follow '_IRQL_requires_same_'    C:\Program Files (x86)\Windows Kits\8.0\Include\shared\ntdef.h    1897
Error    5    error C2085: 'EXCEPTION_ROUTINE' : not in formal parameter list    C:\Program Files (x86)\Windows Kits\8.0\Include\shared\ntdef.h    1903
Error    6    error C2085: 'EXCEPTION_ROUTINE' : not in formal parameter list    C:\Program Files (x86)\Windows Kits\8.0\Include\shared\ntdef.h    1905
Error    7    error C2143: syntax error : missing ';' before '*'    C:\Program Files (x86)\Windows Kits\8.0\Include\shared\ntdef.h    1905
Error    8    error C2143: syntax error : missing ')' before 'constant'    C:\Program Files (x86)\Windows Kits\8.0\Include\KM\wdm.h    10384
Error    9    error C2143: syntax error : missing '{' before 'constant'    C:\Program Files (x86)\Windows Kits\8.0\Include\KM\wdm.h    10384
Error    10    error C2059: syntax error : '<Unknown>'    C:\Program Files (x86)\Windows Kits\8.0\Include\KM\wdm.h    10384

真的是很 ooxx 。問題都是發生在 sal.h, ntdef.h wdm.h 等等基本的 header files 裡。

這類的問題通常是發生在 include 了錯誤的 header files ,所以回頭檢視 solution property : Project >  Properties > Configuration Properties > VC++ Directories 。

image

include directories 多了很多路徑,其他像是 Executable Directories 、Library Directories 也有一樣的問題。嗯嗯,VC++ 2012 匯入了電腦上其他版本 VC++ 的設定,可能的原因之一:安裝完 2012 、第一次啟動時,我允許了 2012 去找尋舊版本的設定並匯入所導致。再點開 Include Directories 看一下:

image

發現這些多餘的路徑都是來自 Inherited values 。這裡,我試了兩種解決方式:

  1. 解法一
    取消 Inherit from parent or project defaults ,然後重新把需要的路徑一個一個加回去,也就是手動把
    $(ProjectDir)、$(CRT_INC_PATH)、$(ddk_INC_PATH)、$(KIT_SHARED_INC_PATH) 加上去。手動作這件事除了麻煩外,還只能用在這個 project 上,也就是一旦我開了新的 driver solution 或是在當下 solution 下新增新的 driver project 都得重做一次。
  2. 解法二
    比較一勞永逸, VC++ 把這個 Inherited Values 定義在 C:\Users\<user-name>\AppData\Local\Microsoft\MSBuild\v4.0 下的檔案裡頭,檔案是根據不同 configuration 而命名:
    Microsoft.Cpp.ARM.user.props
    Microsoft.Cpp.Itanium.user.props
    Microsoft.Cpp.Win32.user.props
    Microsoft.Cpp.x64.user.props
    *.props 是 XML 格式,把不用的 path 都清除乾淨,只留下 default value 就可以了。
    <?xml version="1.0" encoding="utf-8"?>
    <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <ExecutablePath>$(ExecutablePath)</ExecutablePath>
        <IncludePath>$(IncludePath)</IncludePath>
        <ReferencePath>$(ReferencePath)</ReferencePath>
        <LibraryPath>$(LibraryPath)</LibraryPath>
        <SourcePath>$(SourcePath)</SourcePath>
        <ExcludePath>$(ExcludePath)</ExcludePath>
      </PropertyGroup>
    </Project>

    這個方法是比較一勞永逸,不過有個大缺點:不同版本的 Visual C++ 會共用這個檔案。像我的電腦修改了後, VC++ 2010 的 VC++ project 的預設值也會受到影響,但已經產生的、既有 project 則不受影響,算是不幸中的大幸。

How to Deploy my Visual C++ Applications, Part 1

前言

寫程式的人常常會寫了一些應用程式或小工具後,想把它拿到另外一台電腦上測試或是分享給親朋好友,此時若是對方的電腦沒有安裝 Visual Studio,往往會遇到一個問題:對方無法執行我們的程式!

中文版錯誤訊息:ScreenHunter_02 Apr. 25 20.41

無法啟動這個應用程式,因為應用程式的設定不正確。重新安裝應用程式應該可以修復這個問題。

英文版錯誤訊息:(我沒有英文版 Windows ,只好上網偷)

ScreenHunter_01 Apr. 25 22.11

This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

每當我遇到這種情況的時候,我都會想起研究所的學弟 DNA !當然不是想他這個人,是想起他說的話:

What The Fuck! (WTF)

這當然有一些解決方式:

  1. static link、
  2. 找出所有的 dependency ,然後包一包丟過去、
  3. 做個 release build ,然後找 MS 出的轉散發套件(redistributable package)請對方安裝、
  4. 做個安裝程式,把所有東西包一包!

解決方式

這裡就介紹最簡單的解決方式:copy!Visual C++ 的散佈套件放在:

安裝目錄\VC\redist

若是散佈 release 版本,就在這資料夾下根據平台選擇,若是 debug 版本,就選擇 Debug_NonRedist 這個子目錄,進去後一樣根據平台選擇下一個目錄。

image

不論是 release 版或是 debug 版,目錄都會根據函式庫類型分類好,不過 debug 似乎比 release 少了些東西:

  • Microsoft.VC80.ATL
  • Microsoft.VC80.MFCLOC

不確定是不是因為 debug 版沒有上面兩者或是包含在 DebugMFC 裡頭了

ScreenHunter_03 Apr. 25 22.27 Microsoft Visual Studio 8\VC\redist\Debug_NonRedist\x86 的 layout,給 debug build 用

ScreenHunter_04 Apr. 25 22.27Microsoft Visual Studio 8\VC\redist\x86 的 layout,給 release build 用

剩下要做的就是把跟你程式相關的函式庫一同 copy 給對方就可以了,不過這只解決了與 Visual C++ 相關的相依性,其他的程式用到的函式庫,就得靠自己尋找一下。

基於好奇,再往 CRT 的資料夾裡頭看一下,那麼你會發現裡頭有四個檔案:(節錄自C Run-Time Library (CRT))

  1. Microsoft.VC80.DebugCRT.manifest
    Side-by-side assembly 不可或缺的一環,是微軟在 .Net 提出的架構,用來管理程式、元件的相依性。竟然說是不可或缺了,記得一定要 copy 這個檔案過去。
  2. msvcr80d.dll
    Multithreaded, dynamic link (import library for MSVCR80.DLL). Be aware that if you use the Standard C++ Library, your program will need MSVCP80.DLL to run.
  3. msvcp80d.dll
    Standard C++ Library
  4. msvcm80d.dll
    C Runtime import library. Used for mixed managed/native code. 如果程式沒用到 managed code,這個就不需要!

image

 

Reference

  1. MSDN: How to: Deploy using XCopy
  2. This application has failed to start because the application configuration is incorrect
  3. MSDN: C Run-Time Library (CRT)

CreateProcess()

今天下午在寫程式的時候被一個奇怪的問題給卡住,我寫的程式去呼叫 CreateProcess() 但一直跳出下面的錯誤訊息:

ScreenHunter_02 Dec. 24 19.07

原來問題出在我使用 Windows 的 CreateProcess() 這個 api 的方法錯誤,先來偷看一下 MSDN 的函式原型:

BOOL WINAPI CreateProcess(
  __in_opt     LPCTSTR lpApplicationName,
  __inout_opt  LPTSTR lpCommandLine,
  __in_opt     LPSECURITY_ATTRIBUTES lpProcessAttributes,
  __in_opt     LPSECURITY_ATTRIBUTES lpThreadAttributes,
  __in         BOOL bInheritHandles,
  __in         DWORD dwCreationFlags,
  __in_opt     LPVOID lpEnvironment,
  __in_opt     LPCTSTR lpCurrentDirectory,
  __in         LPSTARTUPINFO lpStartupInfo,
  __out        LPPROCESS_INFORMATION lpProcessInformation
);

其實問題的癥結很簡單,就出在第二個參數身上,為什麼 lpCommandLine 的型別是 LPTSTR 而不是 LPCTSTR 呢?理由很簡單,因為系統會去更改這個參數,所以 MSDN 也用了 __inout_opt 來修飾這個參數,因此我們不能傳一個 read only 的記憶體區塊到這個參數來。引用一下 MSDN 的說明:

The Unicode version of this function, CreateProcessW, can modify the contents of this string. Therefore, this parameter cannot be a pointer to read-only memory (such as a const variable or a literal string). If this parameter is a constant string, the function may cause an access violation.

有趣吧?!只有 Unicode 版本的 CreateProcess 會修改這個參數,所以下面的程式碼可以 work:

wchar_t cmd[ 100 ] = L"notepad D:\\mt.txt"; 
CreateProcessW( NULL, cmd, NULL, NULL, false, 0, NULL, NULL, &si, &pi ); 
CreateProcessA( NULL, "notepad D:\\mt.txt", NULL, NULL, false, 0, NULL, NULL, &si, &pi );

但下面的程式碼是不能 work:

CreateProcessW( NULL, L"notepad D:\\mt.txt", NULL, NULL, false, 0, NULL, NULL, &si, &pi );

是不是有點不 consistent 呢?

此外,眼尖的人可能會發現為什麼一個 LPTSTR (即TCHAR*) 型別可以接受一個型別為 const TCHAR array 呢?C++ standard 2.13.4 不是這樣說的嗎?

A string literal is a sequence of characters (as defined in 2.13.2) surrounded by double quotes, optionally beginning with the letter L, as in "..."or L"...".  A string literal that does not begin with L is an ordinary string literal, also referred to as a narrow string literal.  An ordinary string literal has type “array of n const char” and static storage duration (3.7), where n is the size of the string as defined below, and is initialized with the given characters. A string literal that begins with L, such as L"asdf", is a wide string literal.  A wide string literal has type “array of n const wchar_t” and has static storage duration, where n is the size of the string as defined below, and is initialized with the given characters.

怎麼 VC++ 連個 warning 都不給呢?這是因為 C++ 為了相容於 C 所做出的讓步,來看一下 4.2  Array-to-pointer conversion 的描述:

A string literal (2.13.4) that is not a wide string literal can be converted to an rvalue of type “pointer to char”; a wide string literal can be converted to an rvalue of type “pointer to wchar_t”.  In either case, the result is a pointer to the first element of the array.  This conversion is considered only when there is an explicit appropriate pointer target type, and not when there is a general need to convert from an lvalue to an rvalue.

因此,比較好的習慣是:總是用 const char/wchar_t* 去指向一塊 literal string。Scott Meyer 不就說了嗎?

Use const whenever possible

: )

#include <iostream>
#include <typeinfo>
using namespace std;

void foo( char* msg )
{
    cout << "[foo( char* msg )] " << msg << endl;
}
void foo( const char* msg )
{
    cout << "[foo( const char* msg )] " << msg << endl;
}

template<typename T>
void printType( T* x )
{
    cout << "type of T: " << typeid( T ).name() << endl;
}

void badCall()
{
    throw "Exception";
}

int main()
{
    foo( "Hello World" );
    printType( "Hello World" );

    try {
        badCall();
    }
    catch ( const char* msg ) {
        cerr << "[const char* msg] " << msg << endl;
    }
    catch ( char* msg ) {
        cerr << "[char* msg] " << msg << endl;
    }

    return 0;
}

我可沒說上面的 code 可以順利 compile 唷~

簡單利用 Visual Studio 2005 產生 C/C++ 的 asm

  1. 開啟專案屬性(Project Properities)
    step 1
  2. 選擇 C/C++ -> Output Files -> Assembler Output
    step 2
  3. Output 的類型有四種:  step 3
    • Assembly-Only Listing。產生一個 *.asm 檔。檔案中只有組語,並有 ; Line 2 這類註解告訴我們,下列組語是從那一行轉換出來的。Assembly-Only Listing (FA)
    • Asssembly, Machine Code and Source (/FAcs) 。產生一個 *.cod (C/C++ code listing) 檔案,並有 ; 3 : int c = a + b; 這類註解,標示了原始碼,所以比較適合用在與原始碼的比較。另外也輸出 machine code ,就是那些四個十六進位一組的數字。Assembly, Machine Code and Source (FAcs)
    • Assembly with Machine Code。一樣是 *.cod 的輸出,註解沒有原始碼的嵌入,但有 machine code 。Assembly With Machine Code (FAc)
    • Aseembly with Source Code。因為沒有 machine code 的輸出需求,可以產生 *.asm 檔,版面更精簡了,也蠻適合用在與逐行研究 C/C++ -> assembly code 的比較。Assembly With Source Code (FAs)

P.S. 明眼人也知道這篇是騙文章數的…

編譯 Boost 1.35.0 (Visual Studio 2005 (VC 8.0) + Windows XP)

簡介

  1. Boost 的原始碼可以在官網 http://www.boost.org 找到,或是直接到 sourceforge 下載,網址是:http://tinyurl.com/m7jqo
  2. Boost 有著自己一套的建置系統,叫做 Boost.Build [1],可用在編譯、 安裝、測試等功能上。Boost.Build 則是架構於 Boost.Jam, Boost.Jam 又是 Perforce Jam[2] 的衍生,更詳細的介紹可以在 [3] 看到。
  3. 通常在 Windows 上安裝 Boost ,最快速、簡易的方法是去 Boost Consulting 下載 installer [4],不過到今天為止, Boost 1.35.0 的 installer 都還沒 release。所以大家來學學自己編譯吧 : )
  4. Boost Getting Started on Windows [5] 是一篇官方的教學文件,有簡易的 bjam 使用方法,但無註明完整安裝的步驟,另外它也簡介了Boost Project 的 layout, simple usage 等等。
  5. Boost 身為最先進、標準的 C++ library ,它大量使用了 generic programming, metaprogramming 等技巧,使得實際上需要編譯成函式庫(.lib, .dll)的部份反而少了,根據 Boost Getting Started on Windows [5] 的說明,只有以下幾個 library 使用時,一定需要先編譯成函式庫(.lib, .dll):
    1. Boost.Filesystem
    2. Boost.IOStreams
    3. Boost.ProgramOptions
    4. Boost.Python
    5. Boost.Regex
    6. Boost.Serialization
    7. Boost.Signals
    8. Boost.Thread
    9. Boost.Wave

    還有幾個則是 optional:

    1. Boost.DateTime
    2. Boost.Graph
    3. Boost.Test

安裝步驟

  1. 下載 source code 並解壓縮。
  2. 使用 Open Visual Studio 2005 Command Prompt 進入 cmd。利用 Open Visual Studio 2005 Command Prompt 的原因有兩點:
    1. 方便呼叫 namke, cl 等 vc toolchain。
    2. 若是電腦上安裝多個編譯器,使用 Open Visual Studio 2005 Command Prompt 通常可透過環境變數,讓 bjam 使用正確的 toolchain。
  3. 取得 bjam.exe。
    1. 可以選擇到 Boost 提供的預先編譯好的 binary,可在http://tinyurl.com/2q36f 下載。
    2. 或是自行編譯,以下是編譯步驟:
      1. $> cd your_dir\boost_1_35_0\tools\jam\src
      2. $> build.bat
      3. 執行完後,boost_1_35_0\tools\jam\src\bin.ntx86 下就放著編譯完後的 bjam.exe 了!
  4. 將上一個步驟的 bjam.exe 放入 PATH 環境變數或是使用絕對路徑呼叫 bjam,並搭配以下的 options 就可開始編譯並安裝 boost:
    • $> bjam.exe --build-dir="your_dir\boost_1_35_0" --build-type=complete --toolset=msvc install
    • --build-dir: boost 解壓縮的檔案,記得 = 前後不可有空白!
    • --build-type: complete 會產生 release, debug ,以及各種設定的對應:如 multithread, debug, 等等。
    • install: 編譯完後,將 header, lib 安裝到指定目錄,預設目錄是:C:\Boost,大小約 2 G。
  5. 更多的客製化安裝,可以使用 bjam --help 查看 options。
    • bjam 是個有趣的東西,當我在 your_idr\boost_1_35_0\tools\jam\src\bin.ntx86 下執行 bjam --help 時,它跑出的訊息並不多,而切換到 your_idr\boost_1_35_0 時卻又是另一回事,它跑出豐富的 Boost 的編譯資訊,後來發現它會去讀取 Jamroot 這個檔案,這是格外要注意的一點。

Reference

  1. Boost.Build: http://www.boost.org/doc/libs/1_35_0/tools/build/v2/index.html
  2. Perforce Jam: http://www.perforce.com/jam/jam.html
  3. Install Boost: http://www.boost.org/doc/libs/1_35_0/doc/html/bbv2/installation.html
  4. Free Download on Boost Consulting: http://www.boost-consulting.com/products/free
  5. Boost Getting Started on Windows: http://www.boost.org/doc/libs/1_35_0/more/getting_started/windows.html
  6. Boost 提供的 bjam binary 下載點(包含許多種平台): http://tinyurl.com/2q36f
  7. Boost Source on Sourceforge: http://tinyurl.com/m7jqo

Visual Studio + Version Control

前言

    Visual Studio 是 Windows 上大家常用的 IDE ,它以專案的方式管理你的程式,因此儲存時會有一些額外的檔案出現,並以 Microsoft 自訂的格式儲存著,如果這些檔案都是檔案都是純文字也就還好,要是以 binary 存在,除了會吃掉較多 repository 空間外,也容易造成 version control 上的麻煩…


一些 Version Control 的限制

    以 CVS 為例,它對 binary 的支援較不完善 [1],例如說: cvs diff、conflct 呈現是以 plain text 為原則而設計的,它會以 new line 的方式去逐行比對、進行呈現,因此,我們往往需要使用額外的指令 [2] 去操控 CVS,而有些指令則無法用於 binary 檔上。Essential CVS [3] 一書整理了一些 CVS 無法處理的檔案: 裝置檔、符號連結、無法開啟或修改的檔案;要想處理這類檔案,我們可以用間接的方式:改將用來建立或連接它們的命令檔存入 CVS。
    而 SVN 呢?根據 SVN 的 features [4] ,雖然它號稱處理 binary 的相當有效率,不過它有著和 CVS 類似的不便:

例如 [5] 所說:

  1. Not attempt to automatically merge received changes with local changes during svn update or svn merge
  2. Not show the differences as part of svn diff
  3. Not show line-by-line attribution for svn blame

結論與 Visual Studio

    因此,我們使用 Version Control System 時,通常會盡量不讓 binary 檔存入 repository 以避免一些麻煩和不便。而為了讓 Visual Studio 能讓 Version Control System 合作無間,我們當然也希望過濾一些 binary file,常見的檔案類型與副檔名可以在 MSDN 上找到,如 VS 2005 可參考 [7]。而 VC 常見的 binary file  有: *.ncb (Intellisense Database),用在自動完成、查詢上, VC 會自動更新產生可不必加入 repository 以及 *.suo (Solution User ptions),根據 [6][8] 也可不必加入監控行列。

Reference

  1. CVS and binary files
    http://ximbiot.com/cvs/cvshome/cyclic/cvs/dev-binary.html
  2. CVS and binary files
    http://durak.org/sean/pubs/software/cvsbook/CVS-And-Binary-Files.html
  3. Essential CVS
    http://www.oreilly.com/catalog/cvs/
  4. Subversion's Features
    http://subversion.tigris.org/
  5. Subversion FAQ - How does Subversion handle binary files?
    http://subversion.tigris.org/faq.html#binary-files
  6. 請勿將某些檔案類型的檔案簽入到 Subversion 版本庫
    http://blog.miniasp.com/category/e5b088e6a188e7aea1e79086.aspx
  7. File Types and File Extensions in Visual Studio
    http://msdn2.microsoft.com/en-us/library/xhkhh4zs.aspx
  8. Introducing Source Control
    http://msdn2.microsoft.com/en-us/library/ms171339(VS.80).aspx

MiniFilter InstanceSetupCallback is not called?

一般來說,MiniFilter 的 InstanceSetupCallback 會在 filter manager 把 minifilter attache 到 volume 後呼叫。如果沒有的話,可以檢查一下 minifilter 的 INF 是否把 instance fla...