Click here to Skip to main content
11,805,604 members (56,454 online)
Click here to Skip to main content

Tagged as

Disabling Windows file system redirection on a CFileDialog

, 24 Apr 2010 CPOL 14.9K 2
Rate this:
Please Sign up or sign in to vote.


Windows on Windows 64-bit (WOW64) provides file system redirection. In a 64-bit version of Windows Server 2003 or of Windows XP, the %WinDir%\System32 folder is reserved for 64-bit applications. When a 32-bit application tries to access the System32 folder, access is redirected to the following folder:
By default, file system redirection is enabled.


You can use the following functions to control file system redirection:
  • Wow64DisableWow64FsRedirection
  • Wow64EnableWow64FsRedirection
  • Wow64RevertWow64FsRedirection
The problem is that it is disabled on the current thread. Hence I faced a problem where I could not use CFileDialog Box to access the System32 folder. I searched on the net and could not find an article, so here goes my first article Smile | :)

Using the Code

You should derive a class from CFileDialog. And in the constructor, disable the flags and enable it back again in the destructor Smile | :)

class CFileDialogEx :	public CFileDialog
	PVOID OldValue;


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Kartik Sura
Software Developer
India India
Kartik holds a bachelors degree in Computer Engineering.
He works in VC++ and uses MFC though he ends up using bare Win32 apis. He has worked in Java, .NET and is currently learning COM/DCOM.
He has learnt windows drivers and wishes to pursue it further.

He likes to solve technological problems but not the mathematical ones :P

You may also be interested in...

Comments and Discussions

GeneralReason for my vote of 5 Good Document Pin
Gyu-Sang Cho7-Feb-11 8:44
memberGyu-Sang Cho7-Feb-11 8:44 
Generaldoes not work on post vista Pin
Kartik Sura27-May-10 20:38
memberKartik Sura27-May-10 20:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.151002.1 | Last Updated 24 Apr 2010
Article Copyright 2010 by Kartik Sura
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid