File:  [HATARI the Atari ST Emulator] / hatari / src / createDiscImage.c
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Mon Apr 1 07:10:16 2019 UTC (7 years, 2 months ago) by root
Branches: hatari, MAIN
CVS tags: hatari00045, hatari00040, hatari00030, hatari00025, HEAD
hatari 0.25

/*
  Hatari

  Create Disc Image functions
*/


/* FIXME: This file needs a nearly complete rewrite to be used in Hatari */

#include <stdio.h>

#include "main.h"
#include "debug.h"


/*-----------------------------------------------------------------------*/
/*
  Lock disc volume
*/
/*
BOOL CreateDiscImage_LockVolume(FILE *hDisk)
{
  DWORD ReturnedByteCount;

  return(DeviceIoControl(hDisk,FSCTL_LOCK_VOLUME,NULL,0,NULL,0,&ReturnedByteCount,NULL));
}
*/


/*-----------------------------------------------------------------------*/
/*
  UnLock disc volume
*/
/*
BOOL CreateDiscImage_UnLockVolume(FILE *hDisk)
{
  DWORD ReturnedByteCount;

  return(DeviceIoControl(hDisk,FSCTL_UNLOCK_VOLUME,NULL,0,NULL,0,&ReturnedByteCount,NULL));
}
*/


/*-----------------------------------------------------------------------*/
/*
  Read PC floppy disc into image file
*/
void CreateDiscImage_ReadImage(char *pszDriveName)
{
#if 0
 char szDrive[MAX_FILENAME_LENGTH];
 FILE *hDrive;

 /* Build PC floppy image name */
 sprintf(szDrive,"%s",pszDriveName);
 hDrive = fopen(szDrive, "rwb");
 if (hDrive!=NULL)
   {
    if (CreateDiscImage_LockVolume(hDrive))
      {
#ifdef DEBUG_TO_FILE
       Debug_File("all ok\n");
#endif
       CreateDiscImage_UnLockVolume(hDrive);
      }
     else
      {
#ifdef DEBUG_TO_FILE
       Debug_File("MFMT:Locking volume %s %s failed %d\n", szDrive,pszDriveName, GetLastError());
#endif
      }
   }
  else
   {
#ifdef DEBUG_TO_FILE
    Debug_File("MFMT: Open %s %s failed %d\n", szDrive,pszDriveName, GetLastError());
#endif
   }
#endif
}


unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.