home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / mswindo / programm / win32 / 1909 < prev    next >
Encoding:
Text File  |  1992-11-10  |  1.9 KB  |  60 lines

  1. Newsgroups: comp.os.ms-windows.programmer.win32
  2. Path: sparky!uunet!utcsri!torn!maccs!beame
  3. From: beame@maccs.dcss.mcmaster.ca (Carl Beame)
  4. Subject: Re: DuplicateHandle -- passing handles to other processes
  5. Message-ID: <1992Nov11.012854.16455@maccs.dcss.mcmaster.ca>
  6. Organization: Department of Computer Science, McMaster University
  7. References: <BxGL9D.Ks9@unx.sas.com> <1992Nov10.060432.4835@maccs.dcss.mcmaster.ca> <BxI8o0.6K@unx.sas.com>
  8. Date: Wed, 11 Nov 1992 01:28:54 GMT
  9. Lines: 49
  10.  
  11. In article <BxI8o0.6K@unx.sas.com> sasdxk@skyhawk.unx.sas.com (Dave Kolb) writes:
  12.  
  13. Stuff delete
  14. >
  15. >My questions/suggestions are two:
  16. >
  17. >- Does the pipe that CreateFile is opening already exist?  If not you
  18. >  don't have a valid handle to pass.
  19.  
  20.     The pipe named in the CreateFile already exists, and communication has
  21. already taken place between this process and the pipe creator.
  22.  
  23. >
  24. >- You need to set the inherit flag in the lpsa security attributes
  25. >  data structure when creating the remote handle.
  26.  
  27. I do actually call the CreateFile with the following security attributes:
  28.  
  29. SECURITY_ATTRIBUTES sa;
  30.  
  31.     sa.nLength=sizeof(sa);
  32.     sa.bInheritHandle=TRUE;
  33.     sa.lpSecurityDescriptor=NULL;
  34. >
  35. >P.S. How does the created process open the local pipe if the remote# is part of
  36. >the pipe name and that's what you're trying to pass it?  And why pass it if it
  37. >already knows it?  Or why not just have the created process open up the remote pipe?
  38.  
  39.     I am passing the name of the local pipe in the command line to the 
  40. remote process so it can connect back to the creator process to receive
  41. the value of the newly created handle.
  42.  
  43. >
  44. >I guess this is a contrived fragment???
  45.  
  46.     Not really, I just changed the name of the pipes used.
  47.  
  48. >
  49. >Let us know...
  50. >
  51. >-- 
  52. >Dave Kolb                     Opinions are mine not SAS'
  53. >SAS Institute, Inc.           EMAIL:      sasdxk@unx.sas.com
  54. >SAS Campus Drive - J206       Phone:      (919) 677-8000 x6827
  55. >Cary, NC  27513-2414 USA      FAX:        (919) 677-8123
  56. >
  57.  
  58. - Carl Beame
  59.  
  60.