Nine Posted March 1, 2012 Share Posted March 1, 2012 got it working fine on same computer but got the access denied when client run on another computer i know its an access right or permission, but i cant find anything ... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
BrewManNH Posted March 1, 2012 Share Posted March 1, 2012 Neither will anyone else because we have no idea what you tried and what didn't work. It's best to post a reproducer script that shows the problem and a good explanation of what it does and what it's supposed to do and what it's not doing that you wanted it to do. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Nine Posted March 1, 2012 Author Share Posted March 1, 2012 (edited) server side (computer John):#Include <NamedPipes.au3>#Include <WinAPI.au3>$hNamedPipe = _NamedPipes_CreateNamedPipe(".pipeIPwServer",2,1)$test = _NamedPipes_ConnectNamedPipe($hNamedPipe)(server wait for a connection as it is supposed to be)(rest of the script is irrelevant)client side (computer Lou):#Include <NamedPipes.au3>#Include <WinAPI.au3>$hFile = _WinAPI_CreateFile("JohnpipeIPwServer", 2, 6)if not $hFile then msgbox (0,"error",_WinAPI_GetLastError() & ": " & _WinAPI_GetLastErrorMessage()) exitendif(getting error 5 : access denied)(rest of the script is irrelevant) Edited March 1, 2012 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
BrewManNH Posted March 1, 2012 Share Posted March 1, 2012 Does the person running the script on the client have write access rights to your computer? Or at the very least write access rights to that folder? If not, it will never work because they'll never be able to create the file. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Nine Posted March 1, 2012 Author Share Posted March 1, 2012 first it's not a file, its a named pipe.and yes it has access to the other comp even where the server script is located.im xfering files all the time...the create file is just one way to enable the linkwith a named pipe. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Nine Posted March 1, 2012 Author Share Posted March 1, 2012 ok guys, i am getting somewhere...i tested my script with read access only.And it's working fine but of course only in one direction. So computer Lou can read the namedpipe created on John but cannot write to it. So I went to Microsoft site and herewhat i found :"If lpSecurityAttributes is NULL, the named pipe gets a default security descriptor and the handle cannot be inherited. The ACLs in the default security descriptor for a named pipe grant full control to the LocalSystem account, administrators, and the creator owner. They also grant read access to members of the Everyone group and the anonymous account."The lpSecurityAttributes is the last parameter of the _NamedPipes_CreateNamedPipe command. So, any one knows how to create the SECURITY_DESCRIPTOR imbedded in this structure ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Nine Posted March 1, 2012 Author Share Posted March 1, 2012 (edited) Found something else that might clarify the problem. One guy is having the same problem as I. Here what he was suggested to do... SECURITY_ATTRIBUTES m_pSecAttrib; SECURITY_DESCRIPTOR* m_pSecDesc; m_pSecDesc = (SECURITY_DESCRIPTOR*)LocalAlloc(LPTR,SECURITY_DESCRIPTOR_MIN_LENGTH); InitializeSecurityDescriptor(m_pSecDesc,SECURITY_DESCRIPTOR_REVISION); SetSecurityDescriptorDacl(m_pSecDesc,TRUE,(PACL)NULL,FALSE); m_pSecAttrib.nLength = sizeof(SECURITY_ATTRIBUTES); m_pSecAttrib.bInheritHandle = TRUE; m_pSecAttrib.lpSecurityDescriptor = m_pSecDesc; ::CreateNamedPipe(PIPE_NAME, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, 32768,32768, NMPWAIT_USE_DEFAULT_WAIT, &m_pSecAttrib); Knowing that both InitializeSecurityDescriptor and SetSecurityDescriptorDacl are coming from Advapi32.dll, the only missing part is the SECURITY_DESCRIPTOR_REVISION variable. That i really dont know where its coming from ? any1 have an idea ? thanks. Edited March 1, 2012 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Nine Posted March 2, 2012 Author Share Posted March 2, 2012 Finally got it working guys...took me almost a week but i got it. Here's my code in case someone else had to find the way out #Include <NamedPipes.au3> #Include <WinAPI.au3> msgbox (0,"server","starting pipe") Local Const $SECURITY_DESCRIPTOR_REVISION = 1 Local $tSecurityDescriptor = DllStructCreate("byte;byte;word;ptr[4]") Local $aRet = DllCall("Advapi32.dll", "bool", "InitializeSecurityDescriptor", _ "struct*", $tSecurityDescriptor, "dword", $SECURITY_DESCRIPTOR_REVISION) If @error Then msgbox (0,"Error","@error = " & @error & " / " & @extended) exit endif if not $aRet[0] then msgbox (0,"Error","Win err = " & _WinAPI_GetLastError() & " / " & _WinAPI_GetLastErrorMessage()) exit endif $aRet = DllCall("Advapi32.dll", "bool", "SetSecurityDescriptorDacl", _ "struct*", $tSecurityDescriptor, "bool", 1, "ptr", 0, "bool", 0) If @error Then msgbox (0,"Error","@error = " & @error & " / " & @extended) exit endif if not $aRet[0] then msgbox (0,"Error","Win err = " & _WinAPI_GetLastError() & " / " & _WinAPI_GetLastErrorMessage()) exit endif Local $tSecurityAttributes = DllStructCreate($tagSECURITY_ATTRIBUTES) DllStructSetData($tSecurityAttributes, 1, DllStructGetSize($tSecurityAttributes)) DllStructSetData($tSecurityAttributes, 2, DllStructGetPtr($tSecurityDescriptor)) DllStructSetData($tSecurityAttributes, 3, 1) Local $hNamedPipe = _NamedPipes_CreateNamedPipe(".pipeIPwServer",2,1,0,1,1,0,2,4096,4096,5000, _ DllStructGetPtr($tSecurityAttributes)) _NamedPipes_ConnectNamedPipe($hNamedPipe) enjoy ! “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
RTFC Posted January 25, 2015 Share Posted January 25, 2015 Useful; thanks a lot. My Contributions and Wrappers Spoiler BitMaskSudokuSolver BuildPartitionTable CodeCrypter CodeScanner DigitalDisplay Eigen4AutoIt FAT Suite HighMem MetaCodeFileLibrary OSgrid Pool RdRand SecondDesktop SimulatedAnnealing Xbase I/O Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now