Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/Makefile.inc
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/Makefile.inc?rev=980662&view=auto
==============================================================================
--- commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/Makefile.inc (added)
+++ commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/Makefile.inc Fri Jul 30 06:50:12 2010
@@ -0,0 +1,346 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @author Mladen Turk
+#
+#
+# ====================================================================
+#
+# Makefile.inc Master makefile definitions.
+# This file defines CPU architecture and basic compiler
+# and linker parameters.
+# Common params:
+# CPU Compile for specified CPU. Supported CPU's are:
+# X86 (Common x86 architecture)
+# X64 (AMD64/EMT64 architecture)
+# I64 (Intel IA64 architecture)
+# If not specified it will default to the
+# PROCESSOR_ARCHITECTURE environment variable
+# or to the X86 if not specified.
+# WINVER Compile for specified Windows version
+# WINNT for Windows 2000 and up(default)
+# WINXP for Windows XP and up
+# WIN2003 for Windows 2003 and up
+# VSITA for Windows Vista and up
+# Deprecated targets (may not even compile):
+# NT4 for Windows NT4 and up
+# WIN9X for Windows 95, 98 and Me
+# BUILD Build version
+# RETAIL or RELEASE (default)
+# DEBUG
+# TARGET Build application target
+# EXE Console executable (default)
+# GUI Windows GUI executable
+# DLL Dynamic Link Library
+# LIB Static library
+# UNICODE Build unicode version
+# If definded and not empty -D_UNICODE is added
+# to CFLAGS; -D_MBCS is added otherwise
+# Environment variables used:
+# EXTRA_CFLAGS Added to the common CFLAGS
+# EXTRA_CXXFLAGS Added to the common CXXFLAGS
+# EXTRA_LIBS Added to the common LIBS
+# EXTRA_LFLAGS Added to the common LFLAGS
+# EXTRA_RCFLAGS Added to the common RCFLAGS
+#
+# Compiler tools environment variables:
+# CC C compiler (defaults to cl.exe)
+# CXX C++ compiler (defaults to $CC -TP)
+# CPP C preprocessor (defaults to $CC -EP)
+# LINK Linker (defaults to link.exe)
+# RC Resource compiler (defaults to rc.exe)
+# MT Manifest toolkit (defaults to mt.exe)
+# ML Assembler (defaults to ml.exe or ml64.exe)
+#
+# Originally contributed by Mladen Turk <mturk jboss.com>
+#
+# ====================================================================
+#
+
+# C/C++ compiler
+!IF !DEFINED(CC) || "$(CC)" == ""
+CC = cl.exe
+!ENDIF
+!IF !DEFINED(CXX) || "$(CXX)" == ""
+CXX = $(CC) -TP
+!ENDIF
+!IF !DEFINED(CPP) || "$(CPP)" == ""
+CPP = $(CC) -EP
+!ENDIF
+# Linker
+!IF !DEFINED(LINK) || "$(LINK)" == ""
+LINK = link.exe
+!ENDIF
+# Resource Compiler
+!IF !DEFINED(RC) || "$(RC)" == ""
+RC = rc.exe
+!ENDIF
+# Manifest toolkit
+!IF !DEFINED(MT) || "$(MT)" == ""
+MT = mt.exe
+!ENDIF
+
+# Use BUILD_CPU if CPU was not set
+!IF !DEFINED(CPU) || "$(CPU)" == ""
+!IF "$(BUILD_CPU)" == "i386" || "$(BUILD_CPU)" == "x86" || "$(BUILD_CPU)" == "i686"
+CPU=X86
+!ENDIF
+!IF "$(BUILD_CPU)" == "amd64" || "$(BUILD_CPU)" == "x86_64" || "$(BUILD_CPU)" == "x64"
+CPU=X64
+!ENDIF
+!IF "$(BUILD_CPU)" == "ia64" || "$(BUILD_CPU)" == "i64"
+CPU=I64
+!ENDIF
+!ENDIF
+# Figure out CPU from the current host
+!IF !DEFINED(CPU) || "$(CPU)" == ""
+!IF "$(PROCESSOR_ARCHITECTURE)" == ""
+!IF "$(PROCESSOR_ARCHITEW6432)" == ""
+CPU=X86
+!ELSE
+CPU=$(PROCESSOR_ARCHITEW6432)
+!ENDIF
+!ELSE
+CPU=$(PROCESSOR_ARCHITECTURE)
+!ENDIF
+!ENDIF
+
+!IF "$(CPU)" != "X86"
+!IF "$(CPU)" != "X64"
+!IF "$(CPU)" != "I64"
+!ERROR Must specify CPU environment variable (X86, X64, I64) $(CPU)
+!ENDIF
+!ENDIF
+!ENDIF
+
+!IF !DEFINED(TARGET) || "$(TARGET)" == ""
+TARGET=EXE
+!ENDIF
+
+!IF "$(TARGET)" != "EXE"
+!IF "$(TARGET)" != "GUI"
+!IF "$(TARGET)" != "DLL"
+!IF "$(TARGET)" != "LIB"
+!ERROR Must specify TARGET environment variable (EXE, GUI, DLL, LIB)
+!ENDIF
+!ENDIF
+!ENDIF
+!ENDIF
+
+!IF !DEFINED(WINVER) || "$(WINVER)" == ""
+WINVER=WINXP
+!ENDIF
+
+
+!IF "$(WINVER)" != "WINNT"
+!IF "$(WINVER)" != "WINXP"
+!IF "$(WINVER)" != "WIN2003"
+!IF "$(WINVER)" != "VISTA"
+!IF "$(WINVER)" != "WIN7"
+!ERROR Must specify WINVER environment variable (WINNT, WINXP, WIN2003, VISTA, WIN7)
+!ENDIF
+!ENDIF
+!ENDIF
+!ENDIF
+!ENDIF
+
+!IF "$(WINVER)" == "WINNT"
+NMAKE_WINVER = 0x0500
+_WIN32_IE = 0x0500
+!ELSEIF "$(WINVER)" == "WINXP"
+NMAKE_WINVER = 0x0501
+_WIN32_IE = 0x0600
+!ELSEIF "$(WINVER)" == "WIN2003"
+NMAKE_WINVER = 0x0502
+_WIN32_IE = 0x0600
+!ELSEIF "$(WINVER)" == "VISTA"
+NMAKE_WINVER = 0x0600
+_WIN32_IE = 0x0700
+!ELSEIF "$(WINVER)" == "WIN7"
+NMAKE_WINVER = 0x0700
+_WIN32_IE = 0x0800
+!ELSE
+!ERROR Must specify WINVER environment variable (WINNT, WINXP, WIN2003, VISTA, WIN7)
+!ENDIF
+
+NMAKE_WINNT = -D_WINNT -D_WIN32_WINNT=$(NMAKE_WINVER) -DWINVER=$(NMAKE_WINVER) -D_WIN32_IE=$(_WIN32_IE)
+
+!IF !DEFINED(BUILD) || "$(BUILD)" == ""
+BUILD=RELEASE
+!ENDIF
+!IFDEF RELEASE
+BUILD=RELEASE
+!ENDIF
+!IFDEF DEBUG
+BUILD=DEBUG
+!ENDIF
+!IFDEF NODEBUG
+BUILD=RELEASE
+!ENDIF
+
+!IF "$(BUILD)" != "RELEASE"
+!IF "$(BUILD)" != "DEBUG"
+!ERROR Must specify BUILD environment variable (RELEASE, DEBUG)
+!ENDIF
+!ENDIF
+
+# Common flags for all platforms
+CMN_CFLAGS = -c -nologo -DWIN32 -D_WIN32 -D_WINDOWS $(NMAKE_WINNT) -W3
+!IF "$(TARGET)" == "EXE"
+CMN_CFLAGS = $(CMN_CFLAGS) -D_CONSOLE
+!ENDIF
+# Mark that extern C newer throws C++ exception
+CMN_CFLAGS = $(CMN_CFLAGS) -EHsc
+
+!IF !DEFINED(UNICODE) || "$(UNICODE)" == ""
+CMN_CFLAGS = $(CMN_CFLAGS) -D_MBCS -DMBCS
+!ELSE
+CMN_CFLAGS = $(CMN_CFLAGS) -D_UNICODE -DUNICODE
+!ENDIF
+
+!IF "$(CPU)" == "X86"
+CPU_CFLAGS = -D_X86_=1
+MACHINE=X86
+MACHINE_LC=i386
+!ELSEIF "$(CPU)" == "X64"
+CPU_CFLAGS = -D_AMD64_=1 -DWIN64 -D_WIN64
+MACHINE=AMD64
+MACHINE_LC=amd64
+!ELSEIF "$(CPU)" == "I64"
+CPU_CFLAGS = -D_IA64_=1 -DWIN64 -D_WIN64
+MACHINE=IA64
+MACHINE_LC=ia64
+!ENDIF
+
+!IF "$(BUILD)" == "RELEASE"
+!IF "$(CPU)" == "X86"
+OPT_CFLAGS = -O2 -Ob2 -Oy- -Zi -DNDEBUG
+!ELSE
+OPT_CFLAGS = -O2 -Ob2 -Zi -DNDEBUG
+!ENDIF
+!ELSE
+OPT_CFLAGS = -Od -Zi -DDEBUG -D_DEBUG
+!ENDIF
+
+!IF DEFINED(STATIC_CRT)
+CRT_CFLAGS = -D_MT -MT
+!ELSE
+CRT_CFLAGS = -D_MT -MD
+!ENDIF
+
+!IF "$(BUILD)" == "DEBUG"
+CRT_CFLAGS = $(CRT_CFLAGS)d
+!ENDIF
+
+CFLAGS = $(CMN_CFLAGS) $(CPU_CFLAGS) $(OPT_CFLAGS) $(CRT_CFLAGS)
+
+!IF DEFINED(EXTRA_CFLAGS)
+CFLAGS = $(CFLAGS) $(EXTRA_CFLAGS)
+!ENDIF
+
+# Cleanup CXXFLAGS
+CXXFLAGS =
+!IF DEFINED(EXTRA_CXXFLAGS)
+CXXFLAGS = $(EXTRA_CXXFLAGS)
+!ENDIF
+
+# Linker section
+LIBS = kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib
+# Extra libs from command line or env
+!IF DEFINED(EXTRA_LIBS)
+LIBS = $(LIBS) $(EXTRA_LIBS)
+!ENDIF
+
+# Run-Time Error Checks
+!IF "$(BUILD)" == "DEBUG"
+!IF DEFINED(RTC_CHECK)
+LIBS = $(LIBS) RunTmChk.lib
+CFLAGS = $(CFLAGS) -RTC1
+!ENDIF
+!ENDIF
+
+COMMON_LFLAGS = /NOLOGO
+
+# Always add debugging to the linker
+OPT_LFLAGS = /INCREMENTAL:NO /DEBUG
+!IF "$(BUILD)" == "RELEASE"
+OPT_LFLAGS = /OPT:REF
+!ENDIF
+
+!IF "$(TARGET)" == "EXE"
+LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:CONSOLE /MACHINE:$(MACHINE)
+!ELSEIF "$(TARGET)" == "GUI"
+LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:WINDOWS /MACHINE:$(MACHINE)
+!ELSEIF "$(TARGET)" == "DLL"
+LFLAGS = $(COMMON_LFLAGS) /DLL /SUBSYSTEM:WINDOWS /MACHINE:$(MACHINE)
+!ELSEIF "$(TARGET)" == "LIB"
+LFLAGS = -lib $(COMMON_LFLAGS)
+!ENDIF
+
+!IF DEFINED(EXTRA_LFLAGS)
+LFLAGS = $(LFLAGS) $(EXTRA_LFLAGS)
+!ENDIF
+
+!IF "$(TARGET)" != "LIB"
+LFLAGS = $(LFLAGS) $(OPT_LFLAGS)
+!ENDIF
+
+# Resource compiler flags
+
+RCFLAGS=/l 0x409
+!IF "$(BUILD)" == "RELEASE"
+RCFLAGS = $(RCFLAGS) /d "NDEBUG"
+!ELSE
+RCFLAGS = $(RCFLAGS) /d "_DEBUG" /d "DEBUG"
+!ENDIF
+RCFLAGS = $(RCFLAGS)
+!IF DEFINED(EXTRA_RCFLAGS)
+RCFLAGS = $(RCFLAGS) $(EXTRA_RCFLAGS)
+!ENDIF
+
+
+# Build Target dir e.g. WINNT_I386_RELEASE_DLL
+!IF !DEFINED(WORKDIR) || "$(WORKDIR)" == ""
+!IF !DEFINED(WORKDIR_EXT) || "$(WORKDIR_EXT)" == ""
+WORKDIR = $(WINVER)_$(CPU)_$(TARGET)_$(BUILD)
+WORKDIR_DLL = $(WINVER)_$(CPU)_DLL_$(BUILD)
+WORKDIR_LIB = $(WINVER)_$(CPU)_LIB_$(BUILD)
+WORKDIR_EXE = $(WINVER)_$(CPU)_EXE_$(BUILD)
+!ELSE
+WORKDIR = $(WINVER)_$(CPU)_$(BUILDIR_EXT)_$(BUILD)
+!ENDIF
+!ENDIF
+
+CLEANTARGET=if exist "$(WORKDIR)\$(NULL)" rd /s /q $(WORKDIR)
+MAKEWORKDIR=if not exist "$(WORKDIR)\$(NULL)" mkdir $(WORKDIR)
+MAKEINSTALL=if not exist "$(INSTALLLOC)\$(NULL)" mkdir $(INSTALLLOC)
+
+!IF DEFINED(JAVA_HOME) && "$(JAVA_HOME)" != ""
+JAVA_INCLUDES=-I "$(JAVA_HOME)\include" -I "$(JAVA_HOME)\include\win32"
+!ENDIF
+
+# Assembler Section
+!IF !DEFINED(ML) || "$(ML)" == ""
+!IF "$(CPU)" == "X86"
+ML = ml.exe
+AFLAGS = /coff /Zi /c
+!ELSEIF "$(CPU)" == "X64"
+ML = ml64.exe
+AFLAGS = /Zi /c
+!ELSEIF "$(CPU)" == "I64"
+ML = ml64.exe
+AFLAGS = /coff /Zi /c
+!ENDIF
+!ENDIF
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/apxwin.h
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/apxwin.h?rev=980662&view=auto
==============================================================================
--- commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/apxwin.h (added)
+++ commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/apxwin.h Fri Jul 30 06:50:12 2010
@@ -0,0 +1,216 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _APXWIN_H_INCLUDED_
+#define _APXWIN_H_INCLUDED_
+
+
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0501
+#endif
+
+#include <windows.h>
+#include <windowsx.h>
+#include <commdlg.h>
+#include <commctrl.h>
+#include <objbase.h>
+#include <shlobj.h>
+#include <shlwapi.h>
+#include <shellapi.h>
+#include <zmouse.h>
+#include <richedit.h>
+#include <lm.h>
+
+#ifndef _INTPTR_T_DEFINED
+#ifdef _WIN64
+typedef __int64 intptr_t;
+#else
+typedef _W64 int intptr_t;
+#endif
+#define _INTPTR_T_DEFINED
+#endif
+
+#define APXMACRO_BEGIN do {
+#define APXMACRO_END } while(0)
+
+#ifdef __cplusplus
+#define __APXBEGIN_DECLS extern "C" {
+#define __APXEND_DECLS }
+#else
+#define __APXBEGIN_DECLS
+#define __APXEND_DECLS
+#endif
+
+#define SET_BIT_FLAG(x, b) ((x) |= (1 << b))
+#define CLR_BIT_FLAG(x, b) ((x) &= ~(1 << b))
+#define TST_BIT_FLAG(x, b) ((x) & (1 << b))
+
+#define IS_INVALID_HANDLE(h) (((h) == NULL || (h) == INVALID_HANDLE_VALUE))
+
+#define DYNOLAD_TYPE_DECLARE(fnName, callconv, retType) \
+ typedef retType (callconv *PFN_##fnName) \
+
+#define DYNLOAD_FPTR_DECLARE(fnName) \
+ PFN_##fnName FP_##fnName
+
+#define DYNLOAD_FPTR(fnName) FP_##fnName
+
+#define DYNLOAD_FPTR_ADDRESS(fnName, dllName) \
+ FP_##fnName = (PFN_##fnName)GetProcAddress( \
+ GetModuleHandle(TEXT(#dllName)), \
+ #fnName)
+
+#define DYNLOAD_FPTR_LOAD(fnName, dllHandle) \
+ FP_##fnName = (PFN_##fnName)GetProcAddress( \
+ dllHandle, \
+ #fnName)
+
+#define DYNLOAD_CALL(fnName) (*FP_##fnName)
+
+#ifndef ABS
+#define ABS(x) (((x) > 0) ? (x) : (x) * (-1))
+#endif
+
+#define SIZ_RESLEN 256
+#define SIZ_RESMAX (SIZ_RESLEN -1)
+#define SIZ_BUFLEN 512
+#define SIZ_BUFMAX (SIZ_BUFLEN -1)
+#define SIZ_DESLEN 1024
+#define SIZ_DESMAX (SIZ_DESLEN -1)
+#define SIZ_HUGLEN 8192
+#define SIZ_HUGMAX (SIZ_HUGLEN -1)
+#define SIZ_PATHLEN 4096
+#define SIZ_PATHMAX 4095
+
+#include "handles.h"
+#include "log.h"
+#include "cmdline.h"
+#include "console.h"
+#include "rprocess.h"
+#include "registry.h"
+#include "service.h"
+#include "javajni.h"
+#include "gui.h"
+
+__APXBEGIN_DECLS
+
+typedef enum {
+ APX_WINVER_UNK = 0,
+ APX_WINVER_UNSUP = 1,
+ APX_WINVER_95 = 10,
+ APX_WINVER_95_B = 11,
+ APX_WINVER_95_OSR2 = 12,
+ APX_WINVER_98 = 14,
+ APX_WINVER_98_SE = 16,
+ APX_WINVER_ME = 18,
+
+ APX_WINVER_UNICODE = 20, /* Prior versions support only narrow chars */
+
+ APX_WINVER_CE_3 = 23, /* CE is an odd beast, not supporting */
+ /* some pre-NT features, such as the */
+ APX_WINVER_NT = 30, /* narrow charset APIs (fooA fns), while */
+ APX_WINVER_NT_3_5 = 35, /* not supporting some NT-family features. */
+ APX_WINVER_NT_3_51 = 36,
+
+ APX_WINVER_NT_4 = 40,
+ APX_WINVER_NT_4_SP2 = 42,
+ APX_WINVER_NT_4_SP3 = 43,
+ APX_WINVER_NT_4_SP4 = 44,
+ APX_WINVER_NT_4_SP5 = 45,
+ APX_WINVER_NT_4_SP6 = 46,
+
+ APX_WINVER_2000 = 50,
+ APX_WINVER_2000_SP1 = 51,
+ APX_WINVER_2000_SP2 = 52,
+ APX_WINVER_XP = 60
+} APX_OSLEVEL;
+
+APX_OSLEVEL apxGetOsLevel();
+LPWSTR AsciiToWide(LPCSTR s, LPWSTR ws);
+LPSTR WideToAscii(LPCWSTR ws, LPSTR s);
+LPSTR MzWideToAscii(LPCWSTR ws, LPSTR s);
+LPSTR WideToUTF8(LPCWSTR ws);
+LPSTR MzWideToUTF8(LPCWSTR ws);
+
+typedef struct APXMULTISZ APXMULTISZ;
+typedef APXMULTISZ* LPAPXMULTISZ;
+
+DWORD apxMultiSzToArrayA(APXHANDLE hPool, LPCSTR lpString, LPSTR **lppArray);
+DWORD apxMultiSzToArrayW(APXHANDLE hPool, LPCWSTR lpString, LPWSTR **lppArray);
+LPWSTR apxMultiSzCombine(APXHANDLE hPool, LPCWSTR lpStrA, LPCWSTR lpStrB,
+ LPDWORD lpdwLength);
+
+LPAPXMULTISZ apxMultiSzStrdup(LPCTSTR szSrc);
+LPTSTR apxMultiSzStrcat(LPAPXMULTISZ lpmSz, LPCTSTR szSrc);
+LPCTSTR apxMultiSzGet(LPAPXMULTISZ lpmSz);
+/** Remove the specified character from the string
+ * Replacement is done in-place.
+ */
+LPTSTR apxStrCharRemove(LPTSTR szString, TCHAR chSkip);
+DWORD apxStrUnQuoteInplaceA(LPSTR szString);
+DWORD apxStrUnQuoteInplaceW(LPWSTR szString);
+
+BOOL apxUltohex(ULONG n, LPTSTR lpBuff, DWORD dwBuffLength);
+BOOL apxUptohex(ULONG_PTR n, LPTSTR lpBuff, DWORD dwBuffLength);
+ULONG apxStrToul(LPCTSTR szNum);
+ULONG apxStrToulW(LPCWSTR szNum);
+ULONG apxAtoulW(LPCWSTR szNum);
+
+BOOL apxMakeResourceName(LPCTSTR szPrefix, LPTSTR lpBuff,
+ DWORD dwBuffLength);
+
+INT apxStrMatchA(LPCSTR szString, LPCSTR szPattern, BOOL bIgnoreCase);
+INT apxStrMatchW(LPCWSTR szString, LPCWSTR szPattern, BOOL bIgnoreCase);
+INT apxMultiStrMatchW(LPCWSTR szString, LPCWSTR szPattern,
+ WCHAR chSeparator, BOOL bIgnoreCase);
+LPSTR apxArrayToMultiSzA(APXHANDLE hPool, DWORD nArgs, LPCSTR *lpArgs);
+void apxStrQuoteInplaceW(LPWSTR szString);
+LPWSTR apxMszToCRLFW(APXHANDLE hPool, LPCWSTR szStr);
+LPWSTR apxCRLFToMszW(APXHANDLE hPool, LPCWSTR szStr, LPDWORD lpdwBytes);
+LPSTR apxExpandStrA(APXHANDLE hPool, LPCSTR szString);
+LPWSTR apxExpandStrW(APXHANDLE hPool, LPCWSTR szString);
+void apxStrCharReplaceA(LPSTR szString, CHAR chReplace, CHAR chReplaceWith);
+void apxStrCharReplaceW(LPWSTR szString, WCHAR chReplace, WCHAR chReplaceWith);
+
+
+LPVOID AplFillMemory(PVOID Destination, SIZE_T Length, BYTE Fill);
+void AplZeroMemory(PVOID Destination, SIZE_T Length);
+LPVOID AplCopyMemory(PVOID Destination, const VOID* Source, SIZE_T Length);
+/*
+ * Find the first occurrence of lpFind in lpMem.
+ * dwLen: The length of lpFind
+ * dwSize: The length of lpMem
+ */
+LPBYTE ApcMemSearch(LPCVOID lpMem, LPCVOID lpFind, SIZE_T dwLen, SIZE_T dwSize);
+LPSTR AplRindexA(LPCSTR lpStr, int ch);
+
+#define AplMoveMemory AplCopyMemory
+
+LPSTR lstrlcatA(LPSTR dst, int siz, LPCSTR src);
+LPWSTR lstrlcatW(LPWSTR dst, int siz, LPCWSTR src);
+LPSTR lstrlcpyA(LPSTR dst, int siz, LPCSTR src);
+LPWSTR lstrlcpyW(LPWSTR dst, int siz, LPCWSTR src);
+
+PSECURITY_ATTRIBUTES GetNullACL();
+void CleanNullACL(void *sa);
+
+__APXEND_DECLS
+
+#endif /* _APXWIN_H_INCLUDED_ */
+
Propchange: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/apxwin.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/cmdline.h
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/cmdline.h?rev=980662&view=auto
==============================================================================
--- commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/cmdline.h (added)
+++ commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/cmdline.h Fri Jul 30 06:50:12 2010
@@ -0,0 +1,77 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _CMDLINE_H_INCLUDED_
+#define _CMDLINE_H_INCLUDED_
+
+__APXBEGIN_DECLS
+
+#define APXCMDOPT_NIL 0x00000000 /* Argopt value not needed */
+#define APXCMDOPT_INT 0x00000001 /* Argopt value is unsigned integer */
+#define APXCMDOPT_STR 0x00000002 /* Argopt value is string */
+#define APXCMDOPT_STE 0x00000006 /* Argopt value is expandable string */
+#define APXCMDOPT_MSZ 0x00000010 /* Multiline string '#' separated */
+#define APXCMDOPT_BIN 0x00000020 /* Encrypted binary */
+
+#define APXCMDOPT_REG 0x00000100 /* Save to registry */
+#define APXCMDOPT_SRV 0x00000200 /* Save to service registry */
+#define APXCMDOPT_USR 0x00000400 /* Save to user registry */
+
+#define APXCMDOPT_FOUND 0x00001000 /* The option is present in cmdline */
+#define APXCMDOPT_ADD 0x00002000 /* The option is present in cmdline as ++*/
+
+
+typedef struct APXCMDLINEOPT APXCMDLINEOPT;
+
+struct APXCMDLINEOPT {
+ LPWSTR szName; /* Long Argument Name */
+ LPWSTR szRegistry; /* Registry Association */
+ LPWSTR szSubkey; /* Registry Association */
+ DWORD dwType; /* Argument type (string, number, multistring */
+ LPWSTR szValue; /* Return string value */
+ DWORD dwValue; /* Return numeric value or present if NIL */
+};
+
+typedef struct APXCMDLINE {
+ APXCMDLINEOPT *lpOptions;
+ LPWSTR szExecutable; /* Parsed argv0 */
+ LPWSTR szExePath; /* Parsed argv0 */
+ LPWSTR szApplication; /* Fist string after //CMD// */
+ DWORD dwCmdIndex; /* Command index */
+ LPWSTR *lpArgvw;
+ DWORD dwArgc;
+ APXHANDLE hPool;
+
+} APXCMDLINE, *LPAPXCMDLINE;
+
+LPAPXCMDLINE apxCmdlineParse(
+ APXHANDLE hPool,
+ APXCMDLINEOPT *lpOptions,
+ LPCWSTR *lpszCommands
+);
+
+void apxCmdlineLoadEnvVars(
+ LPAPXCMDLINE lpCmdline
+);
+
+void apxCmdlineFree(
+ LPAPXCMDLINE lpCmdline
+);
+
+
+__APXEND_DECLS
+
+#endif /* _CMDLINE_H_INCLUDED_ */
Propchange: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/cmdline.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/console.h
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/console.h?rev=980662&view=auto
==============================================================================
--- commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/console.h (added)
+++ commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/console.h Fri Jul 30 06:50:12 2010
@@ -0,0 +1,26 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _CONSOLE_H_INCLUDED_
+#define _CONSOLE_H_INCLUDED_
+
+__APXBEGIN_DECLS
+
+
+
+__APXEND_DECLS
+
+#endif /* _CONSOLE_H_INCLUDED_ */
Propchange: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/console.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/gui.h
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/gui.h?rev=980662&view=auto
==============================================================================
--- commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/gui.h (added)
+++ commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/gui.h Fri Jul 30 06:50:12 2010
@@ -0,0 +1,186 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _GUI_H_INCLUDED_
+#define _GUI_H_INCLUDED_
+
+__APXBEGIN_DECLS
+
+
+#define IDC_STATIC -1
+#define IDC_APPLICATION 100
+#define IDI_MAINICON 101
+#define IDC_STATBAR 102
+#define IDB_SUSERS 103
+
+#define IDS_APPLICATION 150
+#define IDS_APPDESCRIPTION 151
+#define IDS_APPVERSION 152
+#define IDS_APPCOPYRIGHT 153
+#define IDS_APPFULLNAME 154
+
+#define IDD_ABOUTBOX 250
+#define IDC_LICENSE 251
+#define IDR_LICENSE 252
+#define IAB_SYSINF 253
+#define IDC_ABOUTAPP 254
+
+#define IDD_PROGRESS 260
+#define IDDP_HEAD 261
+#define IDDP_TEXT 262
+#define IDDP_PROGRESS 263
+
+#define IDD_SELUSER 270
+#define IDSU_SELNAME 271
+#define IDSU_SELECTED 272
+#define IDSU_LIST 273
+#define IDSU_COMBO 274
+
+
+#define WM_TRAYMESSAGE (WM_APP+1)
+
+#define SNDMSGW SendMessageW
+#define SNDMSGA SendMessageA
+#define ComboBox_AddStringW(hwndCtl, lpsz) ((int)(DWORD)SNDMSGW((hwndCtl), CB_ADDSTRING, 0L, (LPARAM)(LPCWSTR)(lpsz)))
+
+#define ListView_SetItemTextW(hwndLV, i, iSubItem_, pszText_) \
+{ LV_ITEMW _ms_lvi;\
+ _ms_lvi.iSubItem = iSubItem_;\
+ _ms_lvi.pszText = pszText_;\
+ SNDMSG((hwndLV), LVM_SETITEMTEXTW, (WPARAM)(i), (LPARAM)(LV_ITEMW *)&_ms_lvi);\
+} ((void)0)
+
+#define ListView_GetItemTextA(hwndLV, i, iSubItem_, pszText_, cchTextMax_) \
+{ LV_ITEMA _ms_lvi;\
+ _ms_lvi.iSubItem = iSubItem_;\
+ _ms_lvi.cchTextMax = cchTextMax_;\
+ _ms_lvi.pszText = pszText_;\
+ SNDMSGA((hwndLV), LVM_GETITEMTEXTA, (WPARAM)(i), (LPARAM)(LV_ITEMA *)&_ms_lvi);\
+} ((void)0)
+
+#define ListView_GetItemTextW(hwndLV, i, iSubItem_, pszText_, cchTextMax_) \
+{ LV_ITEMW _ms_lvi;\
+ _ms_lvi.iSubItem = iSubItem_;\
+ _ms_lvi.cchTextMax = cchTextMax_;\
+ _ms_lvi.pszText = pszText_;\
+ SNDMSG((hwndLV), LVM_GETITEMTEXTW, (WPARAM)(i), (LPARAM)(LV_ITEMW *)&_ms_lvi);\
+} ((void)0)
+
+#define ListView_InsertItemW(hwnd, pitem) \
+ (int)SNDMSGW((hwnd), LVM_INSERTITEMW, 0, (LPARAM)(const LV_ITEMW *)(pitem))
+
+typedef struct APXLVITEM {
+ INT iPosition;
+ BOOL bSortable;
+ INT iWidth;
+ INT iDefault;
+ INT iFmt;
+ LPTSTR szLabel;
+} APXLVITEM, *LPAPXLVITEM;
+
+typedef struct APXGUISTATE {
+ DWORD dwShow;
+ RECT rcPosition;
+ COLORREF bgColor;
+ COLORREF fgColor;
+ COLORREF txColor;
+ INT nColumnWidth[32];
+ INT nUser[8];
+} APXGUISTATE, *LPAPXGUISTATE;
+
+typedef struct APXGUISTORE {
+ HANDLE hInstance;
+ HICON hIcon;
+ HICON hIconSm;
+ HICON hIconHg;
+ HWND hMainWnd;
+ HACCEL hAccel;
+ TCHAR szWndClass[256];
+ TCHAR szWndMutex[256];
+ APXGUISTATE stState;
+ STARTUPINFO stStartupInfo;
+ UINT nWhellScroll;
+
+} APXGUISTORE, *LPAPXGUISTORE;
+
+LPAPXGUISTORE apxGuiInitialize(WNDPROC lpfnWndProc, LPCTSTR szAppName);
+
+BOOL apxCenterWindow(HWND hwndChild, HWND hwndParent);
+
+LPSTR apxLoadResourceA(UINT wID, UINT nBuf);
+LPWSTR apxLoadResourceW(UINT wID, UINT nBuf);
+
+
+void apxAppendMenuItem(HMENU hMenu, UINT idMenu, LPCTSTR szName,
+ BOOL bDefault, BOOL bEnabled);
+void apxAppendMenuItemBmp(HMENU hMenu, UINT idMenu, LPCTSTR szName);
+
+void apxManageTryIconA(HWND hWnd, DWORD dwMessage, LPCSTR szInfoTitle,
+ LPCSTR szInfo, HICON hIcon);
+void apxManageTryIconW(HWND hWnd, DWORD dwMessage, LPCWSTR szInfoTitle,
+ LPCWSTR szInfo, HICON hIcon);
+#ifdef _UNICODE
+#define apxLoadResource apxLoadResourceW
+#else
+#define apxLoadResource apxLoadResourceA
+#endif
+
+void apxAboutBox(HWND hWnd);
+int apxProgressBox(HWND hWnd, LPCTSTR szHeader,
+ LPCWSTR szText,
+ LPAPXFNCALLBACK fnProgressCallback,
+ LPVOID cbData);
+BOOL apxYesNoMessage(LPCTSTR szTitle, LPCTSTR szMessage, BOOL bStop);
+
+BOOL apxCalcStringEllipsis(HDC hDC, LPTSTR szString,
+ int cchMax, UINT uColWidth);
+LPWSTR apxGetDlgTextW(APXHANDLE hPool, HWND hDlg, int nIDDlgItem);
+LPSTR apxGetDlgTextA(APXHANDLE hPool, HWND hDlg, int nIDDlgItem);
+
+#ifdef _UNICODE
+#define apxGetDlgText apxGetDlgTextW
+#else
+#define apxGetDlgText apxGetDlgTextA
+#endif
+
+LPSTR apxBrowseForFolderA(HWND hWnd, LPCSTR szTitle, LPCSTR szName);
+LPWSTR apxBrowseForFolderW(HWND hWnd, LPCWSTR szTitle, LPCWSTR szName);
+
+#ifdef _UNICODE
+#define apxBrowseForFolder apxBrowseForFolderW
+#else
+#define apxBrowseForFolder apxBrowseForFolderA
+#endif
+
+LPSTR apxGetFileNameA(HWND hWnd, LPCSTR szTitle, LPCSTR szFilter,
+ LPCSTR szDefExt, LPCSTR szDefPath, BOOL bOpenOrSave,
+ LPDWORD lpdwFindex);
+
+LPWSTR apxGetFileNameW(HWND hWnd, LPCWSTR szTitle, LPCWSTR szFilter,
+ LPCWSTR szDefExt, LPCWSTR szDefPath, BOOL bOpenOrSave,
+ LPDWORD lpdwFindex);
+
+#ifdef _UNICODE
+#define apxGetFileName apxGetFileNameW
+#else
+#define apxGetFileName apxGetFileNameA
+#endif
+
+LPCWSTR apxDlgSelectUser(HWND hWnd, LPWSTR szUser);
+
+__APXEND_DECLS
+
+#endif /* _GUI_H_INCLUDED_ */
Propchange: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/gui.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/handles.h
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/handles.h?rev=980662&view=auto
==============================================================================
--- commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/handles.h (added)
+++ commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/handles.h Fri Jul 30 06:50:12 2010
@@ -0,0 +1,192 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _HANDLES_H_INCLUDED_
+#define _HANDLES_H_INCLUDED_
+
+__APXBEGIN_DECLS
+
+#define SAFE_CLOSE_HANDLE(h) \
+ if ((h) != NULL && (h) != INVALID_HANDLE_VALUE) { \
+ CloseHandle((h)); \
+ (h) = NULL; \
+ }
+
+typedef struct stAPXHANDLE stAPXHANDLE;
+typedef stAPXHANDLE* APXHANDLE;
+
+/**
+ * Alignment macros
+ */
+
+/* APR_ALIGN() is only to be used to align on a power of 2 boundary */
+#define APX_ALIGN(size, boundary) \
+ (((size) + ((boundary) - 1)) & ~((boundary) - 1))
+
+/** Default alignment */
+#define APX_ALIGN_DEFAULT(size) APX_ALIGN(size, 16)
+
+
+/** Handle callback function prototype */
+typedef BOOL (*LPAPXFNCALLBACK)(APXHANDLE hObject, UINT uMsg,
+ WPARAM wParam, LPARAM lParam);
+
+#if _MSC_VER >= 1300
+#define APXHANDLE_INVALID ((void *)0xdeadbeefLL)
+#else
+#define APXHANDLE_INVALID ((void *)0xdeadbeefL)
+#endif
+
+#define APXHANDLE_HOOK_FIRST 0
+#define APXHANDLE_HOOK_LAST 1
+
+/** Flags */
+/** handle has its own heap */
+#define APXHANDLE_HAS_HEAP 0x00000001
+/** handle has CriticalSection */
+#define APXHANDLE_HAS_LOCK 0x00000002
+/** handle owns the CriticalSection */
+#define APXHANDLE_OWNS_LOCK 0x00000006
+/** handle has EventThread */
+#define APXHANDLE_HAS_EVENT 0x00000010
+/** handle has UserData */
+#define APXHANDLE_HAS_USERDATA 0x00000020
+
+/** Types */
+#define APXHANDLE_TYPE_INVALID 0xdeadbeef
+#define APXHANDLE_TYPE_POOL 0x01000000
+#define APXHANDLE_TYPE_WINHANDLE 0x02000000
+#define APXHANDLE_TYPE_SERVICE 0x03000000
+#define APXHANDLE_TYPE_LPTR 0x04000000
+#define APXHANDLE_TYPE_CONSOLE 0x05000000
+#define APXHANDLE_TYPE_PROCESS 0x06000000
+#define APXHANDLE_TYPE_JVM 0x07000000
+#define APXHANDLE_TYPE_REGISTRY 0x08000000
+
+/** Initialize the Handle manager
+ * reference counted
+ */
+BOOL apxHandleManagerInitialize();
+/** Destroys the Handle manager
+ * reference counted
+ */
+BOOL apxHandleManagerDestroy();
+/** Create the memory pool
+ * param: hParent parent pool or NULL to use the system pool
+ * dwOptions OR'd flags: APXHANDLE_HAS_HEAP,
+ * APXHANDLE_HAS_LOCK
+ * APXHANDLE_OWNS_LOCK
+ */
+APXHANDLE apxPoolCreate(APXHANDLE hParent, DWORD dwOptions);
+/** Create the memory pool
+ * param: hPpool pool to allocate from or NULL for system pool
+ * dwOptions OR'd flags: see APXHANDLE_TYPE_ and APXHANDLE_HAS_
+ * values
+ * lpData user supplied Data
+ * dwDataSize extra pool user data size, combined with options
+ * the lpData is copied to the internal storage;
+ * fnCallback Optional handle callback function
+ */
+APXHANDLE apxHandleCreate(APXHANDLE hPool, DWORD dwOptions,
+ LPVOID lpData, DWORD dwDataSize,
+ LPAPXFNCALLBACK fnCallback);
+/** Close the handle
+ * Calls the callback function and frees the memory
+ */
+BOOL apxCloseHandle(APXHANDLE hObject);
+/** Get The internal user data
+ */
+LPVOID apxHandleGetUserData(APXHANDLE hObject);
+/** Set The internal user data
+ * params:
+ * lpData user supplied Data
+ * dwDataSize user data size, combined with create options
+ * the lpData is either copied to the internal storage
+ * or assigned.
+ */
+LPVOID apxHandleSetUserData(APXHANDLE hObject, LPVOID lpData,
+ DWORD dwDataSize);
+/** Send the message to the handle
+ * Callback function is executed with WM_COMMAND uMsg
+ */
+BOOL apxHandleSendMessage(APXHANDLE hObject, UINT uMsg,
+ WPARAM wParam, LPARAM lParam);
+
+/** Post the message to the handle
+ * function returns imediately.
+ */
+BOOL apxHandlePostMessage(APXHANDLE hObject, UINT uMsg,
+ WPARAM wParam, LPARAM lParam);
+/** Lock or unlock the handle
+ * If bLock is true lock the handle, otherwise unlock.
+ */
+BOOL apxHandleLock(APXHANDLE hObject, BOOL bLock);
+
+/** Add the callback to the handles hook chain
+ *
+ */
+BOOL apxHandleAddHook(APXHANDLE hObject, DWORD dwWhere,
+ LPAPXFNCALLBACK fnCallback);
+
+DWORD apxHandleWait(APXHANDLE hHandle, DWORD dwMilliseconds,
+ BOOL bKill);
+
+/** General pool memory allocation functions
+ */
+LPVOID apxPoolAlloc(APXHANDLE hPool, DWORD dwSize);
+LPVOID apxPoolCalloc(APXHANDLE hPool, DWORD dwSize);
+LPVOID apxPoolRealloc(APXHANDLE hPool, LPVOID lpMem, DWORD dwNewSize);
+LPTSTR apxPoolStrdup(APXHANDLE hPool, LPCTSTR szSource);
+
+/** General system pool memory allocation functions
+ */
+
+LPVOID apxAlloc(DWORD dwSize);
+LPVOID apxCalloc(DWORD dwSize);
+LPVOID apxRealloc(LPVOID lpMem, DWORD dwNewSize);
+
+LPSTR apxStrdupA(LPCSTR szSource);
+LPWSTR apxStrdupW(LPCWSTR szSource);
+LPSTR apxPoolStrdupA(APXHANDLE hPool, LPCSTR szSource);
+LPWSTR apxPoolStrdupW(APXHANDLE hPool, LPCWSTR szSource);
+
+LPWSTR apxPoolWStrdupA(APXHANDLE hPool, LPCSTR szSource);
+
+#define apxPoolWStrdupW apxPoolStrdupW
+
+#ifdef _UNICODE
+#define apxStrdup apxStrdupW
+#define apxPoolStrdup apxPoolStrdupW
+#else
+#define apxStrdup apxStrdupA
+#define apxPoolStrdup apxPoolStrdupW
+#endif
+
+#ifndef _UNICODE
+#define apxPoolWStrdup apxPoolWStrdupA
+#define apxWStrdup apxWStrdupA
+#else
+#define apxPoolWStrdup apxPoolStrdupW
+#define apxWStrdup apxStrdupW
+#endif
+/** Free the allocated memory
+ * It will call te correct pool if the address is valid
+ */
+VOID apxFree(LPVOID lpMem);
+
+__APXEND_DECLS
+
+#endif /* _HANDLES_H_INCLUDED_ */
Propchange: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/handles.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/javajni.h
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/javajni.h?rev=980662&view=auto
==============================================================================
--- commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/javajni.h (added)
+++ commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/javajni.h Fri Jul 30 06:50:12 2010
@@ -0,0 +1,51 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _JAVAJNI_H_INCLUDED_
+#define _JAVAJNI_H_INCLUDED_
+
+__APXBEGIN_DECLS
+
+#define APX_JVM_DESTROY 0x00000001
+
+APXHANDLE apxCreateJava(APXHANDLE hPool, LPCWSTR szJvmDllPath);
+
+BOOL apxJavaInitialize(APXHANDLE hJava, LPCSTR szClassPath,
+ LPCVOID lpOptions, DWORD dwMs, DWORD dwMx,
+ DWORD dwSs, DWORD bJniVfprintf);
+DWORD
+apxJavaCmdInitialize(APXHANDLE hPool, LPCWSTR szClassPath, LPCWSTR szClass,
+ LPCWSTR szOptions, DWORD dwMs, DWORD dwMx,
+ DWORD dwSs, LPCWSTR szCmdArgs, LPWSTR **lppArray);
+
+BOOL apxJavaLoadMainClass(APXHANDLE hJava, LPCSTR szClassName,
+ LPCSTR szMethodName,
+ LPCVOID lpArguments);
+
+BOOL apxJavaStart(APXHANDLE hJava);
+
+DWORD apxJavaWait(APXHANDLE hJava, DWORD dwMilliseconds, BOOL bKill);
+
+BOOL apxJavaSetOut(APXHANDLE hJava, BOOL setErrorOrOut,
+ LPCWSTR szFilename);
+DWORD apxJavaSetOptions(APXHANDLE hJava, DWORD dwOptions);
+
+BOOL apxDestroyJvm(DWORD dwTimeout);
+
+
+__APXEND_DECLS
+
+#endif /* _JAVAJNI_H_INCLUDED_ */
Propchange: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/javajni.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/log.h
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/log.h?rev=980662&view=auto
==============================================================================
--- commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/log.h (added)
+++ commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/log.h Fri Jul 30 06:50:12 2010
@@ -0,0 +1,103 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* Logfile handling
+ * Use Systemdir/Logfiles/Apache as a default path
+ */
+
+#ifndef _LOG_H_INCLUDED_
+#define _LOG_H_INCLUDED_
+
+__APXBEGIN_DECLS
+
+#define APX_LOGLOCK(file) \
+ APXMACRO_BEGIN \
+ DWORD _lmax = 0; \
+ while(!LockFile(file, 0, 0, 512, 0)) { \
+ Sleep(10); \
+ if (_lmax++ > 1000) break; \
+ } \
+ SetFilePointer(file, 0, NULL, FILE_END); \
+ APXMACRO_END
+
+#define APX_LOGUNLOCK(file) \
+ APXMACRO_BEGIN \
+ UnlockFile(file, 0, 0, 512, 0); \
+ APXMACRO_END
+
+#define APXLOG_LEVEL_DEBUG 0
+#define APXLOG_LEVEL_INFO 1
+#define APXLOG_LEVEL_WARN 2
+#define APXLOG_LEVEL_ERROR 3
+
+#define APXLOG_MARK_INFO NULL, APXLOG_LEVEL_INFO, TRUE, NULL, 0, ""
+#define APXLOG_MARK_WARN NULL, APXLOG_LEVEL_WARN, TRUE, NULL, 0, ""
+#define APXLOG_MARK_ERROR NULL, APXLOG_LEVEL_ERROR, TRUE, __FILE__, __LINE__, ""
+#define APXLOG_MARK_DEBUG NULL, APXLOG_LEVEL_DEBUG, TRUE, __FILE__, __LINE__, ""
+#define APXLOG_MARK_RAW NULL, APXLOG_LEVEL_INFO, FALSE, NULL, 0,
+#define APXLOG_MARK_SYSERR NULL, APXLOG_LEVEL_ERROR, TRUE, __FILE__, __LINE__, NULL
+
+LPWSTR apxLogFile(
+ APXHANDLE hPool,
+ LPCWSTR szPath,
+ LPCWSTR szPrefix,
+ LPCWSTR szName,
+ BOOL bTimeStamp
+);
+
+HANDLE apxLogOpen(
+ APXHANDLE hPool,
+ LPCWSTR szPath,
+ LPCWSTR szPrefix
+);
+
+void apxLogClose(
+ HANDLE hFile
+);
+
+void apxLogLevelSet(
+ HANDLE hFile,
+ DWORD dwLevel
+);
+
+void apxLogLevelSetW(
+ HANDLE hFile,
+ LPCWSTR szLevel
+);
+
+int
+apxLogWrite(
+ HANDLE hFile,
+ DWORD dwLevel,
+ BOOL bTimeStamp,
+ LPCSTR szFile,
+ DWORD dwLine,
+ LPCSTR szFormat,
+ ...
+);
+
+int
+apxDisplayError(
+ BOOL bDisplay,
+ LPCSTR szFile,
+ DWORD dwLine,
+ LPCSTR szFormat,
+ ...
+);
+
+__APXEND_DECLS
+
+#endif /* _LOG_H_INCLUDED_ */
Propchange: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/log.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/registry.h
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/registry.h?rev=980662&view=auto
==============================================================================
--- commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/registry.h (added)
+++ commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/registry.h Fri Jul 30 06:50:12 2010
@@ -0,0 +1,146 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _REGISTRY_H_INCLUDED_
+#define _REGISTRY_H_INCLUDED_
+
+__APXBEGIN_DECLS
+
+#define APXREG_SOFTWARE 0x0001
+#define APXREG_SERVICE 0x0002
+#define APXREG_USER 0x0004
+
+#define APXREG_PARAMSOFTWARE 0x0010
+#define APXREG_PARAMSERVICE 0x0020
+#define APXREG_PARAMUSER 0x0040
+
+/** Create or open the process registry keys
+ */
+APXHANDLE apxCreateRegistryA(APXHANDLE hPool, REGSAM samDesired,
+ LPCSTR szRoot, LPCSTR szKeyName,
+ DWORD dwOptions);
+APXHANDLE apxCreateRegistryW(APXHANDLE hPool, REGSAM samDesired,
+ LPCWSTR szRoot, LPCWSTR szKeyName,
+ DWORD dwOptions);
+
+#ifdef _UNICODE
+#define apxCreateRegistry apxCreateRegistryW
+#else
+#define apxCreateRegistry apxCreateRegistryA
+#endif
+
+/** Delete the process registry keys
+ * samDesired only needs to be KREG_WOW6432 or 0
+ */
+BOOL apxDeleteRegistryA(LPCSTR szRoot, LPCSTR szKeyName,
+ REGSAM samDesired, BOOL bDeleteEmptyRoot);
+
+BOOL apxDeleteRegistryW(LPCWSTR szRoot, LPCWSTR szKeyName,
+ REGSAM samDesired, BOOL bDeleteEmptyRoot);
+
+#ifdef _UNICODE
+#define apxDeleteRegistry apxDeleteRegistryW
+#else
+#define apxDeleteRegistry apxDeleteRegistryA
+#endif
+
+/** Get the JavaHome path from registry
+ * and set the JAVA_HOME environment variable if not found
+ * If bPreferJre is set use the JRE's path as JAVA_HOME
+ */
+LPWSTR apxGetJavaSoftHome(APXHANDLE hPool, BOOL bPreferJre);
+
+/** Get the Java RuntimeLib from registry (jvm.dll)
+ */
+LPWSTR apxGetJavaSoftRuntimeLib(APXHANDLE hPool);
+
+LPSTR apxRegistryGetStringA(APXHANDLE hRegistry, DWORD dwFrom,
+ LPCSTR szSubkey, LPCSTR szValueName);
+
+LPWSTR apxRegistryGetStringW(APXHANDLE hRegistry, DWORD dwFrom,
+ LPCWSTR szSubkey, LPCWSTR szValueName);
+
+#ifdef _UNICODE
+#define apxRegistryGetString apxRegistryGetStringW
+#else
+#define apxRegistryGetString apxRegistryGetStringA
+#endif
+
+LPBYTE apxRegistryGetBinaryA(APXHANDLE hRegistry, DWORD dwFrom,
+ LPCSTR szSubkey, LPCSTR szValueName,
+ LPBYTE lpData, LPDWORD lpdwLength);
+
+LPBYTE apxRegistryGetBinaryW(APXHANDLE hRegistry, DWORD dwFrom,
+ LPCWSTR szSubkey, LPCWSTR szValueName,
+ LPBYTE lpData, LPDWORD lpdwLength);
+
+#ifdef _UNICODE
+#define apxRegistryGetBinary apxRegistryGetBinaryW
+#else
+#define apxRegistryGetBinary apxRegistryGetBinaryA
+#endif
+
+BOOL apxRegistrySetBinaryA(APXHANDLE hRegistry, DWORD dwFrom,
+ LPCSTR szSubkey, LPCSTR szValueName,
+ const LPBYTE lpData, DWORD dwLength);
+
+BOOL apxRegistrySetBinaryW(APXHANDLE hRegistry, DWORD dwFrom,
+ LPCWSTR szSubkey, LPCWSTR szValueName,
+ const LPBYTE lpData, DWORD dwLength);
+
+LPWSTR apxRegistryGetMzStrW(APXHANDLE hRegistry, DWORD dwFrom,
+ LPCWSTR szSubkey, LPCWSTR szValueName,
+ LPWSTR lpData, LPDWORD lpdwLength);
+
+BOOL apxRegistrySetMzStrW(APXHANDLE hRegistry, DWORD dwFrom,
+ LPCWSTR szSubkey, LPCWSTR szValueName,
+ LPCWSTR lpData, DWORD dwLength);
+
+BOOL apxRegistrySetStrA(APXHANDLE hRegistry, DWORD dwFrom,
+ LPCSTR szSubkey, LPCSTR szValueName,
+ LPCSTR szValue);
+
+BOOL apxRegistrySetStrW(APXHANDLE hRegistry, DWORD dwFrom,
+ LPCWSTR szSubkey, LPCWSTR szValueName,
+ LPCWSTR szValue);
+
+
+#ifdef _UNICODE
+#define apxRegistrySetStr apxRegistrySetStrW
+#else
+#define apxRegistrySetStr apxRegistrySetStrA
+#endif
+
+BOOL apxRegistrySetNumW(APXHANDLE hRegistry, DWORD dwFrom,
+ LPCWSTR szSubkey, LPCWSTR szValueName,
+ DWORD dwValue);
+
+DWORD apxRegistryGetNumberW(APXHANDLE hRegistry, DWORD dwFrom,
+ LPCWSTR szSubkey, LPCWSTR szValueName);
+
+
+BOOL apxRegistryDeleteW(APXHANDLE hRegistry, DWORD dwFrom,
+ LPCWSTR szSubkey, LPCWSTR szValueName);
+
+#ifdef _UNICODE
+#define apxRegistryDelete apxRegistryDeleteW
+#else
+#define apxRegistryDelete apxRegistryDeleteA
+#endif
+
+__APXEND_DECLS
+
+#endif /* _REGISTRY_H_INCLUDED_ */
Propchange: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/registry.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/rprocess.h
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/rprocess.h?rev=980662&view=auto
==============================================================================
--- commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/rprocess.h (added)
+++ commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/rprocess.h Fri Jul 30 06:50:12 2010
@@ -0,0 +1,77 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _RPROCESS_H_INCLUDED_
+#define _RPROCESS_H_INCLUDED_
+
+__APXBEGIN_DECLS
+
+BOOL apxProcessExecute(APXHANDLE hProcess);
+
+APXHANDLE apxCreateProcessA(APXHANDLE hPool, DWORD dwOptions,
+ LPAPXFNCALLBACK fnCallback,
+ LPCSTR szUsername, LPCSTR szPassword,
+ BOOL bLogonAsService);
+APXHANDLE apxCreateProcessW(APXHANDLE hPool, DWORD dwOptions,
+ LPAPXFNCALLBACK fnCallback,
+ LPCWSTR szUsername, LPCWSTR szPassword,
+ BOOL bLogonAsService);
+
+#ifdef _UNICODE
+#define apxCreateProcess apxCreateProcessW
+#else
+#define apxCreateProcess apxCreateProcessA
+#endif
+
+BOOL apxProcessSetExecutableA(APXHANDLE hProcess, LPCSTR szName);
+BOOL apxProcessSetExecutableW(APXHANDLE hProcess, LPCWSTR szName);
+
+BOOL apxProcessSetCommandLineA(APXHANDLE hProcess, LPCSTR szCmdline);
+BOOL apxProcessSetCommandLineW(APXHANDLE hProcess, LPCWSTR szCmdline);
+BOOL apxProcessSetCommandArgsW(APXHANDLE hProcess, LPCWSTR szTitle,
+ DWORD dwArgc, LPCWSTR *lpArgs);
+
+BOOL apxProcessSetWorkingPathA(APXHANDLE hProcess, LPCSTR szPath);
+BOOL apxProcessSetWorkingPathW(APXHANDLE hProcess, LPCWSTR szPath);
+
+DWORD apxProcessPutcA(APXHANDLE hProcess, INT ch);
+DWORD apxProcessPutcW(APXHANDLE hProcess, INT ch);
+DWORD apxProcessPutsA(APXHANDLE hProcess, LPCSTR szString);
+DWORD apxProcessPutsW(APXHANDLE hProcess, LPCWSTR szString);
+
+#ifndef _UNICODE
+#define apxProcessPutc apxProcessPutcA
+#define apxProcessPuts apxProcessPutsA
+#else
+#define apxProcessPutc apxProcessPutcW
+#define apxProcessPuts apxProcessPutsW
+#endif
+
+DWORD apxProcessWrite(APXHANDLE hProcess, LPCVOID lpData, DWORD dwLen);
+
+VOID apxProcessCloseInputStream(APXHANDLE hProcess);
+BOOL apxProcessFlushStdin(APXHANDLE hProcess);
+
+DWORD apxProcessWait(APXHANDLE hProcess, DWORD dwMilliseconds,
+ BOOL bKill);
+
+BOOL apxProcessRunning(APXHANDLE hProcess);
+DWORD apxProcessGetPid(APXHANDLE hProcess);
+
+
+__APXEND_DECLS
+
+#endif /* _RPROCESS_H_INCLUDED_ */
Propchange: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/rprocess.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/service.h
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/service.h?rev=980662&view=auto
==============================================================================
--- commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/service.h (added)
+++ commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/service.h Fri Jul 30 06:50:12 2010
@@ -0,0 +1,75 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _SERVICE_H_INCLUDED_
+#define _SERVICE_H_INCLUDED_
+
+__APXBEGIN_DECLS
+
+typedef struct APXSERVENTRY {
+ WCHAR szServiceName[SIZ_RESLEN];
+ WCHAR szObjectName[SIZ_RESLEN];
+ WCHAR szServiceDescription[SIZ_DESLEN];
+ DWORD dwStart;
+ LPQUERY_SERVICE_CONFIGW lpConfig;
+ SERVICE_STATUS stServiceStatus;
+ SERVICE_STATUS_PROCESS stStatusProcess;
+
+} APXSERVENTRY, *LPAPXSERVENTRY;
+
+
+APXHANDLE apxCreateService(APXHANDLE hPool, DWORD dwOptions,
+ BOOL bManagerMode);
+
+BOOL apxServiceOpen(APXHANDLE hService, LPCWSTR szServiceName, DWORD dwOptions);
+
+
+BOOL apxServiceSetNames(APXHANDLE hService, LPCWSTR szImagePath,
+ LPCWSTR szDisplayName, LPCWSTR szDescription,
+ LPCWSTR szUsername, LPCWSTR szPassword);
+
+BOOL apxServiceSetOptions(APXHANDLE hService, DWORD dwServiceType,
+ DWORD dwStartType, DWORD dwErrorControl);
+
+BOOL apxServiceControl(APXHANDLE hService, DWORD dwControl, UINT uMsg,
+ LPAPXFNCALLBACK fnControlCallback,
+ LPVOID lpCbData);
+BOOL apxServiceInstall(APXHANDLE hService, LPCWSTR szServiceName,
+ LPCWSTR szDisplayName, LPCWSTR szImagePath,
+ LPCWSTR lpDependencies, DWORD dwServiceType,
+ DWORD dwStartType);
+
+LPAPXSERVENTRY apxServiceEntry(APXHANDLE hService, BOOL bRequeryStatus);
+
+/** Delete te service
+ * Stops the service if running
+ */
+BOOL apxServiceDelete(APXHANDLE hService);
+
+DWORD apxServiceBrowse(APXHANDLE hService,
+ LPCWSTR szIncludeNamePattern,
+ LPCWSTR szIncludeImagePattern,
+ LPCWSTR szExcludeNamePattern,
+ LPCWSTR szExcludeImagePattern,
+ UINT uMsg,
+ LPAPXFNCALLBACK fnDisplayCallback,
+ LPVOID lpCbData);
+
+DWORD apxGetMaxServiceTimeout(APXHANDLE hPool);
+
+__APXEND_DECLS
+
+#endif /* _SERVICE_H_INCLUDED_ */
Propchange: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/include/service.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/commons.bmp
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/commons.bmp?rev=980662&view=auto
==============================================================================
Binary file - no diff available.
Propchange: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/commons.bmp
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/license.rtf
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/license.rtf?rev=980662&view=auto
==============================================================================
--- commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/license.rtf (added)
+++ commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/license.rtf Fri Jul 30 06:50:12 2010
@@ -0,0 +1,33 @@
+{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset238\fprq2{\*\panose 02020603050405020304}Times New Roman;}
+{\f1\fswiss\fcharset238\fprq2{\*\panose 020b0604020202020204}Arial;}{\f39\froman\fcharset0\fprq2 Times New Roman;}{\f38\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f40\froman\fcharset161\fprq2 Times New Roman Greek;}
+{\f41\froman\fcharset162\fprq2 Times New Roman Tur;}{\f42\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f43\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f44\froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\f45\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f49\fswiss\fcharset0\fprq2 Arial;}{\f48\fswiss\fcharset204\fprq2 Arial Cyr;}{\f50\fswiss\fcharset161\fprq2 Arial Greek;}{\f51\fswiss\fcharset162\fprq2 Arial Tur;}
+{\f52\fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f53\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f54\fswiss\fcharset186\fprq2 Arial Baltic;}{\f55\fswiss\fcharset163\fprq2 Arial (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;
+\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;
+\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\*\cs10 \additive
+\ssemihidden Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
+\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}{\*\cs15 \additive \ul\cf2 \sbasedon10 Hyperlink;}}
+{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\rsidtbl \rsid1379267\rsid3345586\rsid5638524\rsid6496053\rsid6510316\rsid6697379\rsid7028353\rsid9000330\rsid9454304\rsid10124145\rsid10819759\rsid12321742\rsid12593955\rsid14358633\rsid15670059\rsid16132583
+}{\*\generator Microsoft Word 11.0.5604;}{\info{\author Mladen Turk}{\operator Mladen Turk}{\creatim\yr2003\mo4\dy9\hr14\min37}{\revtim\yr2004\mo4\dy7\hr8\min42}{\version14}{\edmins11}{\nofpages1}{\nofwords96}{\nofchars549}
+{\*\company Apache Software Foundation}{\nofcharsws644}{\vern24689}}\margl1417\margr1417\margt1417\margb1417 \widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701
+\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind4\viewscale100\nolnhtadjtbl\rsidroot9000330 \fet0\sectd \linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang
+{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang
+{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain
+\qc \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0\pararsid14358633 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b\f1\insrsid16132583\charrsid12321742 The Apache Software License, Version 2.0
+\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\f1\fs18\insrsid16132583\charrsid16132583
+\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0\pararsid9454304 {\f1\fs18\insrsid9454304 }{\f1\fs18\insrsid16132583\charrsid16132583 Copyright 2002-2010 The Apache Software Foundation.
+\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0\pararsid1379267 {\f1\fs18\insrsid16132583\charrsid16132583
+\par }{\f1\fs18\insrsid14358633 }{\f1\fs18\insrsid16132583\charrsid16132583 Licensed under the Apache License, Version 2.0 (the "License");
+\par }{\f1\fs18\insrsid14358633 }{\f1\fs18\insrsid16132583\charrsid16132583 you may not use this file except in compliance with the License.
+\par }{\f1\fs18\insrsid14358633 }{\f1\fs18\insrsid16132583\charrsid16132583 You may obtain a copy of the License at
+\par }{\f1\fs18\insrsid12593955
+\par }{\f1\fs18\insrsid16132583\charrsid16132583
+\par }{\cf2\insrsid6510316 }{\ul\cf2\insrsid16132583\charrsid6510316 http://www.apache.org/licenses/LICENSE-2.0
+\par }{\f1\fs18\insrsid12593955
+\par
+\par }{\f1\fs18\insrsid12321742 \line }{\f1\fs18\insrsid14358633 }{\f1\fs18\insrsid16132583\charrsid16132583 Unless required by applicable law or agreed to in writing, software
+\par }{\f1\fs18\insrsid14358633 }{\f1\fs18\insrsid16132583\charrsid16132583 distributed under the License is distributed on an "AS IS" BASIS,}{\f1\fs18\insrsid14358633 }{\f1\fs18\insrsid16132583\charrsid16132583
+\par }{\f1\fs18\insrsid14358633 }{\f1\fs18\insrsid16132583\charrsid16132583 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+\par }{\f1\fs18\insrsid14358633 }{\f1\fs18\insrsid16132583\charrsid16132583 See the License for the specific language governing permissions and
+\par }{\f1\fs18\insrsid14358633 }{\f1\fs18\insrsid14358633\charrsid16132583 L}{\f1\fs18\insrsid16132583\charrsid16132583 imitations under the License.
+\par }}
\ No newline at end of file
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/procrunr.ico
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/procrunr.ico?rev=980662&view=auto
==============================================================================
Binary file - no diff available.
Propchange: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/procrunr.ico
------------------------------------------------------------------------------
svn:mime-type = image/x-icon
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/procruns.ico
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/procruns.ico?rev=980662&view=auto
==============================================================================
Binary file - no diff available.
Propchange: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/procruns.ico
------------------------------------------------------------------------------
svn:mime-type = image/x-icon
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/procrunw.ico
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/procrunw.ico?rev=980662&view=auto
==============================================================================
Binary file - no diff available.
Propchange: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/procrunw.ico
------------------------------------------------------------------------------
svn:mime-type = image/x-icon
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/susers.bmp
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/susers.bmp?rev=980662&view=auto
==============================================================================
Binary file - no diff available.
Propchange: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/resources/susers.bmp
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/src/cmdline.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/src/cmdline.c?rev=980662&view=auto
==============================================================================
--- commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/src/cmdline.c (added)
+++ commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/src/cmdline.c Fri Jul 30 06:50:12 2010
@@ -0,0 +1,310 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "apxwin.h"
+#include "private.h"
+
+#define EXE_SUFFIX L".EXE"
+#define EXE_SUFFIXLEN (sizeof(EXE_SUFFIX) / sizeof(WCHAR) - 1)
+
+#define X86_SUFFIX L".X86"
+#define X64_SUFFIX L".X64"
+#define A64_SUFFIX L".I64"
+
+/* Those two are declared in handles.c */
+extern LPWSTR *_st_sys_argvw;
+extern int _st_sys_argc;
+
+static WCHAR _st_sys_appexe[MAX_PATH];
+/*
+ * argv parsing.
+ * Parse the argv[0] and split to ExePath and
+ * Executable name. Strip the extension ('.exe').
+ * Check for command in argv[1] //CMD//Application
+ * Parse the options --option value or --option==value
+ * break on first argument that doesn't start with '--'
+ */
+LPAPXCMDLINE apxCmdlineParse(
+ APXHANDLE hPool,
+ APXCMDLINEOPT *lpOptions,
+ LPCWSTR *lpszCommands)
+{
+
+ LPAPXCMDLINE lpCmdline = NULL;
+ DWORD l, i = 0, s = 1;
+ LPWSTR p;
+ WCHAR cmd[4];
+ DWORD match;
+ BOOL add;
+ if (_st_sys_argc < 1)
+ return NULL;
+
+ l = lstrlenW(_st_sys_argvw[0]);
+ if (l < EXE_SUFFIXLEN)
+ return NULL;
+ if (!(lpCmdline = (LPAPXCMDLINE)apxPoolCalloc(hPool, sizeof(APXCMDLINE))))
+ return NULL;
+ lpCmdline->hPool = hPool;
+ lpCmdline->lpOptions = lpOptions;
+ lpCmdline->szExePath = _st_sys_argvw[0];
+ p = lpCmdline->szExePath + l;
+
+ while (p > lpCmdline->szExePath) {
+ if (*p == L'\\') {
+ *p++ = L'\0';
+ break;
+ }
+ p--;
+ }
+ /* Find the path if it wasn't specified in the argv[0] */
+ if (p == lpCmdline->szExePath) {
+ WCHAR mh[4096];
+ LPWSTR m;
+ if (GetModuleFileNameW(GetModuleHandle(NULL), mh, 4096)) {
+ lpCmdline->szExePath = apxPoolStrdupW(hPool, mh);
+ m = lpCmdline->szExePath + lstrlenW(lpCmdline->szExePath);
+ while (m > lpCmdline->szExePath) {
+ if (*(m--) == L'\\') {
+ *(++m) = L'\0';
+ break;
+ }
+ }
+ }
+ }
+ lpCmdline->szExecutable = p;
+ p = _st_sys_argvw[0] + l - EXE_SUFFIXLEN;
+ if (lstrcmpiW(p, EXE_SUFFIX) == 0)
+ *p = L'\0';
+ /* Strip CPU specific suffixes */
+ l = lstrlenW(_st_sys_argvw[0]);
+ if (l > EXE_SUFFIXLEN) {
+ p = _st_sys_argvw[0] + l - EXE_SUFFIXLEN;
+ if (lstrcmpiW(p, X86_SUFFIX) == 0) {
+ *p = L'\0';
+ }
+ else if (lstrcmpiW(p, X64_SUFFIX) == 0) {
+ *p = L'\0';
+ }
+ else if (lstrcmpiW(p, A64_SUFFIX) == 0) {
+ *p = L'\0';
+ }
+ }
+ if (lpszCommands && _st_sys_argc > 1 && lstrlenW(_st_sys_argvw[1]) > 2) {
+ LPWSTR ca = _st_sys_argvw[1];
+ if (ca[0] == L'/' && ca[1] == L'/') {
+ l = 0;
+ ca += 2;
+ while (*ca && *ca != L'/') {
+ cmd[l] = *ca;
+ if (l++ > 3)
+ break;
+ ca++;
+ }
+ cmd[l] = L'\0';
+ while (lpszCommands[i]) {
+ if (lstrcmpW(lpszCommands[i++], cmd) == 0) {
+ lpCmdline->dwCmdIndex = i;
+ break;
+ }
+ }
+ if (lpCmdline->dwCmdIndex) {
+ while (*ca == '/')
+ *(ca++) = L'\0';
+ if (*ca == '\0')
+ lpCmdline->szApplication = _st_sys_argvw[0];
+ else
+ lpCmdline->szApplication = ca;
+ }
+ else {
+ apxLogWrite(APXLOG_MARK_ERROR "Unrecognized cmd option %S",
+ _st_sys_argvw[1]);
+ return NULL;
+ }
+ s = 2;
+ }
+ }
+ else {
+ lpCmdline->szApplication = lpCmdline->szExecutable;
+ lpCmdline->dwCmdIndex = 1;
+ return lpCmdline;
+ }
+ for (i = s; i < (DWORD)_st_sys_argc; i++) {
+ LPWSTR e = NULL;
+ if (_st_sys_argvw[i][0] != L'-' ||
+ _st_sys_argvw[i][1] != L'-') {
+ if (_st_sys_argvw[i][0] != L'+' ||
+ _st_sys_argvw[i][1] != L'+')
+ break;
+ else
+ add = TRUE;
+ }
+ else
+ add = FALSE;
+ p = &(_st_sys_argvw[i][2]);
+ /* Find if the option has '=' char
+ * for --option==value or --option value cases.
+ */
+ while (*p) {
+ if (*p == L'=') {
+ *p = L'\0';
+ e = p + 1;
+ break;
+ }
+ else
+ p++;
+ }
+ match = 0;
+ for (l = 0; lpOptions[l].szName; l++) {
+ if (lstrcmpW(lpOptions[l].szName, &(_st_sys_argvw[i][2])) == 0) {
+ LPWSTR val;
+ /* check if arg is needed */
+ if (e)
+ val = e;
+ else if ((i + 1) < (DWORD)_st_sys_argc)
+ val = _st_sys_argvw[++i];
+ else {
+ lpOptions[l].dwValue = 0;
+ lpOptions[l].szValue = NULL;
+ lpOptions[l].dwType |= APXCMDOPT_FOUND;
+ break;
+ }
+ if (lpOptions[l].dwType & APXCMDOPT_STR)
+ lpOptions[l].szValue = val;
+ else if (lpOptions[l].dwType & APXCMDOPT_INT)
+ lpOptions[l].dwValue = (DWORD)apxAtoulW(val);
+ else if (lpOptions[l].dwType & APXCMDOPT_MSZ) {
+ LPWSTR pp;
+ BOOL insquote = FALSE, indquote=FALSE;
+ DWORD sp = 0;
+ LPWSTR ov = lpOptions[l].szValue;
+ if (lpOptions[l].dwValue > 2) {
+ sp = (lpOptions[l].dwValue - sizeof(WCHAR)) / sizeof(WCHAR);
+ }
+ lpOptions[l].dwValue = (sp + lstrlenW(val) + 2) * sizeof(WCHAR);
+ lpOptions[l].szValue = (LPWSTR)apxPoolCalloc(hPool,
+ lpOptions[l].dwValue);
+ if (sp) {
+ AplMoveMemory(lpOptions[l].szValue, ov, sp * sizeof(WCHAR));
+ apxFree(ov);
+ }
+ pp = val;
+ while(*pp) {
+ if (*pp == L'\'')
+ insquote = !insquote;
+ else if (*pp == L'"') {
+ indquote = !indquote;
+ lpOptions[l].szValue[sp++] = L'"';
+ }
+ else if ((*pp == L'#' || *pp == L';') && !insquote && !indquote)
+ lpOptions[l].szValue[sp++] = L'\0';
+ else
+ lpOptions[l].szValue[sp++] = *pp;
+ pp++;
+ }
+ }
+ lpOptions[l].dwType |= APXCMDOPT_FOUND;
+ if (add)
+ lpOptions[l].dwType |= APXCMDOPT_ADD;
+ match = l + 1;
+ break;
+ }
+ }
+ if (match == 0) {
+ /* --unknown option
+ *
+ */
+ apxLogWrite(APXLOG_MARK_ERROR "Unrecognized program option %S",
+ _st_sys_argvw[i]);
+ return NULL;
+ }
+ }
+ if (i < (DWORD)_st_sys_argc) {
+ lpCmdline->dwArgc = _st_sys_argc - i;
+ lpCmdline->lpArgvw = &_st_sys_argvw[i];
+ }
+ return lpCmdline;
+}
+
+/* Used for future expansion */
+void apxCmdlineFree(
+ LPAPXCMDLINE lpCmdline)
+{
+
+ apxFree(lpCmdline);
+}
+
+/*
+ * Environment variables parsing
+ * Each variable is prfixed with PR_
+ * for example 'set PR_JVM=auto' has a same meaning as providing '--Jvm auto'
+ * on the command line.
+ * Multistring varisables are added to the present conf.
+ */
+void apxCmdlineLoadEnvVars(
+ LPAPXCMDLINE lpCmdline)
+{
+ WCHAR szEnv[64];
+ int i = 0;
+ if (!lpCmdline || !lpCmdline->lpOptions)
+ return;
+
+ while (lpCmdline->lpOptions[i].szName) {
+ DWORD l;
+ WCHAR szVar[SIZ_HUGLEN];
+ lstrlcpyW(szEnv, SIZ_HUGLEN, L"PR_");
+ lstrlcatW(szEnv, SIZ_HUGLEN, lpCmdline->lpOptions[i].szName);
+ l = GetEnvironmentVariableW(szEnv, szVar, SIZ_HUGMAX);
+ if (l == 0 && GetLastError() != ERROR_ENVVAR_NOT_FOUND) {
+ apxLogWrite(APXLOG_MARK_ERROR "Error geting environment variable %S",
+ szEnv);
+ ++i;
+ continue;
+ }
+ if (l && (lpCmdline->lpOptions[i].dwType & APXCMDOPT_STR)) {
+ lpCmdline->lpOptions[i].szValue = apxPoolStrdupW(lpCmdline->hPool, szVar);
+ lpCmdline->lpOptions[i].dwType |= APXCMDOPT_FOUND;
+ }
+ else if (l && (lpCmdline->lpOptions[i].dwType & APXCMDOPT_INT)) {
+ lpCmdline->lpOptions[i].dwValue = (DWORD)apxAtoulW(szVar);
+ lpCmdline->lpOptions[i].dwType |= APXCMDOPT_FOUND;
+ }
+ else if (l && (lpCmdline->lpOptions[i].dwType & APXCMDOPT_MSZ)) {
+ LPWSTR pp;
+ BOOL insquote = FALSE, indquote = FALSE;
+ DWORD sp = 0;
+ lpCmdline->lpOptions[i].dwValue = (lstrlenW(szVar) + 2) * sizeof(WCHAR);
+ lpCmdline->lpOptions[i].szValue = apxPoolCalloc(lpCmdline->hPool,
+ lpCmdline->lpOptions[i].dwValue);
+ pp = szVar;
+ while(*pp) {
+ if (*pp == L'\'')
+ insquote = !insquote;
+ else if (*pp == L'"') {
+ indquote = !indquote;
+ lpCmdline->lpOptions[i].szValue[sp++] = L'"';
+ }
+ else if ((*pp == L'#' || *pp == L';') && !insquote && !indquote)
+ lpCmdline->lpOptions[i].szValue[sp++] = L'\0';
+ else
+ lpCmdline->lpOptions[i].szValue[sp++] = *pp;
+ pp++;
+ }
+ lpCmdline->lpOptions[i].dwType |= APXCMDOPT_FOUND | APXCMDOPT_ADD;
+ }
+ ++i;
+ }
+
+}
Propchange: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/src/cmdline.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/src/console.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/src/console.c?rev=980662&view=auto
==============================================================================
--- commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/src/console.c (added)
+++ commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/src/console.c Fri Jul 30 06:50:12 2010
@@ -0,0 +1,150 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "apxwin.h"
+#include "private.h"
+
+/** Console layout saved in the registry as binary */
+typedef struct stAPXCONSOLE_LAYOUT {
+ /** Main window size */
+ POINT ptSize;
+ /** Main window size and position */
+ RECT rcPos;
+ /** Client window size */
+ POINT ptClientSize;
+ /** Client size and position */
+ RECT rcClientPos;
+ /** Scroll position */
+ POINT ptScrollPos;
+ /** Maximum Scroll position */
+ POINT ptScrollMax;
+ /** Caret position */
+ POINT ptCaretPos;
+ /** Background color */
+ COLORREF clrBackground;
+ /** Text color */
+ COLORREF clrText;
+ /** Selected text background color */
+ COLORREF clrSelectBackground;
+ /** Selected rext color */
+ COLORREF clrSelectText;
+ /** Character size */
+ POINT ptCharSize;
+ /** Current Screen size */
+ POINT ptScreenSize;
+ /** Font size */
+ INT nFontSize;
+ /** Caret size */
+ POINT ptCaretSize;
+ /** Caret Bilnk time in ms */
+ UINT nCaretBlinkTime;
+ /** Typeface name of the font (32 char max including the null terminator) */
+ TCHAR szFontName[32];
+
+} stAPXCONSOLE_LAYOUT, *APXCONSOLE_LAYOUT;
+
+typedef struct stAPXCONSOLE {
+ /** Application instance handle */
+ HINSTANCE hInstance;
+ /** Console Screen Buffer */
+ TCHAR lpScreenBuffer;
+ /** The size of the Console Screen Buffer */
+ DWORD dwScreenBufferSize;
+ /** Main window Handle */
+ HWND hWnd;
+ /** Console window Handle */
+ HWND hConsole;
+ /** Console Window Layout */
+ stAPXCONSOLE_LAYOUT stLayout;
+ /** Console Keyboard Buffer */
+ TCHAR lpKeyboardBuffer;
+ /** The size of the Keyboard Buffer */
+ DWORD dwKeyboardBufferSize;
+ /** Console Handler routine */
+ PHANDLER_ROUTINE fnHandlerRoutine;
+ /** Console Reference Count */
+ DWORD dwReferenceCount;
+} stAPXCONSOLE, *APXCONSOLE;
+
+APXHANDLE __st_sys_console = NULL;
+
+static BOOL __apxConsoleCallback(APXHANDLE hObject, UINT uMsg,
+ WPARAM wParam, LPARAM lParam)
+{
+ APXCONSOLE lpConsole = APXHANDLE_DATA(hObject);
+
+ if (hObject->dwType != APXHANDLE_TYPE_CONSOLE)
+ return FALSE;
+ switch (uMsg) {
+ case WM_CLOSE:
+
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+APXHANDLE
+apxAllocConsoleHandle(APXHANDLE hPool)
+{
+ APXHANDLE hConsole;
+
+ hConsole = apxHandleCreate(hPool, APXHANDLE_HAS_EVENT |
+ APXHANDLE_OWNS_LOCK, NULL,
+ sizeof(stAPXCONSOLE),
+ __apxConsoleCallback);
+
+ return hConsole;
+}
+
+BOOL
+apxFreeConsoleHandle(APXHANDLE hConsole)
+{
+ APXCONSOLE lpConsole = APXHANDLE_DATA(hConsole);
+ if (hConsole->dwType != APXHANDLE_TYPE_CONSOLE)
+ return FALSE;
+
+ return apxCloseHandle(hConsole);
+}
+
+
+
+
+
+/** Standard Console Functions */
+BOOL
+apxAllocConsole()
+{
+
+ if (!__st_sys_console) {
+ __st_sys_console = apxAllocConsoleHandle(NULL);
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+BOOL
+apxFreeConsole()
+{
+ if (apxFreeConsoleHandle(__st_sys_console)) {
+ __st_sys_console = NULL;
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
Propchange: commons/proper/daemon/tags/COMMONS_DAEMON_1_0_3_RC3/src/native/nt/procrun/src/console.c
------------------------------------------------------------------------------
svn:eol-style = native
|