~ubuntu-branches/ubuntu/maverick/librapi2/maverick

« back to all changes in this revision

Viewing changes to src/rapi.c

  • Committer: Bazaar Package Importer
  • Author(s): Volker Christian
  • Date: 2004-03-25 15:38:55 UTC
  • Revision ID: james.westby@ubuntu.com-20040325153855-bcjmhydo8rufdgsv
Tags: upstream-0.8.9
ImportĀ upstreamĀ versionĀ 0.8.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: rapi.c,v 1.11 2003/08/05 11:23:29 twogood Exp $ */
 
2
#undef __STRICT_ANSI__
 
3
#define _GNU_SOURCE
 
4
#include "rapi_internal.h"
 
5
#include "rapi.h"
 
6
#include "rapi_buffer.h"
 
7
#include "rapi_context.h"
 
8
#include <stdlib.h>
 
9
 
 
10
HRESULT CeRapiFreeBuffer( 
 
11
                LPVOID Buffer)
 
12
{
 
13
        free(Buffer);
 
14
        return S_OK;
 
15
}
 
16
 
 
17
HRESULT CeRapiInit(void)/*{{{*/
 
18
{
 
19
        RapiContext* context = rapi_context_current();
 
20
 
 
21
        return rapi_context_connect(context);
 
22
}/*}}}*/
 
23
 
 
24
STDAPI CeRapiUninit(void)/*{{{*/
 
25
{
 
26
        RapiContext* context = rapi_context_current();
 
27
        
 
28
        if (context->is_initialized)
 
29
        {
 
30
    rapi_context_free(context);
 
31
                return S_OK;
 
32
        }
 
33
        else
 
34
        {
 
35
                return E_FAIL;
 
36
        }
 
37
}/*}}}*/
 
38
 
 
39
BOOL CeCheckPassword( /*{{{*/
 
40
                LPWSTR lpszPassword)
 
41
{
 
42
        RapiContext* context = rapi_context_current();
 
43
        BOOL return_value = 0;
 
44
        
 
45
        rapi_context_begin_command(context, 0x34);
 
46
        rapi_buffer_write_optional_string(context->send_buffer, lpszPassword);
 
47
 
 
48
        if ( !rapi_context_call(context) )
 
49
                return false;
 
50
        
 
51
        rapi_buffer_read_uint32(context->recv_buffer, &context->last_error);
 
52
        rapi_buffer_read_uint32(context->recv_buffer, &return_value);
 
53
 
 
54
        return return_value;
 
55
}/*}}}*/
 
56