Author: hbelusca
Date: Sat Sep 14 14:51:56 2013
New Revision: 60102
URL:
http://svn.reactos.org/svn/reactos?rev=60102&view=rev
Log:
[NET][SERVMAN]: Fix warning C4090.
[CMAKE]: Temporarily reconsider C4090 as a warning, otherwise we would have to fix ~= 33
problems in Wine dlls.
Added:
trunk/reactos/base/applications/network/net/cmdStart.c
- copied, changed from r60099,
trunk/reactos/base/applications/network/net/cmdstart.c
Removed:
trunk/reactos/base/applications/network/net/cmdstart.c
Modified:
trunk/reactos/base/applications/mscutils/servman/start.c
trunk/reactos/base/applications/network/net/CMakeLists.txt
trunk/reactos/cmake/msvc.cmake
Modified: trunk/reactos/base/applications/mscutils/servman/start.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/start.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mscutils/servman/start.c [iso-8859-1] Sat Sep 14
14:51:56 2013
@@ -183,7 +183,7 @@
}
if (lpArgsVector)
- LocalFree(lpArgsVector);
+ LocalFree((LPVOID)lpArgsVector);
return bRet;
}
Modified: trunk/reactos/base/applications/network/net/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/net/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/net/CMakeLists.txt [iso-8859-1] Sat Sep 14
14:51:56 2013
@@ -3,7 +3,7 @@
list(APPEND SOURCE
main.c
- cmdstart.c
+ cmdStart.c
cmdStop.c
cmdHelpMsg.c
cmdPause.c
Copied: trunk/reactos/base/applications/network/net/cmdStart.c (from r60099,
trunk/reactos/base/applications/network/net/cmdstart.c)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/net/cmdstart.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/net/cmdStart.c [iso-8859-1] Sat Sep 14
14:51:56 2013
@@ -142,7 +142,7 @@
done:
if (lpArgVectors != NULL)
- HeapFree(GetProcessHeap(), 0, lpArgVectors);
+ HeapFree(GetProcessHeap(), 0, (LPVOID)lpArgVectors);
if (hService != NULL)
CloseServiceHandle(hService);
Removed: trunk/reactos/base/applications/network/net/cmdstart.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/net/cmdstart.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/net/cmdstart.c (removed)
@@ -1,177 +0,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS net command
- * FILE:
- * PURPOSE:
- *
- * PROGRAMMERS: Magnus Olsen (greatlord(a)reactos.org)
- */
-
-#include "net.h"
-
-/* Enumerate all running services */
-static
-INT
-EnumerateRunningServices(VOID)
-{
- SC_HANDLE hManager = NULL;
- SC_HANDLE hService = NULL;
- DWORD dwBufferSize = 0;
- DWORD dwServiceCount;
- DWORD dwResumeHandle = 0;
- LPENUM_SERVICE_STATUS lpServiceBuffer = NULL;
- INT i;
- INT nError = 0;
- DWORD dwError = ERROR_SUCCESS;
-
- hManager = OpenSCManagerW(NULL,
- SERVICES_ACTIVE_DATABASE,
- SC_MANAGER_ENUMERATE_SERVICE);
- if (hManager == NULL)
- {
- dwError = GetLastError();
- nError = 1;
- goto done;
- }
-
- EnumServicesStatusW(hManager,
- SERVICE_WIN32,
- SERVICE_ACTIVE,
- NULL,
- 0,
- &dwBufferSize,
- &dwServiceCount,
- &dwResumeHandle);
-
- if (dwBufferSize != 0)
- {
- lpServiceBuffer = HeapAlloc(GetProcessHeap(), 0, dwBufferSize);
- if (lpServiceBuffer != NULL)
- {
- if (EnumServicesStatusW(hManager,
- SERVICE_WIN32,
- SERVICE_ACTIVE,
- lpServiceBuffer,
- dwBufferSize,
- &dwBufferSize,
- &dwServiceCount,
- &dwResumeHandle))
- {
- printf("The following services hav been started:\n\n");
-
- for (i = 0; i < dwServiceCount; i++)
- {
- printf(" %S\n", lpServiceBuffer[i].lpDisplayName);
- }
- }
-
- HeapFree(GetProcessHeap(), 0, lpServiceBuffer);
- }
- }
-
-done:
- if (hService != NULL)
- CloseServiceHandle(hService);
-
- if (hManager != NULL)
- CloseServiceHandle(hManager);
-
- if (dwError != ERROR_SUCCESS)
- {
- /* FIXME: Print proper error message */
- printf("Error: %lu\n", dwError);
- }
-
- return nError;
-}
-
-/* Start the service argv[2] */
-static
-INT
-StartOneService(INT argc, WCHAR **argv)
-{
- SC_HANDLE hManager = NULL;
- SC_HANDLE hService = NULL;
- LPCWSTR *lpArgVectors = NULL;
- DWORD dwError = ERROR_SUCCESS;
- INT nError = 0;
- INT i;
-
- hManager = OpenSCManagerW(NULL,
- SERVICES_ACTIVE_DATABASE,
- SC_MANAGER_ENUMERATE_SERVICE);
- if (hManager == NULL)
- {
- dwError = GetLastError();
- nError = 1;
- goto done;
- }
-
- hService = OpenServiceW(hManager,
- argv[2],
- SERVICE_START);
- if (hService == NULL)
- {
- dwError = GetLastError();
- nError = 1;
- goto done;
- }
-
- lpArgVectors = HeapAlloc(GetProcessHeap(),
- 0,
- (argc - 2) * sizeof(LPCWSTR));
- if (lpArgVectors == NULL)
- {
- dwError = GetLastError();
- nError = 1;
- goto done;
- }
-
- for (i = 2; i < argc; i++)
- {
- lpArgVectors[i - 2] = argv[i];
- }
-
- if (!StartServiceW(hService,
- (DWORD)argc - 2,
- lpArgVectors))
- {
- dwError = GetLastError();
- nError = 1;
- }
-
-done:
- if (lpArgVectors != NULL)
- HeapFree(GetProcessHeap(), 0, lpArgVectors);
-
- if (hService != NULL)
- CloseServiceHandle(hService);
-
- if (hManager != NULL)
- CloseServiceHandle(hManager);
-
- if (dwError != ERROR_SUCCESS)
- {
- /* FIXME: Print proper error message */
- printf("Error: %lu\n", dwError);
- }
-
- return nError;
-}
-
-INT
-cmdStart(INT argc, WCHAR **argv)
-{
- INT nError = 0;
-
- if (argc == 2)
- {
- nError = EnumerateRunningServices();
- }
- else
- {
- nError = StartOneService(argc, argv);
- }
-
- return nError;
-}
Modified: trunk/reactos/cmake/msvc.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/msvc.cmake?rev=60102…
==============================================================================
--- trunk/reactos/cmake/msvc.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/msvc.cmake [iso-8859-1] Sat Sep 14 14:51:56 2013
@@ -37,7 +37,8 @@
# for C++ programs, the compiler error C2440 is issued)
# - C4098: void function returning a value
# - C4700: uninitialized variable usage
-add_compile_flags("/we4047 /we4090 /we4098 /we4700")
+##add_compile_flags("/we4047 /we4090 /we4098 /we4700")
+add_compile_flags("/we4047 /we4098 /we4700")
# Debugging
#if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")