Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
7f99aa83
Commit
7f99aa83
authored
May 23, 2005
by
Uwe Bonnes
Committed by
Alexandre Julliard
May 23, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented SystemFunction036.
parent
70d04399
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletion
+38
-1
advapi32.spec
dlls/advapi32/advapi32.spec
+1
-1
crypt.c
dlls/advapi32/crypt.c
+37
-0
No files found.
dlls/advapi32/advapi32.spec
View file @
7f99aa83
...
...
@@ -343,7 +343,7 @@
@ stub SystemFunction033
@ stub SystemFunction034
@ stub SystemFunction035
@ st
ub SystemFunction036
@ st
dcall SystemFunction036(ptr long) # RtlGenRandom
@ stdcall SystemFunction040(ptr long long) # RtlEncryptMemory
@ stdcall SystemFunction041(ptr long long) # RtlDecryptMemory
@ stub TraceEvent
...
...
dlls/advapi32/crypt.c
View file @
7f99aa83
...
...
@@ -27,6 +27,10 @@
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "crypt.h"
#include "winnls.h"
...
...
@@ -1891,6 +1895,39 @@ BOOL WINAPI CryptVerifySignatureA (HCRYPTHASH hHash, BYTE *pbSignature, DWORD dw
return
result
;
}
/******************************************************************************
* SystemFunction036 (ADVAPI32.@)
*
* MSDN documents this function as RtlGenRandom and declares it in ntsecapi.h
*
* PARAMS
* pbBufer [O] Pointer to memory to receive random bytes.
* dwLen [I] Number of random bytes to fetch.
*/
BOOL
WINAPI
SystemFunction036
(
PVOID
pbBuffer
,
ULONG
dwLen
)
{
int
dev_random
;
/* FIXME: /dev/urandom does not provide random numbers of a sufficient
* quality for cryptographic applications. /dev/random is much better,
* but it blocks if the kernel has not yet collected enough entropy for
* the request, which will suspend the calling thread for an indefinite
* amount of time. */
dev_random
=
open
(
"/dev/urandom"
,
O_RDONLY
);
if
(
dev_random
!=
-
1
)
{
if
(
read
(
dev_random
,
pbBuffer
,
dwLen
)
==
(
ssize_t
)
dwLen
)
{
close
(
dev_random
);
return
TRUE
;
}
close
(
dev_random
);
}
SetLastError
(
NTE_FAIL
);
return
FALSE
;
}
/*
These functions have nearly identical prototypes to CryptProtectMemory and CryptUnprotectMemory,
in crypt32.dll.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment