461{
463 WCHAR deviceNameBuffer[0x200];
464 WCHAR FSNameBuffer[0x200];
465
466
472#ifdef NT_NATIVE_MODE
476#endif
478
479#ifndef CDRW_W32
480#ifdef UDF_FORMAT_MEDIA
481 PUDFFmtState
fms =
Vcb->fms;
483#endif
485#endif
486
487 pLockMode = &
488#ifdef UDF_FORMAT_MEDIA
490#endif
492
493
494
495 retry = 1 +
496#ifdef UDF_FORMAT_MEDIA
498#endif
500
501#ifndef NT_NATIVE_MODE
504 i =
sizeof(FSNameBuffer)/
sizeof(FSNameBuffer[0]);
506 &returned, &returned, &returned, FSNameBuffer,
i)) {
507 UDFPrint((
"my_open: FS: %S\n", FSNameBuffer));
508 if(!
wcscmp(FSNameBuffer,
L"Unknown")) {
509 retry++;
510 }
511 } else {
513 }
514 UDFPrint((
"my_open: retry %d times\n", retry));
515
516#endif
517
518 do {
519
520#ifndef NT_NATIVE_MODE
523 UserPrint((
"Warrning: File name is similar to drive letter.\n"
524 " Don't you type semicolon ';' instead of colon ':' ?\n"));
525 }
536 }
537 }
538 }
539#else
541 uniFilename.
Buffer = deviceNameBuffer;
544
552 &ioStatus,
559 0);
563 }
564 }
565 }
566#endif
568#ifndef CDRW_W32
569#ifdef UDF_FORMAT_MEDIA
570 if(
fms->opt_flush ||
fms->opt_probe) {
572 }
573#endif
575#else
577#endif
579#ifndef CDRW_W32
581 retry++;
583 UDFPrint((
"SE_TCB privilege not held\n"));
584 } else
588 continue;
589 } else {
590
596 continue;
597 }
599
600 }
601 UserPrint((
"can't lock volume, retry\n"));
603 continue;
604 }
605#endif
607#ifndef NT_NATIVE_MODE
608
612 goto try_as_file;
613#endif
614 }
615
617 UDFPrint((
"Warning: can't allow extended DASD i/o\n"));
618 }
619
620
623 }
625
626#ifndef NT_NATIVE_MODE
632#else
636 &ioStatus,
643 0);
646 }
647#endif
649
651#ifndef CDRW_W32
653#else
655#endif
656
659#ifndef CDRW_W32
661 retry++;
663 UDFPrint((
"SE_TCB privilege not held\n"));
664 } else
667 continue;
668 }
669 UserPrint((
"can't lock read-only volumem retry"));
671 continue;
672 }
673#endif
674 UserPrint((
"can't lock read-only volume"));
675#ifndef NT_NATIVE_MODE
679 goto try_as_file;
680#endif
681 }
682
683
685 }
686#ifndef NT_NATIVE_MODE
687try_as_file:
688#endif
689
690#ifndef CDRW_W32
691#ifdef UDF_FORMAT_MEDIA
693#endif
695
697#endif
698
700#ifndef NT_NATIVE_MODE
706#else
710 &ioStatus,
717 0);
720 }
721#endif
723
725 if(CantLock) {
726#ifndef CDRW_W32
728#ifdef UDF_FORMAT_MEDIA
730#endif
732#else
734#endif
735 }
736#ifndef CDRW_W32
737 UserPrint((
"error opening device or image file"));
739#ifdef UDF_FORMAT_MEDIA
741#endif
743#else
745#endif
746 }
747 UDFPrint((
" opened as file, h=%x\n",
h));
748 break;
749
752}
#define FILE_COMPLETE_IF_OPLOCKED
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
#define NT_SUCCESS(StatCode)
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI GetVolumeInformationW(IN LPCWSTR lpRootPathName, IN LPWSTR lpVolumeNameBuffer, IN DWORD nVolumeNameSize, OUT LPDWORD lpVolumeSerialNumber OPTIONAL, OUT LPDWORD lpMaximumComponentLength OPTIONAL, OUT LPDWORD lpFileSystemFlags OPTIONAL, OUT LPWSTR lpFileSystemNameBuffer OPTIONAL, IN DWORD nFileSystemNameSize)
ULONG MyLockVolume(HANDLE h, ULONG *pLockMode)
BOOLEAN opt_invalidate_volume
#define MAX_INVALIDATE_VOLUME_RETRY
void my_retrieve_vol_type(PVCB Vcb, PWCHAR fn)
#define FILE_SYNCHRONOUS_IO_NONALERT
#define FILE_NO_INTERMEDIATE_BUFFERING
#define FILE_WRITE_THROUGH
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_CASE_INSENSITIVE
#define FILE_FLAG_NO_BUFFERING
#define InitializeObjectAttributes(p, n, a, r, s)
#define FILE_READ_ATTRIBUTES
#define FSCTL_INVALIDATE_VOLUMES
NTSTATUS NTAPI NtCreateFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength)
#define FSCTL_ALLOW_EXTENDED_DASD_IO
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define MKUDF_CANT_OPEN_FILE
#define MKUDF_CANT_LOCK_VOL
#define IOCTL_UDF_INVALIDATE_VOLUMES
BOOL Privilege(LPTSTR pszPrivilege, BOOL bEnable)
static GLenum _GLUfuncptr fn
DWORD WINAPI GetLastError(void)