Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 41697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:13:19+00:00 2026-05-10T15:13:19+00:00

using C++Builder 2007, the FindFirstFile and FindNextFile functions doesn’t seem to be able to

  • 0

using C++Builder 2007, the FindFirstFile and FindNextFile functions doesn’t seem to be able to find some files on 64-bit versions of Vista and XP. My test application is 32-bit.

If I use them to iterate through the folder C:\Windows\System32\Drivers they only find a handful of files although there are 185 when I issue a dir command in a command prompt. Using the same example code lists all files fine on a 32-bit version of XP.

Here is a small example program:

int main(int argc, char* argv[]) {   HANDLE hFind;   WIN32_FIND_DATA FindData;   int ErrorCode;   bool cont = true;    cout << 'FindFirst/Next demo.' << endl << endl;    hFind = FindFirstFile('*.*', &FindData);   if(hFind == INVALID_HANDLE_VALUE)   {     ErrorCode = GetLastError();     if (ErrorCode == ERROR_FILE_NOT_FOUND)     {       cout << 'There are no files matching that path/mask\n' << endl;     }     else     {       cout << 'FindFirstFile() returned error code ' << ErrorCode << endl;     }     cont = false;   }   else   {     cout << FindData.cFileName << endl;   }    if (cont)   {     while (FindNextFile(hFind, &FindData))     {       cout << FindData.cFileName << endl;     }      ErrorCode = GetLastError();     if (ErrorCode == ERROR_NO_MORE_FILES)     {       cout << endl << 'All files logged.' << endl;     }     else     {       cout << 'FindNextFile() returned error code ' << ErrorCode << endl;     }      if (!FindClose(hFind))     {       ErrorCode = GetLastError();       cout << 'FindClose() returned error code ' << ErrorCode << endl;     }   }   return 0; } 

Running it in the C:\Windows\System32\Drivers folder on 64-bit XP returns this:

C:\WINDOWS\system32\drivers>t:\Project1.exe FindFirst/Next demo.  . .. AsIO.sys ASUSHWIO.SYS hfile.txt raspti.zip stcp2v30.sys truecrypt.sys  All files logged. 

A dir command on the same system returns this:

C:\WINDOWS\system32\drivers>dir/p  Volume in drive C has no label.  Volume Serial Number is E8E1-0F1E   Directory of C:\WINDOWS\system32\drivers  16-09-2008  23:12    <DIR>          . 16-09-2008  23:12    <DIR>          .. 17-02-2007  00:02            80.384 1394bus.sys 16-09-2008  23:12             9.453 a.txt 17-02-2007  00:02           322.560 acpi.sys 29-03-2006  14:00            18.432 acpiec.sys 24-03-2005  17:11           188.928 aec.sys 21-06-2008  15:07           291.840 afd.sys 29-03-2006  14:00            51.712 amdk8.sys 17-02-2007  00:03           111.104 arp1394.sys 08-05-2006  20:19             8.192 ASACPI.sys 29-03-2006  14:00            25.088 asyncmac.sys 17-02-2007  00:03           150.016 atapi.sys 17-02-2007  00:03           106.496 atmarpc.sys 29-03-2006  14:00            57.344 atmepvc.sys 17-02-2007  00:03            91.648 atmlane.sys 17-02-2007  00:03           569.856 atmuni.sys 24-03-2005  19:12             5.632 audstub.sys 29-03-2006  14:00             6.144 beep.sys Press any key to continue . . . etc. 

I’m puzzled. What is the reason for this?

Brian

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T15:13:19+00:00Added an answer on May 10, 2026 at 3:13 pm

    Is there redirection going on? See the remarks on Wow64DisableWow64FsRedirection http://msdn.microsoft.com/en-gb/library/aa365743.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 119k
  • Answers 119k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer In the main thread, before spawning the background thread, save… May 11, 2026 at 11:43 pm
  • Editorial Team
    Editorial Team added an answer I think it's something like this: SELECT uid FROM table-b… May 11, 2026 at 11:43 pm
  • Editorial Team
    Editorial Team added an answer What you're talking about is called URL rewriting and yes,… May 11, 2026 at 11:43 pm

Related Questions

using C++Builder 2007, the FindFirstFile and FindNextFile functions doesn't seem to be able to
I have 2 arrays of 16 elements (chars) that I need to compare and
I've had a major annoyance with the C++ Builder IDE for some time now.
I've decided I want to get more into native code development with C++. I'm
One of the vagaries of my development system (Codegear C++Builder) is that some of

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.