It is currently Sat Dec 07, 2019 7:08 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: folder to iso (vista , xp/sp2 + KB932716 !)
PostPosted: Fri Nov 23, 2007 8:42 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Apr 02, 2004 12:21 pm
Posts: 210
Location: germany/thueringen
for testing edit the line:

isofile.s = "c:\tmp\mein.iso"
foldertoiso.s = "c:\temp\"
:D

Code:
Import "shlwapi.lib"
SHCreateStreamOnFileEx(pszFile.p-unicode,grfMode.l,dwAttributes.l,fCreate.b,pstmTemplate.l,ppstm.l);
EndImport

Interface IBootOptions ; Boot options
  QueryInterface(riid.l,ppvObj.l)
  AddRef()
  Release()
  GetTypeInfoCount(pctinfo.l)
  GetTypeInfo(itinfo.l,lcid.l,pptinfo.l)
  GetIDsOfNames(riid.l,rgszNames.l,cNames.l,lcid.l,rgdispid.l)
  Invoke(dispidMember.l,riid.l,lcid.l,wFlags.l,pdispparams.l,pvarResult.l,pexcepinfo.l,puArgErr.l)
  get_BootImage(dispidMember.l)
  get_Manufacturer(dispidMember.l)
  put_Manufacturer(dispidMember.p-bstr)
  get_PlatformId(dispidMember.l)
  put_PlatformId(dispidMember.l)
  get_Emulation(dispidMember.l)
  put_Emulation(dispidMember.l)
  get_ImageSize(dispidMember.l)
  AssignBootImage(newVal.l)
EndInterface

Interface IFileSystemImage ; File system image
  QueryInterface(riid.l,ppvObj.l)
  AddRef()
  Release()
  GetTypeInfoCount(pctinfo.l)
  GetTypeInfo(itinfo.l,lcid.l,pptinfo.l)
  GetIDsOfNames(riid.l,rgszNames.l,cNames.l,lcid.l,rgdispid.l)
  Invoke(dispidMember.l,riid.l,lcid.l,wFlags.l,pdispparams.l,pvarResult.l,pexcepinfo.l,puArgErr.l)
  get_Root(dispidMember.l)
  get_SessionStartBlock(dispidMember.l)
  put_SessionStartBlock(dispidMember.l)
  get_FreeMediaBlocks(dispidMember.l)
  put_FreeMediaBlocks(dispidMember.l)
  SetMaxMediaBlocksFromDevice(discRecorder.l)
  get_UsedBlocks(discRecorder.l)
  get_VolumeName(discRecorder.l)
  put_VolumeName(discRecorder.p-bstr)
  get_ImportedVolumeName(discRecorder.l)
  get_BootImageOptions(discRecorder.l)
  put_BootImageOptions(discRecorder.l)
  get_FileCount(discRecorder.l)
  get_DirectoryCount(discRecorder.l)
  get_WorkingDirectory(discRecorder.l)
  put_WorkingDirectory(discRecorder.p-bstr)
  get_ChangePoint(discRecorder.l)
  get_StrictFileSystemCompliance(discRecorder.l)
  put_StrictFileSystemCompliance(discRecorder.w)
  get_UseRestrictedCharacterSet(discRecorder.l)
  put_UseRestrictedCharacterSet(discRecorder.w)
  get_FileSystemsToCreate(discRecorder.l)
  put_FileSystemsToCreate(discRecorder.l)
  get_FileSystemsSupported(discRecorder.l)
  put_UDFRevision(discRecorder.l)
  get_UDFRevision(discRecorder.l)
  get_UDFRevisionsSupported(discRecorder.l)
  ChooseImageDefaults(discRecorder.l)
  ChooseImageDefaultsForMediaType(value.l)
  put_ISO9660InterchangeLevel(value.l)
  get_ISO9660InterchangeLevel(value.l)
  get_ISO9660InterchangeLevelsSupported(value.l)
  CreateResultImage(a.l)
  Exists(FullPath.p-bstr)
  CalculateDiscIdentifier()
  IdentifyFileSystemsOnDisc(discRecorder.l)
  GetDefaultFileSystemForImport(fileSystems.l)
  ImportFileSystem()
  ImportSpecificFileSystem(fileSystemToUse.l)
  RollbackToChangePoint(ChangePoint.l)
  LockInChangePoint()
  CreateDirectoryItem(Name.p-bstr)
  CreateFileItem(Name.p-bstr)
  get_VolumeNameUDF(Name.l)
  get_VolumeNameJoliet(Name.l)
  get_VolumeNameISO9660(Name.l)
  get_StageFiles(Name.l)
  put_StageFiles(Name.w)
  get_MultisessionInterfaces(Name.l)
  put_MultisessionInterfaces(Name.l)
