How to get files and folders name of windows\\system32 directory for Windows XP 64 bit OS by programming
-
Hi All , I am creating the SDI application for showing the Operating system’s drive explorer tree. This is working fine for all operating system from Win 2K to XP for 32 Bit. But If I check it for Windows XP 64 bit operating system then It is showing strange behave , my all hierarchy of files and folders is coming properly but Files and folder of C:\windows\system32 directory are not coming properly , here it is showing the files and folders of C:\windows\systemWOW64 directory. How to show the actual files and folder of C:\\Windows\\system32 directory ???????? I am using the following code snippet. ShowFileFolder (CString strPath ) { HANDLE hInstance; BOOL bContinue=FALSE; WIN32_FIND_DATA fatr; int iCheck=0; int iLocation; if(strPath.GetAt(strPath.GetLength()-1)!='\\') strPath=strPath+_T("\\"); if(strPath.GetLength()==3) iCheck=1; strPath=strPath+_T("*"); hInstance=FindFirstFile(strPath,&fatr); do { bContinue=FindNextFile(hInstance,&fatr); if(!(wcscmp(fatr.cFileName ,_T("."))==0) && !(wcscmp(fatr.cFileName,_T(".."))==0) && bContinue) { if(fatr.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { if((iLocation=strPath.ReverseFind('*'))!=-1) strPath=strPath.Left(iLocation); ShowFileFolder (strPath); //AddItemToTree(strPath) ; } else { if((iLocation=strPath.ReverseFind('*'))!=-1) strPath=strPath.Left(iLocation); //AddItemToTree(strPath) ; } } }while(hInstance && bContinue); FindClose(hInstance); } ShowFileFolder (“ C:\\Windows\\system32 ”) and ShowFileFolder (“ C:\\Windows\\systemWOW64 ”) showing the same file folder hierarchy but actually both have diff file folders on Windows XP 64 bit OS Regards
-
Hi All , I am creating the SDI application for showing the Operating system’s drive explorer tree. This is working fine for all operating system from Win 2K to XP for 32 Bit. But If I check it for Windows XP 64 bit operating system then It is showing strange behave , my all hierarchy of files and folders is coming properly but Files and folder of C:\windows\system32 directory are not coming properly , here it is showing the files and folders of C:\windows\systemWOW64 directory. How to show the actual files and folder of C:\\Windows\\system32 directory ???????? I am using the following code snippet. ShowFileFolder (CString strPath ) { HANDLE hInstance; BOOL bContinue=FALSE; WIN32_FIND_DATA fatr; int iCheck=0; int iLocation; if(strPath.GetAt(strPath.GetLength()-1)!='\\') strPath=strPath+_T("\\"); if(strPath.GetLength()==3) iCheck=1; strPath=strPath+_T("*"); hInstance=FindFirstFile(strPath,&fatr); do { bContinue=FindNextFile(hInstance,&fatr); if(!(wcscmp(fatr.cFileName ,_T("."))==0) && !(wcscmp(fatr.cFileName,_T(".."))==0) && bContinue) { if(fatr.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { if((iLocation=strPath.ReverseFind('*'))!=-1) strPath=strPath.Left(iLocation); ShowFileFolder (strPath); //AddItemToTree(strPath) ; } else { if((iLocation=strPath.ReverseFind('*'))!=-1) strPath=strPath.Left(iLocation); //AddItemToTree(strPath) ; } } }while(hInstance && bContinue); FindClose(hInstance); } ShowFileFolder (“ C:\\Windows\\system32 ”) and ShowFileFolder (“ C:\\Windows\\systemWOW64 ”) showing the same file folder hierarchy but actually both have diff file folders on Windows XP 64 bit OS Regards
ashtwin wrote:
my all hierarchy of files and folders is coming properly but Files and folder of C:\windows\system32 directory are not coming properly , here it is showing the files and folders of C:\windows\systemWOW64 directory
This is the correct behavior. Win64 virtualizes some parts of the file system and registry for Win32 apps for compatibility reasons. You can disable this feature by calling
Wow64DisableWow64FsRedirection()
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Ford, what's this fish doing in my ear?
-
Hi All , I am creating the SDI application for showing the Operating system’s drive explorer tree. This is working fine for all operating system from Win 2K to XP for 32 Bit. But If I check it for Windows XP 64 bit operating system then It is showing strange behave , my all hierarchy of files and folders is coming properly but Files and folder of C:\windows\system32 directory are not coming properly , here it is showing the files and folders of C:\windows\systemWOW64 directory. How to show the actual files and folder of C:\\Windows\\system32 directory ???????? I am using the following code snippet. ShowFileFolder (CString strPath ) { HANDLE hInstance; BOOL bContinue=FALSE; WIN32_FIND_DATA fatr; int iCheck=0; int iLocation; if(strPath.GetAt(strPath.GetLength()-1)!='\\') strPath=strPath+_T("\\"); if(strPath.GetLength()==3) iCheck=1; strPath=strPath+_T("*"); hInstance=FindFirstFile(strPath,&fatr); do { bContinue=FindNextFile(hInstance,&fatr); if(!(wcscmp(fatr.cFileName ,_T("."))==0) && !(wcscmp(fatr.cFileName,_T(".."))==0) && bContinue) { if(fatr.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { if((iLocation=strPath.ReverseFind('*'))!=-1) strPath=strPath.Left(iLocation); ShowFileFolder (strPath); //AddItemToTree(strPath) ; } else { if((iLocation=strPath.ReverseFind('*'))!=-1) strPath=strPath.Left(iLocation); //AddItemToTree(strPath) ; } } }while(hInstance && bContinue); FindClose(hInstance); } ShowFileFolder (“ C:\\Windows\\system32 ”) and ShowFileFolder (“ C:\\Windows\\systemWOW64 ”) showing the same file folder hierarchy but actually both have diff file folders on Windows XP 64 bit OS Regards