How to build Dokan library
Build Envrionment
You need WDK(Windows Driver Kit). You can get WDK through Microsoft Connect Web site for free.
http://www.microsoft.com/whdc/DevTools/WDK/WDKpkg.mspx
https://connect.microsoft.com
Build
When you unzip the dokan source codes, you can get the following folders.
- \dokan (user-mode library dokan.dll)
- \dokan_control (control program dokanctl.exe)
- \dokan_mirror (sample program)
- \dokan_mount (mount service mounter.exe)
- \sys (driver dokan.sys)
After installing WDK, launch the build environment from the Start menu. Change the directory to dokan source code.
Run “build /wcbg” command within each folders.
Install Driver
Now you can get binary programs for example under “\dokan\objchk_wlh_x86\i386″.
You need dokan.dll dokan.sys dokanctl.exe mounter.exe mirror.exe
Copy dokan.sys under \Windows\system32\drivers
Copy dokan.dll under \Windows\system32
Place dokanctl.exe and mounter.exe in the same folder.
Run “dokanctl.exe /i a” This means register the driver and the service to Windows.
You can also do them separately.
“dokanctl.exe /i d” Install driver.
“dokanctl.exe /i s” install service.
If you update your driver, you MUST restart your computer after uninstalling previous version.
Test the driver
You can get version information when you run “dokanctl.exe /v”.
Sample program
Run “mirror.exe /r c:\ /l m”. This means mirror C drive under M drive. Can you see M drive?
To unmount M drive, run “dokanctl.exe /u m”
Uninstall Driver
“dokanctl.exe /r a” Uninstall both driver and service.
“dokanctl.exe /r d” Uninstall driver.
“dokanctl.exe /r s” Uninstall service.
You should restart your computer after uninstalling driver.
For Windows X64 version
You are required a code signing certification to install driver to Windows Vista x64. You can disable driver signature enforcement using ReadyDriver Plus.
Windbg
You can debug the driver with Windbg. You need to turn debug mode on. See details.
Recent Comments