Subversion Repositories Aucun

Rev

Rev 204 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
106 ixe013 1
#include "stdafx.h"
2
#include "lsahelper.h"
3
 
204 ixe013 4
extern PLSA_SECPKG_FUNCTION_TABLE g_pSec;
106 ixe013 5
 
6
LPVOID LsaAllocateLsa(ULONG size)
7
{
215 ixe013 8
    LPVOID result = 0;
107 ixe013 9
 
215 ixe013 10
    if(g_pSec)
11
    {
12
        result = g_pSec->AllocateLsaHeap(size);
13
    }
107 ixe013 14
 
215 ixe013 15
    return result;
106 ixe013 16
}
17
 
215 ixe013 18
LSA_STRING* AllocateLsaStringLsa(LPCSTR szString)
106 ixe013 19
{
215 ixe013 20
    LSA_STRING* s = 0;
21
    size_t len = strlen(szString);
22
    s = (LSA_STRING*) LsaAllocateLsa(sizeof(LSA_STRING));
106 ixe013 23
 
215 ixe013 24
    if (s)
25
    {
26
        s->Buffer = (char*) LsaAllocateLsa((ULONG) len + 1);
27
        s->Length = (USHORT)len;
28
        s->MaximumLength = (USHORT)len + 1;
29
        strcpy_s(s->Buffer, len + 1,  szString);
30
    }
107 ixe013 31
 
215 ixe013 32
    return s;
107 ixe013 33
}
106 ixe013 34