How to know the CD/DVD's capacity

vbimport

#1

how to know whether the CD/DVD has been formatted?

how to know the CD/DVD’s capacity

how to know whether the CD/DVD is read only?


#2

i use NEROCom.
i work with c#


#3

This is most of the code you will need. You will need to initialize some Nero stuff first, but ultimately, what you are looking for will be in this area:

Just open the device you want to read from. You get the CD Info. The CD Info will contain all the fields it sounds like you are looking for.

Total capacity appears to return total blocks, hence the 2048 multiplier. You’ll also notice that I first divide by 1000. This is because a DWORD can’t store the size of a DVD. Its upper limit is about 4.2 billion. So unless you want to write your own large number class with Strings, this is an easy work around.

NERO_DEVICEHANDLE tempHandle = NeroOpenDevice(&pndiDeviceInfos->nsdisDevInfos[burnerNum]);
NERO_CD_INFO* nci = NeroGetCDInfo(tempHandle, NGCDI_READ_CD_TEXT | NGCDI_READ_ISRC);
capacity = nci->ncdiTotalCapacity; //capacity is returned in Kb otherwise a DWORD cannot
capacity /= 1000; //hold entire size
capacity *= 2048;
NeroCloseDevice(tempHandle);


#4

Sorry mate, can’t help you there.


#5

Thanks ,