reactos/lib/syssetup
diff -u -r1.20 -r1.21
--- install.c 24 Nov 2004 23:09:46 -0000 1.20
+++ install.c 28 Dec 2004 14:41:46 -0000 1.21
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: install.c,v 1.20 2004/11/24 23:09:46 ekohl Exp $
+/* $Id: install.c,v 1.21 2004/12/28 14:41:46 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -39,13 +39,15 @@
#include <userenv.h>
#include <setupapi.h>
+#include <shlobj.h>
+#include <objidl.h>
+#include <shlwapi.h>
+
#include "globals.h"
#include "resource.h"
#define VMWINST
-VOID WINAPI CreateCmdLink(VOID);
-
/* GLOBALS ******************************************************************/
@@ -97,6 +99,74 @@
#endif
+HRESULT CreateShellLink(LPCSTR linkPath, LPCSTR cmd, LPCSTR arg, LPCSTR dir, LPCSTR iconPath, int icon_nr, LPCSTR comment)
+{
+ IShellLinkA* psl;
+ IPersistFile* ppf;
+ WCHAR buffer[MAX_PATH];
+
+ HRESULT hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, &IID_IShellLink, (LPVOID*)&psl);
+
+ if (SUCCEEDED(hr))
+ {
+ hr = psl->lpVtbl->SetPath(psl, cmd);
+
+ if (arg)
+ {
+ hr = psl->lpVtbl->SetArguments(psl, arg);
+ }
+
+ if (dir)
+ {
+ hr = psl->lpVtbl->SetWorkingDirectory(psl, dir);
+ }
+
+ if (iconPath)
+ {
+ hr = psl->lpVtbl->SetIconLocation(psl, iconPath, icon_nr);
+ }
+
+ if (comment)
+ {
+ hr = psl->lpVtbl->SetDescription(psl, comment);
+ }
+
+ hr = psl->lpVtbl->QueryInterface(psl, &IID_IPersistFile, (LPVOID*)&ppf);
+
+ if (SUCCEEDED(hr))
+ {
+ MultiByteToWideChar(CP_ACP, 0, linkPath, -1, buffer, MAX_PATH);
+
+ hr = ppf->lpVtbl->Save(ppf, buffer, TRUE);
+
+ ppf->lpVtbl->Release(ppf);
+ }
+
+ psl->lpVtbl->Release(psl);
+ }
+
+ return hr;
+}
+
+
+static VOID
+CreateCmdLink(VOID)
+{
+ char path[MAX_PATH];
+ LPSTR p;
+
+ CoInitialize(NULL);
+
+ SHGetSpecialFolderPathA(0, path, CSIDL_DESKTOP, TRUE);
+ p = PathAddBackslashA(path);
+
+ strcpy(p, "Command Prompt.lnk");
+ CreateShellLink(path, "cmd.exe", "", NULL, NULL, 0, "Open command prompt");
+
+ CoUninitialize();
+}
+
+
static VOID
CreateRandomSid (PSID *Sid)
{
@@ -320,6 +390,8 @@
return 0;
}
+ CreateCmdLink();
+
/* Create the semi-random Domain-SID */
CreateRandomSid (&DomainSid);
if (DomainSid == NULL)
@@ -368,7 +440,8 @@
* and not completing it, let it restart instead
*/
LastError = GetLastError();
- if (LastError != ERROR_USER_EXISTS) {
+ if (LastError != ERROR_USER_EXISTS)
+ {
DebugPrint("SamCreateUser() failed!\n");
RtlFreeSid(AdminSid);
RtlFreeSid(DomainSid);
reactos/lib/syssetup
diff -u -r1.13 -r1.14
--- Makefile 22 Nov 2004 11:01:45 -0000 1.13
+++ Makefile 28 Dec 2004 14:41:46 -0000 1.14
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.13 2004/11/22 11:01:45 gvg Exp $
+# $Id: Makefile,v 1.14 2004/12/28 14:41:46 ekohl Exp $
PATH_TO_TOP = ../..
@@ -9,7 +9,9 @@
TARGET_BASE = $(TARGET_BASE_LIB_SYSSETUP)
TARGET_SDKLIBS = ntdll.a kernel32.a advapi32.a gdi32.a user32.a samlib.a userenv.a \
- comctl32.a setupapi.a
+ comctl32.a setupapi.a ole32.a shell32.a shlwapi.a
+
+TARGET_GCCLIBS = uuid
TARGET_CFLAGS = -Wall -Werror -fno-builtin