1 --- wine-4.4/dlls/kernel32/Makefile.in.1 2019-09-30 21:18:02.672434942 +0000
2 +++ wine-4.4/dlls/kernel32/Makefile.in 2019-09-30 21:18:32.770874323 +0000
6 IMPORTS = winecrt0 kernelbase ntdll
7 -EXTRALIBS = $(COREFOUNDATION_LIBS) $(POLL_LIBS) $(RT_LIBS)
8 +EXTRALIBS = $(COREFOUNDATION_LIBS) $(POLL_LIBS) $(RT_LIBS) -ldevinfo
9 EXTRADLLFLAGS = -nodefaultlibs -Wb,-F,KERNEL32.dll -Wl,--image-base,0x7b400000
12 --- wine-4.4/dlls/kernel32/oldconfig.c.~1~ 2019-03-15 23:18:31.000000000 +0000
13 +++ wine-4.4/dlls/kernel32/oldconfig.c 2019-10-01 03:26:42.508639311 +0000
15 # include <linux/hdreg.h>
18 +#if defined(__sun) || defined(sun)
19 +#include <libdevinfo.h>
21 +#include <sys/stat.h>
22 +#include <sys/mkdev.h>
32 +#if defined(__sun) || defined(sun)
33 +static int walk_devlinks(di_devlink_t devlink, void *arg)
35 + char **path= (char **)arg;
37 + *path = strdup(di_devlink_path(devlink));
39 + return (DI_WALK_TERMINATE);
42 +static int process_minors(di_node_t node, unsigned char* port, int is_cdrom, int is_scsi) {
45 + di_devlink_handle_t devlink_hdl;
46 + char *cUnixDeviceName = NULL;
48 + devlink_hdl = di_devlink_init(NULL, 0);
49 + if (devlink_hdl == NULL) {
50 + ERR("Couldn't init devlink handle\n");
54 + major = di_driver_major(node);
55 + minor = DI_MINOR_NIL;
56 + while ((minor = di_minor_next(node, minor)) != DI_MINOR_NIL) {
58 + char *devlink = NULL;
62 + dev = di_minor_devt(minor);
63 + if (major == major(dev) && di_minor_type(minor) == DDM_MINOR &&
64 + di_minor_spectype(minor) == S_IFBLK) {
66 + minor_path = di_devfs_minor_path(minor);
67 + mname = di_minor_name(minor);
68 + dev = di_minor_devt(minor);
69 + (void) di_devlink_walk(devlink_hdl, NULL, minor_path,
70 + DI_PRIMARY_LINK, &devlink, walk_devlinks);
72 + /* If devlink ends with d0 or p0, it's device name. Prefer d0 names. */
73 + int dl = strlen(devlink);
75 + if (dl > 2 && devlink[dl-1] == '0' && devlink[dl-2] == 'd') {
76 + if (cUnixDeviceName != NULL) {
77 + free(cUnixDeviceName);
79 + cUnixDeviceName = strdup(devlink);
81 + if (dl > 2 && devlink[dl-1] == '0' && devlink[dl-2] == 'p' && cUnixDeviceName == NULL) {
82 + cUnixDeviceName = strdup(devlink);
88 + di_devlink_fini (&devlink_hdl);
90 + if (cUnixDeviceName) {
91 + SCSI_ADDRESS scsi_addr;
97 + nType = DRIVE_CDROM;
98 + strcpy(cDevModel, "Wine CDROM");
100 + nType = DRIVE_FIXED;
101 + strcpy(cDevModel, "Wine harddisk");
105 + dtype = "WINE scsi";
110 + scsi_addr.PortNumber = *port;
111 + scsi_addr.PathId = 0;
112 + scsi_addr.TargetId = 0;
115 + create_scsi_entry(&scsi_addr, dtype, nType, cDevModel, cUnixDeviceName);
117 + free (cUnixDeviceName);
123 +static int get_ide_disks(di_node_t node, void *arg) {
124 + unsigned char* port = (unsigned char *)arg;
128 + path = di_devfs_path(node);
129 + if (path != NULL) {
130 + char *device_type = NULL;
132 + di_prop_lookup_strings (DDI_DEV_T_ANY, node, "device_type",
134 + if ((di_prop_lookup_strings (DDI_DEV_T_ANY, node, "class", &s) > 0) &&
135 + (strcmp (s, "dada") == 0)) {
136 + driver = di_driver_name(node);
138 + if (process_minors(node, port, 0, 0) < 0) {
139 + di_devfs_path_free(path);
140 + return DI_WALK_TERMINATE;
143 + di_devfs_path_free(path);
145 + return DI_WALK_CONTINUE;
148 +static int get_scsi_disks(di_node_t node, void *arg) {
149 + unsigned char* port = (unsigned char *)arg;
150 + char *path, *driver;
154 + path = di_devfs_path(node);
155 + if (path != NULL) {
156 + driver = di_driver_name(node);
157 + if (driver != NULL && strcmp(driver,"sd") == 0){
158 + if (di_prop_lookup_ints(DDI_DEV_T_ANY, node, "inquiry-device-type", &i) > 0) {
159 + if (*i == 0x07 || *i == 0x05) {
163 + if (process_minors(node, port, is_cdrom, 1) < 0) {
164 + di_devfs_path_free(path);
165 + return DI_WALK_TERMINATE;
170 + return DI_WALK_CONTINUE;
173 +static void create_hardware_branch(void)
176 + unsigned char uFirstSCSIPort = 0;
178 + /* Enumerate ide disks as atapi devices */
179 + node = di_init("/", DINFOCPYALL);
180 + if (node != DI_NODE_NIL) {
181 + di_walk_node (node, DI_WALK_CLDFIRST, &uFirstSCSIPort, get_ide_disks);
184 + ERR("Couldn't di_init while getting IDE disks\n");
187 + /* Enumerate scsi block devices */
188 + node = di_init("/", DINFOCPYALL);
189 + if (node != DI_NODE_NIL) {
190 + di_walk_node (node, DI_WALK_CLDFIRST, &uFirstSCSIPort, get_scsi_disks);
193 + ERR("Couldn't di_init while getting SCSI disks\n");
198 /* create the hardware registry branch */
199 static void create_hardware_branch(void)
202 WARN("Incorrect %s format\n", procname_scsi);
208 /***********************************************************************