EndInterface

Interface IFileSystemImageResult ; FileSystemImage result stream
  QueryInterface(riid.l,ppvObj.l)
  AddRef()
  Release()
  GetTypeInfoCount(pctinfo.l)
  GetTypeInfo(itinfo.l,lcid.l,pptinfo.l)
  GetIDsOfNames(riid.l,rgszNames.l,cNames.l,lcid.l,rgdispid.l)
  Invoke(dispidMember.l,riid.l,lcid.l,wFlags.l,pdispparams.l,pvarResult.l,pexcepinfo.l,puArgErr.l)
  get_ImageStream(dispidMember.l)
  get_ProgressItems(dispidMember.l)
  get_TotalBlocks(dispidMember.l)
  get_BlockSize(dispidMember.l)
  get_DiscId(dispidMember.l)
EndInterface

Interface IFsiDirectoryItem ; FileSystemImage directory item
  QueryInterface(riid.l,ppvObj.l)
  AddRef()
  Release()
  GetTypeInfoCount(pctinfo.l)
  GetTypeInfo(itinfo.l,lcid.l,pptinfo.l)
  GetIDsOfNames(riid.l,rgszNames.l,cNames.l,lcid.l,rgdispid.l)
  Invoke(dispidMember.l,riid.l,lcid.l,wFlags.l,pdispparams.l,pvarResult.l,pexcepinfo.l,puArgErr.l)
  get_Name(dispidMember.l)
  get_FullPath(dispidMember.l)
  get_CreationTime(dispidMember.l)
  put_CreationTime(dispidMember.d)
  get_LastAccessedTime(dispidMember.l)
  put_LastAccessedTime(dispidMember.d)
  get_LastModifiedTime(dispidMember.l)
  put_LastModifiedTime(dispidMember.d)
  get_IsHidden(dispidMember.l)
  put_IsHidden(dispidMember.w)
  FileSystemName(fileSystem.l)
  FileSystemPath(fileSystem.l)
  get__NewEnum(fileSystem.l)
  get_Item(path.p-bstr)
  get_Count(path.l)
  get_EnumFsiItems(path.l)
  AddDirectory(path.p-bstr)
  AddFile(path.p-bstr,fileData.l)
  AddTree(sourceDirectory.p-bstr,includeBaseDirectory.w)
  Add(Item.l)
  Remove(path.p-bstr)
  RemoveTree(path.p-bstr)
EndInterface

Structure STATSTG 
pwcsName.l
type.l
cbSize.q
mtime.FILETIME
ctime.FILETIME
atime.FILETIME
grfMode.f
grfLocksSupported.l
clsid.GUID
grfStateBits.l
reserved.l
EndStructure

Procedure.l Ansi2Uni(ansi.s)
SHStrDup_(@ansi,@memziel)
ProcedureReturn memziel
EndProcedure

#STGM_WRITE = 1
#STGM_CREATE = $1000
#STATFLAG_NONAME = 0

#FsiFileSystemNone = 0
#FsiFileSystemISO9660 = 1
#FsiFileSystemJoliet = 2
#FsiFileSystemUDF = 4
#FsiFileSystemUnknown = 1073741824

isostream.IStream
datastream.IStream

isofile.s = "c:\tmp\mein.iso"
foldertoiso.s = "c:\temp\"

