#include "captive/unicode.h"
#include <libgnomevfs/gnome-vfs-utils.h> /* for gnome_vfs_unescape_string() */
#include <glib/gprintf.h>
+#include "captive/client.h"
/* function will leave g_malloc()ed 'ObjectAttributes->ObjectName'!
GnomeVFSResult captive_ObjectAttributes_init(const gchar *pathname,OBJECT_ATTRIBUTES *ObjectAttributes)
{
gchar *w32_path,*s,*d;
+const gchar *media_root;
g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
g_return_val_if_fail(ObjectAttributes!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
* On the other side it will somehow get managed automatically and it works even
* without the trailing "\\." for root directory open - don't ask me why. :-)
*/
+ switch (captive_option_media) {
+ case CAPTIVE_OPTION_MEDIA_CDROM: media_root="\\Device\\CdRom0"; break; /* libcaptive/storage/cdrom.c */
+ case CAPTIVE_OPTION_MEDIA_DISK: media_root="\\Device\\CaptiveHarddisk0"; break; /* libcaptive/storage/disk.c */
+ default:
+ g_assert_not_reached();
+ media_root="";
+ }
+
w32_path=(gchar *)/* de-const it as we can modify it but we must not free() it */
- captive_printf_alloca("\\Device\\CdRom0\\%s",pathname);
+ captive_printf_alloca("%s\\%s",media_root,pathname);
/* translate '/' -> '\' */
for (s=w32_path;(s=strchr(s,'/'));s++)
*s='\\';