[so] comanda simpla windows

Razvan Crainea razvan.crainea at gmail.com
Mon Mar 24 20:21:31 EET 2014


On Mon, Mar 24, 2014 at 8:13 PM, anda nenu <aannddaa_92 at yahoo.com> wrote:

> 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).
>
> bool parse_simple(simple_command_t *s, int level, command_t *father,
> HANDLE *h)
> {
> STARTUPINFO si;
> PROCESS_INFORMATION pi;
> DWORD dwRet;
>  BOOL bRet;
> HANDLE hFile;
>
> ZeroMemory(&si, sizeof(si));
> si.cb = sizeof(si);
> ZeroMemory(&pi, sizeof(pi));
>
>  si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
> si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
> si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
>
> si.dwFlags |= STARTF_USESTDHANDLES;
>
> bRet = CreateProcess(NULL, get_argv(s), NULL, NULL, TRUE, 0, NULL, NULL,
> &si, &pi);
>  DIE(bRet == FALSE, "Create Process");
>
> dwRet = WaitForSingleObject(pi.hProcess, INFINITE);
>  DIE(dwRet == WAIT_FAILED, "WaitForSingleObject");
>
>     CloseProcess(&pi);
> }
> Please help :D si am apelat-o asa
> if (c->op == OP_NONE) {
>          parse_simple(c->scmd,level,father,h);
> }
>
>

Bună, Anda!

Poți să ne dai mai multe detalii despre ce anume nu merge?

-- 
Răzvan Crainea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/pipermail/so/attachments/20140324/657e8cb8/attachment.html>


More information about the so mailing list