-
October 2nd, 2012, 04:04 PM
#1
Named pipes and COM
I have an app which has a COM interface that other developers can use to access the app and perform basic tasks. One of those tasks is saving a file. I had a request from a user who wants to pass in a named pipe for the file name instead of a path. I use a standard _open call in the main app to do the writing, so it should work automatically. However when you try calling the COM function with a named pipe the _open call returns -1 with errno set to EINVAL. If I copy the code from the main app over to the test app that creates the pipe and do the _open there it works fine, so it seems to be some sort of permission issue. Should this work? Or is there something about the app being accessed via COM that would prevent it from working? Any help or advice would be greatly appreciated.
Dan
-
October 3rd, 2012, 10:40 AM
#2
Re: Named pipes and COM
From _open, _wopen article:
EINVAL
Invalid oflag or pmode argument.
Does your server impersonate client?
Best regards,
Igor
-
October 3rd, 2012, 03:29 PM
#3
Re: Named pipes and COM
Thanks for the help, but I figured it out. Was nothing to do with COM. My routine was checking to see if the the output file supplied existed and if it did it was deleting it before it actually started the output. Apparently when this sequence is used on a pipe it closes the pipe which is why the _open failed.
Dan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|