1 //----------------------------------------------------------------------
2 // This software is part of the OpenBeOS distribution and is covered
5 // Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net
6 //---------------------------------------------------------------------
8 /*! \file DriveSetupAddon.cpp
10 \brief UDF DriveSetup add-on for R5.
12 The interface implemented here is detailed in the Be Newsletter,
13 Volume II, Issue 23, "Getting Mounted". Thanks to Ingo Weinhold
14 for digging that up. :-)
18 #include "Recognition.h"
20 struct partition_data
{
21 char partition_name
[B_FILE_NAME_LENGTH
];
22 char partition_type
[B_FILE_NAME_LENGTH
];
23 char file_system_short_name
[B_FILE_NAME_LENGTH
];
24 char file_system_long_name
[B_FILE_NAME_LENGTH
];
25 char volume_name
[B_FILE_NAME_LENGTH
];
26 char mounted_at
[B_FILE_NAME_LENGTH
];
27 uint32 logical_block_size
;
28 uint64 offset
; // in logical blocks from start of session
30 bool hidden
; //"non-file system" partition
35 extern "C" bool ds_fs_id(partition_data
*, int32
, uint64
, int32
);
38 ds_fs_id(partition_data
*data
, int32 device
, uint64 sessionOffset
,
41 DEBUG_INIT_ETC(NULL
, ("%p, %ld, %Lu, %ld", data
,
42 device
, sessionOffset
, blockSize
));
44 if (!data
|| device
< 0)
50 // Udf volume names are at most 63 2-byte unicode chars, so 256 UTF-8
51 // chars should cover us.
53 status_t error
= Udf::udf_recognize(device
, (data
->offset
+ sessionOffset
), data
->blocks
, blockSize
, name
);
55 strcpy(data
->file_system_short_name
, "udf");
56 strcpy(data
->file_system_long_name
, "Universal Disk Format");
57 strcpy(data
->volume_name
, name
);