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 8062687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:45:19+00:00 2026-06-05T10:45:19+00:00

I am updating a rather old application. It used INI file accesses all around

  • 0

I am updating a rather old application. It used INI file accesses all around the code, creating and freeing INI-accessing class instances here and there.

I want to centralize this to several single instances, one per used file.
So we’d get rid of instances creating/freeing copy-pasted everywhere and would have freedom to completely replace those classes would be decision to switch from INI to other settings storage.

Should one call WritePrivateProfileString(NULL, NULL, NULL…) to apply the changes?
Assume that:
1) the access goes directly to real INI-files, not to registry mapped ones.
2) OS is of NT family (maybe rarely Win2000, most probably WinXP and later). Win9x/ReactOS/WinE/Odin/etc are not cared about.

So, should we flush the ini savings now explicitly or not ?

NT does not cache Registry key writes, do no need to regFlushKey now.
But what about INI files?

MSDN page about WritePrivateProfileString only describes flushing technique wrt Win9x and NT File-to-Reg mappings. It is silent about real INI files.

  • 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. Editorial Team
    Editorial Team
    2026-06-05T10:45:20+00:00Added an answer on June 5, 2026 at 10:45 am

    The documentation contradicts itself (my bold):

    The system keeps a cached version of the most recent registry file mapping to improve performance. If all parameters are NULL, the function flushes the cache. While the system is editing the cached version of the file, processes that edit the file itself will use the original file until the cache has been cleared.

    Is Windows caching the mapping or a file (what file)? But the comment in the sample code makes it clear:

    // Force the system to read the mapping into shared memory 
    // so that future invocations of the application will see it 
    // without the user having to reboot the system
    

    It is the registry file mapping that is cached. If you alter the mapping in the registry then you need to tell Windows to refresh its cache.

    This is also consistent with usage of the API in Windows 3.1, where you didn’t need to flush anything. It’s unlikely that Windows would fundamentally change the usage of the API.

    To double-check, I called WritePrivateProfileString while running Process Monitor. As expected, Windows opens the INI file, updates it and closes it again.

    No flushing required.

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

Sidebar

Related Questions

I am currently updating a few settings in a rather large *.exe.config file via
I have several update methods in a javascript file, used for updating my ajax
Updating an old piece of software but in order to maintain backward compatibility I
After updating to Parsec 3.1 from 2.x, code using many1, such as word =
After updating to XCode 4.3, all my archives built using XCode 4.2 are gone.
I'm maintaining an old-ish application written in VBA for Excel 2002 (XP)/2003, and am
I'm working on updating a project which uses the following code to place a
What file extensions are used most commonly by different languages? Please don't put source
I am writing a class where the same xml is used between some methods.
hi im recurringly updating this map and i noticed its acumulating items rather than

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.