Article ID: 935788 - Last Review: October 11, 2007 - Revision: 1.2 Data is written to a file on a network share even though the WriteFile function returns a value of 0 for the lpNumberOfBytesWritten parameter when you run a custom application in Windows Vista or Windows Server 2003 SP1 or a later versionSYMPTOMSConsider the following scenario. You create a custom application on a computer that is running Windows Vista or Microsoft Windows Server 2003 with Service Pack (SP1) or a later version. The custom application opens a file on a network share for write access. Additionally, the custom application uses the WriteFile function to write data to the file. When you run the custom application, you experience the following symptoms:
The following is an example of a scenario in which you experience this behavior.
CAUSE This behavior may occur if the following conditions are true:
WORKAROUNDTo work around this behavior, set the file attributes to reflect the extended size of the file before you use the WriteFile function to extend the file. To do this, you can use the SetEndOfFile function.
Important This workaround applies only to the example scenario that the "Symptoms" section mentions. Use this method to work around the scenario in which the WriteFile function returns a "STATUS_DISK_FULL" error message. MORE INFORMATIONFor more information about the WriteFile function, visit the following Microsoft Web site: http://msdn2.microsoft.com/en-us/library/aa365747.aspx
(http://msdn2.microsoft.com/en-us/library/aa365747.aspx)
For more information about the SetEndOfFile function, visit the following Microsoft Web site:
http://msdn2.microsoft.com/en-us/library/aa365531.aspx
(http://msdn2.microsoft.com/en-us/library/aa365531.aspx)
APPLIES TO
| Article Translations
|

Back to the top
