Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
6735eb2e
Commit
6735eb2e
authored
Oct 03, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
explorer: Added dynamic drive support for MacOSX.
parent
ab6fa810
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
166 additions
and
4 deletions
+166
-4
configure
configure
+5
-1
configure.ac
configure.ac
+1
-0
Makefile.in
programs/explorer/Makefile.in
+2
-0
desktop.c
programs/explorer/desktop.c
+1
-0
device.c
programs/explorer/device.c
+12
-2
diskarb.c
programs/explorer/diskarb.c
+143
-0
explorer_private.h
programs/explorer/explorer_private.h
+1
-0
hal.c
programs/explorer/hal.c
+1
-1
No files found.
configure
View file @
6735eb2e
...
...
@@ -743,6 +743,7 @@ DLLTOOL
DLLWRAP
COREFOUNDATIONLIB
IOKITLIB
DISKARBITRATIONLIB
LDEXECFLAGS
COREAUDIO
CROSSTEST
...
...
@@ -15359,6 +15360,8 @@ fi
IOKITLIB
=
"-framework IOKit -framework CoreFoundation"
DISKARBITRATIONLIB
=
"-framework DiskArbitration -framework CoreFoundation"
LDEXECFLAGS
=
"-image_base 0x7bf00000 -Wl,-segaddr,WINE_DOS,0x00000000,-segaddr,WINE_SHARED_HEAP,0x7f000000"
if
test
"
$ac_cv_header_CoreAudio_CoreAudio_h
"
=
"yes"
-a
"
$ac_cv_header_AudioUnit_AudioUnit_h
"
=
"yes"
...
...
@@ -24840,6 +24843,7 @@ DLLTOOL!$DLLTOOL$ac_delim
DLLWRAP!
$DLLWRAP$ac_delim
COREFOUNDATIONLIB!
$COREFOUNDATIONLIB$ac_delim
IOKITLIB!
$IOKITLIB$ac_delim
DISKARBITRATIONLIB!
$DISKARBITRATIONLIB$ac_delim
LDEXECFLAGS!
$LDEXECFLAGS$ac_delim
COREAUDIO!
$COREAUDIO$ac_delim
CROSSTEST!
$CROSSTEST$ac_delim
...
...
@@ -24858,7 +24862,7 @@ LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!
$LTLIBOBJS$ac_delim
_ACEOF
if
test
`
sed
-n
"s/.*
$ac_delim
\$
/X/p"
conf
$$
subs.sed |
grep
-c
X
`
=
7
7
;
then
if
test
`
sed
-n
"s/.*
$ac_delim
\$
/X/p"
conf
$$
subs.sed |
grep
-c
X
`
=
7
8
;
then
break
elif
$ac_last_try
;
then
{
{
echo
"
$as_me
:
$LINENO
: error: could not make
$CONFIG_STATUS
"
>
&5
...
...
configure.ac
View file @
6735eb2e
...
...
@@ -1005,6 +1005,7 @@ case $host_os in
dnl declare needed frameworks
AC_SUBST(COREFOUNDATIONLIB,"-framework CoreFoundation")
AC_SUBST(IOKITLIB,"-framework IOKit -framework CoreFoundation")
AC_SUBST(DISKARBITRATIONLIB,"-framework DiskArbitration -framework CoreFoundation")
AC_SUBST(LDEXECFLAGS,["-image_base 0x7bf00000 -Wl,-segaddr,WINE_DOS,0x00000000,-segaddr,WINE_SHARED_HEAP,0x7f000000"])
if test "$ac_cv_header_CoreAudio_CoreAudio_h" = "yes" -a "$ac_cv_header_AudioUnit_AudioUnit_h" = "yes"
then
...
...
programs/explorer/Makefile.in
View file @
6735eb2e
...
...
@@ -7,10 +7,12 @@ APPMODE = -mwindows
IMPORTS
=
user32 gdi32 advapi32 kernel32 ntdll
DELAYIMPORTS
=
comctl32
EXTRADEFS
=
@HALINCL@
EXTRALIBS
=
@DISKARBITRATIONLIB@
C_SRCS
=
\
desktop.c
\
device.c
\
diskarb.c
\
explorer.c
\
hal.c
\
systray.c
...
...
programs/explorer/desktop.c
View file @
6735eb2e
...
...
@@ -166,6 +166,7 @@ void manage_desktop( char *arg )
SetWindowTextW
(
hwnd
,
desktop_nameW
);
SystemParametersInfoA
(
SPI_SETDESKPATTERN
,
-
1
,
NULL
,
FALSE
);
SetDeskWallPaper
(
(
LPSTR
)
-
1
);
initialize_diskarbitration
();
initialize_hal
();
initialize_systray
();
}
...
...
programs/explorer/device.c
View file @
6735eb2e
...
...
@@ -76,6 +76,16 @@ static void send_notify( int drive, int code )
SMTO_ABORTIFHUNG
,
0
,
&
result
);
}
static
inline
int
is_valid_device
(
struct
stat
*
st
)
{
#if defined(linux) || defined(__sun__)
return
S_ISBLK
(
st
->
st_mode
);
#else
/* disks are char devices on *BSD */
return
S_ISCHR
(
st
->
st_mode
);
#endif
}
/* find or create a DOS drive for the corresponding device */
static
int
add_drive
(
const
char
*
device
,
const
char
*
type
)
{
...
...
@@ -84,7 +94,7 @@ static int add_drive( const char *device, const char *type )
struct
stat
dev_st
,
drive_st
;
int
drive
,
first
,
last
,
avail
=
0
;
if
(
stat
(
device
,
&
dev_st
)
==
-
1
||
!
S_ISBLK
(
dev_st
.
st_mode
))
return
-
1
;
if
(
stat
(
device
,
&
dev_st
)
==
-
1
||
!
is_valid_device
(
&
dev_st
))
return
-
1
;
if
(
!
(
path
=
get_dosdevices_path
()))
return
-
1
;
p
=
path
+
strlen
(
path
)
-
3
;
...
...
@@ -123,7 +133,7 @@ static int add_drive( const char *device, const char *type )
else
{
in_use
[
drive
]
=
1
;
if
(
!
S_ISBLK
(
drive_st
.
st_mode
))
continue
;
if
(
!
is_valid_device
(
&
drive_st
))
continue
;
if
(
dev_st
.
st_rdev
==
drive_st
.
st_rdev
)
goto
done
;
}
}
...
...
programs/explorer/diskarb.c
0 → 100644
View file @
6735eb2e
/*
* Devices support using the MacOS Disk Arbitration library.
*
* Copyright 2006 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <sys/time.h>
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winuser.h"
#include "wine/debug.h"
#include "explorer_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
explorer
);
#ifdef __APPLE__
#include <DiskArbitration/DiskArbitration.h>
static
void
appeared_callback
(
DADiskRef
disk
,
void
*
context
)
{
CFDictionaryRef
dict
=
DADiskCopyDescription
(
disk
);
const
void
*
ref
;
char
device
[
64
];
char
mount_point
[
PATH_MAX
];
const
char
*
type
=
NULL
;
if
(
!
dict
)
return
;
/* ignore non-removable devices */
if
(
!
(
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAMediaRemovable"
)
))
||
!
CFBooleanGetValue
(
ref
))
return
;
/* get device name */
if
(
!
(
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAMediaBSDName"
)
)))
return
;
strcpy
(
device
,
"/dev/r"
);
CFStringGetCString
(
ref
,
device
+
6
,
sizeof
(
device
)
-
6
,
kCFStringEncodingASCII
);
if
((
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAVolumePath"
)
)))
CFURLGetFileSystemRepresentation
(
ref
,
true
,
(
UInt8
*
)
mount_point
,
sizeof
(
mount_point
)
);
else
mount_point
[
0
]
=
0
;
if
((
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAVolumeKind"
)
)))
{
if
(
!
CFStringCompare
(
ref
,
CFSTR
(
"cd9660"
),
0
)
||
!
CFStringCompare
(
ref
,
CFSTR
(
"udf"
),
0
))
type
=
"cdrom"
;
}
WINE_TRACE
(
"got mount notification for '%s' on '%s'
\n
"
,
device
,
mount_point
);
add_dos_device
(
device
,
device
,
mount_point
,
type
);
CFRelease
(
dict
);
}
static
void
changed_callback
(
DADiskRef
disk
,
CFArrayRef
keys
,
void
*
context
)
{
appeared_callback
(
disk
,
context
);
}
static
void
disappeared_callback
(
DADiskRef
disk
,
void
*
context
)
{
CFDictionaryRef
dict
=
DADiskCopyDescription
(
disk
);
const
void
*
ref
;
char
device
[
100
];
if
(
!
dict
)
return
;
/* ignore non-removable devices */
if
(
!
(
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAMediaRemovable"
)
))
||
!
CFBooleanGetValue
(
ref
))
return
;
/* get device name */
if
(
!
(
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAMediaBSDName"
)
)))
return
;
strcpy
(
device
,
"/dev/r"
);
CFStringGetCString
(
ref
,
device
+
6
,
sizeof
(
device
)
-
6
,
kCFStringEncodingASCII
);
WINE_TRACE
(
"got unmount notification for '%s'
\n
"
,
device
);
remove_dos_device
(
device
);
CFRelease
(
dict
);
}
static
DWORD
WINAPI
runloop_thread
(
void
*
arg
)
{
DASessionRef
session
=
DASessionCreate
(
NULL
);
if
(
!
session
)
return
1
;
DASessionScheduleWithRunLoop
(
session
,
CFRunLoopGetCurrent
(),
kCFRunLoopDefaultMode
);
DARegisterDiskAppearedCallback
(
session
,
kDADiskDescriptionMatchVolumeMountable
,
appeared_callback
,
NULL
);
DARegisterDiskDisappearedCallback
(
session
,
kDADiskDescriptionMatchVolumeMountable
,
disappeared_callback
,
NULL
);
DARegisterDiskDescriptionChangedCallback
(
session
,
kDADiskDescriptionMatchVolumeMountable
,
kDADiskDescriptionWatchVolumePath
,
changed_callback
,
NULL
);
CFRunLoopRun
();
DASessionUnscheduleFromRunLoop
(
session
,
CFRunLoopGetCurrent
(),
kCFRunLoopDefaultMode
);
CFRelease
(
session
);
return
0
;
}
void
initialize_diskarbitration
(
void
)
{
HANDLE
handle
;
if
(
!
(
handle
=
CreateThread
(
NULL
,
0
,
runloop_thread
,
NULL
,
0
,
NULL
)))
return
;
CloseHandle
(
handle
);
}
#else
/* __APPLE__ */
void
initialize_diskarbitration
(
void
)
{
WINE_TRACE
(
"Skipping on non-Apple platform
\n
"
);
}
#endif
/* __APPLE__ */
programs/explorer/explorer_private.h
View file @
6735eb2e
...
...
@@ -26,6 +26,7 @@ extern BOOL add_dos_device( const char *udi, const char *device,
extern
BOOL
remove_dos_device
(
const
char
*
udi
);
extern
void
manage_desktop
(
char
*
arg
);
extern
void
initialize_diskarbitration
(
void
);
extern
void
initialize_hal
(
void
);
extern
void
initialize_systray
(
void
);
...
...
programs/explorer/hal.c
View file @
6735eb2e
...
...
@@ -240,7 +240,7 @@ void initialize_hal(void)
void
initialize_hal
(
void
)
{
WINE_
WARN
(
"
HAL support not compiled in
\n
"
);
WINE_
TRACE
(
"Skipping,
HAL support not compiled in
\n
"
);
}
#endif
/* HAVE_LIBHAL */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment