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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:39:13+00:00 2026-05-15T21:39:13+00:00

On Windows Server 2008 R2 the following very simple program behaves different on system

  • 0

On Windows Server 2008 R2 the following very simple program behaves different on system disk and on any other disk. Seems that on system disk FILE_FLAG_WRITE_THROUGH makes something …

On disk C: (system disk, commodity SATA, no RAID)

$ time ./test.exe

real    1m8.281s
user    0m0.000s
sys     0m0.015s

On disk E: (another physical SATA disk)

$ time ./test.exe

real    0m5.445s
user    0m0.000s
sys     0m0.000s

–

#include <stdio.h>
#include <windows.h>

#define BUFFER_SIZE   1024
#define ITERATIONS    10240
#define FILEFLAGS     FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH

BYTE   buff[BUFFER_SIZE];

BOOL SyncWriteFile(HANDLE fd,
                   LPCVOID buf,
                   DWORD to_write) {
    DWORD written = 0, already_written = 0;
 BOOL res = FALSE;

 while(written < to_write) {
  res = WriteFile(fd,
   (BYTE*)buf + written,
   to_write - written,
   &already_written,
   NULL);

  if (FALSE == res)
   return FALSE;
  else
   written += already_written;
 }
    return TRUE;
}

void main() 
{
 HANDLE hFile;
 int i;

 hFile = CreateFile(TEXT("test"),
     GENERIC_READ | GENERIC_WRITE,
     0,
     NULL,
     CREATE_NEW,
     FILEFLAGS,
     NULL);

 if (hFile == INVALID_HANDLE_VALUE) {
    fprintf(stderr, "Could not create test file."); 
    exit(1);
 }

 for(i=0; i<ITERATIONS; i++) {
  SyncWriteFile(hFile, buff, sizeof(buff));
 }

 CloseHandle(hFile);
}
  1. What’s going on?
  2. Can somebody try to reproduce this on Win Server?
  • 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-05-15T21:39:13+00:00Added an answer on May 15, 2026 at 9:39 pm

    It was weird behavior of Samsung SATA 500GB disk (dying?) with SD15 firmware. We’ve fixed eventually this with dd utility and new disk. Everything works ok now. Sorry for “false alarm”.

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

Sidebar

Related Questions

I am running a very simple vbs file on windows server 2008 32 bit
I have the following code. In windows server 2008, the program is correct and
I have the following scenario: - 64bit Windows Server 2008. - 32bit .NET application
we have the following environment: a Windows 2008 Server with Apache 2.2.14 and SVN
When I installed Windows Server 2008 I didn't have the (activation) key. Now that
I have a system with windows server 2008 , Apache httpd 2.2 and trac
I have created an Amazon EC2 Instance that provides Windows Server 2008 with SQL
I have a Virtual Machine running the following: Windows Server 2008 SharePoint 2007 SP1
I am running a server with the following attributes: Windows Server 2008 R2 Standard
I'm running Windows Server 2008 and I am trying to setup the following: A

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.