Piotr Caban : scrrun: Add IFileSystem3::GetTempName implementation.

Alexandre Julliard julliard at winehq.org
Mon Jul 29 14:01:17 CDT 2013


Module: wine
Branch: master
Commit: ac132599aa13c3392bd841a3d41822eb91c3d7e1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ac132599aa13c3392bd841a3d41822eb91c3d7e1

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Jul 25 15:12:57 2013 +0200

scrrun: Add IFileSystem3::GetTempName implementation.

---

 dlls/scrrun/Makefile.in  |    2 +-
 dlls/scrrun/filesystem.c |   19 +++++++++++++++++--
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/dlls/scrrun/Makefile.in b/dlls/scrrun/Makefile.in
index 4ceac05..cb5d981 100644
--- a/dlls/scrrun/Makefile.in
+++ b/dlls/scrrun/Makefile.in
@@ -1,5 +1,5 @@
 MODULE    = scrrun.dll
-IMPORTS   = uuid oleaut32 version
+IMPORTS   = uuid oleaut32 version advapi32
 
 C_SRCS = \
 	dictionary.c \
diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index 62bc676..8d0f5b1 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -26,6 +26,7 @@
 #include "ole2.h"
 #include "olectl.h"
 #include "dispex.h"
+#include "ntsecapi.h"
 #include "scrrun.h"
 #include "scrrun_private.h"
 
@@ -868,9 +869,23 @@ static HRESULT WINAPI filesys_GetAbsolutePathName(IFileSystem3 *iface, BSTR Path
 
 static HRESULT WINAPI filesys_GetTempName(IFileSystem3 *iface, BSTR *pbstrResult)
 {
-    FIXME("%p %p\n", iface, pbstrResult);
+    static const WCHAR fmt[] = {'r','a','d','%','0','5','X','.','t','x','t',0};
 
-    return E_NOTIMPL;
+    DWORD random;
+
+    TRACE("%p %p\n", iface, pbstrResult);
+
+    if(!pbstrResult)
+        return E_POINTER;
+
+    *pbstrResult = SysAllocStringLen(NULL, 12);
+    if(!*pbstrResult)
+        return E_OUTOFMEMORY;
+
+    if(!RtlGenRandom(&random, sizeof(random)))
+        return E_FAIL;
+    sprintfW(*pbstrResult, fmt, random & 0xfffff);
+    return S_OK;
 }
 
 static HRESULT WINAPI filesys_DriveExists(IFileSystem3 *iface, BSTR DriveSpec,




More information about the wine-cvs mailing list