// BURNING AN ISO 9660 IMAGE FILE TO A BLANK CD-R DISC // Directions: put a blank CD-R disc into the writer device, prepare an // ISO 9660 file system image file, name it "C:\MY_FILE.ISO", then compile // link and run this program // A) PROTOTYPES TO PUT INTO THE HEADER: HINSTANCE MMC1DllHandle; bool ( __stdcall *pfnFFAspiStart )( HWND ); int ( __stdcall *pfnFFCDWrite )( HWND, int, int, int, HANDLE ); void ( __stdcall *pfnFFAspiStop )( void ); // B) SOURCE CODE TO PUT INTO CPP FILE: // load MMC1DLL.DLL MMC1DllHandle = LoadLibrary ( "MMC1DLL.DLL" ); if ( MMC1DllHandle == 0 ) { MessageBox ( NULL, "LoadLibrary:\nMMC1DLL.DLL not found.", "Error FS 001", MB_SYSTEMMODAL ); return; } // load FFAspiStart address pfnFFAspiStart = ( bool ( __stdcall *)( HWND ) ) GetProcAddress ( MMC1DllHandle, "FFAspiStart" ); if ( pfnFFAspiStart == NULL ) { MessageBox ( NULL, "GetProcAddress:\nFFAspiStart not found.", "Error FS 002", MB_SYSTEMMODAL ); return; } // load FFCDWrite address pfnFFCDWrite = ( int ( __stdcall *)( HWND, int, int, int, HANDLE ) ) GetProcAddress ( MMC1DllHandle, "FFCDWrite" ); if ( pfnFFCDWrite == NULL ) { MessageBox ( NULL, "GetProcAddress:\nFFCDWrite not found.", "Error FS 003", MB_SYSTEMMODAL ); return; } // load FFAspiStop address pfnFFAspiStop = ( void ( __stdcall *)( void ) ) GetProcAddress ( MMC1DllHandle, "FFAspiStop" ); if ( pfnFFAspiStop == NULL ) { MessageBox ( NULL, "GetProcAddress:\nFFAspiStop not found.", "Error FS 004", MB_SYSTEMMODAL ); return; } // check ASPI support if ( pfnFFAspiStart ( Application -> Handle ) == false ) { MessageBox ( NULL, "No ASPI support.", "Error FS 005", MB_SYSTEMMODAL ); return; } // burn the disc HANDLE handle = CreateFileA ( "C:\\MY_FILE.ISO", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); if ( handle == INVALID_HANDLE_VALUE ) { MessageBox ( NULL, "Mannaggia.", "Il file non si apre:", MB_SYSTEMMODAL ); } pfnFFCDWrite ( Application -> Handle, 0, 2, 0, handle ); CloseHandle ( handle ); // stop ASPI support pfnFFAspiStop ( ); // unload the DLL FreeLibrary ( MMC1DllHandle );