http://bugs.winehq.org/show_bug.cgi?id=20081
Summary: Add ability to simply call the unix function mknod() Product: Wine Version: 1.1.29 Platform: PC URL: http://rh-software.com/ OS/Version: Linux Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: ray@pobox.co.uk
Please can a wine_mknod() function be added that can be loaded in a similar way to wine_get_host_version() that SIV could use ? Currently I am having to do this using code similar to: stprintf( b, TEXT( "/bin/mknod -m %o /dev/cpu/%u/msr c 202 %u" ), m, i, i ); _tsystem( b ); which works, but is not ideal if there is a failure and I should report an error. Having this in ntdll.dll would make things very easy, but I am not sure if this is the appropriate .dll to use, I would be happy to load any .dll.
http://bugs.winehq.org/show_bug.cgi?id=20081
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Alias|wine_mknod |
--- Comment #1 from Dmitry Timoshkov dmitry@codeweavers.com 2009-09-18 05:14:21 --- Does this functionality exist in Windows?
http://bugs.winehq.org/show_bug.cgi?id=20081
red-ray ray@pobox.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- Difficulty|--- |Minutes
--- Comment #2 from red-ray ray@pobox.co.uk 2009-09-18 13:16:23 --- (In reply to comment #1)
Does this functionality exist in Windows?
As Windows does not have mknod type devices obviously not, if it did there would be the mknod() function in the Windows C library that I would have used. I feel this would be a useful facility. You seem to be implying that Wine should only have functions that Windows has, however such functions as wine_get_host_version() are in Wine, but not in Windows, so I don't see why a wine_mknod() is any different.
http://bugs.winehq.org/show_bug.cgi?id=20081
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |WONTFIX
--- Comment #3 from Vitaliy Margolen vitaliy@kievinfo.com 2009-09-18 21:09:29 ---
Does this functionality exist in Windows?
As Windows does not have mknod type devices obviously not
You answered your own question.
http://bugs.winehq.org/show_bug.cgi?id=20081
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Vitaliy Margolen vitaliy@kievinfo.com 2009-09-18 21:10:16 --- Closing. Don't mix Windows and *NIX. There are reasons why winelib exists.
http://bugs.winehq.org/show_bug.cgi?id=20081
red-ray ray@pobox.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |UNCONFIRMED Resolution|WONTFIX |
--- Comment #5 from red-ray ray@pobox.co.uk 2009-09-19 03:32:34 --- (In reply to comment #4)
Closing. Don't mix Windows and *NIX. There are reasons why winelib exists.
It should be my decision as to how my code works. Converting SIV to a winelib app is not worth the effort just so I can call mknod. Given adding what I would like is trivial I can't see why you don't just add it !
http://bugs.winehq.org/show_bug.cgi?id=20081
--- Comment #6 from Jeff Zaroyko jeffz@jeffz.name 2009-09-19 04:30:40 --- If it's not needed for Wine itself, but only as an extension of your application then that is something for you to deal with, not the Wine project. This should be marked invalid.
http://bugs.winehq.org/show_bug.cgi?id=20081
--- Comment #7 from red-ray ray@pobox.co.uk 2009-09-19 07:01:17 --- (In reply to comment #6)
If it's not needed for Wine itself, but only as an extension of your application then that is something for you to deal with, not the Wine project. This should be marked invalid.
I thought the idea of Wine was to allow Windows programs to run WILL on *nix systems. SIV needs to create /dev/cpu/nn/msr devices to do this and I feel Wine should help in doing this.
http://bugs.winehq.org/show_bug.cgi?id=20081
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |WONTFIX
--- Comment #8 from Vitaliy Margolen vitaliy@kievinfo.com 2009-09-19 12:33:33 --- No, this is still a won't fix. You can not expect windows applications knowing what to do with this call. You are writing a winelib app. So you can call system yourself.
http://bugs.winehq.org/show_bug.cgi?id=20081
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #9 from Vitaliy Margolen vitaliy@kievinfo.com 2009-09-19 12:33:53 --- Closing.
http://bugs.winehq.org/show_bug.cgi?id=20081
red-ray ray@pobox.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |UNCONFIRMED Resolution|WONTFIX |
--- Comment #10 from red-ray ray@pobox.co.uk 2009-09-19 15:21:10 --- (In reply to comment #8)
No, this is still a won't fix. You can not expect windows applications knowing what to do with this call. You are writing a winelib app. So you can call system yourself.
Windows apps do not need to know what to do with this call. Wine needs to know what to do with this call.
My Windows app does know what to do with this call, others may not. There are lots of Windows calls that many windows apps do not know what to do with.
No, I am not writing a winelib app. Do you mean "If I wish to do this I will have to write a Winelib app" ?
http://bugs.winehq.org/show_bug.cgi?id=20081
--- Comment #11 from Henri Verbeet hverbeet@gmail.com 2009-09-19 16:08:24 --- (In reply to comment #10)
No, I am not writing a winelib app. Do you mean "If I wish to do this I will have to write a Winelib app" ?
More or less. I think it might be enough to write a winelib dll that exports the appropriate functions.
http://bugs.winehq.org/show_bug.cgi?id=20081
Matt Lewandowsky matt@greenviolet.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |matt@greenviolet.net
--- Comment #12 from Matt Lewandowsky matt@greenviolet.net 2009-09-19 16:35:36 --- Your code sounds very Linux-specific; have you tested it on other platforms Wine runs on? Some of them have notes which indicate that you probably don't want to use mknod, and others indicate that your syntax isn't correct:
E.g. Solaris:
mknod name b major minor mknod name c major minor mknod name p [...] With the advent of physical device naming, it would be preferable to create a symbolic link to the physical name of the device (in the /devices subtree) rather than using mknod.
and BSD:
mknod [-F format] name [c | b] major minor mknod [-F format] name [c | b] major unit subunit mknod name [c | b] number
Also, on these systems, major number 202 may already be in use by something else; I'm not sure that's what you want. Also, don't some of the /dev pseudo-filesystem options for Linux effectively defeat mknod when it's used?
With these considerations in mind, I can't see the need for a wine_mknod() function. Perhaps if you can find an analog in the Windows API, then someone should figure out the "right" way of doing it. But I don't know of such an analog.
I concur with the others who are saying you should be writing a winelib app. I'd add the caveat that you probably want to do a ton of sanity checking, if you're relying on direct access to system interfaces under Wine.
http://bugs.winehq.org/show_bug.cgi?id=20081
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID
--- Comment #13 from Vitaliy Margolen vitaliy@kievinfo.com 2009-09-19 17:17:17 --- Stop reopening this bug! You asking for something that normal windows applications can not use. And if you writing something specifically for Wine, you should be using winelib aka call the system functions directly.
Closed DO NOT REOPEN!!!
http://bugs.winehq.org/show_bug.cgi?id=20081
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #14 from Vitaliy Margolen vitaliy@kievinfo.com 2009-09-19 17:18:32 --- If you really have to have this call in Wine - send patches in, you surely know how to do that. We'll see if it gets in or not.
http://bugs.winehq.org/show_bug.cgi?id=20081
red-ray ray@pobox.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |ABANDONED
--- Comment #15 from red-ray ray@pobox.co.uk 2009-09-20 02:26:04 --- (In reply to comment #12) Thank you for your reply, it's good to actually get a comment that makes sense ! I suspected that different Wine hosts may have different mknod command line requirements and hoped that by using the mknod() function this would be reduced. What I am actually doing is reading MSRs with on Windows I do by calling my Kernel Driver which does an RDMSR instruction. With Wine I can not do this as Wine does not run my driver in Kernel mode and therefore RDMSR can not be used. I could argue that as I can do this on Windows then I should be able to do the same with Wine, but I realise this is never going to possible with Wine, so I needed to find another way.
I found on Linux I could do this my reading the type 202 devices, so this is what I do, but these devices need to be created which is why I need to use mknod. As you have pointed out I am going to have to do different things on different Wine hosts which is something I expected and internally my code is designed to make doing this easy and also to allow for not being able to read MSRs at all.
When I initially put in the request I felt it was a trivial addition to Wine and could bee no good reason what it would be rejected and I still feel this is the case. Further, as far as I know, i few Wine functions work of some hosts and not others already.
Given the hostile response this request has received I am totally losing interest in improving Wine, so will probably simply create a whinelib dll that exports the native functions I wish to use.
http://bugs.winehq.org/show_bug.cgi?id=20081
--- Comment #16 from Jeff Zaroyko jeffz@jeffz.name 2009-09-20 03:30:44 --- (In reply to comment #15)
(In reply to comment #12) When I initially put in the request I felt it was a trivial addition to Wine and could bee no good reason what it would be rejected and I still feel thi is the case.
Feel free to submit a patch to wine-patches and ask for feedback on wine-devel if it's not accepted.
http://bugs.winehq.org/show_bug.cgi?id=20081
--- Comment #17 from red-ray ray@pobox.co.uk 2009-09-20 04:06:54 --- (In reply to comment #13)
Stop reopening this bug! You asking for something that normal windows applications can not use. And if you writing something specifically for Wine, you should be using winelib aka call the system functions directly. Closed DO NOT REOPEN!!!
"Normal" Windows applications can run their drivers in kernel mode. Wine does not allow this, so I am trying to work round this. Having a wine_mknod() would help me do this. I am half inclined to follow your regime, reopen this and add the comment,
Reopened DO NOT CLOSE !!!!!!!!!!!!!
http://bugs.winehq.org/show_bug.cgi?id=20081
--- Comment #18 from red-ray ray@pobox.co.uk 2009-09-20 10:38:49 --- (In reply to comment #16)
(In reply to comment #15)
(In reply to comment #12) When I initially put in the request I felt it was a trivial addition to Wine and could bee no good reason what it would be rejected and I still feel thi is the case.
Feel free to submit a patch to wine-patches and ask for feedback on wine-devel if it's not accepted.
I would do this if I was confident I could do this for all Wine hosts, but as been pointed out there are lots of varations in mknod. Given I have only been using Wine for a couple of weeks and have never generated a patch I suspect doing this would currently be tricky for me.
On Real Windows I read the MSRs in my kernel mode driver, but on Wine this driver gets run in User Mode. The is the problem I am working around. Were Wine to run my driver in Kernel Mode then I would not need to use mknod() at all, so I have logged http://bugs.winehq.org/show_bug.cgi?id=20098.
http://bugs.winehq.org/show_bug.cgi?id=20081
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|ABANDONED |WONTFIX Difficulty|Minutes |---
http://bugs.winehq.org/show_bug.cgi?id=20081
red-ray ray@pobox.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|WONTFIX |ABANDONED
http://bugs.winehq.org/show_bug.cgi?id=20081
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|ABANDONED |WONTFIX
--- Comment #19 from Dmitry Timoshkov dmitry@codeweavers.com 2009-09-21 22:20:22 --- This is a developer's decision how to resolve this bug.
http://bugs.winehq.org/show_bug.cgi?id=20081
red-ray ray@pobox.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|WONTFIX |ABANDONED
--- Comment #20 from red-ray ray@pobox.co.uk 2009-09-22 00:47:28 --- It is my decision to stop trying to get this implemented
http://bugs.winehq.org/show_bug.cgi?id=20081
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|ABANDONED |WONTFIX
--- Comment #21 from Dmitry Timoshkov dmitry@codeweavers.com 2009-09-22 00:58:13 --- Not really. You abandon the bug if some activity is required from your side, but you don't want/can't do that. Wine developers/bug triagers set the resolution to WONTFIX if the functionality you request can't be added.
Please leave this as it is. This is Wine bugzilla, not your private playground.
http://bugs.winehq.org/show_bug.cgi?id=20081
--- Comment #22 from red-ray ray@pobox.co.uk 2009-09-22 01:07:41 --- (In reply to comment #21) I just wish I could find a tidy solution to reading MSRs.
When I initially asked for wine_mknod() I felt it was a reasonable work-a-round to Wine being unable to run my driver in kernel mode. This far more effort has been put into refusing to do this than it would have taked to actually add wine_mknod() !