summaryrefslogtreecommitdiff
path: root/portland/dapi/tests/test_runasuser.c
blob: 5fe4f1afdecfd8b3809a98bdcbf771a896b66ff2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>

#include <dapi/comm.h>
#include <dapi/calls.h>

int main()
    {
    int ok;
    DapiConnection* conn = dapi_connectAndInit();
    if( conn == NULL )
        {
        fprintf( stderr, "Cannot connect!\n" );
        return 1;
        }
    ok = dapi_RunAsUser_Window( conn, "", "xterm -title test", 0 ); /* no mainwindow */
    printf( "Result: %s\n", ok == 1 ? "Ok" : "Failed" );
    dapi_close( conn );
    return 0;
    }