Changeset 769 in dev for trunk/ab5.0/jenga


Ignore:
Timestamp:
Mar 28, 2009, 12:12:58 PM (16 years ago)
Author:
イグトランス (egtra)
Message:

読み取りのみのファイル操作の場合、CreateFileでFILE_SHARE_READ指定を追加。コンパイラを同時起動しても正常動作させるための修正。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/jenga/include/common/File.h

    r583 r769  
    1818    std::string Read()
    1919    {
    20         HANDLE hFile = CreateFile( filePath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
     20        HANDLE hFile = CreateFile( filePath.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
    2121        if( hFile == INVALID_HANDLE_VALUE )
    2222        {
     
    3838    bool ReadBinary( Binary &binary )
    3939    {
    40         HANDLE hFile = CreateFile( filePath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
     40        HANDLE hFile = CreateFile( filePath.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
    4141        if( hFile == INVALID_HANDLE_VALUE )
    4242        {
Note: See TracChangeset for help on using the changeset viewer.