lol, no offense taken
Yes. Every time i make changes to the server code i remove the old one and then install the newer version, then run it from windows services.
lol, no offense taken
Yes. Every time i make changes to the server code i remove the old one and then install the newer version, then run it from windows services.
"Artificial Intelligence usually beats natural stupidity."
I think the problem is really in the authentication :S
This project uses windows authentication between the client and server.
If i'm in a specific account sending a message through a named pipe to a server, the server machine must accept my account.
How do i make the server accept my account? If this is actually the issue...
"Artificial Intelligence usually beats natural stupidity."
Again, my caveat, I'm not a Network/Security administrator.
At the target workstation, right click on My computer, click on manage, click on Local users and Groups, Select Groups in the right pane. There should be an Administrators group listed. Add your userid to this group. Click on Ok etc to back out. Reboot the target workstation and go into control panel and select user accounts. you should see your user account listed. Reset the password of this account to match your password. Once this is done try your app.
One other thing. since I work with Active directory, I have always had to preface the added user account with the domain. For Instance, when I added my account to the Local Admin group, I had to use Domain\123456. I' m not sure if you will have to do that. You may just need to add 123456.
When you say to add my userid to that group, do you mean the userid i use in the host machine? If so, how can i get my userid? :SAt the target workstation, right click on My computer, click on manage, click on Local users and Groups, Select Groups in the right pane. There should be an Administrators group listed. Add your userid to this group.
"Artificial Intelligence usually beats natural stupidity."
You should find your userid (user name) from the task manager. It's the Users tab. What type of network are you on? Is it a school network, home network or corporate network?When you say to add my userid to that group, do you mean the userid i use in the host machine? If so, how can i get my userid? :S
But anyway, I don't think it's an authentication issue because if it were, the returned error code would be 1326, Logon failure: Unknown user name or bad password.
The error 3 indicates that it's a poorly formed path. Humor me again and change this
to thisCode:char *pszPipe="\\\\192.168.1.82\\pipe\\ServNT";
Code:char pszPipe[] = {"\\\\192.168.1.82\\pipe\\ServNT"};
Last edited by BobS0327; 11-10-2008 at 10:03 PM.
oh! i thought that userid was different from user name, sorry :S
ok, i will humor you...
after changing:
to thisCode:char *pszPipe="\\\\192.168.1.82\\pipe\\ServNT";
i can know access the serverCode:char pszPipe[] = {"\\\\192.168.1.82\\pipe\\ServNT"};
but........i know get a SetNamedPipeHandlerState error.
At least we are progressing
"Artificial Intelligence usually beats natural stupidity."
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
your right!
i changed it back to:
and it "works"...Code:char *pszPipe="\\\\192.168.1.82\\pipe\\ServNT";
really strange :S
i might have been doing something wrong, but anyway, at least now i can access the server.
How can i resolve this other error?
SetNamedPipeHandlerState error
"Artificial Intelligence usually beats natural stupidity."
What is the exact error code?
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
The error that you were getting, error 3 "System cannot find the specified path" indicated that the path was poorly formed which indicated that there was something wrong with *pszPipe. But yet I kept staring at that variable and my mind told me that there wasn't anything wrong with it. I just didn't want to believe the returned error code because *pszPipe looked correct to me.
I can't recreate the error. Otherwise, I'd run it thru Ollydbg and tell you exactly what the issue is.
Are you sure? Your error checking code is contains errors
hPipe will never equal NULL as CreateFile returns INVALID_HANDLE_VALUE when it fails.Code:hPipe = CreateFile(pszPipe, GENERIC_WRITE|GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hPipe==NULL) { printf("CLIENT: Error a connecting \n"); return 1; }
hey everyone!
My client and server apps are working nicely on the same machine. I can send command lines from the client app to the server via pipe and the server runs 's the commands. How can there be an error in the code if i can accomplish these tasks?
About the issue of not connecting to my VM. My teacher said that to communicate from different machines in this project i have to be logged as the same user in both machines :S and for that i have to use a some "start" command line. For example, before a run the client app on the host machine i have to log-on to the VM, and for that i run this command:
After that i run my client app.Code:start \\vmIP Username Password
That's what i did...and know i can access the server.
But.....when i send a command line from the client app to the server, the server gives me a "ReadFile error 109" in the event viewer
Why is that happening?
Last edited by IndioDoido; 11-11-2008 at 07:24 PM.
"Artificial Intelligence usually beats natural stupidity."
As adeyblue points out, you're incorrectly checking the return value of Create File
It should be:
The reason being is that INVALID_HANDLE_VALUE is 6 and if memory serves me correctly, NULL evaluates to 0 (zero). Thus, your CreateFile call will ALWAYS be successful whether or not it is actually successful. If CreateFile fails, it will return six not zero.Code:if (hPipe==INVALID_HANDLE_VALUE) { printf("CLIENT: Error a connecting \n"); return 1; }
The 109 error translates to "the named pipe has ended". Normally, this should be an informational message. Named pipes work in the following manner:
The server makes a client connection, communicates with the client until the client disconnects casuing ReadFile to return FALSE. it then disconnects the server side connection which causes the "109 the name pipe has ended" message. and then the server attempts to connect to another client.
Thus, under normal circumstances the 109 message is just an informational message.
hi BobS0327
i've changed the error checking code to:
I still get the same error in the event viewer when i send a command to the serverCode:if (hPipe==INVALID_HANDLE_VALUE)
But, in the client side i now "trigger" this checking:
Code:if (!SetNamedPipeHandleState(hPipe,&dwMode,NULL,NULL)) { printf("CLIENT: Error SetNamedPipeHandleState\n"); return 1; }
Last edited by IndioDoido; 11-12-2008 at 08:02 PM.
"Artificial Intelligence usually beats natural stupidity."