| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| C++ (Non Visual C++ Issues) Ask or answer C and C++ questions not related to Visual C++. This includes Console programming, Linux programming, or general ANSI C++. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Debate: Is ReadProcessMemory normally considered an IPC solution?
ReadProcessMemory is a Debugging and Error Handling function, right?
See Memory problem in C, in which I say that ReadProcessMemory is not normally considered an IPC solution. My definition of "normally considered an IPC solution" is something in the Interprocess Communications section of the Platform SDK. Is it reasonable for me to say that ReadProcessMemory is not normally considered an IPC solution? The reason I ask is because there are a few CodeGuru members that I can't get through to, so instead of continuing to get into useless debates, I would prefer to create more productive discussions to resolve issues such as the above. I really, really, really think I am being reasonable, and if I am, then it would be more productive if more members are involved, since I would have much less need to bother the other members and myself as much as I have had to lately. I only want to discuss issues relevant to this forum though; that is, the question of ReadProcessMemory is normally considered an IPC solution. |
|
#2
|
||||
|
||||
|
Since a lot of other members can't seem to get through to Sam
Here is the other side of the 'argument' for lack of a better word. Any method by which data is exchanged between two processes is a Inter Process Communication, you cannot change the definition of the word. And normally wasn't the point of the converstation. |
|
#3
|
|||
|
|||
|
Quote:
|
|
#4
|
||||
|
||||
|
Quote:
|
|
#5
|
||||
|
||||
|
btw what does 'normally' have to do with anything?
normally... readprocessmemory/writeprocessmemory: Quote:
Quite a bit of code out there uses Read/Write process memory. box...me...outside box...sam...inside |
|
#6
|
||||
|
||||
|
i agree with sam *erie silence*
i do not consider Read/Write process memory to be IPC. There is no doubt it can be used for such things *i've considered it a time or two but always gone another route instead* but that's not its INTENDED use (then again how often IS it used as it's intended to be) so yes i think it is reasonable for you to say that sam. |
|
#7
|
||||
|
||||
|
Quote:
|
|
#8
|
||||
|
||||
|
Quote:
|
|
#9
|
||||
|
||||
|
Quote:
mailslots use IPC pipes use IPC filemappings use IPC key word, USE. But I think there is too much focus on 'this is what microsoft says is an IPC' there is no such thing as a singular set of IPC methods. |
|
#10
|
||||
|
||||
|
just one more thing about intended use. Again it's stated that ReadProcessMemory(...)/WriteProcessMemory are 'normally' used inside of a debugger. But that is not their only use.
My god if we pigeon hole people into only using API's as they are defined, eg: it's in the debug API library so you can't use it for anything else, neener neener, then I pity the featureless restricted code that we would be using today. I mean the Native API isn't documented by mickeysoft, so are we to say we cannot use it? I know nobody is making this argument, but sometimes it sure seems that way.... |
|
#11
|
||||
|
||||
|
It's not usually the appropriate approach to use them like IPC and U can advise to use something other (standard ("normally") IPC , according to your words).
But I can point U to the case when ReadProcessMemory/WriteProcessMemory aren't Debugging and Error Handling functions. So, Quote:
__________________
"UNIX is simple; it just takes a genius to understand its simplicity!" |
|
#12
|
|||
|
|||
|
I hope that the following list of criterions qualifys what defines an IPC.
1. Providing a means for communication between two or more processes. 2. Creating a channel that, must at least, identify the server. 3. Allows reading and writing of data via the channel. 4. Allows sychronous and/or asychronous communication. If I am missing anything, please help me to complete the list. By comparing Read/WriteProcessMemory() against the list, it passes all the criterions except (1). Unlike the IPCs listed by MS, the default capability of Read/WriteProcessMemory() doesn't allows multiple client processes to write data into the server simultaneously. This is because it doesn't provide any sychronization nor queue that distinguish one message from another. In other words, data can be overwritten before the server act on it. Of couse, we can always add named mutexes or even create a queue to overcome the shortcoming. That's not the point as its default capabilities doesn't do that. So I believe that it is still sort of "use at your own risk" and probably why MS doesn't qualify it as an IPC. |
|
#13
|
||||
|
||||
|
filemappings do not provide sync objects either. But sync objects are used. if you look at OutputDebugString(...) you'll see it creates a mutant, and signals it if a debugger is not attached, after it writes the debug string to the filemapping.
so...a filemapping is not an IPC??? mickeysoft says it is... ![]() Quote:
|
|
#14
|
|||
|
|||
|
Quote:
![]() One difference between file mapping and Read/WriteProcessMemory() that I can see is the former provide a restricted access while the latter can access virtually every part of the process memory. The latter is very much more powerful and if not use properly can lead to many problems. As for the former, the problem is more isolated.
|
|
#15
|
||||
|
||||
|
Quote:
Now, lets clarify, would I use it as an IPC, maybe, it all depends, but to dismiss it out of hand is IMHO not very logical. but the whole point of this exercise is just a matter of definition eg: semantics... whereas I think the majority of people would say, it's not a microsoft IPC because they don't list it as such. Where I would say, umm ok, keep having that narrow focus... btw: is LPC an IPC...even though it's called Local Procedure Call...yep...it's an IPC.... but it's not listed in the microsoft IPC's, yet it's one of the most often called API's in the OS... |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|