- Timestamp:
- Oct 16, 2013 8:04:59 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/winphone/pjlib/src/pj/file_access_win32.c
r3553 r4618 34 34 #endif 35 35 36 static HANDLE WINAPI create_file(LPCTSTR filename, DWORD desired_access, 37 DWORD share_mode, 38 LPSECURITY_ATTRIBUTES security_attributes, 39 DWORD creation_disposition, 40 DWORD flags_and_attributes, 41 HANDLE template_file) 42 { 43 #ifdef PJ_WIN32_WINPHONE 44 return CreateFile2(filename, desired_access, share_mode, 45 creation_disposition, NULL); 46 #else 47 return CreateFile(filename, desired_access, share_mode, 48 security_attributes, creation_disposition, 49 flags_and_attributes, template_file); 50 #endif 51 } 36 52 37 53 /* … … 45 61 PJ_ASSERT_RETURN(filename != NULL, 0); 46 62 47 hFile = CreateFile(PJ_STRING_TO_NATIVE(filename,wfilename,sizeof(wfilename)), 48 CONTROL_ACCESS, 49 FILE_SHARE_READ, NULL, 50 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); 63 hFile = create_file(PJ_STRING_TO_NATIVE(filename, 64 wfilename,sizeof(wfilename)), 65 CONTROL_ACCESS, 66 FILE_SHARE_READ, NULL, 67 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); 68 51 69 if (hFile == INVALID_HANDLE_VALUE) 52 70 return 0; … … 69 87 PJ_ASSERT_RETURN(filename != NULL, -1); 70 88 71 hFile = CreateFile(PJ_STRING_TO_NATIVE(filename, wfilename,sizeof(wfilename)), 72 CONTROL_ACCESS, 73 FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, 74 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); 89 hFile = create_file(PJ_STRING_TO_NATIVE(filename, 90 wfilename,sizeof(wfilename)), 91 CONTROL_ACCESS, 92 FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, 93 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); 75 94 if (hFile == INVALID_HANDLE_VALUE) 76 95 return -1; … … 178 197 PJ_ASSERT_RETURN(filename!=NULL && stat!=NULL, PJ_EINVAL); 179 198 180 hFile = CreateFile(PJ_STRING_TO_NATIVE(filename,wfilename,sizeof(wfilename)), 181 CONTROL_ACCESS, 182 FILE_SHARE_READ, NULL, 183 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); 199 hFile = create_file(PJ_STRING_TO_NATIVE(filename, 200 wfilename,sizeof(wfilename)), 201 CONTROL_ACCESS, 202 FILE_SHARE_READ, NULL, 203 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); 184 204 if (hFile == INVALID_HANDLE_VALUE) 185 205 return PJ_RETURN_OS_ERROR(GetLastError());
Note: See TracChangeset
for help on using the changeset viewer.