Changeset 225 in xtideuniversalbios for trunk/Serial_Server/win32
- Timestamp:
- Jan 27, 2012, 6:19:21 PM (13 years ago)
- google:author:
- gregli@hotmail.com
- Location:
- trunk/Serial_Server/win32
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Serial_Server/win32/Win32.cpp
r219 r225 26 26 "", 27 27 " -g [cyl:head:sect] Geometry in cylinders, sectors per cylinder, and heads", 28 " -g without parameters uses CHSmode (default is LBA28)",28 " -g also implies CHS addressing mode (default is LBA28)", 29 29 "", 30 30 " -n [megabytes] Create new disk with given size or use -g geometry", … … 161 161 else if( imagecount < 2 ) 162 162 { 163 if( createFile && cyl == 0 ) 164 { 165 cyl = 65; 166 sect = 63; 167 head = 16; 168 } 163 169 images[imagecount] = new FlatImage( argv[t], readOnly, imagecount, createFile, cyl, head, sect, useCHS ); 164 170 imagecount++; -
trunk/Serial_Server/win32/Win32File.h
r219 r225 18 18 { 19 19 public: 20 voidCreate( char *p_name )20 int Create( char *p_name ) 21 21 { 22 22 fp = CreateFileA( p_name, GENERIC_WRITE, 0, 0, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0 ); 23 if( !fp ) 24 log( -1, "'%s', could not create file", p_name ); 23 24 if( fp == INVALID_HANDLE_VALUE ) 25 { 26 if( GetLastError() == ERROR_FILE_EXISTS ) 27 { 28 log( 0, "'%s', file already exists", p_name ); 29 return( 0 ); 30 } 31 else 32 log( -1, "'%s', could not create file", p_name ); 33 } 34 25 35 name = p_name; 36 37 return( 1 ); 26 38 } 27 39 … … 29 41 { 30 42 fp = CreateFileA( p_name, GENERIC_READ|GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 ); 31 if( !fp ) 43 44 if( fp == INVALID_HANDLE_VALUE ) 32 45 log( -1, "'%s', could not open file", p_name ); 46 33 47 name = p_name; 34 48 } … … 78 92 79 93 if( !ReadFile( fp, buff, len, &out_len, NULL ) || len != out_len ) 80 log( -1, "'%s', ReadFile failed" );94 log( -1, "'%s', ReadFile failed", name ); 81 95 } 82 96 … … 86 100 87 101 if( !WriteFile( fp, buff, len, &out_len, NULL ) || len != out_len ) 88 log( -1, "'%s', WriteFile failed" );102 log( -1, "'%s', WriteFile failed", name ); 89 103 } 90 104 -
trunk/Serial_Server/win32/Win32Serial.h
r219 r225 40 40 41 41 pipe = CreateNamedPipeA( PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE|PIPE_REJECT_REMOTE_CLIENTS, 2, 1024, 1024, 0, NULL ); 42 if( !pipe)42 if( pipe == INVALID_HANDLE_VALUE ) 43 43 log( -1, "Could not CreateNamedPipe " PIPENAME ); 44 44 … … 62 62 63 63 pipe = CreateFileA( name, GENERIC_READ|GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 ); 64 if( !pipe)64 if( pipe == INVALID_HANDLE_VALUE ) 65 65 log( -1, "Could not Open \"%s\"", name ); 66 66
Note:
See TracChangeset
for help on using the changeset viewer.