4 * Copyright 1996 Marcus Meissner
22 /**************************************************************************
23 * RtlLengthRequiredSid [NTDLL]
26 RtlLengthRequiredSid(DWORD nrofsubauths
) {
27 return sizeof(DWORD
)*nrofsubauths
+sizeof(SID
);
30 /**************************************************************************
31 * RtlNormalizeProcessParams [NTDLL]
34 RtlNormalizeProcessParams(LPVOID x
)
36 fprintf(stdnimp
,"RtlNormalizeProcessParams(%p), stub.\n",x
);
40 /**************************************************************************
41 * RtlInitializeSid [NTDLL]
44 RtlInitializeSid(LPSID lpsid
,LPSID_IDENTIFIER_AUTHORITY lpsidauth
,DWORD c
) {
47 if (a
>=SID_MAX_SUB_AUTHORITIES
)
49 lpsid
->SubAuthorityCount
= a
;
50 lpsid
->Revision
= SID_REVISION
;
51 memcpy(&(lpsid
->IdentifierAuthority
),lpsidauth
,sizeof(SID_IDENTIFIER_AUTHORITY
));
55 /**************************************************************************
56 * RtlSubAuthoritySid [NTDLL]
59 RtlSubAuthoritySid(LPSID lpsid
,DWORD nr
) {
60 return &(lpsid
->SubAuthority
[nr
]);
63 /**************************************************************************
64 * RtlSubAuthorityCountSid [NTDLL]
67 RtlSubAuthorityCountSid(LPSID lpsid
) {
68 return ((LPBYTE
)lpsid
)+1;
71 /**************************************************************************
75 RtlCopySid(DWORD len
,LPSID to
,LPSID from
) {
76 if (len
<(from
->SubAuthorityCount
*4+8))
78 memmove(to
,from
,from
->SubAuthorityCount
*4+8);
82 /**************************************************************************
83 * RtlOemToUnicodeN [NTDLL]
86 RtlOemToUnicodeN(LPWSTR unistr
,DWORD unilen
,LPDWORD reslen
,LPSTR oemstr
,DWORD oemlen
) {
93 x
=(LPWSTR
)xmalloc((len
+1)*sizeof(WCHAR
));
94 lstrcpynAtoW(x
,oemstr
,len
+1);
95 memcpy(unistr
,x
,len
*2);
96 if (reslen
) *reslen
= len
*2;
100 /**************************************************************************
101 * RtlUnicodeToOemN [NTDLL]
104 RtlUnicodeToOemN(LPSTR oemstr
,DWORD oemlen
,LPDWORD reslen
,LPWSTR unistr
,DWORD unilen
) {
111 x
=(LPSTR
)xmalloc(len
+1);
112 lstrcpynWtoA(x
,unistr
,len
+1);
113 memcpy(oemstr
,x
,len
);
114 if (reslen
) *reslen
= len
;
118 /**************************************************************************
119 * RtlUnicodeStringToOemString [NTDLL]
122 RtlUnicodeStringToOemString(LPUNICODE_STRING uni
,LPANSI_STRING oem
,BOOL32 alloc
)
125 oem
->Buffer
= (LPSTR
)xmalloc(uni
->Length
/2)+1;
126 oem
->MaximumLength
= uni
->Length
/2+1;
128 oem
->Length
= uni
->Length
/2;
129 lstrcpynWtoA(oem
->Buffer
,uni
->Buffer
,uni
->Length
/2+1);