<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 24, 2014 at 8:13 PM, anda nenu <span dir="ltr"><<a href="mailto:aannddaa_92@yahoo.com" target="_blank">aannddaa_92@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><div>
Buna, nu imi dau seama de ce nu merge urmatorul cod pentru executia unei comenzi simple (fiind la fel ca cel din laborator mi-am permis sa il scriu aici).</div><div><br></div><div>bool parse_simple(simple_command_t *s, int level, command_t *father, HANDLE *h)</div>
<div>{</div><div><span style="white-space:pre-wrap"> </span>STARTUPINFO si;</div><div><span style="white-space:pre-wrap"> </span>PROCESS_INFORMATION pi;</div><div><span style="white-space:pre-wrap"> </span>DWORD dwRet;</div>
<div><span style="white-space:pre-wrap"> </span>BOOL bRet;</div><div><span style="white-space:pre-wrap"> </span>HANDLE hFile;</div><div><br></div><div><span style="white-space:pre-wrap">
</span>ZeroMemory(&si, sizeof(si));</div><div><span style="white-space:pre-wrap"> </span>si.cb = sizeof(si);</div><div><span style="white-space:pre-wrap"> </span>ZeroMemory(&pi, sizeof(pi));</div><div><br></div>
<div><span style="white-space:pre-wrap"> </span>si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);</div><div><span style="white-space:pre-wrap"> </span>si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);</div><div><span style="white-space:pre-wrap"> </span>si.hStdError = GetStdHandle(STD_ERROR_HANDLE);</div>
<div><br></div><div><span style="white-space:pre-wrap"> </span>si.dwFlags |= STARTF_USESTDHANDLES;</div><div><br></div><div><span style="white-space:pre-wrap"> </span>bRet = CreateProcess(NULL, get_argv(s), NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi); </div>
<div><span style="white-space:pre-wrap"> </span>DIE(bRet == FALSE, "Create Process");</div><div><br></div><div><span style="white-space:pre-wrap"> </span>dwRet = WaitForSingleObject(pi.hProcess, INFINITE);</div>
<div><span style="white-space:pre-wrap"> </span>DIE(dwRet == WAIT_FAILED, "WaitForSingleObject");</div><div><br></div><div> CloseProcess(&pi);</div><div>}</div><div>Please help :D si am apelat-o asa </div>
<div>if (c->op == OP_NONE) { </div><div> <span style="white-space:pre-wrap"> </span>parse_simple(c->scmd,level,father,h);</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif">
<span style="font-size:10pt">}</span></div><div> </div></div></div></blockquote><div><br></div><div>Bună, Anda!</div><div><br></div><div>Poți să ne dai mai multe detalii despre ce anume nu merge?</div></div><div><br></div>
-- <br>Răzvan Crainea
</div></div>