CreateStreamOnHGlobal_(0,#True,@datastream)
SHCreateStreamOnFileEx(isofile ,#STGM_WRITE|#STGM_CREATE,0,0,0,@isoStream)

CoInitialize_(0)
If CoCreateInstance_(?CLSID_BootOptions,0,1,?IID_IBootOptions,@object_boot.IBootOptions) = 0
object_boot\put_Manufacturer("Microsoft")
object_boot\put_PlatformId(0) ;x86 family processor
object_boot\put_Emulation(0)  ;EmulationType.EmulationNone
;...

If CoCreateInstance_(?CLSID_FileSystemImage,0,1,?IID_IFileSystemImage,@object_fsimage.IFileSystemImage) = 0

object_fsimage\put_FreeMediaBlocks(0) ;Enables larger-than-CD image
object_fsimage\put_FileSystemsToCreate(#FsiFileSystemJoliet)
object_fsimage\put_VolumeName("my iso")
object_fsimage\put_BootImageOptions(object_boot.IBootOptions)

object_fsimage\get_root(@object_fsidir.IFsiDirectoryItem)

Debug object_fsidir\AddTree(foldertoiso,#VARIANT_TRUE)
Debug object_fsidir\get_count(@dirinroot.l)
Debug dirinroot ;1

object_fsimage\CreateResultImage(@result.IFileSystemImageResult)

result\get_ImageStream(@datastream)

dataStream\Stat(st.STATSTG,#STATFLAG_NONAME)
Debug "size: " + Str(st\cbSize) + " bytes"

ret1.q
ret2.q

datastream\copyto(isostream,st\cbSize,@ret1,@ret2)

Debug ret1
Debug ret2

object_fsimage\release()
EndIf

object_boot\Release()
EndIf

object_fsidir\release()
isostream\release()
datastream\release()

CoUninitialize_()

End

DataSection
CLSID_FileSystemImage:
Data.l $2C941FC5
Data.w $975B,$59BE
Data.b $A9,$60,$9A,$2A,$26,$28,$53,$A5
IID_IFileSystemImage:
Data.l $2C941FE1
Data.w $975B,$59BE
Data.b $A9,$60,$9A,$2A,$26,$28,$53,$A5
CLSID_BootOptions:
Data.l $2C941FCE
Data.w $975B,$59BE
Data.b $A9,$60,$9A,$2A,$26,$28,$53,$A5
IID_IBootOptions:
Data.l $2C941FD4
Data.w $975B,$59BE
Data.b $A9,$60,$9A,$2A,$26,$28,$53,$A5
EndDataSection

_________________
["1:0>1"]


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Nov 24, 2007 2:19 am 
Offline
Addict
Addict
User avatar

Joined: Fri Feb 13, 2004 12:45 am
Posts: 2787
Location: Bergen, Norway
That's pretty cool. Thanks for the code.
Could that work for compressed ISO (isz) files as well?

_________________
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Nov 24, 2007 3:10 am 
Offline
Addict
Addict

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 3362
Compressed iso (isz) is an open format created by the makers of Ultra ISO and is not supported natively by the Windows OS.

http://www.ezbsystems.com/isz/iszspec.txt


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Nov 24, 2007 7:57 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Apr 29, 2003 9:18 pm
Posts: 1459
Location: North by Northwest
I read somewhere that if you create an ISO and use Vista build-in stuff for that the resulting ISO can't be read on Linux.
Is this true?

Don't have Vista myself, so I can't test it...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Nov 24, 2007 8:01 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Nov 05, 2006 11:42 pm
Posts: 4542
Location: Lyon - France
Quote:
Compressed iso (isz) is an open format created by the makers of Ultra ISO and is not supported natively by the Windows OS.


Hello, good job BINGO
but is it the reason why, i have an error at the line 210 :roll: :

Code:
object_fsidir\release()


I have XP Sp2, Pb v4.10 Beta

_________________
ImageThe happiness is a road...
Not a destination


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Nov 25, 2007 11:20 am 
Offline
User
User

Joined: Mon Mar 28, 2005 1:29 pm
Posts: 25
Location: Germany
@Kwaï chang caïne
On XP sp2 you have to install KB932716 (Image Mastering API v2.0) first.

_________________
I am German - that's hard enough ;)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Nov 26, 2007 12:46 am 
Offline
Addict
Addict

Joined: Mon May 29, 2006 1:01 am
Posts: 1965
Location: Outback
Pretty nifty!

_________________
Dare2 cut down to size


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Jan 05, 2008 8:58 pm 
Offline
Addict
Addict

Joined: Sat Dec 31, 2005 5:24 pm
Posts: 2970
Location: Where ya would never look.....
This is very nice, Thank You :)

Is there some way to get an indication when the iso creation and write to the destination is complete?

how do you add a file with it? AddFile? can't get AddFile to work.


Top
 Profile  
Reply with quote  
 Post subject: Re: folder to iso (vista , xp/sp2 + KB932716 !)
PostPosted: Sun Dec 06, 2009 10:01 pm 
Offline
Addict
Addict

Joined: Wed Feb 28, 2007 9:13 am
Posts: 1038
Location: London
I'm running this on XP SP2 (with the KB932716 hotfix installed). An ISO is created with a filesize that seems about right. But when I open the ISO (with WinRAR and with PowerISO), nothing is inside it. Or at least, nothing gets extracted from it.

_________________
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."


Top
 Profile  
Reply with quote  
 Post subject: Re: folder to iso (vista , xp/sp2 + KB932716 !)
PostPosted: Mon Dec 07, 2009 12:06 am 
Offline
Addict
Addict

Joined: Sat Dec 31, 2005 5:24 pm
Posts: 2970
Location: Where ya would never look.....
you might look here where I did basically the entire IMAPI thing > viewtopic.php?f=12&t=30535&hilit=IMAPI

Part of this is included, works fine here. Might help. It might be that your not actually adding files to the .iso

_________________
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye