Synchronize with trunk revision 59781.

svn path=/branches/ntvdm/; revision=59784
This commit is contained in:
Hermès Bélusca-Maïto 2013-08-19 18:55:28 +00:00
commit 8e37700e5c
80 changed files with 13962 additions and 6369 deletions

View file

@ -501,8 +501,14 @@ CreateFreeLoaderIniForReactos(
/* ReactOS_Ram */
CreateFreeLoaderEntry(IniCache, IniSection,
L"ReactOS_Ram", L"\"ReactOS (RAM Disk)\"",
L"ReactOS", L"ramdisk(0)\\ReactOS",
L"Windows2003", L"ramdisk(0)\\ReactOS",
L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /RDIMAGEPATH=reactos.img /RDIMAGEOFFSET=32256");
/* ReactOS_EMS */
CreateFreeLoaderEntry(IniCache, IniSection,
L"ReactOS_EMS", L"\"ReactOS (Emergency Management Services)\"",
L"Windows2003", ArcPath,
L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /redirect=com2 /redirectbaudrate=115200");
#endif
/* Save the ini file */

View file

@ -956,7 +956,7 @@ ScmControlService(PSERVICE Service,
dwError = ERROR_SERVICE_REQUEST_TIMEOUT;
goto Done;
}
else if (dwError == ERROR_SUCCESS)
else if (dwError == WAIT_OBJECT_0)
{
bResult = GetOverlappedResult(Service->lpImage->hControlPipe,
&Overlapped,
@ -1010,7 +1010,7 @@ ScmControlService(PSERVICE Service,
dwError = ERROR_SERVICE_REQUEST_TIMEOUT;
goto Done;
}
else if (dwError == ERROR_SUCCESS)
else if (dwError == WAIT_OBJECT_0)
{
bResult = GetOverlappedResult(Service->lpImage->hControlPipe,
&Overlapped,
@ -1207,7 +1207,7 @@ ScmSendStartCommand(PSERVICE Service,
dwError = ERROR_SERVICE_REQUEST_TIMEOUT;
goto Done;
}
else if (dwError == ERROR_SUCCESS)
else if (dwError == WAIT_OBJECT_0)
{
bResult = GetOverlappedResult(Service->lpImage->hControlPipe,
&Overlapped,
@ -1261,7 +1261,7 @@ ScmSendStartCommand(PSERVICE Service,
dwError = ERROR_SERVICE_REQUEST_TIMEOUT;
goto Done;
}
else if (dwError == ERROR_SUCCESS)
else if (dwError == WAIT_OBJECT_0)
{
bResult = GetOverlappedResult(Service->lpImage->hControlPipe,
&Overlapped,
@ -1425,9 +1425,9 @@ ScmWaitForServiceConnect(PSERVICE Service)
return ERROR_SERVICE_REQUEST_TIMEOUT;
}
else if (dwError == ERROR_SUCCESS)
else if (dwError == WAIT_OBJECT_0)
{
DPRINT("WaitForSingleObject() returned ERROR_SUCCESS\n");
DPRINT("WaitForSingleObject() returned WAIT_OBJECT_0\n");
DPRINT("Process Id: %lu\n", dwProcessId);

View file

@ -1345,11 +1345,11 @@ HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","Type",0x00010001,0x00000020
HKLM,"SYSTEM\CurrentControlSet\Services\DHCP\Parameters","ServiceDll",0x00020000,"%SystemRoot%\system32\dhcpcsvc.dll"
; EMS Serial Administration Console Driver
HKLM,"SYSTEM\CurrentControlSet\Services\NMIDebug","ErrorControl",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\NMIDebug","Group",0x00000000,"EMS"
HKLM,"SYSTEM\CurrentControlSet\Services\NMIDebug","ImagePath",0x00020000,"system32\drivers\sacdrv.sys"
HKLM,"SYSTEM\CurrentControlSet\Services\NMIDebug","Start",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\NMIDebug","Type",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\sacdrv","ErrorControl",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\sacdrv","Group",0x00000000,"EMS"
HKLM,"SYSTEM\CurrentControlSet\Services\sacdrv","ImagePath",0x00020000,"system32\drivers\sacdrv.sys"
HKLM,"SYSTEM\CurrentControlSet\Services\sacdrv","Start",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\sacdrv","Type",0x00010001,0x00000001
; Event logging service
HKLM,"SYSTEM\CurrentControlSet\Services\EventLog",,0x00000010

View file

@ -100,7 +100,7 @@ BOOLEAN Rs232PortGetByte(PUCHAR ByteReceived)
if (PortInitialized == FALSE)
return FALSE;
return (CpGetByte(&Rs232ComPort, ByteReceived, TRUE) == CP_GET_SUCCESS);
return (CpGetByte(&Rs232ComPort, ByteReceived, TRUE, FALSE) == CP_GET_SUCCESS);
}
/*

View file

@ -143,7 +143,7 @@ BOOLEAN
WinLdrPortGetByte(IN ULONG PortId,
OUT PUCHAR Data)
{
return CpGetByte(&Port[PortId], Data, TRUE) == CP_GET_SUCCESS;
return CpGetByte(&Port[PortId], Data, TRUE, FALSE) == CP_GET_SUCCESS;
}
BOOLEAN
@ -151,7 +151,7 @@ WinLdrPortPollOnly(IN ULONG PortId)
{
UCHAR Dummy;
return CpGetByte(&Port[PortId], &Dummy, FALSE) == CP_GET_SUCCESS;
return CpGetByte(&Port[PortId], &Dummy, FALSE, TRUE) == CP_GET_SUCCESS;
}
VOID
@ -246,7 +246,8 @@ WinLdrSetupEms(IN PCHAR BootOptions)
/* Start fresh */
RtlZeroMemory(&LoaderRedirectionInformation, sizeof(HEADLESS_LOADER_BLOCK));
LoaderRedirectionInformation.PciDeviceId = PCI_INVALID_VENDORID;
/* Use a direction port if one was given, or use ACPI to detect one instead */
RedirectPort = strstr(BootOptions, "/redirect=");
@ -257,6 +258,7 @@ WinLdrSetupEms(IN PCHAR BootOptions)
{
RedirectPort += sizeof("com") - 1;
LoaderRedirectionInformation.PortNumber = atoi(RedirectPort);
LoaderRedirectionInformation.TerminalType = 1; //HeadlessSerialPort
}
else
{

View file

@ -673,11 +673,6 @@ LoadAndBootWindows(IN OperatingSystemItem* OperatingSystem,
/* Allocate and minimalistic-initialize LPB */
AllocateAndInitLPB(&LoaderBlock);
#ifdef _M_IX86
/* Setup redirection support */
WinLdrSetupEms(BootOptions);
#endif
/* Load Hive */
UiDrawBackdrop();
UiDrawProgressBarCenter(15, 100, "Loading system hive...");
@ -711,6 +706,11 @@ LoadAndBootWindowsCommon(
LPCSTR SystemRoot;
TRACE("LoadAndBootWindowsCommon()\n");
#ifdef _M_IX86
/* Setup redirection support */
WinLdrSetupEms((PCHAR)BootOptions);
#endif
/* Convert BootPath to SystemRoot */
SystemRoot = strstr(BootPath, "\\");

View file

@ -143,16 +143,16 @@ else()
get_target_property(RSYM native-rsym IMPORTED_LOCATION_NOCONFIG)
set(CMAKE_C_LINK_EXECUTABLE
"<CMAKE_C_COMPILER> ${CMAKE_C_FLAGS} <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>"
"${RSYM} <TARGET> <TARGET>")
"${RSYM} -s ${REACTOS_SOURCE_DIR} <TARGET> <TARGET>")
set(CMAKE_CXX_LINK_EXECUTABLE
"<CMAKE_CXX_COMPILER> ${CMAKE_CXX_FLAGS} <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>"
"${RSYM} <TARGET> <TARGET>")
"${RSYM} -s ${REACTOS_SOURCE_DIR} <TARGET> <TARGET>")
set(CMAKE_C_CREATE_SHARED_LIBRARY
"<CMAKE_C_COMPILER> ${CMAKE_C_FLAGS} <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
"${RSYM} <TARGET> <TARGET>")
"${RSYM} -s ${REACTOS_SOURCE_DIR} <TARGET> <TARGET>")
set(CMAKE_CXX_CREATE_SHARED_LIBRARY
"<CMAKE_CXX_COMPILER> ${CMAKE_CXX_FLAGS} <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
"${RSYM} <TARGET> <TARGET>")
"${RSYM} -s ${REACTOS_SOURCE_DIR} <TARGET> <TARGET>")
set(CMAKE_RC_CREATE_SHARED_LIBRARY
"<CMAKE_C_COMPILER> ${CMAKE_C_FLAGS} <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
endif()

View file

@ -44,8 +44,8 @@ CsrpConnectToServer(IN PWSTR ObjectDirectory)
SECURITY_QUALITY_OF_SERVICE SecurityQos;
SID_IDENTIFIER_AUTHORITY NtSidAuthority = {SECURITY_NT_AUTHORITY};
PSID SystemSid = NULL;
CSR_CONNECTION_INFO ConnectionInfo;
ULONG ConnectionInfoLength = sizeof(CSR_CONNECTION_INFO);
CSR_API_CONNECTINFO ConnectionInfo;
ULONG ConnectionInfoLength = sizeof(CSR_API_CONNECTINFO);
DPRINT("%s(%S)\n", __FUNCTION__, ObjectDirectory);
@ -107,7 +107,7 @@ CsrpConnectToServer(IN PWSTR ObjectDirectory)
SecurityQos.EffectiveOnly = TRUE;
/* Setup the connection info */
ConnectionInfo.Version = 0x10000;
ConnectionInfo.Version = CSRSRV_VERSION;
/* Create a SID for us */
Status = RtlAllocateAndInitializeSid(&NtSidAuthority,

View file

@ -18,6 +18,7 @@ add_definitions(
spec2def(glu32.dll glu32.spec ADD_IMPORTLIB)
list(APPEND SOURCE
glu32.rc
src/libutil/error.c
src/libutil/glue.c
src/libutil/mipmap.c

View file

@ -0,0 +1,5 @@
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS OpenGL Utility Library\0"
#define REACTOS_STR_INTERNAL_NAME "glu32\0"
#define REACTOS_STR_ORIGINAL_FILENAME "glu32.dll\0"
#include <reactos/version.rc>

View file

@ -175,7 +175,7 @@ BasepInitConsole(VOID)
ULONG SessionId = NtCurrentPeb()->SessionId;
BOOLEAN InServer;
CONSOLE_CONNECTION_INFO ConnectInfo;
CONSRV_API_CONNECTINFO ConnectInfo;
ULONG ConnectInfoSize = sizeof(ConnectInfo);
DPRINT("BasepInitConsole for : %wZ\n", &Parameters->ImagePathName);

View file

@ -157,7 +157,7 @@ DefineDosDeviceW(
}
else
{
DefineDosDeviceRequest->dwFlags = dwFlags;
DefineDosDeviceRequest->Flags = dwFlags;
CsrCaptureMessageBuffer(CaptureBuffer,
(PVOID)DeviceUpcaseNameU.Buffer,
@ -174,11 +174,11 @@ DefineDosDeviceW(
CsrCaptureMessageBuffer(CaptureBuffer,
(PVOID)NtTargetPathU.Buffer,
NtTargetPathU.Length,
(PVOID*)&DefineDosDeviceRequest->TargetName.Buffer);
(PVOID*)&DefineDosDeviceRequest->TargetPath.Buffer);
}
DefineDosDeviceRequest->TargetName.Length =
DefineDosDeviceRequest->TargetPath.Length =
NtTargetPathU.Length;
DefineDosDeviceRequest->TargetName.MaximumLength =
DefineDosDeviceRequest->TargetPath.MaximumLength =
NtTargetPathU.Length;
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,

View file

@ -92,7 +92,7 @@ GetTempFileNameW(IN LPCWSTR lpPathName,
CHAR IDString[5];
WCHAR * TempFileName;
BASE_API_MESSAGE ApiMessage;
PBASE_GET_TEMP_FILE GetTempFile = &ApiMessage.Data.GetTempFile;
PBASE_GET_TEMP_FILE GetTempFile = &ApiMessage.Data.GetTempFileRequest;
DWORD FileAttributes, LastError;
UNICODE_STRING PathNameString, PrefixString;
static const WCHAR Ext[] = { L'.', 't', 'm', 'p', UNICODE_NULL };

View file

@ -11,6 +11,7 @@
/* INCLUDES *******************************************************************/
#include <k32.h>
#include <winspool.h>
#define NDEBUG
#include <debug.h>

View file

@ -963,13 +963,13 @@ GetProcessShutdownParameters(OUT LPDWORD lpdwLevel,
{
NTSTATUS Status;
BASE_API_MESSAGE ApiMessage;
PBASE_GET_PROCESS_SHUTDOWN_PARAMS GetShutdownParametersRequest = &ApiMessage.Data.GetShutdownParametersRequest;
PBASE_GETSET_PROCESS_SHUTDOWN_PARAMS ShutdownParametersRequest = &ApiMessage.Data.ShutdownParametersRequest;
/* Ask CSRSS for shutdown information */
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
NULL,
CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX, BasepGetProcessShutdownParam),
sizeof(BASE_GET_PROCESS_SHUTDOWN_PARAMS));
sizeof(BASE_GETSET_PROCESS_SHUTDOWN_PARAMS));
if (!NT_SUCCESS(Status))
{
/* Return the failure from CSRSS */
@ -978,8 +978,8 @@ GetProcessShutdownParameters(OUT LPDWORD lpdwLevel,
}
/* Get the data back */
*lpdwLevel = GetShutdownParametersRequest->Level;
*lpdwFlags = GetShutdownParametersRequest->Flags;
*lpdwLevel = ShutdownParametersRequest->ShutdownLevel;
*lpdwFlags = ShutdownParametersRequest->ShutdownFlags;
return TRUE;
}
@ -993,15 +993,15 @@ SetProcessShutdownParameters(IN DWORD dwLevel,
{
NTSTATUS Status;
BASE_API_MESSAGE ApiMessage;
PBASE_SET_PROCESS_SHUTDOWN_PARAMS SetShutdownParametersRequest = &ApiMessage.Data.SetShutdownParametersRequest;
PBASE_GETSET_PROCESS_SHUTDOWN_PARAMS ShutdownParametersRequest = &ApiMessage.Data.ShutdownParametersRequest;
/* Write the data into the CSRSS request and send it */
SetShutdownParametersRequest->Level = dwLevel;
SetShutdownParametersRequest->Flags = dwFlags;
ShutdownParametersRequest->ShutdownLevel = dwLevel;
ShutdownParametersRequest->ShutdownFlags = dwFlags;
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
NULL,
CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX, BasepSetProcessShutdownParam),
sizeof(BASE_SET_PROCESS_SHUTDOWN_PARAMS));
sizeof(BASE_GETSET_PROCESS_SHUTDOWN_PARAMS));
if (!NT_SUCCESS(Status))
{
/* Return the failure from CSRSS */
@ -2426,7 +2426,7 @@ CreateProcessInternalW(IN HANDLE hUserToken,
/* Set message structures */
CreateProcessMsg = &CsrMsg.Data.CreateProcessRequest;
VdmMsg = &CsrMsg.Data.CheckVdm;
VdmMsg = &CsrMsg.Data.CheckVDMRequest;
/* Clear the more complex structures by zeroing out their entire memory */
RtlZeroMemory(&Context, sizeof(Context));

View file

@ -2,7 +2,7 @@
* PROJECT: ReactOS Win32 Base API
* LICENSE: GPL - See COPYING in the top level directory
* FILE: dll/win32/kernel32/client/vdm.c
* PURPOSE: Virtual Dos Machine (VDM) Support
* PURPOSE: Virtual DOS Machines (VDM) Support
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
*/
@ -49,17 +49,18 @@ BaseIsDosApplication(IN PUNICODE_STRING PathName,
/* Is it a .com? */
String.Length = BaseDotComSuffixName.Length;
String.Buffer = &PathName->Buffer[(PathName->Length - String.Length) / sizeof(WCHAR)];
if (RtlEqualUnicodeString(&String, &BaseDotComSuffixName, TRUE)) return 2;
if (RtlEqualUnicodeString(&String, &BaseDotComSuffixName, TRUE)) return BINARY_TYPE_COM;
/* Is it a .pif? */
String.Length = BaseDotPifSuffixName.Length;
String.Buffer = &PathName->Buffer[(PathName->Length - String.Length) / sizeof(WCHAR)];
if (RtlEqualUnicodeString(&String, &BaseDotPifSuffixName, TRUE)) return 3;
if (RtlEqualUnicodeString(&String, &BaseDotPifSuffixName, TRUE)) return BINARY_TYPE_PIF;
/* Is it an exe? */
String.Length = BaseDotExeSuffixName.Length;
String.Buffer = &PathName->Buffer[(PathName->Length - String.Length) / sizeof(WCHAR)];
if (RtlEqualUnicodeString(&String, &BaseDotExeSuffixName, TRUE)) return 1;
if (RtlEqualUnicodeString(&String, &BaseDotExeSuffixName, TRUE)) return BINARY_TYPE_EXE;
return 0;
}

View file

@ -20,7 +20,6 @@
#include <winreg.h>
#include <wincon.h>
#include <winuser.h>
#include <winspool.h>
#include <tlhelp32.h>
/* Redefine NTDDI_VERSION to 2K3 SP1 to get correct NDK definitions */

View file

@ -20,7 +20,7 @@
/*
* TODO:
* Implement NetUserGetGroups
* Implement NetUserGetGroups (WIP)
* Implement NetUserSetGroups
* NetUserGetLocalGroups does not support LG_INCLUDE_INDIRECT yet.
* Add missing information levels.
@ -2056,7 +2056,7 @@ NetUserAdd(LPCWSTR servername,
/* Open the Account Domain */
Status = OpenAccountDomain(ServerHandle,
(servername != NULL) ? &ServerName : NULL,
DOMAIN_CREATE_USER | DOMAIN_LOOKUP,
DOMAIN_CREATE_USER | DOMAIN_LOOKUP | DOMAIN_READ_PASSWORD_PARAMETERS,
&DomainHandle);
if (!NT_SUCCESS(Status))
{
@ -2621,15 +2621,160 @@ NetUserGetGroups(LPCWSTR servername,
LPDWORD entriesread,
LPDWORD totalentries)
{
FIXME("%s %s %d %p %d %p %p stub\n", debugstr_w(servername),
UNICODE_STRING ServerName;
UNICODE_STRING UserName;
SAM_HANDLE ServerHandle = NULL;
SAM_HANDLE AccountDomainHandle = NULL;
SAM_HANDLE UserHandle = NULL;
PSID AccountDomainSid = NULL;
PULONG RelativeIds = NULL;
PSID_NAME_USE Use = NULL;
PGROUP_MEMBERSHIP GroupMembership = NULL;
ULONG GroupCount;
NET_API_STATUS ApiStatus = NERR_Success;
NTSTATUS Status = STATUS_SUCCESS;
TRACE("%s %s %d %p %d %p %p stub\n", debugstr_w(servername),
debugstr_w(username), level, bufptr, prefixmaxlen, entriesread,
totalentries);
if (servername != NULL)
RtlInitUnicodeString(&ServerName, servername);
RtlInitUnicodeString(&UserName, username);
/* Connect to the SAM Server */
Status = SamConnect((servername != NULL) ? &ServerName : NULL,
&ServerHandle,
SAM_SERVER_CONNECT | SAM_SERVER_LOOKUP_DOMAIN,
NULL);
if (!NT_SUCCESS(Status))
{
ERR("SamConnect failed (Status %08lx)\n", Status);
ApiStatus = NetpNtStatusToApiStatus(Status);
goto done;
}
/* Get the Account Domain SID */
Status = GetAccountDomainSid((servername != NULL) ? &ServerName : NULL,
&AccountDomainSid);
if (!NT_SUCCESS(Status))
{
ERR("GetAccountDomainSid failed (Status %08lx)\n", Status);
ApiStatus = NetpNtStatusToApiStatus(Status);
goto done;
}
/* Open the Account Domain */
Status = SamOpenDomain(ServerHandle,
DOMAIN_LOOKUP | DOMAIN_GET_ALIAS_MEMBERSHIP,
AccountDomainSid,
&AccountDomainHandle);
if (!NT_SUCCESS(Status))
{
ERR("OpenAccountDomain failed (Status %08lx)\n", Status);
ApiStatus = NetpNtStatusToApiStatus(Status);
goto done;
}
/* Get the RID for the given user name */
Status = SamLookupNamesInDomain(AccountDomainHandle,
1,
&UserName,
&RelativeIds,
&Use);
if (!NT_SUCCESS(Status))
{
ERR("SamLookupNamesInDomain failed (Status %08lx)\n", Status);
ApiStatus = NetpNtStatusToApiStatus(Status);
goto done;
}
/* Fail, if it is not a user account */
if (Use[0] != SidTypeUser)
{
ERR("Account is not a User!\n");
ApiStatus = NERR_UserNotFound;
goto done;
}
/* Open the user object */
Status = SamOpenUser(AccountDomainHandle,
USER_LIST_GROUPS,
RelativeIds[0],
&UserHandle);
if (!NT_SUCCESS(Status))
{
ERR("SamOpenUser failed (Status %08lx)\n", Status);
ApiStatus = NetpNtStatusToApiStatus(Status);
goto done;
}
/* Get the group memberships of this user */
Status = SamGetGroupsForUser(UserHandle,
&GroupMembership,
&GroupCount);
if (!NT_SUCCESS(Status))
{
ERR("SamGetGroupsForUser failed (Status %08lx)\n", Status);
ApiStatus = NetpNtStatusToApiStatus(Status);
goto done;
}
/* If there is no group membership, we're done */
if (GroupCount == 0)
{
ApiStatus = NERR_Success;
goto done;
}
done:
if (GroupMembership != NULL)
SamFreeMemory(GroupMembership);
if (UserHandle != NULL)
SamCloseHandle(UserHandle);
if (RelativeIds != NULL)
SamFreeMemory(RelativeIds);
if (Use != NULL)
SamFreeMemory(Use);
if (AccountDomainSid != NULL)
RtlFreeHeap(RtlGetProcessHeap(), 0, AccountDomainSid);
if (AccountDomainHandle != NULL)
SamCloseHandle(AccountDomainHandle);
if (ServerHandle != NULL)
SamCloseHandle(ServerHandle);
if (ApiStatus != NERR_Success && ApiStatus != ERROR_MORE_DATA)
{
*entriesread = 0;
*totalentries = 0;
}
else
{
// *entriesread = Count;
// *totalentries = Count;
}
// *bufptr = (LPBYTE)Buffer;
return ApiStatus;
#if 0
*bufptr = NULL;
*entriesread = 0;
*totalentries = 0;
return ERROR_INVALID_LEVEL;
#endif
}

View file

@ -1847,7 +1847,7 @@ SamSetInformationUser(IN SAM_HANDLE UserHandle,
{
PSAMPR_USER_SET_PASSWORD_INFORMATION PasswordBuffer;
SAMPR_USER_INTERNAL1_INFORMATION Internal1Buffer;
PUSER_ALL_INFORMATION AllBuffer;
USER_ALL_INFORMATION InternalAllBuffer;
OEM_STRING LmPwdString;
CHAR LmPwdBuffer[15];
NTSTATUS Status;
@ -1914,23 +1914,118 @@ SamSetInformationUser(IN SAM_HANDLE UserHandle,
if (!NT_SUCCESS(Status))
{
TRACE("SamrSetInformation() failed (Status 0x%08lx)\n", Status);
return Status;
}
return Status;
}
else if (UserInformationClass == UserAllInformation)
{
AllBuffer = (PUSER_ALL_INFORMATION)Buffer;
RtlCopyMemory(&InternalAllBuffer,
Buffer,
sizeof(USER_ALL_INFORMATION));
if (AllBuffer->WhichFields & (USER_ALL_LMPASSWORDPRESENT | USER_ALL_NTPASSWORDPRESENT))
if (InternalAllBuffer.WhichFields & (USER_ALL_LMPASSWORDPRESENT | USER_ALL_NTPASSWORDPRESENT))
{
Status = SampCheckPassword(UserHandle,
&AllBuffer->NtPassword);
if (!NT_SUCCESS(Status))
if (InternalAllBuffer.WhichFields & USER_ALL_OWFPASSWORD)
{
TRACE("SampCheckPassword failed (Status 0x%08lx)\n", Status);
return Status;
/* Check NT password hash */
if (InternalAllBuffer.WhichFields & USER_ALL_NTPASSWORDPRESENT)
{
if (InternalAllBuffer.NtPassword.Length != sizeof(ENCRYPTED_NT_OWF_PASSWORD))
return STATUS_INVALID_PARAMETER;
}
/* Check LM password hash */
if (InternalAllBuffer.WhichFields & USER_ALL_LMPASSWORDPRESENT)
{
if (InternalAllBuffer.LmPassword.Length != sizeof(ENCRYPTED_LM_OWF_PASSWORD))
return STATUS_INVALID_PARAMETER;
}
}
else
{
/*
* Only allow the NT password to be set.
* The LM password will be created here.
*/
if (InternalAllBuffer.WhichFields & USER_ALL_LMPASSWORDPRESENT)
{
TRACE("Do not try to set a clear text LM password!\n");
return STATUS_INVALID_PARAMETER;
}
if (InternalAllBuffer.WhichFields & USER_ALL_NTPASSWORDPRESENT)
{
Status = SampCheckPassword(UserHandle,
&InternalAllBuffer.NtPassword);
if (!NT_SUCCESS(Status))
{
TRACE("SampCheckPassword failed (Status 0x%08lx)\n", Status);
return Status;
}
/* Calculate the NT password hash */
Status = SystemFunction007((PUNICODE_STRING)&InternalAllBuffer.NtPassword,
(LPBYTE)&Internal1Buffer.EncryptedNtOwfPassword);
if (!NT_SUCCESS(Status))
{
TRACE("SystemFunction007 failed (Status 0x%08lx)\n", Status);
return Status;
}
InternalAllBuffer.NtPasswordPresent = TRUE;
InternalAllBuffer.LmPasswordPresent = FALSE;
InternalAllBuffer.NtPassword.Length = sizeof(ENCRYPTED_NT_OWF_PASSWORD);
InternalAllBuffer.NtPassword.MaximumLength = sizeof(ENCRYPTED_NT_OWF_PASSWORD);
InternalAllBuffer.NtPassword.Buffer = (LPWSTR)&Internal1Buffer.EncryptedNtOwfPassword;
/* Build the LM password */
LmPwdString.Length = 15;
LmPwdString.MaximumLength = 15;
LmPwdString.Buffer = LmPwdBuffer;
ZeroMemory(LmPwdString.Buffer, LmPwdString.MaximumLength);
Status = RtlUpcaseUnicodeStringToOemString(&LmPwdString,
(PUNICODE_STRING)&InternalAllBuffer.NtPassword,
FALSE);
if (NT_SUCCESS(Status))
{
/* Calculate the LM password hash */
Status = SystemFunction006(LmPwdString.Buffer,
(LPSTR)&Internal1Buffer.EncryptedLmOwfPassword);
if (NT_SUCCESS(Status))
{
InternalAllBuffer.WhichFields |= USER_ALL_LMPASSWORDPRESENT;
InternalAllBuffer.LmPasswordPresent = TRUE;
InternalAllBuffer.LmPassword.Length = sizeof(ENCRYPTED_LM_OWF_PASSWORD);
InternalAllBuffer.LmPassword.MaximumLength = sizeof(ENCRYPTED_LM_OWF_PASSWORD);
InternalAllBuffer.LmPassword.Buffer = (LPWSTR)&Internal1Buffer.EncryptedLmOwfPassword;
}
}
}
}
}
RpcTryExcept
{
Status = SamrSetInformationUser((SAMPR_HANDLE)UserHandle,
UserAllInformation,
(PVOID)&InternalAllBuffer);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
Status = I_RpcMapWin32Status(RpcExceptionCode());
}
RpcEndExcept;
if (!NT_SUCCESS(Status))
{
TRACE("SamrSetInformation() failed (Status 0x%08lx)\n", Status);
}
return Status;
}
RpcTryExcept

View file

@ -7115,10 +7115,25 @@ SampSetUserAll(PSAM_DB_OBJECT UserObject,
SAM_USER_FIXED_DATA FixedData;
ULONG Length = 0;
ULONG WhichFields;
PENCRYPTED_NT_OWF_PASSWORD NtPassword = NULL;
PENCRYPTED_LM_OWF_PASSWORD LmPassword = NULL;
BOOLEAN NtPasswordPresent = FALSE;
BOOLEAN LmPasswordPresent = FALSE;
BOOLEAN WriteFixedData = FALSE;
NTSTATUS Status = STATUS_SUCCESS;
WhichFields = Buffer->All.WhichFields;
/* Get the fixed size attributes */
Length = sizeof(SAM_USER_FIXED_DATA);
Status = SampGetObjectAttribute(UserObject,
L"F",
NULL,
(PVOID)&FixedData,
&Length);
if (!NT_SUCCESS(Status))
goto done;
if (WhichFields & USER_ALL_USERNAME)
{
Status = SampSetUserName(UserObject,
@ -7234,39 +7249,89 @@ SampSetUserAll(PSAM_DB_OBJECT UserObject,
goto done;
}
if (WhichFields & (USER_ALL_PRIMARYGROUPID |
USER_ALL_ACCOUNTEXPIRES |
USER_ALL_USERACCOUNTCONTROL |
USER_ALL_COUNTRYCODE |
USER_ALL_CODEPAGE))
if (WhichFields & USER_ALL_PRIMARYGROUPID)
{
Length = sizeof(SAM_USER_FIXED_DATA);
Status = SampGetObjectAttribute(UserObject,
L"F",
NULL,
(PVOID)&FixedData,
&Length);
FixedData.PrimaryGroupId = Buffer->All.PrimaryGroupId;
WriteFixedData = TRUE;
}
if (WhichFields & USER_ALL_ACCOUNTEXPIRES)
{
FixedData.AccountExpires.LowPart = Buffer->All.AccountExpires.LowPart;
FixedData.AccountExpires.HighPart = Buffer->All.AccountExpires.HighPart;
WriteFixedData = TRUE;
}
if (WhichFields & USER_ALL_USERACCOUNTCONTROL)
{
FixedData.UserAccountControl = Buffer->All.UserAccountControl;
WriteFixedData = TRUE;
}
if (WhichFields & USER_ALL_COUNTRYCODE)
{
FixedData.CountryCode = Buffer->All.CountryCode;
WriteFixedData = TRUE;
}
if (WhichFields & USER_ALL_CODEPAGE)
{
FixedData.CodePage = Buffer->All.CodePage;
WriteFixedData = TRUE;
}
if (WhichFields & (USER_ALL_NTPASSWORDPRESENT |
USER_ALL_LMPASSWORDPRESENT))
{
if (WhichFields & USER_ALL_NTPASSWORDPRESENT)
{
NtPassword = (PENCRYPTED_NT_OWF_PASSWORD)Buffer->All.NtOwfPassword.Buffer;
NtPasswordPresent = Buffer->All.NtPasswordPresent;
}
if (WhichFields & USER_ALL_LMPASSWORDPRESENT)
{
LmPassword = (PENCRYPTED_LM_OWF_PASSWORD)Buffer->All.LmOwfPassword.Buffer;
LmPasswordPresent = Buffer->All.LmPasswordPresent;
}
Status = SampSetUserPassword(UserObject,
NtPassword,
NtPasswordPresent,
LmPassword,
LmPasswordPresent);
if (!NT_SUCCESS(Status))
goto done;
if (WhichFields & USER_ALL_PRIMARYGROUPID)
FixedData.PrimaryGroupId = Buffer->All.PrimaryGroupId;
/* The password has just been set */
Status = NtQuerySystemTime(&FixedData.PasswordLastSet);
if (!NT_SUCCESS(Status))
goto done;
if (WhichFields & USER_ALL_ACCOUNTEXPIRES)
WriteFixedData = TRUE;
}
if (WhichFields & USER_ALL_PASSWORDEXPIRED)
{
if (Buffer->All.PasswordExpired)
{
FixedData.AccountExpires.LowPart = Buffer->All.AccountExpires.LowPart;
FixedData.AccountExpires.HighPart = Buffer->All.AccountExpires.HighPart;
/* The pasword was last set ages ago */
FixedData.PasswordLastSet.LowPart = 0;
FixedData.PasswordLastSet.HighPart = 0;
}
else
{
/* The pasword was last set right now */
Status = NtQuerySystemTime(&FixedData.PasswordLastSet);
if (!NT_SUCCESS(Status))
goto done;
}
if (WhichFields & USER_ALL_USERACCOUNTCONTROL)
FixedData.UserAccountControl = Buffer->All.UserAccountControl;
if (WhichFields & USER_ALL_COUNTRYCODE)
FixedData.CountryCode = Buffer->Preferences.CountryCode;
if (WhichFields & USER_ALL_CODEPAGE)
FixedData.CodePage = Buffer->Preferences.CodePage;
WriteFixedData = TRUE;
}
if (WriteFixedData == TRUE)
{
Status = SampSetObjectAttribute(UserObject,
L"F",
REG_BINARY,
@ -7276,15 +7341,7 @@ SampSetUserAll(PSAM_DB_OBJECT UserObject,
goto done;
}
/*
FIXME:
USER_ALL_NTPASSWORDPRESENT
USER_ALL_LMPASSWORDPRESENT
USER_ALL_PASSWORDEXPIRED
*/
done:
return Status;
}

View file

@ -402,12 +402,14 @@ SampSetUserPassword(IN PSAM_DB_OBJECT UserObject,
NTSTATUS Status;
UseNtPassword =
((memcmp(NtPassword, &EmptyNtHash, sizeof(ENCRYPTED_NT_OWF_PASSWORD)) != 0) &&
(NtPasswordPresent != FALSE));
((NtPasswordPresent != FALSE) &&
(NtPassword != NULL) &&
(memcmp(NtPassword, &EmptyNtHash, sizeof(ENCRYPTED_NT_OWF_PASSWORD)) != 0));
UseLmPassword =
((memcmp(LmPassword, &EmptyLmHash, sizeof(ENCRYPTED_LM_OWF_PASSWORD)) != 0) &&
(LmPasswordPresent != FALSE));
((LmPasswordPresent != FALSE) &&
(LmPassword != NULL) &&
(memcmp(LmPassword, &EmptyLmHash, sizeof(ENCRYPTED_LM_OWF_PASSWORD)) != 0));
/* Update the NT password history only if we have a new non-empty NT password */
if (UseNtPassword)

View file

@ -222,7 +222,7 @@ NTAPI
KdpPollByte(OUT PUCHAR OutByte)
{
/* Poll the byte */
if (CpGetByte(&KdDebugComPort, OutByte, FALSE) == CP_GET_SUCCESS)
if (CpGetByte(&KdDebugComPort, OutByte, FALSE, TRUE) == CP_GET_SUCCESS)
{
return KDP_PACKET_RECEIVED;
}
@ -237,7 +237,7 @@ NTAPI
KdpReceiveByte(OUT PUCHAR OutByte)
{
/* Get the byte */
if (CpGetByte(&KdDebugComPort, OutByte, TRUE) == CP_GET_SUCCESS)
if (CpGetByte(&KdDebugComPort, OutByte, TRUE, FALSE) == CP_GET_SUCCESS)
{
return KDP_PACKET_RECEIVED;
}

View file

@ -111,8 +111,7 @@ VOID
ChannelReferenceToOneByIndexWithLock(IN LONG Index)
{
ChannelSlotLock(Index);
ASSERT(ChannelGetReferenceCount((Index)) == 1);
_InterlockedExchange(&ChannelRefCount[Index], 1);
ChannelReferenceToOneByIndex(Index);
ChannelSlotUnlock(Index);
}
@ -359,7 +358,7 @@ ChanMgrCreateChannel(OUT PSAC_CHANNEL *Channel,
ChannelLockCreates();
/* Is the channel manager initialized? */
if (ChannelCreateEnabled)
if (!ChannelCreateEnabled)
{
/* Nope, bail out */
Status = STATUS_UNSUCCESSFUL;
@ -405,7 +404,6 @@ ChanMgrCreateChannel(OUT PSAC_CHANNEL *Channel,
if (i == SAC_MAX_CHANNELS)
{
/* Bail out */
Status = STATUS_UNSUCCESSFUL;
goto ReturnStatus;
}

View file

@ -147,11 +147,11 @@ ChannelIRead(IN PSAC_CHANNEL Channel,
return Status;
}
UCHAR
WCHAR
NTAPI
ChannelIReadLast(IN PSAC_CHANNEL Channel)
{
UCHAR LastChar;
WCHAR LastChar;
/* Read the last character while holding the lock */
ChannelLockIBuffer(Channel);
@ -410,9 +410,19 @@ ChannelInitializeVTable(IN PSAC_CHANNEL Channel)
switch (Channel->ChannelType)
{
case VtUtf8:
/* FIXME: TODO */
ASSERT(FALSE);
return STATUS_NOT_IMPLEMENTED;
/* Setup the calls for a VT-UTF8 channel */
Channel->ChannelCreate = VTUTF8ChannelCreate;
Channel->ChannelDestroy = VTUTF8ChannelDestroy;
Channel->ChannelOutputFlush = VTUTF8ChannelOFlush;
Channel->ChannelOutputEcho = VTUTF8ChannelOEcho;
Channel->ChannelOutputWrite = VTUTF8ChannelOWrite;
Channel->ChannelOutputRead = VTUTF8ChannelORead;
Channel->ChannelInputWrite = VTUTF8ChannelIWrite;
Channel->ChannelInputRead = VTUTF8ChannelIRead;
Channel->ChannelInputReadLast = VTUTF8ChannelIReadLast;
Channel->ChannelInputBufferIsFull = VTUTF8ChannelIBufferIsFull;
Channel->ChannelInputBufferLength = VTUTF8ChannelIBufferLength;
break;
case Cmd:
/* FIXME: TODO */

View file

@ -17,58 +17,44 @@ ULONG GlobalBufferSize;
/* FUNCTIONS *****************************************************************/
VOID
NTAPI
DoRebootCommand(IN BOOLEAN Reboot)
NTSTATUS
DoChannelListCommand(
VOID
)
{
LARGE_INTEGER Timeout, TickCount;
NTSTATUS Status;
KEVENT Event;
SAC_DBG(1, "SAC DoRebootCommand: Entering.\n");
return STATUS_NOT_IMPLEMENTED;
}
/* Get the current time now, and setup a timeout in 1 second */
KeQueryTickCount(&TickCount);
Timeout.QuadPart = TickCount.QuadPart / (10000000 / KeQueryTimeIncrement());
NTSTATUS
DoChannelCloseByNameCommand(
IN PCHAR Count
)
{
return STATUS_NOT_IMPLEMENTED;
}
/* Check if the timeout is small enough */
if (Timeout.QuadPart < 60 )
{
/* Show the prompt */
ConMgrSimpleEventMessage(Reboot ?
SAC_RESTART_PROMPT : SAC_SHUTDOWN_PROMPT,
TRUE);
NTSTATUS
DoChannelCloseByIndexCommand(
IN ULONG ChannelIndex
)
{
return STATUS_NOT_IMPLEMENTED;
}
/* Do the wait */
KeInitializeEvent(&Event, SynchronizationEvent, 0);
Timeout.QuadPart = -10000000 * (60 - Timeout.LowPart);
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, &Timeout);
}
NTSTATUS
DoChannelSwitchByNameCommand(
IN PCHAR Count
)
{
return STATUS_NOT_IMPLEMENTED;
}
/* Do a shutdown or a reboot, based on the request */
Status = NtShutdownSystem(Reboot ? ShutdownReboot : ShutdownPowerOff);
/* Check if anyone in the command channel already allocated this */
if (!GlobalBuffer)
{
/* Allocate it */
GlobalBuffer = SacAllocatePool(PAGE_SIZE, GLOBAL_BLOCK_TAG);
if (!GlobalBuffer)
{
/* We need the global buffer, bail out without it*/
SacPutSimpleMessage(SAC_OUT_OF_MEMORY_PROMPT);
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC DoRebootCommand: Exiting (1).\n");
return;
}
/* Set the size of the buffer */
GlobalBufferSize = PAGE_SIZE;
}
/* We came back from a reboot, this doesn't make sense, tell the user */
SacPutSimpleMessage(Reboot ? SAC_RESTART_FAIL_PROMPT : SAC_SHUTDOWN_FAIL_PROMPT);
swprintf(GlobalBuffer, GetMessage(SAC_FAIL_PROMPT), Status);
SacPutString(GlobalBuffer);
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC DoRebootCommand: Exiting.\n");
NTSTATUS
DoChannelSwitchByIndexCommand(
IN ULONG ChannelIndex
)
{
return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS
@ -124,169 +110,201 @@ CallQueryIPIOCTL(
}
VOID
DoFullInfoCommand(
VOID
)
NTAPI
DoRebootCommand(IN BOOLEAN Reboot)
{
LARGE_INTEGER Timeout, TickCount;
NTSTATUS Status;
KEVENT Event;
SAC_DBG(1, "SAC DoRebootCommand: Entering.\n");
/* Get the current time now, and setup a timeout in 1 second */
KeQueryTickCount(&TickCount);
Timeout.QuadPart = TickCount.QuadPart / (10000000 / KeQueryTimeIncrement());
/* Check if the timeout is small enough */
if (Timeout.QuadPart < 60 )
{
/* Show the prompt */
ConMgrSimpleEventMessage(Reboot ?
SAC_RESTART_PROMPT : SAC_SHUTDOWN_PROMPT,
TRUE);
/* Do the wait */
KeInitializeEvent(&Event, SynchronizationEvent, 0);
Timeout.QuadPart = -10000000 * (60 - Timeout.LowPart);
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, &Timeout);
}
/* Do a shutdown or a reboot, based on the request */
Status = NtShutdownSystem(Reboot ? ShutdownReboot : ShutdownPowerOff);
/* Check if anyone in the command channel already allocated this */
if (!GlobalBuffer)
{
/* Allocate it */
GlobalBuffer = SacAllocatePool(PAGE_SIZE, GLOBAL_BLOCK_TAG);
if (!GlobalBuffer)
{
/* We need the global buffer, bail out without it*/
SacPutSimpleMessage(SAC_OUT_OF_MEMORY_PROMPT);
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC DoRebootCommand: Exiting (1).\n");
return;
}
/* Set the size of the buffer */
GlobalBufferSize = PAGE_SIZE;
}
/* We came back from a reboot, this doesn't make sense, tell the user */
SacPutSimpleMessage(Reboot ? SAC_RESTART_FAIL_PROMPT : SAC_SHUTDOWN_FAIL_PROMPT);
swprintf(GlobalBuffer, GetMessage(SAC_FAIL_PROMPT), Status);
SacPutString(GlobalBuffer);
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC DoRebootCommand: Exiting.\n");
}
VOID
NTAPI
DoFullInfoCommand(VOID)
{
}
VOID
DoPagingCommand(
VOID
)
NTAPI
DoPagingCommand(VOID)
{
}
VOID
DoSetTimeCommand(
IN PCHAR InputTime
)
NTAPI
DoSetTimeCommand(IN PCHAR InputTime)
{
}
VOID
DoKillCommand(
IN PCHAR KillString
)
NTAPI
DoKillCommand(IN PCHAR KillString)
{
}
VOID
DoLowerPriorityCommand(
IN PCHAR PrioString
)
NTAPI
DoLowerPriorityCommand(IN PCHAR PrioString)
{
}
VOID
DoRaisePriorityCommand(
IN PCHAR PrioString
)
NTAPI
DoRaisePriorityCommand(IN PCHAR PrioString)
{
}
VOID
DoLimitMemoryCommand(
IN PCHAR LimitString
)
NTAPI
DoLimitMemoryCommand(IN PCHAR LimitString)
{
}
VOID
DoCrashCommand(
VOID
)
NTAPI
DoCrashCommand(VOID)
{
}
VOID
DoMachineInformationCommand(
VOID
)
{
}
NTSTATUS
DoChannelListCommand(
VOID
)
{
return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS
DoChannelCloseByNameCommand(
IN PCHAR Count
)
{
return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS
DoChannelCloseByIndexCommand(
IN ULONG ChannelIndex
)
{
return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS
DoChannelSwitchByNameCommand(
IN PCHAR Count
)
{
return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS
DoChannelSwitchByIndexCommand(
IN ULONG ChannelIndex
)
{
return STATUS_NOT_IMPLEMENTED;
}
VOID
DoChannelCommand(
IN PCHAR ChannelString
)
NTAPI
DoMachineInformationCommand(VOID)
{
}
VOID
DoCmdCommand(
VOID
)
NTAPI
DoChannelCommand(IN PCHAR ChannelString)
{
}
VOID
DoLockCommand(
VOID
)
NTAPI
DoCmdCommand(IN PCHAR InputString)
{
}
VOID
DoHelpCommand(
VOID
)
NTAPI
DoLockCommand(VOID)
{
}
#define PRINT_HELP_MESSAGE(x) \
{ \
Count += NewCount; \
NewCount = GetMessageLineCount(x); \
if ( (NewCount + Count) > SAC_VTUTF8_COL_HEIGHT) \
{ \
PutMore(&ScreenFull); \
if (ScreenFull) return; \
Count = 0; \
} \
SacPutSimpleMessage(x); \
}
VOID
NTAPI
DoHelpCommand(VOID)
{
ULONG NewCount = 0, Count = 0;
BOOLEAN ScreenFull = FALSE;
PRINT_HELP_MESSAGE(112);
PRINT_HELP_MESSAGE(12);
PRINT_HELP_MESSAGE(13);
PRINT_HELP_MESSAGE(14);
PRINT_HELP_MESSAGE(15);
PRINT_HELP_MESSAGE(16);
PRINT_HELP_MESSAGE(31);
PRINT_HELP_MESSAGE(18);
PRINT_HELP_MESSAGE(19);
PRINT_HELP_MESSAGE(32);
PRINT_HELP_MESSAGE(20);
PRINT_HELP_MESSAGE(21);
PRINT_HELP_MESSAGE(22);
PRINT_HELP_MESSAGE(23);
PRINT_HELP_MESSAGE(24);
PRINT_HELP_MESSAGE(25);
PRINT_HELP_MESSAGE(27);
PRINT_HELP_MESSAGE(28);
PRINT_HELP_MESSAGE(29);
}
VOID
NTAPI
DoGetNetInfo(IN BOOLEAN DoPrint)
{
}
VOID
DoGetNetInfo(
IN BOOLEAN DoPrint
)
NTAPI
DoSetIpAddressCommand(IN PCHAR IpString)
{
}
VOID
DoSetIpAddressCommand(
IN PCHAR IpString
)
NTAPI
DoTlistCommand(VOID)
{
}
VOID
DoTlistCommand(
VOID
)
{
}
}

View file

@ -27,77 +27,11 @@ PSAC_CHANNEL SacChannel;
ULONG ExecutePostConsumerCommand;
PSAC_CHANNEL ExecutePostConsumerCommandData;
BOOLEAN InputInEscape, InputInEscTab, ConMgrLastCharWasCR;
CHAR InputBuffer[80];
/* FUNCTIONS *****************************************************************/
VOID
NTAPI
ConMgrSerialPortConsumer(VOID)
{
NTSTATUS Status;
CHAR Char;
SAC_DBG(0x2000, "SAC TimerDpcRoutine: Entering.\n"); //bug
/* Acquire the manager lock and make sure a channel is selected */
SacAcquireMutexLock();
ASSERT(CurrentChannel);
/* Read whatever came off the serial port */
for (Status = SerialBufferGetChar(&Char);
NT_SUCCESS(Status);
Status = SerialBufferGetChar(&Char))
{
/* If nothing came through, bail out */
if (Status == STATUS_NO_DATA_DETECTED) break;
}
/* We're done, release the lock */
SacReleaseMutexLock();
SAC_DBG(0x2000, "SAC TimerDpcRoutine: Exiting.\n"); //bug
}
VOID
NTAPI
ConMgrWorkerProcessEvents(IN PSAC_DEVICE_EXTENSION DeviceExtension)
{
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC WorkerProcessEvents: Entering.\n");
/* Enter the main loop */
while (TRUE)
{
/* Wait for something to do */
KeWaitForSingleObject(&DeviceExtension->Event,
Executive,
KernelMode,
FALSE,
NULL);
/* Consume data off the serial port */
ConMgrSerialPortConsumer();
switch (ExecutePostConsumerCommand)
{
case 1:
/* A reboot was sent, do it */
DoRebootCommand(FALSE);
break;
case 2:
/* A close was sent, do it */
ChanMgrCloseChannel(ExecutePostConsumerCommandData);
ChanMgrReleaseChannel(ExecutePostConsumerCommandData);
break;
case 3:
/* A shutdown was sent, do it */
DoRebootCommand(TRUE);
break;
}
/* Clear the serial port consumer state */
ExecutePostConsumerCommand = 0;
ExecutePostConsumerCommandData = NULL;
}
}
VOID
NTAPI
SacPutString(IN PWCHAR String)
@ -235,7 +169,7 @@ ConMgrInitialize(VOID)
/* Setup the attributes for the raw SAC channel */
RtlZeroMemory(&SacChannelAttributes, sizeof(SacChannelAttributes));
SacChannelAttributes.ChannelType = Raw;
SacChannelAttributes.ChannelType = Raw; /* FIXME: Should be VtUtf8 */
/* Get the right name for it */
pcwch = GetMessage(SAC_CHANNEL_NAME);
@ -504,6 +438,7 @@ ConMgrChannelOWrite(IN PSAC_CHANNEL Channel,
/* Do the write with the lock held */
SacAcquireMutexLock();
ASSERT(FALSE);
Status = STATUS_NOT_IMPLEMENTED;// ChannelOWrite(Channel, WriteBuffer + 24, *(WriteBuffer + 20));
SacReleaseMutexLock();
@ -512,6 +447,433 @@ ConMgrChannelOWrite(IN PSAC_CHANNEL Channel,
return Status;
}
#define Shutdown 1
#define Restart 3
#define Nothing 0
BOOLEAN GlobalPagingNeeded;
VOID
NTAPI
ConMgrProcessInputLine(VOID)
{
BOOLEAN EnablePaging;
NTSTATUS Status;
SAC_DBG(4, "SAC Input Test: %s\n", InputBuffer);
if (!strncmp(InputBuffer, "t", 1))
{
DoTlistCommand();
}
else if (!strncmp(InputBuffer, "?", 1))
{
DoHelpCommand();
}
else if (!strncmp(InputBuffer, "help", 4))
{
DoHelpCommand();
}
else if (!strncmp(InputBuffer, "f", 1))
{
DoFullInfoCommand();
}
else if (!strncmp(InputBuffer, "p", 1))
{
DoPagingCommand();
}
else if (!strncmp(InputBuffer, "id", 2))
{
DoMachineInformationCommand();
}
else if (!strncmp(InputBuffer, "crashdump", 9))
{
DoCrashCommand();
}
else if (!strncmp(InputBuffer, "lock", 4))
{
DoLockCommand();
}
else if (!strncmp(InputBuffer, "shutdown", 8))
{
ExecutePostConsumerCommand = Shutdown;
}
else if (!strncmp(InputBuffer, "restart", 7))
{
ExecutePostConsumerCommand = Restart;
}
else if (!strncmp(InputBuffer, "d", 1))
{
EnablePaging = GlobalPagingNeeded;
Status = HeadlessDispatch(HeadlessCmdDisplayLog,
&EnablePaging,
sizeof(EnablePaging),
NULL,
0);
if (!NT_SUCCESS(Status)) SAC_DBG(4, "SAC Display Log failed.\n");
}
else if (!strncmp(InputBuffer, "cmd", 3))
{
if (CommandConsoleLaunchingEnabled)
{
DoCmdCommand(InputBuffer);
}
else
{
SacPutSimpleMessage(148);
}
}
else if (!(strncmp(InputBuffer, "ch", 2)) &&
(((strlen(InputBuffer) > 1) && (InputBuffer[2] == ' ')) ||
(strlen(InputBuffer) == 2)))
{
DoChannelCommand(InputBuffer);
}
else if (!(strncmp(InputBuffer, "k", 1)) &&
(((strlen(InputBuffer) > 1) && (InputBuffer[1] == ' ')) ||
(strlen(InputBuffer) == 1)))
{
DoKillCommand(InputBuffer);
}
else if (!(strncmp(InputBuffer, "l", 1)) &&
(((strlen(InputBuffer) > 1) && (InputBuffer[1] == ' ')) ||
(strlen(InputBuffer) == 1)))
{
DoLowerPriorityCommand(InputBuffer);
}
else if (!(strncmp(InputBuffer, "r", 1)) &&
(((strlen(InputBuffer) > 1) && (InputBuffer[1] == ' ')) ||
(strlen(InputBuffer) == 1)))
{
DoRaisePriorityCommand(InputBuffer);
}
else if (!(strncmp(InputBuffer, "m", 1)) &&
(((strlen(InputBuffer) > 1) && (InputBuffer[1] == ' ')) ||
(strlen(InputBuffer) == 1)))
{
DoLimitMemoryCommand(InputBuffer);
}
else if (!(strncmp(InputBuffer, "s", 1)) &&
(((strlen(InputBuffer) > 1) && (InputBuffer[1] == ' ')) ||
(strlen(InputBuffer) == 1)))
{
DoSetTimeCommand(InputBuffer);
}
else if (!(strncmp(InputBuffer, "i", 1)) &&
(((strlen(InputBuffer) > 1) && (InputBuffer[1] == ' ')) ||
(strlen(InputBuffer) == 1)))
{
DoSetIpAddressCommand(InputBuffer);
}
else if ((InputBuffer[0] != '\n') && (InputBuffer[0] != ANSI_NULL))
{
SacPutSimpleMessage(105);
}
}
VOID
NTAPI
ConMgrSerialPortConsumer(VOID)
{
NTSTATUS Status;
CHAR Char;
WCHAR LastChar;
CHAR ReadBuffer[2];
ULONG ReadBufferSize, i;
WCHAR StringBuffer[2];
SAC_DBG(SAC_DBG_MACHINE, "SAC TimerDpcRoutine: Entering.\n"); //bug
/* Acquire the manager lock and make sure a channel is selected */
SacAcquireMutexLock();
ASSERT(CurrentChannel);
/* Read whatever came off the serial port */
for (Status = SerialBufferGetChar(&Char);
NT_SUCCESS(Status);
Status = SerialBufferGetChar(&Char))
{
/* If nothing came through, bail out */
if (Status == STATUS_NO_DATA_DETECTED) break;
/* Check if ESC was pressed */
if (Char == '\x1B')
{
/* Was it already pressed? */
if (!InputInEscape)
{
/* First time ESC is pressed! Remember and reset TAB state */
InputInEscTab = FALSE;
InputInEscape = TRUE;
continue;
}
}
else if (Char == '\t')
{
/* TAB was pressed, is it following ESC (VT-100 sequence)? */
if (InputInEscape)
{
/* Yes! This must be the only ESC-TAB we see in once moment */
ASSERT(InputInEscTab == FALSE);
/* No longer treat us as being in ESC */
InputInEscape = FALSE;
/* ESC-TAB is the sequence for changing channels */
Status = ConMgrAdvanceCurrentChannel();
if (!NT_SUCCESS(Status)) break;
/* Remember ESC-TAB was pressed */
InputInEscTab = TRUE;
continue;
}
}
else if ((Char == '0') && (InputInEscTab))
{
/* It this ESC-TAB-0? */
ASSERT(InputInEscape == FALSE);
InputInEscTab = FALSE;
/* If writes are already enabled, don't do this */
if (!CurrentChannel->WriteEnabled)
{
/* Reset the channel, this is our special sequence */
Status = ConMgrResetCurrentChannel(FALSE);
if (!NT_SUCCESS(Status)) break;
}
continue;
}
else
{
/* This is ESC-TAB-something else */
InputInEscTab = FALSE;
/* If writes are already enabled, don't do this */
if (!CurrentChannel->WriteEnabled)
{
/* Display the current channel */
InputInEscape = FALSE;
Status = ConMgrDisplayCurrentChannel();
if (!NT_SUCCESS(Status)) break;
continue;
}
}
/* Check if an ESC-sequence was being typed into a command channel */
if ((InputInEscape) && (CurrentChannel != SacChannel))
{
/* Store the ESC in the current channel buffer */
ReadBuffer[0] = '\x1B';
ChannelIWrite(CurrentChannel, ReadBuffer, sizeof(CHAR));
}
/* Check if we are no longer pressing ESC and exit the mode if so */
if (Char != '\x1B') InputInEscape = FALSE;
/* Whatever was typed in, save it int eh current channel */
ChannelIWrite(CurrentChannel, &Char, sizeof(Char));
/* If this is a command channel, we're done, nothing to process */
if (CurrentChannel != SacChannel) continue;
/* Check for line feed right after a carriage return */
if ((ConMgrLastCharWasCR) && (Char == '\n'))
{
/* Ignore the line feed, but clear the carriage return */
ChannelIReadLast(CurrentChannel);
ConMgrLastCharWasCR = 0;
continue;
}
/* Check if the user did a carriage return */
ConMgrLastCharWasCR = (Char == '\n');
/* If the user did an "ENTER", we need to run the command */
if ((Char == '\n') || (Char == '\r'))
{
/* Echo back to the terminal */
SacPutString(L"\r\n");
DoLineParsing:
/* Inhibit the character (either CR or LF) */
ChannelIReadLast(CurrentChannel);
/* NULL-terminate the channel's input buffer */
ReadBuffer[0] = ANSI_NULL;
ChannelIWrite(CurrentChannel, ReadBuffer, sizeof(CHAR));
/* Loop over every last character */
do
{
/* Read every character in the channel, and strip whitespace */
LastChar = ChannelIReadLast(CurrentChannel);
ReadBuffer[0] = (CHAR) LastChar;
} while ((!(LastChar) ||
(LastChar == L' ') ||
(LastChar == L'\t')) &&
(ChannelIBufferLength(CurrentChannel)));
/* Write back into the channel the last character */
ChannelIWrite(CurrentChannel, ReadBuffer, sizeof(CHAR));
/* NULL-terminate the input buffer */
ReadBuffer[0] = ANSI_NULL;
ChannelIWrite(CurrentChannel, ReadBuffer, sizeof(CHAR));
/* Now loop over every first character */
do
{
/* Read every character in the channel, and strip whitespace */
ChannelIRead(CurrentChannel,
ReadBuffer,
sizeof(CHAR), /* FIXME: Should be sizeof(ReadBuffer) */
&ReadBufferSize);
} while ((ReadBufferSize) &&
((ReadBuffer[0] == ' ') || (ReadBuffer[0] == '\t')));
/* We read one more than we should, so treat that as our first one */
InputBuffer[0] = ReadBuffer[0];
i = 1;
/* And now loop reading all the others */
do
{
/* Read each character -- there should be max 80 */
ChannelIRead(CurrentChannel,
ReadBuffer,
sizeof(CHAR), /* FIXME: Should be sizeof(ReadBuffer) */
&ReadBufferSize);
ASSERT(i < SAC_VTUTF8_COL_WIDTH);
InputBuffer[i++] = ReadBuffer[0];
} while (ReadBufferSize);
/* Now go over the entire input stream */
for (i = 0; InputBuffer[i]; i++)
{
/* Again it should be less than 80 characters */
ASSERT(i < SAC_VTUTF8_COL_WIDTH);
/* And downbase each character */
Char = InputBuffer[i];
if ((Char >= 'A') && (Char <= 'Z')) InputBuffer[i] = Char + ' ';
}
/* Ok, at this point, no pending command should exist */
ASSERT(ExecutePostConsumerCommand == Nothing);
/* Go and process the input, then show the prompt again */
ConMgrProcessInputLine();
SacPutSimpleMessage(SAC_PROMPT);
/* If the user typed a valid command, get out of here */
if (ExecutePostConsumerCommand != Nothing) break;
/* Keep going */
continue;
}
/* Check if the user typed backspace or delete */
if ((Char == '\b') || (Char == '\x7F'))
{
/* Omit the last character, which should be the DEL/BS itself */
if (ChannelIBufferLength(CurrentChannel))
{
ChannelIReadLast(CurrentChannel);
}
/* Omit the before-last character, which is the one to delete */
if (ChannelIBufferLength(CurrentChannel))
{
/* Also send two backspaces back to the console */
SacPutString(L"\b \b");
ChannelIReadLast(CurrentChannel);
}
/* Keep going */
continue;
}
/* If the user pressed CTRL-C at this point, treat it like ENTER */
if (Char == '\x03') goto DoLineParsing;
/* Check if the user pressed TAB */
if (Char == '\t')
{
/* Omit it, send a BELL, and keep going. We ignore TABs */
ChannelIReadLast(CurrentChannel);
SacPutString(L"\a");
continue;
}
/* Check if the user is getting close to the end of the screen */
if (ChannelIBufferLength(CurrentChannel) == (SAC_VTUTF8_COL_WIDTH - 2))
{
/* Delete the last character, replacing it with this one instead */
swprintf(StringBuffer, L"\b%c", Char);
SacPutString(StringBuffer);
/* Omit the last two characters from the buffer */
ChannelIReadLast(CurrentChannel);
ChannelIReadLast(CurrentChannel);
/* Write the last character that was just typed in */
ReadBuffer[0] = Char;
ChannelIWrite(CurrentChannel, ReadBuffer, sizeof(CHAR));
continue;
}
/* Nothing of interest happened, just write the character back */
swprintf(StringBuffer, L"%c", Char);
SacPutString(StringBuffer);
}
/* We're done, release the lock */
SacReleaseMutexLock();
SAC_DBG(SAC_DBG_MACHINE, "SAC TimerDpcRoutine: Exiting.\n"); //bug
}
VOID
NTAPI
ConMgrWorkerProcessEvents(IN PSAC_DEVICE_EXTENSION DeviceExtension)
{
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC WorkerProcessEvents: Entering.\n");
/* Enter the main loop */
while (TRUE)
{
/* Wait for something to do */
KeWaitForSingleObject(&DeviceExtension->Event,
Executive,
KernelMode,
FALSE,
NULL);
/* Consume data off the serial port */
ConMgrSerialPortConsumer();
switch (ExecutePostConsumerCommand)
{
case 1:
/* A reboot was sent, do it */
DoRebootCommand(FALSE);
break;
case 2:
/* A close was sent, do it */
ChanMgrCloseChannel(ExecutePostConsumerCommandData);
ChanMgrReleaseChannel(ExecutePostConsumerCommandData);
break;
case 3:
/* A shutdown was sent, do it */
DoRebootCommand(TRUE);
break;
}
/* Clear the serial port consumer state */
ExecutePostConsumerCommand = 0;
ExecutePostConsumerCommandData = NULL;
}
}
NTSTATUS
NTAPI
ConMgrGetChannelCloseMessage(IN PSAC_CHANNEL Channel,
@ -522,13 +884,6 @@ ConMgrGetChannelCloseMessage(IN PSAC_CHANNEL Channel,
return STATUS_NOT_IMPLEMENTED;
}
VOID
NTAPI
ConMgrProcessInputLine(VOID)
{
ASSERT(FALSE);
}
NTSTATUS
NTAPI
ConMgrHandleEvent(IN ULONG EventCode,

View file

@ -77,6 +77,8 @@ CreateDeviceSecurityDescriptor(IN PDEVICE_OBJECT *DeviceObject)
else
{
SAC_DBG(SAC_DBG_INIT, "SAC CreateDeviceSecurityDescriptor : Unable to create Raw ACL, error : %x\n", Status);
/* FIXME: Temporary hack */
Status = STATUS_SUCCESS;
goto CleanupPath;
}
@ -236,7 +238,7 @@ InitializeDeviceData(IN PDEVICE_OBJECT DeviceObject)
KeInitializeTimer(&DeviceExtension->Timer);
KeInitializeDpc(&DeviceExtension->Dpc, TimerDpcRoutine, DeviceExtension);
KeInitializeSpinLock(&DeviceExtension->Lock);
KeInitializeEvent(&DeviceExtension->Event, SynchronizationEvent, 0);
KeInitializeEvent(&DeviceExtension->Event, SynchronizationEvent, FALSE);
InitializeListHead(&DeviceExtension->List);
/* Attempt to enable HDL support */
@ -315,8 +317,8 @@ InitializeDeviceData(IN PDEVICE_OBJECT DeviceObject)
DeviceExtension->PriorityFail = TRUE;
/* Initialize rundown and wait for the thread to do it */
KeInitializeEvent(&DeviceExtension->RundownEvent, SynchronizationEvent, 0);
KeSetEvent(&DeviceExtension->Event, DeviceExtension->PriorityBoost, 0);
KeInitializeEvent(&DeviceExtension->RundownEvent, SynchronizationEvent, FALSE);
KeSetEvent(&DeviceExtension->Event, DeviceExtension->PriorityBoost, FALSE);
Status = KeWaitForSingleObject(&DeviceExtension->RundownEvent,
Executive,
KernelMode,
@ -377,7 +379,7 @@ InitializeGlobalData(IN PUNICODE_STRING RegistryPath,
SAC_DBG(SAC_DBG_ENTRY_EXIT, "Entering.\n");
/* If we already did this, bail out */
if (!GlobalDataInitialized) goto SuccessExit;
if (GlobalDataInitialized) goto SuccessExit;
/* Setup the symbolic link for Win32 support */
RtlInitUnicodeString(&LinkName, L"\\DosDevices\\SAC");

View file

@ -12,6 +12,8 @@
/* GLOBALS *******************************************************************/
LONG TimerDpcCount;
/* FUNCTIONS *****************************************************************/
NTSTATUS
@ -61,7 +63,48 @@ TimerDpcRoutine(IN PKDPC Dpc,
IN PVOID SystemArgument1,
IN PVOID SystemArgument2)
{
HEADLESS_RSP_GET_BYTE ByteValue;
ULONG ValueSize;
BOOLEAN GotChar;
NTSTATUS Status;
PSAC_DEVICE_EXTENSION SacExtension;
/* Update our counter */
_InterlockedExchangeAdd(&TimerDpcCount, 1);
/* Set defaults and loop for new characters */
GotChar = FALSE;
ValueSize = sizeof(ByteValue);
do
{
/* Ask the kernel for a byte */
Status = HeadlessDispatch(HeadlessCmdGetByte,
NULL,
0,
&ByteValue,
&ValueSize);
/* Break out if there's nothing interesting */
if (!NT_SUCCESS(Status)) break;
if (!ByteValue.Value) break;
/* Update the serial port buffer */
SerialPortBuffer[SerialPortProducerIndex] = ByteValue.Value;
GotChar = TRUE;
/* Update the index, let it roll-over if needed */
_InterlockedExchange(&SerialPortProducerIndex,
(SerialPortProducerIndex + 1) &
(SAC_SERIAL_PORT_BUFFER_SIZE - 1));
} while (ByteValue.Value);
/* Did we get anything */
if (GotChar)
{
/* Signal the worker thread that there is work to do */
SacExtension = DeferredContext;
KeSetEvent(&SacExtension->Event, SacExtension->PriorityBoost, FALSE);
}
}
VOID

View file

@ -93,6 +93,11 @@ MyAllocatePool(IN SIZE_T PoolSize,
IN PCHAR File,
IN ULONG Line)
{
PVOID p;
p = ExAllocatePoolWithTag(NonPagedPool, PoolSize, Tag);
SAC_DBG(SAC_DBG_MM, "Returning block 0x%X.\n", p);
return p;
#if 0
KIRQL OldIrql;
PSAC_MEMORY_LIST GlobalDescriptor, NewDescriptor;
PSAC_MEMORY_ENTRY LocalDescriptor, NextDescriptor;
@ -102,7 +107,7 @@ MyAllocatePool(IN SIZE_T PoolSize,
SAC_DBG(SAC_DBG_MM, "Entering.\n");
/* Acquire the memory allocation lock and align the size request */
KeAcquireSpinLock(&MemoryLock, &OldIrql);;
KeAcquireSpinLock(&MemoryLock, &OldIrql);
PoolSize = ALIGN_UP(PoolSize, ULONGLONG);
#if _USE_SAC_HEAP_ALLOCATOR_
@ -220,12 +225,14 @@ MyAllocatePool(IN SIZE_T PoolSize,
Buffer = LocalDescriptor + 1;
RtlZeroMemory(Buffer, PoolSize);
return Buffer;
#endif
}
VOID
NTAPI
MyFreePool(IN PVOID *Block)
{
#if 0
PSAC_MEMORY_ENTRY NextDescriptor;
PSAC_MEMORY_ENTRY ThisDescriptor, FoundDescriptor;
PSAC_MEMORY_ENTRY LocalDescriptor = (PVOID)((ULONG_PTR)(*Block) - sizeof(SAC_MEMORY_ENTRY));
@ -323,10 +330,10 @@ MyFreePool(IN PVOID *Block)
LocalSize = GlobalSize = 0;
ThisDescriptor = (PVOID)LocalSize;
NextDescriptor = (PVOID)GlobalSize;
GlobalDescriptor = (PVOID) ThisDescriptor;
GlobalDescriptor = (PVOID)ThisDescriptor;
FoundDescriptor = (PVOID)GlobalDescriptor;
GlobalDescriptor = (PVOID) NextDescriptor;
NextDescriptor = (PVOID) FoundDescriptor;
GlobalDescriptor = (PVOID)NextDescriptor;
NextDescriptor = (PVOID)FoundDescriptor;
/* Use the NT pool allocator*/
ExFreePool(LocalDescriptor);
@ -334,6 +341,8 @@ MyFreePool(IN PVOID *Block)
/* Release the lock, delete the address, and return */
KeReleaseSpinLock(&MemoryLock, OldIrql);
#endif
ExFreePool(*Block);
*Block = NULL;
SAC_DBG(SAC_DBG_MM, "exiting.\n");
}

View file

@ -23,17 +23,19 @@ RawChannelCreate(IN PSAC_CHANNEL Channel)
{
CHECK_PARAMETER(Channel);
/* Allocate the output buffer */
Channel->OBuffer = SacAllocatePool(SAC_RAW_OBUFFER_SIZE, GLOBAL_BLOCK_TAG);
CHECK_ALLOCATION(Channel->OBuffer);
/* Allocate the input buffer */
Channel->IBuffer = SacAllocatePool(SAC_RAW_IBUFFER_SIZE, GLOBAL_BLOCK_TAG);
CHECK_ALLOCATION(Channel->IBuffer);
/* Reset all flags and return success */
Channel->OBufferIndex = 0;
Channel->OBufferFirstGoodIndex = 0;
Channel->ChannelHasNewIBufferData = FALSE;
Channel->ChannelHasNewOBufferData = FALSE;
return STATUS_SUCCESS;
}
@ -43,16 +45,9 @@ RawChannelDestroy(IN PSAC_CHANNEL Channel)
{
CHECK_PARAMETER(Channel);
if (Channel->OBuffer)
{
SacFreePool(Channel->OBuffer);
}
if (Channel->IBuffer)
{
SacFreePool(Channel->IBuffer);
}
/* Free the buffer and then destroy the channel */
if (Channel->OBuffer) SacFreePool(Channel->OBuffer);
if (Channel->IBuffer) SacFreePool(Channel->IBuffer);
return ChannelDestroy(Channel);
}
@ -63,13 +58,6 @@ ChannelHasNewOBufferData(IN PSAC_CHANNEL Channel)
return Channel->ChannelHasNewOBufferData;
}
FORCEINLINE
BOOLEAN
ChannelHasNewIBufferData(IN PSAC_CHANNEL Channel)
{
return Channel->ChannelHasNewIBufferData;
}
NTSTATUS
NTAPI
RawChannelORead(IN PSAC_CHANNEL Channel,
@ -207,38 +195,6 @@ RawChannelOFlush(IN PSAC_CHANNEL Channel)
return ConMgrFlushData(Channel);
}
ULONG
NTAPI
RawChannelGetIBufferIndex(IN PSAC_CHANNEL Channel)
{
ASSERT(Channel);
ASSERT(Channel->IBufferIndex < SAC_RAW_IBUFFER_SIZE);
return Channel->IBufferIndex;
}
VOID
NTAPI
RawChannelSetIBufferIndex(IN PSAC_CHANNEL Channel,
IN ULONG BufferIndex)
{
NTSTATUS Status;
ASSERT(Channel);
ASSERT(Channel->IBufferIndex < SAC_RAW_IBUFFER_SIZE);
Channel->IBufferIndex = BufferIndex;
Channel->ChannelHasNewIBufferData = BufferIndex != 0;
if (!Channel->IBufferIndex)
{
if (Channel->Flags & SAC_CHANNEL_FLAG_HAS_NEW_DATA_EVENT)
{
ChannelClearEvent(Channel, HasNewDataEvent);
UNREFERENCED_PARAMETER(Status);
}
}
}
NTSTATUS
NTAPI
RawChannelOWrite(IN PSAC_CHANNEL Channel,
@ -256,6 +212,40 @@ RawChannelOWrite(IN PSAC_CHANNEL Channel,
return RawChannelOWrite2(Channel, String, Length);
}
ULONG
NTAPI
RawChannelGetIBufferIndex(IN PSAC_CHANNEL Channel)
{
ASSERT(Channel);
ASSERT(Channel->IBufferIndex < SAC_RAW_IBUFFER_SIZE);
/* Return the current buffer index */
return Channel->IBufferIndex;
}
VOID
NTAPI
RawChannelSetIBufferIndex(IN PSAC_CHANNEL Channel,
IN ULONG BufferIndex)
{
NTSTATUS Status;
ASSERT(Channel);
ASSERT(Channel->IBufferIndex < SAC_RAW_IBUFFER_SIZE);
/* Set the new index, and if it's not zero, it means we have data */
Channel->IBufferIndex = BufferIndex;
_InterlockedExchange(&Channel->ChannelHasNewIBufferData, BufferIndex != 0);
/* If we have new data, and an event has been registered... */
if (!(Channel->IBufferIndex) &&
(Channel->Flags & SAC_CHANNEL_FLAG_HAS_NEW_DATA_EVENT))
{
/* Go ahead and signal it */
ChannelClearEvent(Channel, HasNewDataEvent);
UNREFERENCED_PARAMETER(Status);
}
}
NTSTATUS
NTAPI
RawChannelIRead(IN PSAC_CHANNEL Channel,
@ -264,38 +254,46 @@ RawChannelIRead(IN PSAC_CHANNEL Channel,
IN PULONG ReturnBufferSize)
{
ULONG CopyChars;
CHECK_PARAMETER1(Channel);
CHECK_PARAMETER2(Buffer);
CHECK_PARAMETER_WITH_STATUS(BufferSize > 0, STATUS_INVALID_BUFFER_SIZE);
/* Assume failure */
*ReturnBufferSize = 0;
/* Check how many bytes are in the buffer */
if (Channel->ChannelInputBufferLength(Channel) == 0)
{
/* Apparently nothing. Make sure the flag indicates so too */
ASSERT(ChannelHasNewIBufferData(Channel) == FALSE);
}
else
{
CopyChars = Channel->ChannelInputBufferLength(Channel);
if (CopyChars > BufferSize) CopyChars = BufferSize;
/* Use the smallest number of bytes either in the buffer or requested */
CopyChars = min(Channel->ChannelInputBufferLength(Channel), BufferSize);
ASSERT(CopyChars <= Channel->ChannelInputBufferLength(Channel));
/* Copy them into the caller's buffer */
RtlCopyMemory(Buffer, Channel->IBuffer, CopyChars);
/* Update the channel's index past the copied (read) bytes */
RawChannelSetIBufferIndex(Channel,
RawChannelGetIBufferIndex(Channel) - CopyChars);
/* Are there still bytes that haven't been read yet? */
if (Channel->ChannelInputBufferLength(Channel))
{
/* Shift them up in the buffer */
RtlMoveMemory(Channel->IBuffer,
&Channel->IBuffer[CopyChars],
Channel->ChannelInputBufferLength(Channel));
}
/* Return the number of bytes we actually copied */
*ReturnBufferSize = CopyChars;
}
/* Return success */
return STATUS_SUCCESS;
}
@ -307,6 +305,7 @@ RawChannelIBufferIsFull(IN PSAC_CHANNEL Channel,
CHECK_PARAMETER1(Channel);
CHECK_PARAMETER2(BufferStatus);
/* If the index is beyond the length, the buffer must be full */
*BufferStatus = RawChannelGetIBufferIndex(Channel) > SAC_RAW_IBUFFER_SIZE;
return STATUS_SUCCESS;
}
@ -316,25 +315,31 @@ NTAPI
RawChannelIBufferLength(IN PSAC_CHANNEL Channel)
{
ASSERT(Channel);
/* The index is the current length (since we're 0-based) */
return RawChannelGetIBufferIndex(Channel);
}
CHAR
WCHAR
NTAPI
RawChannelIReadLast(IN PSAC_CHANNEL Channel)
{
UCHAR LastChar = 0;
ASSERT(Channel);
/* Check if there's anything to read in the buffer */
if (Channel->ChannelInputBufferLength(Channel))
{
RawChannelSetIBufferIndex(Channel, RawChannelGetIBufferIndex(Channel) - 1);
/* Go back one character */
RawChannelSetIBufferIndex(Channel,
RawChannelGetIBufferIndex(Channel) - 1);
/* Read it, and clear its current value */
LastChar = Channel->IBuffer[RawChannelGetIBufferIndex(Channel)];
Channel->IBuffer[RawChannelGetIBufferIndex(Channel)] = 0;
Channel->IBuffer[RawChannelGetIBufferIndex(Channel)] = ANSI_NULL;
}
/* Return the last character */
return LastChar;
}
@ -347,27 +352,34 @@ RawChannelIWrite(IN PSAC_CHANNEL Channel,
NTSTATUS Status;
BOOLEAN IsFull;
ULONG Index;
CHECK_PARAMETER1(Channel);
CHECK_PARAMETER2(Buffer);
CHECK_PARAMETER_WITH_STATUS(BufferSize > 0, STATUS_INVALID_BUFFER_SIZE);
/* First, check if the input buffer still has space */
Status = RawChannelIBufferIsFull(Channel, &IsFull);
if (!NT_SUCCESS(Status)) return Status;
if (IsFull) return STATUS_UNSUCCESSFUL;
/* Get the current buffer index */
Index = RawChannelGetIBufferIndex(Channel);
if ((SAC_RAW_IBUFFER_SIZE - Index) >= BufferSize) return STATUS_INSUFFICIENT_RESOURCES;
if ((SAC_RAW_IBUFFER_SIZE - Index) < BufferSize)
{
return STATUS_INSUFFICIENT_RESOURCES;
}
/* Copy the new data */
RtlCopyMemory(&Channel->IBuffer[Index], Buffer, BufferSize);
/* Update the index */
RawChannelSetIBufferIndex(Channel, BufferSize + Index);
/* Signal the event, if one was set */
if (Channel->Flags & SAC_CHANNEL_FLAG_HAS_NEW_DATA_EVENT)
{
ChannelSetEvent(Channel, HasNewDataEvent);
}
/* All done */
return STATUS_SUCCESS;
}

View file

@ -35,6 +35,7 @@
#define SAC_DBG_UTIL 0x02
#define SAC_DBG_INIT 0x04
#define SAC_DBG_MM 0x1000
#define SAC_DBG_MACHINE 0x2000
#define SAC_DBG(x, ...) \
if (SACDebug & x) \
{ \
@ -155,6 +156,8 @@
#define SAC_MAX_CHANNELS 10
#define SAC_SERIAL_PORT_BUFFER_SIZE 1024 // 1KB
#define SAC_MAX_MESSAGES 200
#define SAC_VTUTF8_COL_WIDTH 80
#define SAC_VTUTF8_COL_HEIGHT 25
//
// Channel flags
@ -300,7 +303,7 @@ ULONG
);
typedef
CHAR
WCHAR
(NTAPI *PSAC_CHANNEL_IREAD_LAST)(
IN struct _SAC_CHANNEL* Channel
);
@ -765,6 +768,35 @@ ChannelDestroy(
IN PSAC_CHANNEL Channel
);
NTSTATUS
NTAPI
ChannelIWrite(
IN PSAC_CHANNEL Channel,
IN PCHAR Buffer,
IN ULONG BufferSize
);
WCHAR
NTAPI
ChannelIReadLast(
IN PSAC_CHANNEL Channel
);
ULONG
NTAPI
ChannelIBufferLength(
IN PSAC_CHANNEL Channel
);
NTSTATUS
NTAPI
ChannelIRead(
IN PSAC_CHANNEL Channel,
IN PCHAR Buffer,
IN ULONG BufferSize,
IN OUT PULONG ResultBufferSize
);
//
// RAW Channel Table
//
@ -833,7 +865,7 @@ RawChannelIBufferLength(
IN PSAC_CHANNEL Channel
);
CHAR
WCHAR
NTAPI
RawChannelIReadLast(
IN PSAC_CHANNEL Channel
@ -847,9 +879,106 @@ RawChannelIWrite(
IN ULONG BufferSize
);
//
// VT-UTF8 Channel Table
//
NTSTATUS
NTAPI
VTUTF8ChannelCreate(
IN PSAC_CHANNEL Channel
);
NTSTATUS
NTAPI
VTUTF8ChannelDestroy(
IN PSAC_CHANNEL Channel
);
NTSTATUS
NTAPI
VTUTF8ChannelORead(
IN PSAC_CHANNEL Channel,
IN PCHAR Buffer,
IN ULONG BufferSize,
OUT PULONG ByteCount
);
NTSTATUS
NTAPI
VTUTF8ChannelOEcho(
IN PSAC_CHANNEL Channel,
IN PCHAR String,
IN ULONG Length
);
NTSTATUS
NTAPI
VTUTF8ChannelOFlush(
IN PSAC_CHANNEL Channel
);
NTSTATUS
NTAPI
VTUTF8ChannelOWrite(
IN PSAC_CHANNEL Channel,
IN PCHAR String,
IN ULONG Length
);
NTSTATUS
NTAPI
VTUTF8ChannelIRead(
IN PSAC_CHANNEL Channel,
IN PCHAR Buffer,
IN ULONG BufferSize,
IN PULONG ReturnBufferSize
);
NTSTATUS
NTAPI
VTUTF8ChannelIBufferIsFull(
IN PSAC_CHANNEL Channel,
OUT PBOOLEAN BufferStatus
);
ULONG
NTAPI
VTUTF8ChannelIBufferLength(
IN PSAC_CHANNEL Channel
);
WCHAR
NTAPI
VTUTF8ChannelIReadLast(
IN PSAC_CHANNEL Channel
);
NTSTATUS
NTAPI
VTUTF8ChannelIWrite(
IN PSAC_CHANNEL Channel,
IN PCHAR Buffer,
IN ULONG BufferSize
);
//
// Helper Routines
//
BOOLEAN
NTAPI
SacTranslateUtf8ToUnicode(
IN CHAR Utf8Char,
IN PCHAR Utf8Buffer,
OUT PWCHAR Utf8Value
);
ULONG
NTAPI
GetMessageLineCount(
IN ULONG MessageIndex
);
NTSTATUS
NTAPI
SerialBufferGetChar(
@ -892,6 +1021,102 @@ DoRebootCommand(
IN BOOLEAN Reboot
);
VOID
NTAPI
DoFullInfoCommand(
VOID
);
VOID
NTAPI
DoPagingCommand(
VOID
);
VOID
NTAPI
DoSetTimeCommand(
IN PCHAR InputTime
);
VOID
NTAPI
DoKillCommand(
IN PCHAR KillString
);
VOID
NTAPI
DoLowerPriorityCommand(
IN PCHAR PrioString
);
VOID
NTAPI
DoRaisePriorityCommand(
IN PCHAR PrioString
);
VOID
NTAPI
DoLimitMemoryCommand(
IN PCHAR LimitString
);
VOID
NTAPI
DoCrashCommand(
VOID
);
VOID
NTAPI
DoMachineInformationCommand(
VOID
);
VOID
NTAPI
DoChannelCommand(
IN PCHAR ChannelString
);
VOID
NTAPI
DoCmdCommand(
IN PCHAR InputString
);
VOID
NTAPI
DoLockCommand(
VOID
);
VOID
NTAPI
DoHelpCommand(
VOID
);
VOID
NTAPI
DoGetNetInfo(
IN BOOLEAN DoPrint
);
VOID
NTAPI
DoSetIpAddressCommand(
IN PCHAR IpString
);
VOID
NTAPI
DoTlistCommand(
VOID
);
//
// External data
//
@ -900,8 +1125,11 @@ extern PSAC_MESSAGE_ENTRY GlobalMessageTable;
extern KMUTEX CurrentChannelLock;
extern LONG CurrentChannelRefCount;
extern PCHAR SerialPortBuffer;
extern LONG SerialPortConsumerIndex, SerialPortProducerIndex;
extern PCHAR Utf8ConversionBuffer;
extern BOOLEAN GlobalPagingNeeded;
extern ULONG Utf8ConversionBufferSize;
extern BOOLEAN CommandConsoleLaunchingEnabled;
//
// Function to initailize a SAC Semaphore Lock
@ -1014,3 +1242,11 @@ ChannelGetIndex(IN PSAC_CHANNEL Channel)
/* Return the index of the channel */
return Channel->Index;
}
FORCEINLINE
BOOLEAN
ChannelHasNewIBufferData(IN PSAC_CHANNEL Channel)
{
/* Return if there's any new data in the input buffer */
return Channel->ChannelHasNewIBufferData;
}

View file

@ -13,8 +13,10 @@
/* GLOBALS *******************************************************************/
PCHAR Utf8ConversionBuffer;
ULONG Utf8ConversionBufferSize;
ULONG Utf8ConversionBufferSize = PAGE_SIZE;
PSAC_MACHINE_INFO MachineInformation;
PVOID RequestSacCmdEventObjectBody;
PKEVENT RequestSacCmdEventWaitObjectBody;
PVOID RequestSacCmdSuccessEventObjectBody;
@ -32,6 +34,56 @@ PCHAR SerialPortBuffer;
/* FUNCTIONS *****************************************************************/
BOOLEAN
NTAPI
SacTranslateUtf8ToUnicode(IN CHAR Utf8Char,
IN PCHAR Utf8Buffer,
OUT PWCHAR Utf8Value)
{
ULONG i;
/* Find out how many valid characters we have in the buffer */
i = 0;
while (Utf8Buffer[i++] && (i < 3));
/* If we have at least 3, shift everything by a byte */
if (i >= 3)
{
/* The last input character goes at the end */
Utf8Buffer[0] = Utf8Buffer[1];
Utf8Buffer[1] = Utf8Buffer[2];
Utf8Buffer[2] = Utf8Char;
}
else
{
/* We don't have more than 3 characters, place the input at the index */
Utf8Buffer[i] = Utf8Char;
}
/* Print to debugger */
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SacTranslateUtf8ToUnicode - About to decode the UTF8 buffer.\n");
SAC_DBG(SAC_DBG_ENTRY_EXIT, " UTF8[0]: 0x%02lx UTF8[1]: 0x%02lx UTF8[2]: 0x%02lx\n",
Utf8Buffer[0],
Utf8Buffer[1],
Utf8Buffer[2]);
/* Is this a simple ANSI character? */
if (!(Utf8Char & 0x80))
{
/* Return it as Unicode, nothing left to do */
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SACDRV: SacTranslateUTf8ToUnicode - Case1\n");
*Utf8Value = (WCHAR)Utf8Char;
Utf8Buffer[0] = Utf8Buffer[1];
Utf8Buffer[1] = Utf8Buffer[2];
Utf8Buffer[2] = UNICODE_NULL;
return TRUE;
}
/* Anything else is not yet supported */
ASSERT(FALSE);
return FALSE;
}
BOOLEAN
NTAPI
SacTranslateUnicodeToUtf8(IN PWCHAR SourceBuffer,
@ -41,8 +93,43 @@ SacTranslateUnicodeToUtf8(IN PWCHAR SourceBuffer,
OUT PULONG UTF8Count,
OUT PULONG ProcessedCount)
{
ASSERT(FALSE);
return FALSE;
*UTF8Count = 0;
*ProcessedCount = 0;
while ((*SourceBuffer) &&
(*UTF8Count < DestinationBufferSize) &&
(*ProcessedCount < SourceBufferLength))
{
if (*SourceBuffer & 0xFF80)
{
if (*SourceBuffer & 0xF800)
{
if ((*UTF8Count + 3) >= DestinationBufferSize) break;
DestinationBuffer[*UTF8Count] = ((*SourceBuffer >> 12) & 0xF) | 0xE0;
++*UTF8Count;
DestinationBuffer[*UTF8Count] = ((*SourceBuffer >> 6) & 0x3F) | 0x80;
}
else
{
if ((*UTF8Count + 2) >= DestinationBufferSize) break;
DestinationBuffer[*UTF8Count] = ((*SourceBuffer >> 6) & 31) | 0xC0;
}
++*UTF8Count;
DestinationBuffer[*UTF8Count] = (*SourceBuffer & 0x3F) | 0x80;
}
else
{
DestinationBuffer[*UTF8Count] = (*SourceBuffer & 0x7F);
}
++*UTF8Count;
++*ProcessedCount;
++SourceBuffer;
}
ASSERT(*ProcessedCount <= SourceBufferLength);
ASSERT(*UTF8Count <= DestinationBufferSize);
return TRUE;
}
PWCHAR
@ -114,15 +201,83 @@ SacFormatMessage(IN PWCHAR FormattedString,
IN PWCHAR MessageString,
IN ULONG MessageSize)
{
/* FIXME: For now don't format anything */
wcsncpy(FormattedString, MessageString, MessageSize / sizeof(WCHAR));
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC SacFormatMessage: Entering.\n");
/* Check if any of the parameters are NULL or zero */
if (!(MessageString) || !(FormattedString) || !(MessageSize))
{
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC SacFormatMessage: Exiting with invalid parameters.\n");
return;
}
/* Keep going as long as there's still characters */
while ((MessageString[0]) && (MessageSize))
{
/* Is it a non-formatting character? */
if (MessageString[0] != L'%')
{
/* Just write it back into the buffer and keep going */
*FormattedString++ = MessageString[0];
MessageString++;
}
else
{
/* Go over the format characters we recognize */
switch (MessageString[1])
{
case L'0':
*FormattedString = UNICODE_NULL;
return;
case L'%':
*FormattedString++ = L'%';
break;
case L'\\':
*FormattedString++ = L'\r';
*FormattedString++ = L'\n';
break;
case L'r':
*FormattedString++ = L'\r';
break;
case L'b':
*FormattedString++ = L' ';
break;
case L'.':
*FormattedString++ = L'.';
break;
case L'!':
*FormattedString++ = L'!';
break;
default:
/* Only move forward one character */
MessageString--;
break;
}
/* Move forward two characters */
MessageString += 2;
}
/* Move to the next character*/
MessageSize--;
}
/* All done */
*FormattedString = UNICODE_NULL;
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC SacFormatMessage: Exiting.\n");
}
NTSTATUS
NTAPI
PreloadGlobalMessageTable(IN PVOID ImageBase)
{
NTSTATUS Status;
NTSTATUS Status, Status2;
ULONG MessageId, TotalLength, TextSize, i;
PWCHAR StringBuffer;
PMESSAGE_RESOURCE_ENTRY MessageEntry;
@ -130,6 +285,7 @@ PreloadGlobalMessageTable(IN PVOID ImageBase)
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC PreloadGlobalMessageTable: Entering.\n");
/* Nothing to do if we already have a table */
Status = STATUS_SUCCESS;
if (GlobalMessageTable) goto Exit;
/* Loop through up to 200 messages */
@ -137,12 +293,12 @@ PreloadGlobalMessageTable(IN PVOID ImageBase)
for (MessageId = 1; MessageId != SAC_MAX_MESSAGES; MessageId++)
{
/* Find this message ID in the string table*/
Status = RtlFindMessage(ImageBase,
11,
LANG_NEUTRAL,
MessageId,
&MessageEntry);
if (NT_SUCCESS(Status))
Status2 = RtlFindMessage(ImageBase,
11,
LANG_NEUTRAL,
MessageId,
&MessageEntry);
if (NT_SUCCESS(Status2))
{
/* Make sure it's Unicode */
ASSERT(MessageEntry->Flags & MESSAGE_RESOURCE_UNICODE);
@ -182,12 +338,12 @@ PreloadGlobalMessageTable(IN PVOID ImageBase)
for (i = 0, MessageId = 1; MessageId != SAC_MAX_MESSAGES; MessageId++)
{
/* Make sure the message is still there...! */
Status = RtlFindMessage(ImageBase,
11,
LANG_NEUTRAL,
MessageId,
&MessageEntry);
if (NT_SUCCESS(Status))
Status2 = RtlFindMessage(ImageBase,
11,
LANG_NEUTRAL,
MessageId,
&MessageEntry);
if (NT_SUCCESS(Status2))
{
/* Write the entry in the message table*/
GlobalMessageTable[i].Index = MessageId;
@ -202,7 +358,7 @@ PreloadGlobalMessageTable(IN PVOID ImageBase)
ASSERT((ULONG)(wcslen(StringBuffer)*sizeof(WCHAR)) <= TextSize);
/* Move to the next buffer space */
StringBuffer += TextSize;
StringBuffer += (TextSize / sizeof(WCHAR));
/* Move to the next entry, make sure the status is full success */
i++;
@ -229,135 +385,6 @@ TearDownGlobalMessageTable(VOID)
return STATUS_SUCCESS;
}
NTSTATUS
NTAPI
TranslateMachineInformationXML(IN PWCHAR *Buffer,
IN PWCHAR ExtraData)
{
NTSTATUS Status;
ULONG Size;
PWCHAR p;
CHECK_PARAMETER1(Buffer);
Status = STATUS_SUCCESS;
Size = wcslen(L"<machine-info>\r\n");
if (MachineInformation->MachineName)
{
Size += wcslen(MachineInformation->MachineName);
Size += wcslen(L"<name>%s</name>\r\n");
}
if (MachineInformation->MachineGuid)
{
Size += wcslen(MachineInformation->MachineGuid);
Size += wcslen(L"<guid>%s</guid>\r\n");
}
if (MachineInformation->ProcessorArchitecture)
{
Size += wcslen(MachineInformation->ProcessorArchitecture);
Size += wcslen(L"<processor-architecture>%s</processor-architecture>\r\n");
}
if (MachineInformation->MajorVersion)
{
Size += wcslen(MachineInformation->MajorVersion);
Size += wcslen(L"<os-version>%s</os-version>\r\n");
}
if (MachineInformation->BuildNumber)
{
Size += wcslen(MachineInformation->BuildNumber);
Size += wcslen(L"<os-build-number>%s</os-build-number>\r\n");
}
if (MachineInformation->ProductType)
{
Size += wcslen(MachineInformation->ProductType);
Size += wcslen(L"<os-product>%s</os-product>\r\n");
}
if (MachineInformation->ServicePack)
{
Size += wcslen(MachineInformation->ServicePack);
Size += wcslen(L"<os-service-pack>%s</os-service-pack>\r\n");
}
if (ExtraData) Size += wcslen(ExtraData);
Size += wcslen(L"</machine-info>\r\n");
p = (PWCHAR)SacAllocatePool((Size + sizeof(ANSI_NULL)) * sizeof(WCHAR), GLOBAL_BLOCK_TAG);
*Buffer = p;
if (!p) return STATUS_NO_MEMORY;
Size = wcslen(L"<machine-info>\r\n");
wcscpy(p, L"<machine-info>\r\n");
p += Size;
if (MachineInformation->MachineName)
{
p += swprintf(p, L"<name>%s</name>\r\n", MachineInformation->MachineName);
}
if (MachineInformation->MachineGuid)
{
p += swprintf(p, L"<guid>%s</guid>\r\n", MachineInformation->MachineGuid);
}
if (MachineInformation->ProcessorArchitecture)
{
p += swprintf(p, L"<processor-architecture>%s</processor-architecture>\r\n", MachineInformation->ProcessorArchitecture);
}
if (MachineInformation->MajorVersion)
{
p += swprintf(p, L"<os-version>%s</os-version>\r\n", MachineInformation->MajorVersion);
}
if (MachineInformation->BuildNumber)
{
p += swprintf(p, L"<os-build-number>%s</os-build-number>\r\n", MachineInformation->BuildNumber);
}
if (MachineInformation->ProductType)
{
p += swprintf(p, L"<os-product>%s</os-product>\r\n", MachineInformation->ProductType);
}
if (MachineInformation->ServicePack)
{
p += swprintf(p, L"<os-service-pack>%s</os-service-pack>\r\n", MachineInformation->ServicePack);
}
if (ExtraData)
{
Size = wcslen(ExtraData);
wcscpy(p, ExtraData);
p += Size;
}
wcscpy(p, L"</machine-info>\r\n");
ASSERT((((ULONG) wcslen(*Buffer) + 1) * sizeof(WCHAR)) <= Size);
return Status;
}
VOID
NTAPI
InitializeMachineInformation(VOID)
{
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC Initialize Machine Information : Entering.\n");
/* FIXME: TODO */
MachineInformation = NULL;
ASSERT(FALSE);
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC Initialize Machine Information : Exiting with error.\n");
}
NTSTATUS
NTAPI
GetRegistryValueBuffer(IN PCWSTR KeyName,
@ -479,7 +506,7 @@ SetRegistryValue(IN PCWSTR KeyName,
NTSTATUS
NTAPI
CopyRegistryValueData(IN PULONG* Buffer,
CopyRegistryValueData(IN PVOID* Buffer,
IN PKEY_VALUE_PARTIAL_INFORMATION PartialInfo)
{
NTSTATUS Status = STATUS_SUCCESS;
@ -504,6 +531,446 @@ CopyRegistryValueData(IN PULONG* Buffer,
return Status;
}
NTSTATUS
NTAPI
TranslateMachineInformationXML(IN PWCHAR *Buffer,
IN PWCHAR ExtraData)
{
NTSTATUS Status;
ULONG Size;
PWCHAR p;
CHECK_PARAMETER1(Buffer);
/* Start by believing the world is beautiful */
Status = STATUS_SUCCESS;
/* First, the header */
Size = wcslen(L"<machine-info>\r\n");
/* Do we have a machine name? */
if (MachineInformation->MachineName)
{
/* Go and add it in */
Size += wcslen(MachineInformation->MachineName);
Size += wcslen(L"<name>%s</name>\r\n");
}
/* Do we have a GUID? */
if (MachineInformation->MachineGuid)
{
/* Go and add it in */
Size += wcslen(MachineInformation->MachineGuid);
Size += wcslen(L"<guid>%s</guid>\r\n");
}
/* Do we know the processor? */
if (MachineInformation->ProcessorArchitecture)
{
/* Go and add it in */
Size += wcslen(MachineInformation->ProcessorArchitecture);
Size += wcslen(L"<processor-architecture>%s</processor-architecture>\r\n");
}
/* Do we have the version? */
if (MachineInformation->MajorVersion)
{
/* Go and add it in */
Size += wcslen(MachineInformation->MajorVersion);
Size += wcslen(L"<os-version>%s</os-version>\r\n");
}
/* Do we have the build? */
if (MachineInformation->BuildNumber)
{
/* Go and add it in */
Size += wcslen(MachineInformation->BuildNumber);
Size += wcslen(L"<os-build-number>%s</os-build-number>\r\n");
}
/* Do we have the product type? */
if (MachineInformation->ProductType)
{
/* Go and add it in */
Size += wcslen(MachineInformation->ProductType);
Size += wcslen(L"<os-product>%s</os-product>\r\n");
}
/* Do we have a service pack? */
if (MachineInformation->ServicePack)
{
/* Go and add it in */
Size += wcslen(MachineInformation->ServicePack);
Size += wcslen(L"<os-service-pack>%s</os-service-pack>\r\n");
}
/* Anything else we need to know? Add it in too */
if (ExtraData) Size += wcslen(ExtraData);
/* Finally, add the footer */
Size += wcslen(L"</machine-info>\r\n");
/* Convert to bytes and add a NULL */
Size += sizeof(ANSI_NULL);
Size *= sizeof(WCHAR);
/* Allocate space for the buffer */
p = SacAllocatePool(Size, GLOBAL_BLOCK_TAG);
*Buffer = p;
if (!p) return STATUS_NO_MEMORY;
wcscpy(p, L"<machine-info>\r\n");
p += wcslen(L"<machine-info>\r\n");;
if (MachineInformation->MachineName)
{
p += swprintf(p,
L"<name>%s</name>\r\n",
MachineInformation->MachineName);
}
if (MachineInformation->MachineGuid)
{
p += swprintf(p,
L"<guid>%s</guid>\r\n",
MachineInformation->MachineGuid);
}
if (MachineInformation->ProcessorArchitecture)
{
p += swprintf(p,
L"<processor-architecture>%s</processor-architecture>\r\n",
MachineInformation->ProcessorArchitecture);
}
if (MachineInformation->MajorVersion)
{
p += swprintf(p,
L"<os-version>%s</os-version>\r\n",
MachineInformation->MajorVersion);
}
if (MachineInformation->BuildNumber)
{
p += swprintf(p,
L"<os-build-number>%s</os-build-number>\r\n",
MachineInformation->BuildNumber);
}
if (MachineInformation->ProductType)
{
p += swprintf(p,
L"<os-product>%s</os-product>\r\n",
MachineInformation->ProductType);
}
if (MachineInformation->ServicePack)
{
p += swprintf(p,
L"<os-service-pack>%s</os-service-pack>\r\n",
MachineInformation->ServicePack);
}
if (ExtraData)
{
wcscpy(p, ExtraData);
p += wcslen(ExtraData);
}
wcscpy(p, L"</machine-info>\r\n");
SAC_DBG(SAC_DBG_ENTRY_EXIT, "MachineInformation: %S\n", *Buffer);
ASSERT((((ULONG)wcslen(*Buffer) + 1) * sizeof(WCHAR)) <= Size);
return Status;
}
VOID
NTAPI
InitializeMachineInformation(VOID)
{
NTSTATUS Status;
PWCHAR GuidString, MajorVersion, ServicePack, BuildNumber, MessageBuffer;
PWCHAR ProductType;
ULONG SuiteTypeMessage;
BOOLEAN SetupInProgress = FALSE;
GUID SystemGuid;
ULONG RealSize, Size, OutputSize;
PKEY_VALUE_PARTIAL_INFORMATION PartialInfo;
RTL_OSVERSIONINFOEXW VersionInformation;
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC Initialize Machine Information : Entering.\n");
/* Don't do anything if we already quried this */
if (MachineInformation)
{
SAC_DBG(SAC_DBG_MACHINE, "SAC Initialize Machine Information:: MachineInformationBuffer already initialzied.\n");
return;
}
/* Allocate the machine information */
MachineInformation = SacAllocatePool(sizeof(*MachineInformation),
GLOBAL_BLOCK_TAG);
if (!MachineInformation)
{
goto Fail;
}
/* Zero it out for now */
RtlZeroMemory(MachineInformation, sizeof(*MachineInformation));
/* Query OS version */
RtlZeroMemory(&VersionInformation, sizeof(VersionInformation));
VersionInformation.dwOSVersionInfoSize = sizeof(VersionInformation);
Status = RtlGetVersion((PRTL_OSVERSIONINFOW)&VersionInformation);
if (!NT_SUCCESS(Status))
{
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC InitializeMachineInformation: Exiting (2).\n");
goto Fail;
}
/* Check if setup is in progress */
Status = GetRegistryValueBuffer(L"\\Registry\\Machine\\System\\Setup",
L"SystemSetupInProgress",
&PartialInfo);
if (NT_SUCCESS(Status))
{
/* The key is there, is the value set? */
if (*(PULONG)PartialInfo->Data) SetupInProgress = TRUE;
SacFreePool(PartialInfo);
if (SetupInProgress)
{
/* Yes, so we'll use a special hostname to identify this */
MessageBuffer = GetMessage(SAC_UNINITIALIZED_MSG);
Size = wcslen(MessageBuffer);
ASSERT(Size > 0);
RealSize = Size * sizeof(WCHAR) + sizeof(UNICODE_NULL);
/* Make room for it and copy it in there */
MachineInformation->MachineName = SacAllocatePool(RealSize,
GLOBAL_BLOCK_TAG);
if (MachineInformation->MachineName)
{
wcscpy(MachineInformation->MachineName, MessageBuffer);
}
}
}
/* If we are not in setup mode, or if we failed to check... */
if (!SetupInProgress)
{
/* Query the computer name */
Status = GetRegistryValueBuffer(L"\\Registry\\Machine\\System\\"
L"CurrentControlSet\\Control\\"
L"ComputerName\\ComputerName",
L"ComputerName",
&PartialInfo);
if (!NT_SUCCESS(Status))
{
/* It's not critical, but we won't have it */
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC InitializeMachineInformation: Failed to get machine name.\n");
}
else
{
/* We have the name, copy it from the registry */
Status = CopyRegistryValueData((PVOID*)&MachineInformation->
MachineName,
PartialInfo);
SacFreePool(PartialInfo);
if (!NT_SUCCESS(Status))
{
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC InitializeMachineInformation: Exiting (20).\n");
goto Fail;
}
}
}
/* Next step, try to get the machine GUID */
RtlZeroMemory(&SystemGuid, sizeof(SystemGuid));
OutputSize = sizeof(SystemGuid);
Status = HeadlessDispatch(HeadlessCmdQueryGUID,
NULL,
0,
&SystemGuid,
&OutputSize);
if (!NT_SUCCESS(Status))
{
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC InitializeMachineInformation: Failed to get Machine GUID.\n");
}
else
{
/* We have it -- make room for it */
GuidString = SacAllocatePool(0x50, GLOBAL_BLOCK_TAG);
if (!GuidString)
{
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC InitializeMachineInformation: Exiting (31).\n");
goto Fail;
}
/* Build the string with the GUID in it, and save the ppointer to it */
swprintf(GuidString,
L"%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
SystemGuid.Data1,
SystemGuid.Data2,
SystemGuid.Data3,
SystemGuid.Data4[0],
SystemGuid.Data4[1],
SystemGuid.Data4[2],
SystemGuid.Data4[3],
SystemGuid.Data4[4],
SystemGuid.Data4[5],
SystemGuid.Data4[6],
SystemGuid.Data4[7]);
MachineInformation->MachineGuid = GuidString;
}
/* Next, query the processor architecture */
Status = GetRegistryValueBuffer(L"\\Registry\\Machine\\System\\"
L"CurrentControlSet\\Control\\"
L"Session Manager\\Environment",
L"PROCESSOR_ARCHITECTURE",
&PartialInfo);
if (!NT_SUCCESS(Status))
{
/* It's not critical, but we won't have it */
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC InitializeMachineInformation: Exiting (30).\n");
}
else
{
/* We have it! Copy the value from the registry */
Status = CopyRegistryValueData((PVOID*)&MachineInformation->
ProcessorArchitecture,
PartialInfo);
SacFreePool(PartialInfo);
if (!NT_SUCCESS(Status))
{
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC InitializeMachineInformation: Exiting (30).\n");
goto Fail;
}
}
/* Now allocate a buffer for the OS version number */
MajorVersion = SacAllocatePool(0x18, GLOBAL_BLOCK_TAG);
if (!MajorVersion)
{
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC InitializeMachineInformation: Exiting (50).\n");
goto Fail;
}
/* Build the buffer and set a pointer to it */
swprintf(MajorVersion,
L"%d.%d",
VersionInformation.dwMajorVersion,
VersionInformation.dwMinorVersion);
MachineInformation->MajorVersion = MajorVersion;
/* Now allocate a buffer for the OS build number */
BuildNumber = SacAllocatePool(0xC, GLOBAL_BLOCK_TAG);
if (!BuildNumber)
{
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC InitializeMachineInformation: Exiting (60).\n");
goto Fail;
}
/* Build the buffer and set a pointer to it */
swprintf(BuildNumber, L"%d", VersionInformation.dwBuildNumber);
MachineInformation->BuildNumber = BuildNumber;
/* Now check what kind of SKU this is */
if (ExVerifySuite(DataCenter))
{
SuiteTypeMessage = SAC_DATACENTER_SUITE_MSG;
}
else if (ExVerifySuite(EmbeddedNT))
{
SuiteTypeMessage = SAC_EMBEDDED_SUITE_MSG;
}
else if (ExVerifySuite(Enterprise))
{
SuiteTypeMessage = SAC_ENTERPRISE_SUITE_MSG;
}
else
{
/* Unknown or perhaps a client SKU */
SuiteTypeMessage = SAC_NO_SUITE_MSG;
}
/* Get the string that correponds to the SKU type */
MessageBuffer = GetMessage(SuiteTypeMessage);
if (!MessageBuffer)
{
/* We won't have it, but this isn't critical */
SAC_DBG(SAC_DBG_INIT, "SAC InitializeMachineInformation: Failed to get product type.\n");
}
else
{
/* Calculate the size we need to hold the string */
Size = wcslen(MessageBuffer);
ASSERT(Size > 0);
RealSize = Size * sizeof(WCHAR) + sizeof(UNICODE_NULL);
/* Allocate a buffer for it */
ProductType = SacAllocatePool(RealSize, GLOBAL_BLOCK_TAG);
if (!ProductType)
{
SAC_DBG(SAC_DBG_INIT, "SAC InitializeMachineInformation: Failed product type memory allocation.\n");
goto Fail;
}
/* Copy the string and set the pointer */
RtlCopyMemory(ProductType, MessageBuffer, RealSize);
MachineInformation->ProductType = ProductType;
}
/* Check if this is a SP version or RTM version */
if (VersionInformation.wServicePackMajor)
{
/* This is a service pack, allocate a buffer for the version */
ServicePack = SacAllocatePool(0x18, GLOBAL_BLOCK_TAG);
if (ServicePack)
{
/* Build the buffer and set a pointer to it */
swprintf(ServicePack,
L"%d.%d",
VersionInformation.wServicePackMajor,
VersionInformation.wServicePackMinor);
MachineInformation->ServicePack = ServicePack;
/* We've collected all the machine info and are done! */
return;
}
/* This is the failure path */
SAC_DBG(SAC_DBG_INIT, "SAC InitializeMachineInformation: Failed service pack memory allocation.\n");
}
else
{
/* Get a generic string that indicates there's no service pack */
MessageBuffer = GetMessage(SAC_NO_DATA_MSG);
Size = wcslen(MessageBuffer);
ASSERT(Size > 0);
RealSize = Size * sizeof(WCHAR) + sizeof(UNICODE_NULL);
/* Allocate memory for the "no service pack" string */
ServicePack = SacAllocatePool(RealSize, GLOBAL_BLOCK_TAG);
if (ServicePack)
{
/* Copy the buffer and set a pointer to it */
RtlCopyMemory(ServicePack, MessageBuffer, RealSize);
MachineInformation->ServicePack = ServicePack;
/* We've collected all the machine info and are done! */
return;
}
SAC_DBG(SAC_DBG_INIT, "SAC InitializeMachineInformation: Failed service pack memory allocation.\n");
}
Fail:
/* In the failure path, always cleanup the machine information buffer */
if (MachineInformation)
{
SacFreePool(MachineInformation);
}
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC Initialize Machine Information : Exiting with error.\n");
}
NTSTATUS
NTAPI
GetCommandConsoleLaunchingPermission(OUT PBOOLEAN Permission)
@ -549,7 +1016,7 @@ ImposeSacCmdServiceStartTypePolicy(VOID)
if (!Buffer) return STATUS_UNSUCCESSFUL;
/* Read the value */
Status = CopyRegistryValueData(&Data, Buffer);
Status = CopyRegistryValueData((PVOID*)&Data, Buffer);
SacFreePool(Buffer);
if (!NT_SUCCESS(Status)) return Status;
@ -632,7 +1099,7 @@ NTAPI
RegisterBlueScreenMachineInformation(VOID)
{
PWCHAR XmlBuffer;
PHEADLESS_BLUE_SCREEN_DATA BsBuffer;
PHEADLESS_CMD_SET_BLUE_SCREEN_DATA BsBuffer;
ULONG Length, HeaderLength, TotalLength;
NTSTATUS Status;
ULONG i;
@ -653,15 +1120,15 @@ RegisterBlueScreenMachineInformation(VOID)
CHECK_PARAMETER_WITH_STATUS(BsBuffer, STATUS_NO_MEMORY);
/* Copy the XML property name */
strcpy((PCHAR)BsBuffer->XMLData, "MACHINEINFO");
BsBuffer->Property = (PUCHAR)HeaderLength + sizeof(ANSI_NULL);
strcpy((PCHAR)BsBuffer->Data, "MACHINEINFO");
BsBuffer->ValueIndex = HeaderLength + sizeof(ANSI_NULL);
/* Copy the data and NULL-terminate it */
for (i = 0; i < Length; i++)
{
BsBuffer->XMLData[HeaderLength + sizeof(ANSI_NULL) + i] = XmlBuffer[i];
BsBuffer->Data[BsBuffer->ValueIndex + i] = XmlBuffer[i];
}
BsBuffer->XMLData[HeaderLength + sizeof(ANSI_NULL) + i] = ANSI_NULL;
BsBuffer->Data[BsBuffer->ValueIndex + i] = ANSI_NULL;
/* Let the OS save the buffer for later */
Status = HeadlessDispatch(HeadlessCmdSetBlueScreenData,
@ -756,6 +1223,25 @@ SerialBufferGetChar(OUT PCHAR Char)
return STATUS_SUCCESS;
}
ULONG
NTAPI
GetMessageLineCount(IN ULONG MessageIndex)
{
ULONG LineCount = 0;
PWCHAR Buffer;
/* Get the message buffer */
Buffer = GetMessage(MessageIndex);
if (Buffer)
{
/* Scan it looking for new lines, and increment the conut each time */
while (*Buffer) if (*Buffer++ == L'\n') ++LineCount;
}
/* Return the line count */
return LineCount;
}
ULONG
ConvertAnsiToUnicode(
IN PWCHAR pwch,
@ -782,16 +1268,6 @@ InvokeUserModeService(
return STATUS_NOT_IMPLEMENTED;
}
BOOLEAN
SacTranslateUtf8ToUnicode(
IN CHAR Utf8Char,
IN PCHAR UnicodeBuffer,
OUT PCHAR Utf8Value
)
{
return FALSE;
}
NTSTATUS
TranslateMachineInformationText(
IN PWCHAR Buffer)
@ -810,14 +1286,6 @@ CopyAndInsertStringAtInterval(
return STATUS_NOT_IMPLEMENTED;
}
ULONG
GetMessageLineCount(
IN ULONG MessageIndex
)
{
return 0;
}
NTSTATUS
RegisterSacCmdEvent(
IN PVOID Object,

View file

@ -1,36 +1,109 @@
/*
* PROJECT: ReactOS Boot Loader
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/sac/driver/vtutf8chan.c
* PURPOSE: Driver for the Server Administration Console (SAC) for EMS
* PROGRAMMERS: ReactOS Portable Systems Group
* PROJECT: ReactOS Drivers
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/sac/driver/vtutf8chan.c
* PURPOSE: Driver for the Server Administration Console (SAC) for EMS
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
/* INCLUDES ******************************************************************/
#include "sacdrv.h"
/* GLOBALS ********************************************************************/
/* GLOBALS *******************************************************************/
/* FUNCTIONS ******************************************************************/
CHAR IncomingUtf8ConversionBuffer[4];
WCHAR IncomingUnicodeValue;
/* FUNCTIONS *****************************************************************/
typedef struct _SAC_CURSOR_DATA
{
UCHAR CursorX;
UCHAR CursorY;
UCHAR CursorVisible;
WCHAR CursorValue;
} SAC_CURSOR_DATA, *PSAC_CURSOR_DATA;
C_ASSERT(sizeof(SAC_CURSOR_DATA) == 6);
#define SAC_VTUTF8_OBUFFER_SIZE 0x2D00
#define SAC_VTUTF8_IBUFFER_SIZE 0x2000
NTSTATUS
VTUTF8ChannelCreate(
IN PSAC_CHANNEL Channel
)
NTAPI
VTUTF8ChannelOInit(IN PSAC_CHANNEL Channel)
{
return STATUS_NOT_IMPLEMENTED;
PSAC_CURSOR_DATA Cursor;
ULONG x, y;
CHECK_PARAMETER(Channel);
/* Set the current channel cursor parameters */
Channel->CursorVisible = 0;
Channel->CursorX = 40;
Channel->CursorY = 37;
/* Loop the output buffer height by width */
Cursor = (PSAC_CURSOR_DATA)Channel->OBuffer;
y = SAC_VTUTF8_COL_HEIGHT - 1;
do
{
x = SAC_VTUTF8_COL_WIDTH;
do
{
/* For every character, set the defaults */
Cursor->CursorValue = ' ';
Cursor->CursorX = 40;
Cursor->CursorY = 38;
/* Move to the next character */
Cursor++;
} while (--x);
} while (--y);
/* All done */
return STATUS_SUCCESS;
}
NTSTATUS
VTUTF8ChannelDestroy(
IN PSAC_CHANNEL Channel
)
NTAPI
VTUTF8ChannelCreate(IN PSAC_CHANNEL Channel)
{
return STATUS_NOT_IMPLEMENTED;
NTSTATUS Status;
CHECK_PARAMETER(Channel);
/* Allocate the output buffer */
Channel->OBuffer = SacAllocatePool(SAC_VTUTF8_OBUFFER_SIZE, GLOBAL_BLOCK_TAG);
CHECK_ALLOCATION(Channel->OBuffer);
/* Allocate the input buffer */
Channel->IBuffer = SacAllocatePool(SAC_VTUTF8_IBUFFER_SIZE, GLOBAL_BLOCK_TAG);
CHECK_ALLOCATION(Channel->IBuffer);
/* Initialize the output stream */
Status = VTUTF8ChannelOInit(Channel);
if (NT_SUCCESS(Status)) return Status;
/* Reset all flags and return success */
_InterlockedExchange(&Channel->ChannelHasNewOBufferData, 0);
_InterlockedExchange(&Channel->ChannelHasNewIBufferData, 0);
return STATUS_SUCCESS;
}
NTSTATUS
NTAPI
VTUTF8ChannelDestroy(IN PSAC_CHANNEL Channel)
{
CHECK_PARAMETER(Channel);
/* Free the buffer and then destroy the channel */
if (Channel->OBuffer) SacFreePool(Channel->OBuffer);
if (Channel->IBuffer) SacFreePool(Channel->IBuffer);
return ChannelDestroy(Channel);
}
NTSTATUS
NTAPI
VTUTF8ChannelORead(
IN PSAC_CHANNEL Channel,
IN PCHAR Buffer,
@ -41,17 +114,8 @@ VTUTF8ChannelORead(
return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS
VTUTF8ChannelOEcho(
IN PSAC_CHANNEL Channel,
IN PWCHAR String,
IN ULONG Size
)
{
return STATUS_NOT_IMPLEMENTED;
}
BOOLEAN
NTAPI
VTUTF8ChannelScanForNumber(
IN PWCHAR String,
OUT PULONG Number
@ -61,6 +125,7 @@ VTUTF8ChannelScanForNumber(
}
NTSTATUS
NTAPI
VTUTF8ChannelAnsiDispatch(
IN NTSTATUS Status,
IN ULONG AnsiCode,
@ -72,6 +137,7 @@ VTUTF8ChannelAnsiDispatch(
}
NTSTATUS
NTAPI
VTUTF8ChannelProcessAttributes(
IN PSAC_CHANNEL Channel,
IN UCHAR Attribute
@ -80,24 +146,8 @@ VTUTF8ChannelProcessAttributes(
return STATUS_NOT_IMPLEMENTED;
}
ULONG
VTUTF8ChannelGetIBufferIndex(
IN PSAC_CHANNEL Channel
)
{
return 0;
}
VOID
VTUTF8ChannelSetIBufferIndex(
IN PSAC_CHANNEL Channel,
IN ULONG BufferIndex
)
{
}
NTSTATUS
NTAPI
VTUTF8ChannelConsumeEscapeSequence(
IN PSAC_CHANNEL Channel,
IN PWCHAR String
@ -107,6 +157,7 @@ VTUTF8ChannelConsumeEscapeSequence(
}
NTSTATUS
NTAPI
VTUTF8ChannelOFlush(
IN PSAC_CHANNEL Channel
)
@ -115,67 +166,240 @@ VTUTF8ChannelOFlush(
}
NTSTATUS
VTUTF8ChannelIRead(
IN PSAC_CHANNEL Channel,
IN PCHAR Buffer,
IN ULONG BufferSize,
IN PULONG ReturnBufferSize
)
NTAPI
VTUTF8ChannelOWrite2(IN PSAC_CHANNEL Channel,
IN PCHAR String,
IN ULONG Size)
{
return STATUS_NOT_IMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS
VTUTF8ChannelIBufferIsFull(
IN PSAC_CHANNEL Channel,
OUT PBOOLEAN BufferStatus
)
NTAPI
VTUTF8ChannelOEcho(IN PSAC_CHANNEL Channel,
IN PCHAR String,
IN ULONG Size)
{
return STATUS_NOT_IMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
}
WCHAR
VTUTF8ChannelIReadLast(
IN PSAC_CHANNEL Channel
)
NTSTATUS
NTAPI
VTUTF8ChannelOWrite(IN PSAC_CHANNEL Channel,
IN PCHAR String,
IN ULONG Length)
{
return 0;
NTSTATUS Status;
CHECK_PARAMETER1(Channel);
CHECK_PARAMETER2(String);
/* Call the lower level function */
Status = VTUTF8ChannelOWrite2(Channel, String, Length / sizeof(WCHAR));
if (NT_SUCCESS(Status))
{
/* Is the channel enabled for output? */
if ((ConMgrIsWriteEnabled(Channel)) && (Channel->WriteEnabled))
{
/* Go ahead and output it */
Status = VTUTF8ChannelOEcho(Channel, String, Length);
}
else
{
/* Otherwise, just remember that we have new data */
_InterlockedExchange(&Channel->ChannelHasNewOBufferData, 1);
}
}
/* We're done */
return Status;
}
ULONG
VTUTF8ChannelIBufferLength(
IN PSAC_CHANNEL Channel
)
NTAPI
VTUTF8ChannelGetIBufferIndex(IN PSAC_CHANNEL Channel)
{
return 0;
ASSERT(Channel);
ASSERT((Channel->IBufferIndex % sizeof(WCHAR)) == 0);
ASSERT(Channel->IBufferIndex < SAC_VTUTF8_IBUFFER_SIZE);
/* Return the current buffer index */
return Channel->IBufferIndex;
}
VOID
NTAPI
VTUTF8ChannelSetIBufferIndex(IN PSAC_CHANNEL Channel,
IN ULONG BufferIndex)
{
NTSTATUS Status;
ASSERT(Channel);
ASSERT((Channel->IBufferIndex % sizeof(WCHAR)) == 0);
ASSERT(Channel->IBufferIndex < SAC_VTUTF8_IBUFFER_SIZE);
/* Set the new index, and if it's not zero, it means we have data */
Channel->IBufferIndex = BufferIndex;
_InterlockedExchange(&Channel->ChannelHasNewIBufferData, BufferIndex != 0);
/* If we have new data, and an event has been registered... */
if (!(Channel->IBufferIndex) &&
(Channel->Flags & SAC_CHANNEL_FLAG_HAS_NEW_DATA_EVENT))
{
/* Go ahead and signal it */
ChannelClearEvent(Channel, HasNewDataEvent);
UNREFERENCED_PARAMETER(Status);
}
}
NTSTATUS
VTUTF8ChannelOWrite2(
IN PSAC_CHANNEL Channel,
IN PWCHAR String,
IN ULONG Size
)
NTAPI
VTUTF8ChannelIRead(IN PSAC_CHANNEL Channel,
IN PCHAR Buffer,
IN ULONG BufferSize,
IN PULONG ReturnBufferSize)
{
return STATUS_NOT_IMPLEMENTED;
ULONG CopyChars;
CHECK_PARAMETER1(Channel);
CHECK_PARAMETER2(Buffer);
CHECK_PARAMETER_WITH_STATUS(BufferSize > 0, STATUS_INVALID_BUFFER_SIZE);
/* Assume failure */
*ReturnBufferSize = 0;
/* Check how many bytes are in the buffer */
if (Channel->ChannelInputBufferLength(Channel) == 0)
{
/* Apparently nothing. Make sure the flag indicates so too */
ASSERT(ChannelHasNewIBufferData(Channel) == FALSE);
}
else
{
/* Use the smallest number of bytes either in the buffer or requested */
CopyChars = min(Channel->ChannelInputBufferLength(Channel) * sizeof(WCHAR),
BufferSize);
ASSERT(CopyChars <= Channel->ChannelInputBufferLength(Channel));
/* Copy them into the caller's buffer */
RtlCopyMemory(Buffer, Channel->IBuffer, CopyChars);
/* Update the channel's index past the copied (read) bytes */
VTUTF8ChannelSetIBufferIndex(Channel,
VTUTF8ChannelGetIBufferIndex(Channel) - CopyChars);
/* Are there still bytes that haven't been read yet? */
if (Channel->ChannelInputBufferLength(Channel))
{
/* Shift them up in the buffer */
RtlMoveMemory(Channel->IBuffer,
&Channel->IBuffer[CopyChars],
Channel->ChannelInputBufferLength(Channel) *
sizeof(WCHAR));
}
/* Return the number of bytes we actually copied */
*ReturnBufferSize = CopyChars;
}
/* Return success */
return STATUS_SUCCESS;
}
NTSTATUS
VTUTF8ChannelIWrite(
IN PSAC_CHANNEL Channel,
IN PCHAR Buffer,
IN ULONG BufferSize
)
NTAPI
VTUTF8ChannelIBufferIsFull(IN PSAC_CHANNEL Channel,
OUT PBOOLEAN BufferStatus)
{
return STATUS_NOT_IMPLEMENTED;
CHECK_PARAMETER1(Channel);
/* If the index is beyond the length, the buffer must be full */
*BufferStatus = VTUTF8ChannelGetIBufferIndex(Channel) > SAC_VTUTF8_IBUFFER_SIZE;
return STATUS_SUCCESS;
}
ULONG
NTAPI
VTUTF8ChannelIBufferLength(IN PSAC_CHANNEL Channel)
{
ASSERT(Channel);
/* The index is the length, so divide by two to get character count */
return VTUTF8ChannelGetIBufferIndex(Channel) / sizeof(WCHAR);
}
WCHAR
NTAPI
VTUTF8ChannelIReadLast(IN PSAC_CHANNEL Channel)
{
PWCHAR LastCharLocation;
WCHAR LastChar = 0;
ASSERT(Channel);
/* Check if there's anything to read in the buffer */
if (Channel->ChannelInputBufferLength(Channel))
{
/* Go back one character */
VTUTF8ChannelSetIBufferIndex(Channel,
VTUTF8ChannelGetIBufferIndex(Channel) -
sizeof(WCHAR));
/* Read it, and clear its current value */
LastCharLocation = (PWCHAR)&Channel->IBuffer[VTUTF8ChannelGetIBufferIndex(Channel)];
LastChar = *LastCharLocation;
*LastCharLocation = UNICODE_NULL;
}
/* Return the last character */
return LastChar;
}
NTSTATUS
VTUTF8ChannelOWrite(
IN PSAC_CHANNEL Channel,
IN PWCHAR String,
IN ULONG Length
)
NTAPI
VTUTF8ChannelIWrite(IN PSAC_CHANNEL Channel,
IN PCHAR Buffer,
IN ULONG BufferSize)
{
return STATUS_NOT_IMPLEMENTED;
NTSTATUS Status;
BOOLEAN IsFull;
ULONG Index, i;
CHECK_PARAMETER1(Channel);
CHECK_PARAMETER2(Buffer);
CHECK_PARAMETER_WITH_STATUS(BufferSize > 0, STATUS_INVALID_BUFFER_SIZE);
/* First, check if the input buffer still has space */
Status = VTUTF8ChannelIBufferIsFull(Channel, &IsFull);
if (!NT_SUCCESS(Status)) return Status;
if (IsFull) return STATUS_UNSUCCESSFUL;
/* Get the current buffer index */
Index = VTUTF8ChannelGetIBufferIndex(Channel);
if ((SAC_VTUTF8_IBUFFER_SIZE - Index) < BufferSize)
{
return STATUS_INSUFFICIENT_RESOURCES;
}
/* Copy the new data */
for (i = 0; i < BufferSize; i++)
{
/* Convert the character */
if (SacTranslateUtf8ToUnicode(Buffer[i],
IncomingUtf8ConversionBuffer,
&IncomingUnicodeValue))
{
/* Write it into the buffer */
*(PWCHAR)&Channel->IBuffer[VTUTF8ChannelGetIBufferIndex(Channel)] =
IncomingUnicodeValue;
/* Update the index */
Index = VTUTF8ChannelGetIBufferIndex(Channel);
VTUTF8ChannelSetIBufferIndex(Channel, Index + sizeof(WCHAR));
}
}
/* Signal the event, if one was set */
if (Channel->Flags & SAC_CHANNEL_FLAG_HAS_NEW_DATA_EVENT)
{
ChannelSetEvent(Channel, HasNewDataEvent);
}
/* All done */
return STATUS_SUCCESS;
}

View file

@ -3,6 +3,7 @@
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#ifndef _INC_MBSTRING
#define _INC_MBSTRING
@ -390,13 +391,13 @@ extern "C" {
_In_ size_t _Count);
_CRTIMP
int
errno_t
__cdecl
_mbsnbcpy_s(
_Out_writes_z_(size) unsigned char* dst,
_In_ size_t size,
_In_z_ const unsigned char* src,
_In_ size_t n);
_Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_z_ const unsigned char *_Src,
_In_ size_t _MaxCount);
_CRTIMP
unsigned char*

View file

@ -15,28 +15,133 @@
extern "C" {
#endif
_CRTIMP errno_t __cdecl _cgets_s(char *_Buffer,size_t _Size,size_t *_SizeRead);
_CRTIMP int __cdecl _cprintf_s(const char *_Format,...);
_CRTIMP int __cdecl _cscanf_s(const char *_Format,...);
_CRTIMP int __cdecl _cscanf_s_l(const char *_Format,_locale_t _Locale,...);
_CRTIMP int __cdecl _vcprintf_s(const char *_Format,va_list _ArgList);
_CRTIMP int __cdecl _cprintf_s_l(const char *_Format,_locale_t _Locale,...);
_CRTIMP int __cdecl _vcprintf_s_l(const char *_Format,_locale_t _Locale,va_list _ArgList);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_cgets_s(
_Out_writes_z_(_Size) char *_Buffer,
_In_ size_t _Size,
_Out_ size_t *_SizeRead);
_Check_return_opt_
_CRTIMP
int
__cdecl
_cprintf_s(
_In_z_ _Printf_format_string_ const char *_Format,
...);
_Check_return_opt_
_CRTIMP
int
__cdecl
_cscanf_s(
_In_z_ _Scanf_s_format_string_ const char *_Format,
...);
_Check_return_opt_
_CRTIMP
int
__cdecl
_cscanf_s_l(
_In_z_ _Scanf_s_format_string_ const char *_Format,
_In_opt_ _locale_t _Locale,
...);
_Check_return_opt_
_CRTIMP
int
__cdecl
_vcprintf_s(
_In_z_ _Printf_format_string_ const char *_Format,
va_list _ArgList);
_Check_return_opt_
_CRTIMP
int
__cdecl
_cprintf_s_l(
_In_z_ _Printf_format_string_ const char *_Format,
_In_opt_ _locale_t _Locale,
...);
_Check_return_opt_
_CRTIMP
int
__cdecl
_vcprintf_s_l(
_In_z_ _Printf_format_string_ const char *_Format,
_In_opt_ _locale_t _Locale,
va_list _ArgList);
#ifndef _WCONIO_DEFINED_S
#define _WCONIO_DEFINED_S
_CRTIMP errno_t __cdecl _cgetws_s(wchar_t *_Buffer,size_t _SizeInWords,size_t *_SizeRead);
_CRTIMP int __cdecl _cwprintf_s(const wchar_t *_Format,...);
_CRTIMP int __cdecl _cwscanf_s(const wchar_t *_Format,...);
_CRTIMP int __cdecl _cwscanf_s_l(const wchar_t *_Format,_locale_t _Locale,...);
_CRTIMP int __cdecl _vcwprintf_s(const wchar_t *_Format,va_list _ArgList);
_CRTIMP int __cdecl _cwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,...);
_CRTIMP int __cdecl _vcwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
#endif
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_cgetws_s(
_Out_writes_to_(_SizeInWords, *_SizeRead) wchar_t *_Buffer,
_In_ size_t _SizeInWords,
_Out_ size_t *_SizeRead);
_Check_return_opt_
_CRTIMP
int
__cdecl
_cwprintf_s(
_In_z_ _Printf_format_string_ const wchar_t *_Format,
...);
_Check_return_opt_
_CRTIMP
int
__cdecl
_cwscanf_s(
_In_z_ _Scanf_s_format_string_ const wchar_t *_Format,
...);
_Check_return_opt_
_CRTIMP
int
__cdecl
_cwscanf_s_l(
_In_z_ _Scanf_s_format_string_ const wchar_t *_Format,
_In_opt_ _locale_t _Locale,
...);
_Check_return_opt_
_CRTIMP
int
__cdecl
_vcwprintf_s(
_In_z_ _Printf_format_string_ const wchar_t *_Format,
va_list _ArgList);
_CRTIMP
int
__cdecl
_cwprintf_s_l(
_In_z_ _Printf_format_string_ const wchar_t *_Format,
_In_opt_ _locale_t _Locale,
...);
_CRTIMP
int
__cdecl
_vcwprintf_s_l(
_In_z_ _Printf_format_string_ const wchar_t *_Format,
_In_opt_ _locale_t _Locale,
va_list _ArgList);
#endif /* _WCONIO_DEFINED_S */
#ifdef __cplusplus
}
#endif
#endif
#endif
#endif /* MINGW_HAS_SECURE_API */
#endif /* _INC_CONIO_S */

View file

@ -3,6 +3,7 @@
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#ifndef _INC_MBSTRING_S
#define _INC_MBSTRING_S
@ -16,37 +17,246 @@ extern "C" {
#ifndef _MBSTRING_S_DEFINED
#define _MBSTRING_S_DEFINED
_CRTIMP errno_t __cdecl _mbscat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src);
_CRTIMP errno_t __cdecl _mbscat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,_locale_t _Locale);
_CRTIMP errno_t __cdecl _mbscpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src);
_CRTIMP errno_t __cdecl _mbscpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,_locale_t _Locale);
_CRTIMP errno_t __cdecl _mbslwr_s(unsigned char *_Str,size_t _SizeInBytes);
_CRTIMP errno_t __cdecl _mbslwr_s_l(unsigned char *_Str,size_t _SizeInBytes,_locale_t _Locale);
_CRTIMP errno_t __cdecl _mbsnbcat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount);
_CRTIMP errno_t __cdecl _mbsnbcat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale);
_CRTIMP errno_t __cdecl _mbsnbcpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount);
_CRTIMP errno_t __cdecl _mbsnbcpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale);
_CRTIMP errno_t __cdecl _mbsnbset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Ch,size_t _MaxCount);
_CRTIMP errno_t __cdecl _mbsnbset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Ch,size_t _MaxCount,_locale_t _Locale);
_CRTIMP errno_t __cdecl _mbsncat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount);
_CRTIMP errno_t __cdecl _mbsncat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale);
_CRTIMP errno_t __cdecl _mbsncpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount);
_CRTIMP errno_t __cdecl _mbsncpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale);
_CRTIMP errno_t __cdecl _mbsnset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,size_t _MaxCount);
_CRTIMP errno_t __cdecl _mbsnset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,size_t _MaxCount,_locale_t _Locale);
_CRTIMP errno_t __cdecl _mbsset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val);
_CRTIMP errno_t __cdecl _mbsset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,_locale_t _Locale);
_CRTIMP unsigned char *__cdecl _mbstok_s(unsigned char *_Str,const unsigned char *_Delim,unsigned char **_Context);
_CRTIMP unsigned char *__cdecl _mbstok_s_l(unsigned char *_Str,const unsigned char *_Delim,unsigned char **_Context,_locale_t _Locale);
_CRTIMP errno_t __cdecl _mbsupr_s(unsigned char *_Str,size_t _SizeInBytes);
_CRTIMP errno_t __cdecl _mbsupr_s_l(unsigned char *_Str,size_t _SizeInBytes,_locale_t _Locale);
_CRTIMP errno_t __cdecl _mbccpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,int *_PCopied,const unsigned char *_Src);
_CRTIMP errno_t __cdecl _mbccpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,int *_PCopied,const unsigned char *_Src,_locale_t _Locale);
#endif
_CRTIMP
errno_t
__cdecl
_mbscat_s(
_Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_z_ const unsigned char *_Src);
_CRTIMP
errno_t
__cdecl
_mbscat_s_l(
_Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_z_ const unsigned char *_Src,
_In_opt_ _locale_t _Locale);
_CRTIMP
errno_t
__cdecl
_mbscpy_s(
_Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_z_ const unsigned char *_Src);
_CRTIMP
errno_t
__cdecl
_mbscpy_s_l(
_Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_z_ const unsigned char *_Src,
_In_opt_ _locale_t _Locale);
_CRTIMP
errno_t
__cdecl
_mbslwr_s(
_Inout_updates_opt_z_(_SizeInBytes) unsigned char *_Str,
_In_ size_t _SizeInBytes);
_CRTIMP
errno_t
__cdecl
_mbslwr_s_l(
_Inout_updates_opt_z_(_SizeInBytes) unsigned char *_Str,
_In_ size_t _SizeInBytes,
_In_opt_ _locale_t _Locale);
_CRTIMP
errno_t
__cdecl
_mbsnbcat_s(
_Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_z_ const unsigned char *_Src,
_In_ size_t _MaxCount);
_CRTIMP
errno_t
__cdecl
_mbsnbcat_s_l(
_Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_z_ const unsigned char *_Src,
_In_ size_t _MaxCount,
_In_opt_ _locale_t _Locale);
_CRTIMP
errno_t
__cdecl
_mbsnbcpy_s(
_Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_z_ const unsigned char *_Src,
_In_ size_t _MaxCount);
_CRTIMP
errno_t
__cdecl
_mbsnbcpy_s_l(
_Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_z_ const unsigned char *_Src,
_In_ size_t _MaxCount,
_In_opt_ _locale_t _Locale);
_CRTIMP
errno_t
__cdecl
_mbsnbset_s(
_Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_ unsigned int _Ch,
_In_ size_t _MaxCount);
_CRTIMP
errno_t
__cdecl
_mbsnbset_s_l(
_Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_ unsigned int _Ch,
_In_ size_t _MaxCount,
_In_opt_ _locale_t _Locale);
_CRTIMP
errno_t
__cdecl
_mbsncat_s(
_Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_z_ const unsigned char *_Src,
_In_ size_t _MaxCount);
_CRTIMP
errno_t
__cdecl
_mbsncat_s_l(
_Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_z_ const unsigned char *_Src,
_In_ size_t _MaxCount,
_In_opt_ _locale_t _Locale);
_CRTIMP
errno_t
__cdecl
_mbsncpy_s(
_Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_z_ const unsigned char *_Src,
_In_ size_t _MaxCount);
_CRTIMP
errno_t
__cdecl
_mbsncpy_s_l(
_Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_z_ const unsigned char *_Src,
_In_ size_t _MaxCount,
_In_opt_ _locale_t _Locale);
_CRTIMP
errno_t
__cdecl
_mbsnset_s(
_Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_ unsigned int _Val,
_In_ size_t _MaxCount);
_CRTIMP
errno_t
__cdecl
_mbsnset_s_l(
_Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_ unsigned int _Val,
_In_ size_t _MaxCount,
_In_opt_ _locale_t _Locale);
_CRTIMP
errno_t
__cdecl
_mbsset_s(
_Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_ unsigned int _Val);
_CRTIMP
errno_t
__cdecl
_mbsset_s_l(
_Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_In_ unsigned int _Val,
_In_opt_ _locale_t _Locale);
_Check_return_
_CRTIMP
unsigned char *
__cdecl
_mbstok_s(
_Inout_opt_z_ unsigned char *_Str,
_In_z_ const unsigned char *_Delim,
_Inout_ _Deref_prepost_opt_z_ unsigned char **_Context);
_Check_return_
_CRTIMP
unsigned char *
__cdecl
_mbstok_s_l(
_Inout_opt_z_ unsigned char *_Str,
_In_z_ const unsigned char *_Delim,
_Inout_ _Deref_prepost_opt_z_ unsigned char **_Context,
_In_opt_ _locale_t _Locale);
_CRTIMP
errno_t
__cdecl
_mbsupr_s(
_Inout_updates_z_(_SizeInBytes) unsigned char *_Str,
_In_ size_t _SizeInBytes);
_CRTIMP
errno_t
__cdecl
_mbsupr_s_l(
_Inout_updates_z_(_SizeInBytes) unsigned char *_Str,
_In_ size_t _SizeInBytes,
_In_opt_ _locale_t _Locale);
_CRTIMP
errno_t
__cdecl
_mbccpy_s(
_Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_Out_opt_ int *_PCopied,
_In_z_ const unsigned char *_Src);
_CRTIMP
errno_t
__cdecl
_mbccpy_s_l(
_Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst,
_In_ size_t _DstSizeInBytes,
_Out_opt_ int *_PCopied,
_In_z_ const unsigned char *_Src,
_In_opt_ _locale_t _Locale);
#endif /* _MBSTRING_S_DEFINED */
#ifdef __cplusplus
}
#endif
#endif
#endif
#endif /* MINGW_HAS_SECURE_API */
#endif /* _INC_MBSTRING_S */

View file

@ -3,6 +3,7 @@
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#ifndef _INC_STRING_S
#define _INC_STRING_S
@ -14,46 +15,299 @@
extern "C" {
#endif
_CRTIMP errno_t __cdecl _strset_s(char *_Dst,size_t _DstSize,int _Value);
_CRTIMP errno_t __cdecl _strerror_s(char *_Buf,size_t _SizeInBytes,const char *_ErrMsg);
_CRTIMP errno_t __cdecl _strlwr_s(char *_Str,size_t _Size);
_CRTIMP errno_t __cdecl _strlwr_s_l(char *_Str,size_t _Size,_locale_t _Locale);
_CRTIMP errno_t __cdecl _strnset_s(char *_Str,size_t _Size,int _Val,size_t _MaxCount);
_CRTIMP errno_t __cdecl _strupr_s(char *_Str,size_t _Size);
_CRTIMP errno_t __cdecl _strupr_s_l(char *_Str,size_t _Size,_locale_t _Locale);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_strset_s(
_Inout_updates_z_(_DstSize) char *_Dst,
_In_ size_t _DstSize,
_In_ int _Value);
_CRTIMP errno_t __cdecl strncat_s(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount);
_CRTIMP errno_t __cdecl _strncat_s_l(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount,_locale_t _Locale);
_CRTIMP errno_t __cdecl strcpy_s(char *_Dst, size_t _SizeInBytes, const char *_Src);
_CRTIMP errno_t __cdecl strncpy_s(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount);
_CRTIMP errno_t __cdecl _strncpy_s_l(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount,_locale_t _Locale);
_CRTIMP char *__cdecl strtok_s(char *_Str,const char *_Delim,char **_Context);
_CRTIMP char *__cdecl _strtok_s_l(char *_Str,const char *_Delim,char **_Context,_locale_t _Locale);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_strerror_s(
_Out_writes_z_(_SizeInBytes) char *_Buf,
_In_ size_t _SizeInBytes,
_In_opt_z_ const char *_ErrMsg);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_strlwr_s(
_Inout_updates_z_(_Size) char *_Str,
_In_ size_t _Size);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_strlwr_s_l(
_Inout_updates_z_(_Size) char *_Str,
_In_ size_t _Size,
_In_opt_ _locale_t _Locale);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_strnset_s(
_Inout_updates_z_(_Size) char *_Str,
_In_ size_t _Size,
_In_ int _Val,
_In_ size_t _MaxCount);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_strupr_s(
_Inout_updates_z_(_Size) char *_Str,
_In_ size_t _Size);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_strupr_s_l(
_Inout_updates_z_(_Size) char *_Str,
_In_ size_t _Size,
_In_opt_ _locale_t _Locale);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
strncat_s(
_Inout_updates_z_(_DstSizeInChars) char *_Dst,
_In_ size_t _DstSizeInChars,
_In_z_ const char *_Src,
_In_ size_t _MaxCount);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_strncat_s_l(
_Inout_updates_z_(_DstSizeInChars) char *_Dst,
_In_ size_t _DstSizeInChars,
_In_z_ const char *_Src,
_In_ size_t _MaxCount,
_In_opt_ _locale_t _Locale);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
strcpy_s(
_Out_writes_z_(_SizeInBytes) char *_Dst,
_In_ size_t _SizeInBytes,
_In_z_ const char *_Src);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
strncpy_s(
_Out_writes_z_(_DstSizeInChars) char *_Dst,
_In_ size_t _DstSizeInChars,
_In_z_ const char *_Src,
_In_ size_t _MaxCount);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_strncpy_s_l(
_Out_writes_z_(_DstSizeInChars) char *_Dst,
_In_ size_t _DstSizeInChars,
_In_z_ const char *_Src,
_In_ size_t _MaxCount,
_In_opt_ _locale_t _Locale);
_Check_return_
_CRTIMP
char *
__cdecl
strtok_s(
_Inout_opt_z_ char *_Str,
_In_z_ const char *_Delim,
_Inout_ _Deref_prepost_opt_z_ char **_Context);
_Check_return_
_CRTIMP
char *
__cdecl
_strtok_s_l(
_Inout_opt_z_ char *_Str,
_In_z_ const char *_Delim,
_Inout_ _Deref_prepost_opt_z_ char **_Context,
_In_opt_ _locale_t _Locale);
#ifndef _WSTRING_S_DEFINED
#define _WSTRING_S_DEFINED
_CRTIMP wchar_t *__cdecl wcstok_s(wchar_t *_Str,const wchar_t *_Delim,wchar_t **_Context);
_CRTIMP errno_t __cdecl _wcserror_s(wchar_t *_Buf,size_t _SizeInWords,int _ErrNum);
_CRTIMP errno_t __cdecl __wcserror_s(wchar_t *_Buffer,size_t _SizeInWords,const wchar_t *_ErrMsg);
_CRTIMP errno_t __cdecl _wcsnset_s(wchar_t *_Dst,size_t _DstSizeInWords,wchar_t _Val,size_t _MaxCount);
_CRTIMP errno_t __cdecl _wcsset_s(wchar_t *_Str,size_t _SizeInWords,wchar_t _Val);
_CRTIMP errno_t __cdecl _wcslwr_s(wchar_t *_Str,size_t _SizeInWords);
_CRTIMP errno_t __cdecl _wcslwr_s_l(wchar_t *_Str,size_t _SizeInWords,_locale_t _Locale);
_CRTIMP errno_t __cdecl _wcsupr_s(wchar_t *_Str,size_t _Size);
_CRTIMP errno_t __cdecl _wcsupr_s_l(wchar_t *_Str,size_t _Size,_locale_t _Locale);
_CRTIMP errno_t __cdecl wcsncat_s(wchar_t *_Dst,size_t _DstSizeInChars,const wchar_t *_Src,size_t _MaxCount);
_CRTIMP errno_t __cdecl _wcsncat_s_l(wchar_t *_Dst,size_t _DstSizeInChars,const wchar_t *_Src,size_t _MaxCount,_locale_t _Locale);
_CRTIMP errno_t __cdecl wcsncpy_s(wchar_t *_Dst,size_t _DstSizeInChars,const wchar_t *_Src,size_t _MaxCount);
_CRTIMP errno_t __cdecl _wcsncpy_s_l(wchar_t *_Dst,size_t _DstSizeInChars,const wchar_t *_Src,size_t _MaxCount,_locale_t _Locale);
_CRTIMP wchar_t *__cdecl _wcstok_s_l(wchar_t *_Str,const wchar_t *_Delim,wchar_t **_Context,_locale_t _Locale);
_CRTIMP errno_t __cdecl _wcsset_s_l(wchar_t *_Str,size_t _SizeInChars,unsigned int _Val,_locale_t _Locale);
_CRTIMP errno_t __cdecl _wcsnset_s_l(wchar_t *_Str,size_t _SizeInChars,unsigned int _Val, size_t _Count,_locale_t _Locale);
_Check_return_
_CRTIMP
wchar_t *
__cdecl
wcstok_s(
_Inout_opt_z_ wchar_t *_Str,
_In_z_ const wchar_t *_Delim,
_Inout_ _Deref_prepost_opt_z_ wchar_t **_Context);
#endif
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_wcserror_s(
_Out_writes_opt_z_(_SizeInWords) wchar_t *_Buf,
_In_ size_t _SizeInWords,
_In_ int _ErrNum);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
__wcserror_s(
_Out_writes_opt_z_(_SizeInWords) wchar_t *_Buffer,
_In_ size_t _SizeInWords,
_In_z_ const wchar_t *_ErrMsg);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_wcsnset_s(
_Inout_updates_z_(_DstSizeInWords) wchar_t *_Dst,
_In_ size_t _DstSizeInWords,
_In_ wchar_t _Val,
_In_ size_t _MaxCount);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_wcsset_s(
_Inout_updates_z_(_SizeInWords) wchar_t *_Str,
_In_ size_t _SizeInWords,
_In_ wchar_t _Val);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_wcslwr_s(
_Inout_updates_z_(_SizeInWords) wchar_t *_Str,
_In_ size_t _SizeInWords);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_wcslwr_s_l(
_Inout_updates_z_(_SizeInWords) wchar_t *_Str,
_In_ size_t _SizeInWords,
_In_opt_ _locale_t _Locale);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_wcsupr_s(
_Inout_updates_z_(_Size) wchar_t *_Str,
_In_ size_t _Size);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_wcsupr_s_l(
_Inout_updates_z_(_Size) wchar_t *_Str,
_In_ size_t _Size,
_In_opt_ _locale_t _Locale);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
wcsncat_s(
_Inout_updates_z_(_DstSizeInChars) wchar_t *_Dst,
_In_ size_t _DstSizeInChars,
_In_z_ const wchar_t *_Src,
_In_ size_t _MaxCount);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_wcsncat_s_l(
_Inout_updates_z_(_DstSizeInChars) wchar_t *_Dst,
_In_ size_t _DstSizeInChars,
_In_z_ const wchar_t *_Src,
_In_ size_t _MaxCount,
_In_opt_ _locale_t _Locale);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
wcsncpy_s(
_Out_writes_z_(_DstSizeInChars) wchar_t *_Dst,
_In_ size_t _DstSizeInChars,
_In_z_ const wchar_t *_Src,
_In_ size_t _MaxCount);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_wcsncpy_s_l(
_Out_writes_z_(_DstSizeInChars) wchar_t *_Dst,
_In_ size_t _DstSizeInChars,
_In_z_ const wchar_t *_Src,
_In_ size_t _MaxCount,
_In_opt_ _locale_t _Locale);
_CRTIMP
wchar_t *
__cdecl
_wcstok_s_l(
_Inout_opt_z_ wchar_t *_Str,
_In_z_ const wchar_t *_Delim,
_Inout_ _Deref_prepost_opt_z_ wchar_t **_Context,
_In_opt_ _locale_t _Locale);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_wcsset_s_l(
_Inout_updates_z_(_SizeInChars) wchar_t *_Str,
_In_ size_t _SizeInChars,
_In_ unsigned int _Val,
_In_opt_ _locale_t _Locale);
_Check_return_wat_
_CRTIMP
errno_t
__cdecl
_wcsnset_s_l(
_Inout_updates_z_(_SizeInChars) wchar_t *_Str,
_In_ size_t _SizeInChars,
_In_ unsigned int _Val,
_In_ size_t _Count,
_In_opt_ _locale_t _Locale);
#endif /* _WSTRING_S_DEFINED */
#ifdef __cplusplus
}
#endif
#endif
#endif
#endif /* MINGW_HAS_SECURE_API */
#endif /* _INC_STRING_S */

File diff suppressed because it is too large Load diff

View file

@ -3,6 +3,7 @@
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#ifndef _INC_COMMCTRL
#define _INC_COMMCTRL
@ -21,7 +22,7 @@
#ifndef _HRESULT_DEFINED
#define _HRESULT_DEFINED
typedef LONG HRESULT;
typedef _Return_type_success_(return >= 0) LONG HRESULT;
#endif
#ifndef NOUSER
@ -70,7 +71,8 @@ extern "C" {
#define ICC_NATIVEFNTCTL_CLASS 0x2000
#define ICC_STANDARD_CLASSES 0x4000
#define ICC_LINK_CLASS 0x8000
WINCOMMCTRLAPI WINBOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *);
WINCOMMCTRLAPI WINBOOL WINAPI InitCommonControlsEx(_In_ const INITCOMMONCONTROLSEX *);
#define ODT_HEADER 100
#define ODT_TAB 101
@ -330,15 +332,57 @@ extern "C" {
#define ILC_PERITEMMIRROR 0x8000
WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Create(int cx,int cy,UINT flags,int cInitial,int cGrow);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_Destroy(HIMAGELIST himl);
WINCOMMCTRLAPI int WINAPI ImageList_GetImageCount(HIMAGELIST himl);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_SetImageCount(HIMAGELIST himl,UINT uNewCount);
WINCOMMCTRLAPI int WINAPI ImageList_Add(HIMAGELIST himl,HBITMAP hbmImage,HBITMAP hbmMask);
WINCOMMCTRLAPI int WINAPI ImageList_ReplaceIcon(HIMAGELIST himl,int i,HICON hicon);
WINCOMMCTRLAPI COLORREF WINAPI ImageList_SetBkColor(HIMAGELIST himl,COLORREF clrBk);
WINCOMMCTRLAPI COLORREF WINAPI ImageList_GetBkColor(HIMAGELIST himl);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_SetOverlayImage(HIMAGELIST himl,int iImage,int iOverlay);
WINCOMMCTRLAPI HRESULT WINAPI HIMAGELIST_QueryInterface(HIMAGELIST,REFIID,void **);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_Destroy(_In_opt_ HIMAGELIST himl);
WINCOMMCTRLAPI int WINAPI ImageList_GetImageCount(_In_ HIMAGELIST himl);
WINCOMMCTRLAPI
WINBOOL
WINAPI
ImageList_SetImageCount(
_In_ HIMAGELIST himl,
_In_ UINT uNewCount);
WINCOMMCTRLAPI
int
WINAPI
ImageList_Add(
_In_ HIMAGELIST himl,
_In_ HBITMAP hbmImage,
_In_opt_ HBITMAP hbmMask);
WINCOMMCTRLAPI
int
WINAPI
ImageList_ReplaceIcon(
_In_ HIMAGELIST himl,
_In_ int i,
_In_ HICON hicon);
WINCOMMCTRLAPI
COLORREF
WINAPI
ImageList_SetBkColor(
_In_ HIMAGELIST himl,
_In_ COLORREF clrBk);
WINCOMMCTRLAPI COLORREF WINAPI ImageList_GetBkColor(_In_ HIMAGELIST himl);
WINCOMMCTRLAPI
WINBOOL
WINAPI
ImageList_SetOverlayImage(
_In_ HIMAGELIST himl,
_In_ int iImage,
_In_ int iOverlay);
WINCOMMCTRLAPI
HRESULT
WINAPI
HIMAGELIST_QueryInterface(
_In_ HIMAGELIST,
_In_ REFIID,
_Outptr_ void **);
#define ImageList_AddIcon(himl,hicon) ImageList_ReplaceIcon(himl,-1,hicon)
#define ILD_NORMAL 0x0
@ -365,13 +409,70 @@ extern "C" {
#define ILS_SATURATE 0x4
#define ILS_ALPHA 0x8
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_Draw(HIMAGELIST himl,int i,HDC hdcDst,int x,int y,UINT fStyle);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_Replace(HIMAGELIST himl,int i,HBITMAP hbmImage,HBITMAP hbmMask);
WINCOMMCTRLAPI int WINAPI ImageList_AddMasked(HIMAGELIST himl,HBITMAP hbmImage,COLORREF crMask);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_DrawEx(HIMAGELIST himl,int i,HDC hdcDst,int x,int y,int dx,int dy,COLORREF rgbBk,COLORREF rgbFg,UINT fStyle);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_DrawIndirect(IMAGELISTDRAWPARAMS *pimldp);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_Remove(HIMAGELIST himl,int i);
WINCOMMCTRLAPI HICON WINAPI ImageList_GetIcon(HIMAGELIST himl,int i,UINT flags);
WINCOMMCTRLAPI
WINBOOL
WINAPI
ImageList_Draw(
_In_ HIMAGELIST himl,
_In_ int i,
_In_ HDC hdcDst,
_In_ int x,
_In_ int y,
_In_ UINT fStyle);
WINCOMMCTRLAPI
WINBOOL
WINAPI
ImageList_Replace(
_In_ HIMAGELIST himl,
_In_ int i,
_In_ HBITMAP hbmImage,
_In_opt_ HBITMAP hbmMask);
WINCOMMCTRLAPI
int
WINAPI
ImageList_AddMasked(
_In_ HIMAGELIST himl,
_In_ HBITMAP hbmImage,
_In_ COLORREF crMask);
WINCOMMCTRLAPI
WINBOOL
WINAPI
ImageList_DrawEx(
_In_ HIMAGELIST himl,
_In_ int i,
_In_ HDC hdcDst,
_In_ int x,
_In_ int y,
_In_ int dx,
_In_ int dy,
_In_ COLORREF rgbBk,
_In_ COLORREF rgbFg,
_In_ UINT fStyle);
WINCOMMCTRLAPI
WINBOOL
WINAPI
ImageList_DrawIndirect(
_In_ IMAGELISTDRAWPARAMS *pimldp);
WINCOMMCTRLAPI
WINBOOL
WINAPI
ImageList_Remove(
_In_ HIMAGELIST himl,
_In_ int i);
WINCOMMCTRLAPI
HICON
WINAPI
ImageList_GetIcon(
_In_ HIMAGELIST himl,
_In_ int i,
_In_ UINT flags);
WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_LoadImageA(HINSTANCE hi,LPCSTR lpbmp,int cx,int cGrow,COLORREF crMask,UINT uType,UINT uFlags);
WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_LoadImageW(HINSTANCE hi,LPCWSTR lpbmp,int cx,int cGrow,COLORREF crMask,UINT uType,UINT uFlags);
@ -379,26 +480,61 @@ extern "C" {
#define ILCF_MOVE 0x0
#define ILCF_SWAP 0x1
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_Copy(HIMAGELIST himlDst,int iDst,HIMAGELIST himlSrc,int iSrc,UINT uFlags);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_BeginDrag(HIMAGELIST himlTrack,int iTrack,int dxHotspot,int dyHotspot);
WINCOMMCTRLAPI
WINBOOL
WINAPI
ImageList_Copy(
_In_ HIMAGELIST himlDst,
_In_ int iDst,
_In_ HIMAGELIST himlSrc,
_In_ int iSrc,
_In_ UINT uFlags);
WINCOMMCTRLAPI
WINBOOL
WINAPI
ImageList_BeginDrag(
_In_ HIMAGELIST himlTrack,
_In_ int iTrack,
_In_ int dxHotspot,
_In_ int dyHotspot);
WINCOMMCTRLAPI void WINAPI ImageList_EndDrag(void);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_DragEnter(HWND hwndLock,int x,int y);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_DragLeave(HWND hwndLock);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_DragMove(int x,int y);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_SetDragCursorImage(HIMAGELIST himlDrag,int iDrag,int dxHotspot,int dyHotspot);
WINCOMMCTRLAPI
WINBOOL
WINAPI
ImageList_SetDragCursorImage(
_In_ HIMAGELIST himlDrag,
_In_ int iDrag,
_In_ int dxHotspot,
_In_ int dyHotspot);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_DragShowNolock(WINBOOL fShow);
WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_GetDragImage(POINT *ppt,POINT *pptHotspot);
_Success_(return != NULL)
WINCOMMCTRLAPI
HIMAGELIST
WINAPI
ImageList_GetDragImage(
_Out_opt_ POINT *ppt,
_Out_opt_ POINT *pptHotspot);
#define ImageList_RemoveAll(himl) ImageList_Remove(himl,-1)
#define ImageList_ExtractIcon(hi,himl,i) ImageList_GetIcon(himl,i,0)
#define ImageList_LoadBitmap(hi,lpbmp,cx,cGrow,crMask) ImageList_LoadImage(hi,lpbmp,cx,cGrow,crMask,IMAGE_BITMAP,0)
#ifdef __IStream_INTERFACE_DEFINED__
WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Read(LPSTREAM pstm);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_Write(HIMAGELIST himl,LPSTREAM pstm);
WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Read(_In_ LPSTREAM pstm);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_Write(_In_ HIMAGELIST himl, _In_ LPSTREAM pstm);
#define ILP_NORMAL 0
#define ILP_DOWNLEVEL 1
WINCOMMCTRLAPI HRESULT WINAPI ImageList_ReadEx(DWORD dwFlags,LPSTREAM pstm,REFIID riid,PVOID *ppv);
WINCOMMCTRLAPI HRESULT WINAPI ImageList_WriteEx(HIMAGELIST himl,DWORD dwFlags,LPSTREAM pstm);
WINCOMMCTRLAPI HRESULT WINAPI ImageList_ReadEx(_In_ DWORD dwFlags, _In_ LPSTREAM pstm, _In_ REFIID riid, _Outptr_ PVOID *ppv);
WINCOMMCTRLAPI HRESULT WINAPI ImageList_WriteEx(_In_ HIMAGELIST himl, _In_ DWORD dwFlags, _In_ LPSTREAM pstm);
#endif
#ifndef IMAGEINFO
@ -411,11 +547,46 @@ extern "C" {
} IMAGEINFO,*LPIMAGEINFO;
#endif
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl,int *cx,int *cy);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_SetIconSize(HIMAGELIST himl,int cx,int cy);
WINCOMMCTRLAPI WINBOOL WINAPI ImageList_GetImageInfo(HIMAGELIST himl,int i,IMAGEINFO *pImageInfo);
WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Merge(HIMAGELIST himl1,int i1,HIMAGELIST himl2,int i2,int dx,int dy);
WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Duplicate(HIMAGELIST himl);
_Success_(return != 0)
WINCOMMCTRLAPI
WINBOOL
WINAPI
ImageList_GetIconSize(
_In_ HIMAGELIST himl,
_Out_opt_ int *cx,
_Out_opt_ int *cy);
_Success_(return != 0)
WINCOMMCTRLAPI
WINBOOL
WINAPI
ImageList_SetIconSize(
_In_ HIMAGELIST himl,
_In_ int cx,
_In_ int cy);
_Success_(return != 0)
WINCOMMCTRLAPI
WINBOOL
WINAPI
ImageList_GetImageInfo(
_In_ HIMAGELIST himl,
_In_ int i,
_Out_ IMAGEINFO *pImageInfo);
WINCOMMCTRLAPI
HIMAGELIST
WINAPI
ImageList_Merge(
_In_ HIMAGELIST himl1,
_In_ int i1,
_In_ HIMAGELIST himl2,
_In_ int i2,
_In_ int dx,
_In_ int dy);
WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Duplicate(_In_ HIMAGELIST himl);
#endif
#ifndef NOHEADER
@ -1760,8 +1931,22 @@ extern "C" {
#ifndef NOMENUHELP
WINCOMMCTRLAPI void WINAPI MenuHelp(UINT uMsg,WPARAM wParam,LPARAM lParam,HMENU hMainMenu,HINSTANCE hInst,HWND hwndStatus,UINT *lpwIDs);
WINCOMMCTRLAPI WINBOOL WINAPI ShowHideMenuCtl(HWND hWnd,UINT_PTR uFlags,LPINT lpInfo);
WINCOMMCTRLAPI void WINAPI GetEffectiveClientRect(HWND hWnd,LPRECT lprc,const INT *lpInfo);
WINCOMMCTRLAPI
WINBOOL
WINAPI
ShowHideMenuCtl(
_In_ HWND hWnd,
_In_ UINT_PTR uFlags,
_In_z_ LPINT lpInfo);
WINCOMMCTRLAPI
void
WINAPI
GetEffectiveClientRect(
_In_ HWND hWnd,
_Out_ LPRECT lprc,
_In_z_ const INT *lpInfo);
#define MINSYSCOMMAND SC_SIZE
#endif
@ -4519,33 +4704,79 @@ typedef struct {
typedef int (CALLBACK *PFNDSAENUMCALLBACK)(void *p,void *pData);
WINCOMMCTRLAPI HDSA WINAPI DSA_Create(int cbItem,int cItemGrow);
WINCOMMCTRLAPI WINBOOL WINAPI DSA_Destroy(HDSA hdsa);
WINCOMMCTRLAPI void WINAPI DSA_DestroyCallback(HDSA hdsa,PFNDSAENUMCALLBACK pfnCB,void *pData);
WINCOMMCTRLAPI PVOID WINAPI DSA_GetItemPtr(HDSA hdsa,int i);
WINCOMMCTRLAPI int WINAPI DSA_InsertItem(HDSA hdsa,int i,void *pitem);
WINCOMMCTRLAPI WINBOOL WINAPI DSA_Destroy(_Inout_opt_ HDSA hdsa);
WINCOMMCTRLAPI
void
WINAPI
DSA_DestroyCallback(
_Inout_opt_ HDSA hdsa,
_In_ PFNDSAENUMCALLBACK pfnCB,
_In_opt_ void *pData);
WINCOMMCTRLAPI PVOID WINAPI DSA_GetItemPtr(_In_ HDSA hdsa, int i);
WINCOMMCTRLAPI
int
WINAPI
DSA_InsertItem(
_Inout_ HDSA hdsa,
_In_ int i,
_In_ void *pitem);
typedef struct _DPA *HDPA;
WINCOMMCTRLAPI HDPA WINAPI DPA_Create(int cItemGrow);
WINCOMMCTRLAPI WINBOOL WINAPI DPA_Destroy(HDPA hdpa);
WINCOMMCTRLAPI PVOID WINAPI DPA_DeletePtr(HDPA hdpa,int i);
WINCOMMCTRLAPI WINBOOL WINAPI DPA_DeleteAllPtrs(HDPA hdpa);
WINCOMMCTRLAPI void WINAPI DPA_EnumCallback(HDPA hdpa,PFNDPAENUMCALLBACK pfnCB,void *pData);
WINCOMMCTRLAPI void WINAPI DPA_DestroyCallback(HDPA hdpa,PFNDPAENUMCALLBACK pfnCB,void *pData);
WINCOMMCTRLAPI WINBOOL WINAPI DPA_SetPtr(HDPA hdpa,int i,void *p);
WINCOMMCTRLAPI int WINAPI DPA_InsertPtr(HDPA hdpa,int i,void *p);
WINCOMMCTRLAPI PVOID WINAPI DPA_GetPtr(HDPA hdpa,INT_PTR i);
WINCOMMCTRLAPI WINBOOL WINAPI DPA_Destroy(_Inout_opt_ HDPA hdpa);
WINCOMMCTRLAPI PVOID WINAPI DPA_DeletePtr(_Inout_ HDPA hdpa, _In_ int i);
WINCOMMCTRLAPI WINBOOL WINAPI DPA_DeleteAllPtrs(_Inout_ HDPA hdpa);
WINCOMMCTRLAPI
void
WINAPI
DPA_EnumCallback(
_In_opt_ HDPA hdpa,
_In_opt_ PFNDPAENUMCALLBACK pfnCB,
_In_opt_ void *pData);
WINCOMMCTRLAPI
void
WINAPI
DPA_DestroyCallback(
_Inout_opt_ HDPA hdpa,
_In_ PFNDPAENUMCALLBACK pfnCB,
_In_opt_ void *pData);
typedef int (CALLBACK *PFNDPACOMPARE)(void *p1,void *p2,LPARAM lParam);
WINCOMMCTRLAPI WINBOOL WINAPI DPA_Sort(HDPA hdpa,PFNDPACOMPARE pfnCompare,LPARAM lParam);
WINCOMMCTRLAPI
WINBOOL
WINAPI
DPA_Sort(
_Inout_ HDPA hdpa,
_In_ PFNDPACOMPARE pfnCompare,
_In_ LPARAM lParam);
#define DPAS_SORTED 0x1
#define DPAS_INSERTBEFORE 0x2
#define DPAS_INSERTAFTER 0x4
WINCOMMCTRLAPI int WINAPI DPA_Search(HDPA hdpa,void *pFind,int iStart,PFNDPACOMPARE pfnCompare,LPARAM lParam,UINT options);
WINCOMMCTRLAPI WINBOOL WINAPI Str_SetPtrW(LPWSTR *ppsz,LPCWSTR psz);
WINCOMMCTRLAPI
int
WINAPI
DPA_Search(
_In_ HDPA hdpa,
_In_opt_ void *pFind,
_In_ int iStart,
_In_ PFNDPACOMPARE pfnCompare,
_In_ LPARAM lParam,
_In_ UINT options);
WINCOMMCTRLAPI
WINBOOL
WINAPI Str_SetPtrW(
_Inout_ LPWSTR *ppsz,
_In_opt_ LPCWSTR psz);
typedef struct _DPASTREAMINFO {
int iPos;
@ -4553,17 +4784,71 @@ typedef struct _DPASTREAMINFO {
} DPASTREAMINFO;
struct IStream;
typedef HRESULT (CALLBACK *PFNDPASTREAM)(DPASTREAMINFO*, struct IStream*, void*);
typedef void* (CALLBACK *PFNDPAMERGE)(UINT, void*, void*, LPARAM);
typedef const void* (CALLBACK *PFNDPAMERGECONST)(UINT, const void*, const void*, LPARAM);
WINCOMMCTRLAPI HRESULT WINAPI DPA_LoadStream(HDPA * phdpa, PFNDPASTREAM pfn, struct IStream * pstream, void *pvInstData);
WINCOMMCTRLAPI HRESULT WINAPI DPA_SaveStream(HDPA hdpa, PFNDPASTREAM pfn, struct IStream * pstream, void *pvInstData);
WINCOMMCTRLAPI WINBOOL WINAPI DPA_Grow(HDPA pdpa, int cp);
WINCOMMCTRLAPI int WINAPI DPA_InsertPtr(HDPA hdpa, int i, void *p);
WINCOMMCTRLAPI PVOID WINAPI DPA_GetPtr(HDPA hdpa, INT_PTR i);
WINCOMMCTRLAPI WINBOOL WINAPI DPA_SetPtr(HDPA hdpa, int i, void *p);
WINCOMMCTRLAPI int WINAPI DPA_GetPtrIndex(HDPA hdpa, const void *p);
typedef HRESULT
(CALLBACK *PFNDPASTREAM)(
_In_ DPASTREAMINFO*,
_In_ struct IStream*,
_In_opt_ void*);
typedef void*
(CALLBACK *PFNDPAMERGE)(
_In_ UINT,
_In_ void*,
_In_ void*,
_In_ LPARAM);
typedef const void*
(CALLBACK *PFNDPAMERGECONST)(
_In_ UINT,
_In_ const void*,
_In_ const void*,
_In_ LPARAM);
WINCOMMCTRLAPI
HRESULT
WINAPI
DPA_LoadStream(
_Outptr_ HDPA * phdpa,
_In_ PFNDPASTREAM pfn,
_In_ struct IStream * pstream,
_In_opt_ void *pvInstData);
WINCOMMCTRLAPI
HRESULT
WINAPI
DPA_SaveStream(
_In_ HDPA hdpa,
_In_ PFNDPASTREAM pfn,
_In_ struct IStream * pstream,
_In_opt_ void *pvInstData);
WINCOMMCTRLAPI WINBOOL WINAPI DPA_Grow(_Inout_ HDPA pdpa, _In_ int cp);
WINCOMMCTRLAPI
int
WINAPI
DPA_InsertPtr(
_Inout_ HDPA hdpa,
_In_ int i,
_In_opt_ void *p);
WINCOMMCTRLAPI PVOID WINAPI DPA_GetPtr(_In_ HDPA hdpa, _In_ INT_PTR i);
WINCOMMCTRLAPI
WINBOOL
WINAPI
DPA_SetPtr(
_Inout_ HDPA hdpa,
_In_ int i,
_In_opt_ void *p);
WINCOMMCTRLAPI
int
WINAPI
DPA_GetPtrIndex(
_In_ HDPA hdpa,
_In_opt_ const void *p);
#define DPA_GetPtrCount(hdpa) (*(int *)(hdpa))
#define DPA_SetPtrCount(hdpa, cItems) (*(int *)(hdpa) = (cItems))
@ -4606,7 +4891,12 @@ typedef const void* (CALLBACK *PFNDPAMERGECONST)(UINT, const void*, const void*,
} TRACKMOUSEEVENT,*LPTRACKMOUSEEVENT;
#endif
WINCOMMCTRLAPI WINBOOL WINAPI _TrackMouseEvent(LPTRACKMOUSEEVENT lpEventTrack);
WINCOMMCTRLAPI
WINBOOL
WINAPI
_TrackMouseEvent(
_Inout_ LPTRACKMOUSEEVENT lpEventTrack);
#endif
#ifndef NOFLATSBAPIS
@ -4653,11 +4943,46 @@ typedef const void* (CALLBACK *PFNDPAMERGECONST)(UINT, const void*, const void*,
typedef LRESULT (CALLBACK *SUBCLASSPROC)(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam,UINT_PTR uIdSubclass,DWORD_PTR dwRefData);
WINBOOL WINAPI SetWindowSubclass(HWND hWnd,SUBCLASSPROC pfnSubclass,UINT_PTR uIdSubclass,DWORD_PTR dwRefData);
WINBOOL WINAPI GetWindowSubclass(HWND hWnd,SUBCLASSPROC pfnSubclass,UINT_PTR uIdSubclass,DWORD_PTR *pdwRefData);
WINBOOL WINAPI RemoveWindowSubclass(HWND hWnd,SUBCLASSPROC pfnSubclass,UINT_PTR uIdSubclass);
_Success_(return != 0)
WINBOOL
WINAPI
SetWindowSubclass(
_In_ HWND hWnd,
_In_ SUBCLASSPROC pfnSubclass,
_In_ UINT_PTR uIdSubclass,
_In_ DWORD_PTR dwRefData);
_Success_(return != 0)
WINBOOL
WINAPI
GetWindowSubclass(
_In_ HWND hWnd,
_In_ SUBCLASSPROC pfnSubclass,
_In_ UINT_PTR uIdSubclass,
_Out_opt_ DWORD_PTR *pdwRefData);
_Success_(return != 0)
WINBOOL
WINAPI
RemoveWindowSubclass(
_In_ HWND hWnd,
_In_ SUBCLASSPROC pfnSubclass,
_In_ UINT_PTR uIdSubclass);
LRESULT WINAPI DefSubclassProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
int WINAPI DrawShadowText(HDC hdc,LPCWSTR pszText,UINT cch,RECT *prc,DWORD dwFlags,COLORREF crText,COLORREF crShadow,int ixOffset,int iyOffset);
int
WINAPI
DrawShadowText(
_In_ HDC hdc,
_In_reads_(cch) LPCWSTR pszText,
_In_ UINT cch,
_In_ RECT *prc,
_In_ DWORD dwFlags,
_In_ COLORREF crText,
_In_ COLORREF crShadow,
_In_ int ixOffset,
_In_ int iyOffset);
#ifndef NOTASKDIALOG
@ -4701,7 +5026,13 @@ typedef struct _TASKDIALOG_BUTTON
PCWSTR pszButtonText;
} TASKDIALOG_BUTTON;
typedef HRESULT (CALLBACK *PFTASKDIALOGCALLBACK)(HWND, UINT, WPARAM, LPARAM, LONG_PTR);
typedef HRESULT
(CALLBACK *PFTASKDIALOGCALLBACK)(
_In_ HWND,
_In_ UINT,
_In_ WPARAM,
_In_ LPARAM,
_In_ LONG_PTR);
typedef struct _TASKDIALOGCONFIG
{
@ -4739,7 +5070,13 @@ typedef struct _TASKDIALOGCONFIG
UINT cxWidth;
} TASKDIALOGCONFIG;
HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *, int *, int *, BOOL *);
HRESULT
WINAPI
TaskDialogIndirect(
_In_ const TASKDIALOGCONFIG *,
_Out_opt_ int *,
_Out_opt_ int *,
_Out_opt_ BOOL *);
#include <poppack.h>
@ -4748,5 +5085,6 @@ HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *, int *, int *, BOOL *
#ifdef __cplusplus
}
#endif
#endif
#endif

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -322,37 +322,108 @@ typedef enum tagCOINIT
COINIT_SPEED_OVER_MEMORY = 0x8 /* Trade memory for speed */
} COINIT;
HRESULT WINAPI CoInitialize(LPVOID lpReserved);
HRESULT WINAPI CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit);
_Check_return_ HRESULT WINAPI CoInitialize(_In_opt_ LPVOID lpReserved);
_Check_return_
HRESULT
WINAPI
CoInitializeEx(
_In_opt_ LPVOID lpReserved,
_In_ DWORD dwCoInit);
void WINAPI CoUninitialize(void);
DWORD WINAPI CoGetCurrentProcess(void);
HINSTANCE WINAPI CoLoadLibrary(LPOLESTR lpszLibName, BOOL bAutoFree);
HINSTANCE WINAPI CoLoadLibrary(_In_ LPOLESTR lpszLibName, _In_ BOOL bAutoFree);
void WINAPI CoFreeAllLibraries(void);
void WINAPI CoFreeLibrary(HINSTANCE hLibrary);
void WINAPI CoFreeLibrary(_In_ HINSTANCE hLibrary);
void WINAPI CoFreeUnusedLibraries(void);
void WINAPI CoFreeUnusedLibrariesEx(DWORD dwUnloadDelay, DWORD dwReserved);
HRESULT WINAPI CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv);
HRESULT WINAPI CoCreateInstanceEx(REFCLSID rclsid,
LPUNKNOWN pUnkOuter,
DWORD dwClsContext,
COSERVERINFO* pServerInfo,
ULONG cmq,
MULTI_QI* pResults);
void
WINAPI
CoFreeUnusedLibrariesEx(
_In_ DWORD dwUnloadDelay,
_In_ DWORD dwReserved);
HRESULT WINAPI CoGetInstanceFromFile(COSERVERINFO* pServerInfo, CLSID* pClsid, IUnknown* punkOuter, DWORD dwClsCtx, DWORD grfMode, OLECHAR* pwszName, DWORD dwCount, MULTI_QI* pResults);
HRESULT WINAPI CoGetInstanceFromIStorage(COSERVERINFO* pServerInfo, CLSID* pClsid, IUnknown* punkOuter, DWORD dwClsCtx, IStorage* pstg, DWORD dwCount, MULTI_QI* pResults);
_Check_return_
HRESULT
WINAPI
CoCreateInstance(
_In_ REFCLSID rclsid,
_In_opt_ LPUNKNOWN pUnkOuter,
_In_ DWORD dwClsContext,
_In_ REFIID iid,
_Outptr_ _At_(*ppv, _Post_readable_size_(_Inexpressible_(varies))) LPVOID *ppv);
HRESULT WINAPI CoGetMalloc(DWORD dwMemContext, LPMALLOC* lpMalloc);
LPVOID WINAPI CoTaskMemAlloc(ULONG size) __WINE_ALLOC_SIZE(1);
void WINAPI CoTaskMemFree(LPVOID ptr);
LPVOID WINAPI CoTaskMemRealloc(LPVOID ptr, ULONG size);
_Check_return_
HRESULT
WINAPI
CoCreateInstanceEx(
_In_ REFCLSID rclsid,
_In_opt_ LPUNKNOWN pUnkOuter,
_In_ DWORD dwClsContext,
_In_opt_ COSERVERINFO *pServerInfo,
_In_ ULONG cmq,
_Inout_updates_(cmq) MULTI_QI *pResults);
HRESULT WINAPI CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy);
_Check_return_
HRESULT
WINAPI
CoGetInstanceFromFile(
_In_opt_ COSERVERINFO *pServerInfo,
_In_opt_ CLSID *pClsid,
_In_opt_ IUnknown *punkOuter,
_In_ DWORD dwClsCtx,
_In_ DWORD grfMode,
_In_ _Null_terminated_ OLECHAR *pwszName,
_In_ DWORD dwCount,
_Inout_updates_(dwCount) MULTI_QI *pResults);
_Check_return_
HRESULT
WINAPI
CoGetInstanceFromIStorage(
_In_opt_ COSERVERINFO *pServerInfo,
_In_opt_ CLSID *pClsid,
_In_opt_ IUnknown *punkOuter,
_In_ DWORD dwClsCtx,
_In_ IStorage *pstg,
_In_ DWORD dwCount,
_Inout_updates_(dwCount) MULTI_QI *pResults);
_Check_return_
HRESULT
WINAPI
CoGetMalloc(
_In_ DWORD dwMemContext,
_Outptr_ LPMALLOC *lpMalloc);
_Ret_opt_
_Post_writable_byte_size_(size)
__drv_allocatesMem(Mem)
_Check_return_
LPVOID
WINAPI
CoTaskMemAlloc(_In_ ULONG size) __WINE_ALLOC_SIZE(1);
void
WINAPI
CoTaskMemFree(
_In_opt_ __drv_freesMem(Mem) _Post_invalid_ LPVOID ptr);
_Ret_opt_
_Post_writable_byte_size_(size)
_When_(size > 0, __drv_allocatesMem(Mem) _Check_return_)
LPVOID
WINAPI
CoTaskMemRealloc(
_In_opt_ __drv_freesMem(Mem) _Post_invalid_ LPVOID ptr,
_In_ ULONG size);
HRESULT WINAPI CoRegisterMallocSpy(_In_ LPMALLOCSPY pMallocSpy);
HRESULT WINAPI CoRevokeMallocSpy(void);
HRESULT WINAPI CoGetContextToken( ULONG_PTR *token );
_Check_return_ HRESULT WINAPI CoGetContextToken(_Out_ ULONG_PTR *token);
/* class registration flags; passed to CoRegisterClassObject */
typedef enum tagREGCLS
@ -364,60 +435,286 @@ typedef enum tagREGCLS
REGCLS_SURROGATE = 8
} REGCLS;
HRESULT WINAPI CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo, REFIID iid, LPVOID *ppv);
HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid,LPUNKNOWN pUnk,DWORD dwClsContext,DWORD flags,LPDWORD lpdwRegister);
HRESULT WINAPI CoRevokeClassObject(DWORD dwRegister);
HRESULT WINAPI CoGetPSClsid(REFIID riid,CLSID *pclsid);
HRESULT WINAPI CoRegisterPSClsid(REFIID riid, REFCLSID rclsid);
HRESULT WINAPI CoRegisterSurrogate(LPSURROGATE pSurrogate);
HRESULT WINAPI CoSuspendClassObjects(void);
HRESULT WINAPI CoResumeClassObjects(void);
_Check_return_
HRESULT
WINAPI
CoGetClassObject(
_In_ REFCLSID rclsid,
_In_ DWORD dwClsContext,
_In_opt_ COSERVERINFO *pServerInfo,
_In_ REFIID iid,
_Outptr_ LPVOID *ppv);
_Check_return_
HRESULT
WINAPI
CoRegisterClassObject(
_In_ REFCLSID rclsid,
_In_ LPUNKNOWN pUnk,
_In_ DWORD dwClsContext,
_In_ DWORD flags,
_Out_ LPDWORD lpdwRegister);
_Check_return_
HRESULT
WINAPI
CoRevokeClassObject(
_In_ DWORD dwRegister);
_Check_return_
HRESULT
WINAPI
CoGetPSClsid(
_In_ REFIID riid,
_Out_ CLSID *pclsid);
_Check_return_
HRESULT
WINAPI
CoRegisterPSClsid(
_In_ REFIID riid,
_In_ REFCLSID rclsid);
_Check_return_ HRESULT WINAPI CoRegisterSurrogate(_In_ LPSURROGATE pSurrogate);
_Check_return_ HRESULT WINAPI CoSuspendClassObjects(void);
_Check_return_ HRESULT WINAPI CoResumeClassObjects(void);
ULONG WINAPI CoAddRefServerProcess(void);
ULONG WINAPI CoReleaseServerProcess(void);
/* marshalling */
HRESULT WINAPI CoCreateFreeThreadedMarshaler(LPUNKNOWN punkOuter, LPUNKNOWN* ppunkMarshal);
HRESULT WINAPI CoGetInterfaceAndReleaseStream(LPSTREAM pStm, REFIID iid, LPVOID* ppv);
HRESULT WINAPI CoGetMarshalSizeMax(ULONG* pulSize, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
HRESULT WINAPI CoGetStandardMarshal(REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags, LPMARSHAL* ppMarshal);
HRESULT WINAPI CoMarshalHresult(LPSTREAM pstm, HRESULT hresult);
HRESULT WINAPI CoMarshalInterface(LPSTREAM pStm, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
HRESULT WINAPI CoMarshalInterThreadInterfaceInStream(REFIID riid, LPUNKNOWN pUnk, LPSTREAM* ppStm);
HRESULT WINAPI CoReleaseMarshalData(LPSTREAM pStm);
HRESULT WINAPI CoDisconnectObject(LPUNKNOWN lpUnk, DWORD reserved);
HRESULT WINAPI CoUnmarshalHresult(LPSTREAM pstm, HRESULT* phresult);
HRESULT WINAPI CoUnmarshalInterface(LPSTREAM pStm, REFIID riid, LPVOID* ppv);
HRESULT WINAPI CoLockObjectExternal(LPUNKNOWN pUnk, BOOL fLock, BOOL fLastUnlockReleases);
BOOL WINAPI CoIsHandlerConnected(LPUNKNOWN pUnk);
_Check_return_
HRESULT
WINAPI
CoCreateFreeThreadedMarshaler(
_In_opt_ LPUNKNOWN punkOuter,
_Outptr_ LPUNKNOWN *ppunkMarshal);
_Check_return_
HRESULT
WINAPI
CoGetInterfaceAndReleaseStream(
_In_ LPSTREAM pStm,
_In_ REFIID iid,
_Outptr_ LPVOID *ppv);
_Check_return_
HRESULT
WINAPI
CoGetMarshalSizeMax(
_Out_ ULONG *pulSize,
_In_ REFIID riid,
_In_ LPUNKNOWN pUnk,
_In_ DWORD dwDestContext,
_In_opt_ LPVOID pvDestContext,
_In_ DWORD mshlflags);
_Check_return_
HRESULT
WINAPI
CoGetStandardMarshal(
_In_ REFIID riid,
_In_ LPUNKNOWN pUnk,
_In_ DWORD dwDestContext,
_In_opt_ LPVOID pvDestContext,
_In_ DWORD mshlflags,
_Outptr_ LPMARSHAL *ppMarshal);
HRESULT WINAPI CoMarshalHresult(_In_ LPSTREAM pstm, _In_ HRESULT hresult);
_Check_return_
HRESULT
WINAPI
CoMarshalInterface(
_In_ LPSTREAM pStm,
_In_ REFIID riid,
_In_ LPUNKNOWN pUnk,
_In_ DWORD dwDestContext,
_In_opt_ LPVOID pvDestContext,
_In_ DWORD mshlflags);
_Check_return_
HRESULT
WINAPI
CoMarshalInterThreadInterfaceInStream(
_In_ REFIID riid,
_In_ LPUNKNOWN pUnk,
_Outptr_ LPSTREAM *ppStm);
_Check_return_ HRESULT WINAPI CoReleaseMarshalData(_In_ LPSTREAM pStm);
_Check_return_
HRESULT
WINAPI
CoDisconnectObject(
_In_ LPUNKNOWN lpUnk,
_In_ DWORD reserved);
HRESULT WINAPI CoUnmarshalHresult(_In_ LPSTREAM pstm, _Out_ HRESULT *phresult);
_Check_return_
HRESULT
WINAPI
CoUnmarshalInterface(
_In_ LPSTREAM pStm,
_In_ REFIID riid,
_Outptr_ LPVOID *ppv);
_Check_return_
HRESULT
WINAPI
CoLockObjectExternal(
_In_ LPUNKNOWN pUnk,
_In_ BOOL fLock,
_In_ BOOL fLastUnlockReleases);
BOOL WINAPI CoIsHandlerConnected(_In_ LPUNKNOWN pUnk);
/* security */
HRESULT WINAPI CoInitializeSecurity(PSECURITY_DESCRIPTOR pSecDesc, LONG cAuthSvc, SOLE_AUTHENTICATION_SERVICE* asAuthSvc, void* pReserved1, DWORD dwAuthnLevel, DWORD dwImpLevel, void* pReserved2, DWORD dwCapabilities, void* pReserved3);
HRESULT WINAPI CoGetCallContext(REFIID riid, void** ppInterface);
HRESULT WINAPI CoSwitchCallContext(IUnknown *pContext, IUnknown **ppOldContext);
HRESULT WINAPI CoQueryAuthenticationServices(DWORD* pcAuthSvc, SOLE_AUTHENTICATION_SERVICE** asAuthSvc);
HRESULT WINAPI CoQueryProxyBlanket(IUnknown* pProxy, DWORD* pwAuthnSvc, DWORD* pAuthzSvc, OLECHAR** pServerPrincName, DWORD* pAuthnLevel, DWORD* pImpLevel, RPC_AUTH_IDENTITY_HANDLE* pAuthInfo, DWORD* pCapabilities);
HRESULT WINAPI CoSetProxyBlanket(IUnknown* pProxy, DWORD dwAuthnSvc, DWORD dwAuthzSvc, OLECHAR* pServerPrincName, DWORD dwAuthnLevel, DWORD dwImpLevel, RPC_AUTH_IDENTITY_HANDLE pAuthInfo, DWORD dwCapabilities);
HRESULT WINAPI CoCopyProxy(IUnknown* pProxy, IUnknown** ppCopy);
_Check_return_
HRESULT
WINAPI
CoInitializeSecurity(
_In_opt_ PSECURITY_DESCRIPTOR pSecDesc,
_In_ LONG cAuthSvc,
_In_reads_opt_(cAuthSvc) SOLE_AUTHENTICATION_SERVICE *asAuthSvc,
_In_opt_ void *pReserved1,
_In_ DWORD dwAuthnLevel,
_In_ DWORD dwImpLevel,
_In_opt_ void *pReserved2,
_In_ DWORD dwCapabilities,
_In_opt_ void *pReserved3);
HRESULT WINAPI CoImpersonateClient(void);
HRESULT WINAPI CoQueryClientBlanket(DWORD* pAuthnSvc, DWORD* pAuthzSvc, OLECHAR** pServerPrincName, DWORD* pAuthnLevel, DWORD* pImpLevel, RPC_AUTHZ_HANDLE* pPrivs, DWORD* pCapabilities);
HRESULT WINAPI CoRevertToSelf(void);
_Check_return_
HRESULT
WINAPI
CoGetCallContext(
_In_ REFIID riid,
_Outptr_ void **ppInterface);
_Check_return_
HRESULT
WINAPI
CoSwitchCallContext(
_In_opt_ IUnknown *pContext,
_Outptr_ IUnknown **ppOldContext);
_Check_return_
HRESULT
WINAPI
CoQueryAuthenticationServices(
_Out_ DWORD *pcAuthSvc,
_Outptr_result_buffer_(*pcAuthSvc) SOLE_AUTHENTICATION_SERVICE **asAuthSvc);
_Check_return_
HRESULT
WINAPI
CoQueryProxyBlanket(
_In_ IUnknown *pProxy,
_Out_opt_ DWORD *pwAuthnSvc,
_Out_opt_ DWORD *pAuthzSvc,
_Outptr_opt_ OLECHAR **pServerPrincName,
_Out_opt_ DWORD *pAuthnLevel,
_Out_opt_ DWORD *pImpLevel,
_Out_opt_ RPC_AUTH_IDENTITY_HANDLE *pAuthInfo,
_Out_opt_ DWORD *pCapabilities);
_Check_return_
HRESULT
WINAPI
CoSetProxyBlanket(
_In_ IUnknown *pProxy,
_In_ DWORD dwAuthnSvc,
_In_ DWORD dwAuthzSvc,
_In_opt_ OLECHAR *pServerPrincName,
_In_ DWORD dwAuthnLevel,
_In_ DWORD dwImpLevel,
_In_opt_ RPC_AUTH_IDENTITY_HANDLE pAuthInfo,
_In_ DWORD dwCapabilities);
_Check_return_
HRESULT
WINAPI CoCopyProxy(
_In_ IUnknown *pProxy,
_Outptr_ IUnknown **ppCopy);
_Check_return_ HRESULT WINAPI CoImpersonateClient(void);
_Check_return_
HRESULT
WINAPI
CoQueryClientBlanket(
_Out_opt_ DWORD *pAuthnSvc,
_Out_opt_ DWORD *pAuthzSvc,
_Outptr_opt_ OLECHAR **pServerPrincName,
_Out_opt_ DWORD *pAuthnLevel,
_Out_opt_ DWORD *pImpLevel,
_Outptr_opt_ RPC_AUTHZ_HANDLE *pPrivs,
_Inout_opt_ DWORD *pCapabilities);
_Check_return_ HRESULT WINAPI CoRevertToSelf(void);
/* misc */
HRESULT WINAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID pClsidNew);
HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew);
HRESULT WINAPI CoAllowSetForegroundWindow(IUnknown *pUnk, LPVOID lpvReserved);
HRESULT WINAPI CoGetObjectContext(REFIID riid, LPVOID *ppv);
HRESULT WINAPI CoCreateGuid(GUID* pguid);
BOOL WINAPI CoIsOle1Class(REFCLSID rclsid);
_Check_return_
HRESULT
WINAPI
CoGetTreatAsClass(
_In_ REFCLSID clsidOld,
_Out_ LPCLSID pClsidNew);
BOOL WINAPI CoDosDateTimeToFileTime(WORD nDosDate, WORD nDosTime, FILETIME* lpFileTime);
BOOL WINAPI CoFileTimeToDosDateTime(FILETIME* lpFileTime, WORD* lpDosDate, WORD* lpDosTime);
HRESULT WINAPI CoFileTimeNow(FILETIME* lpFileTime);
HRESULT WINAPI CoRegisterMessageFilter(LPMESSAGEFILTER lpMessageFilter,LPMESSAGEFILTER *lplpMessageFilter);
HRESULT WINAPI CoRegisterChannelHook(REFGUID ExtensionGuid, IChannelHook *pChannelHook);
_Check_return_
HRESULT
WINAPI
CoTreatAsClass(
_In_ REFCLSID clsidOld,
_In_ REFCLSID clsidNew);
HRESULT
WINAPI
CoAllowSetForegroundWindow(
_In_ IUnknown *pUnk,
_In_opt_ LPVOID lpvReserved);
_Check_return_
HRESULT
WINAPI
CoGetObjectContext(
_In_ REFIID riid,
_Outptr_ LPVOID *ppv);
_Check_return_ HRESULT WINAPI CoCreateGuid(_Out_ GUID *pguid);
BOOL WINAPI CoIsOle1Class(_In_ REFCLSID rclsid);
BOOL
WINAPI
CoDosDateTimeToFileTime(
_In_ WORD nDosDate,
_In_ WORD nDosTime,
_Out_ FILETIME *lpFileTime);
BOOL
WINAPI
CoFileTimeToDosDateTime(
_In_ FILETIME *lpFileTime,
_Out_ WORD *lpDosDate,
_Out_ WORD *lpDosTime);
HRESULT WINAPI CoFileTimeNow(_Out_ FILETIME *lpFileTime);
_Check_return_
HRESULT
WINAPI
CoRegisterMessageFilter(
_In_opt_ LPMESSAGEFILTER lpMessageFilter,
_Outptr_opt_result_maybenull_ LPMESSAGEFILTER *lplpMessageFilter);
HRESULT
WINAPI
CoRegisterChannelHook(
_In_ REFGUID ExtensionGuid,
_In_ IChannelHook *pChannelHook);
typedef enum tagCOWAIT_FLAGS
{
@ -425,22 +722,68 @@ typedef enum tagCOWAIT_FLAGS
COWAIT_ALERTABLE = 0x00000002
} COWAIT_FLAGS;
HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags,DWORD dwTimeout,ULONG cHandles,LPHANDLE pHandles,LPDWORD lpdwindex);
_Check_return_
HRESULT
WINAPI
CoWaitForMultipleHandles(
_In_ DWORD dwFlags,
_In_ DWORD dwTimeout,
_In_ ULONG cHandles,
_In_reads_(cHandles) LPHANDLE pHandles,
_Out_ LPDWORD lpdwindex);
/*****************************************************************************
* GUID API
*/
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR*);
HRESULT WINAPI CLSIDFromString(LPCOLESTR, LPCLSID);
HRESULT WINAPI CLSIDFromProgID(LPCOLESTR progid, LPCLSID riid);
HRESULT WINAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *lplpszProgID);
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax);
_Check_return_
HRESULT
WINAPI
StringFromCLSID(
_In_ REFCLSID id,
_Outptr_ LPOLESTR*);
_Check_return_
HRESULT
WINAPI
CLSIDFromString(
_In_ LPCOLESTR,
_Out_ LPCLSID);
_Check_return_
HRESULT
WINAPI
CLSIDFromProgID(
_In_ LPCOLESTR progid,
_Out_ LPCLSID riid);
_Check_return_
HRESULT
WINAPI
ProgIDFromCLSID(
_In_ REFCLSID clsid,
_Outptr_ LPOLESTR *lplpszProgID);
_Check_return_
INT
WINAPI
StringFromGUID2(
_In_ REFGUID id,
_Out_writes_to_(cmax, return) LPOLESTR str,
_In_ INT cmax);
/*****************************************************************************
* COM Server dll - exports
*/
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID * ppv) DECLSPEC_HIDDEN;
_Check_return_
HRESULT
WINAPI
DllGetClassObject(
_In_ REFCLSID rclsid,
_In_ REFIID riid,
_Outptr_ LPVOID *ppv) DECLSPEC_HIDDEN;
HRESULT WINAPI DllCanUnloadNow(void) DECLSPEC_HIDDEN;
/* shouldn't be here, but is nice for type checking */
@ -453,27 +796,134 @@ HRESULT WINAPI DllUnregisterServer(void) DECLSPEC_HIDDEN;
/*****************************************************************************
* Data Object
*/
HRESULT WINAPI CreateDataAdviseHolder(LPDATAADVISEHOLDER* ppDAHolder);
HRESULT WINAPI CreateDataCache(LPUNKNOWN pUnkOuter, REFCLSID rclsid, REFIID iid, LPVOID* ppv);
HRESULT
WINAPI
CreateDataAdviseHolder(
_Outptr_ LPDATAADVISEHOLDER *ppDAHolder);
HRESULT
WINAPI
CreateDataCache(
_In_opt_ LPUNKNOWN pUnkOuter,
_In_ REFCLSID rclsid,
_In_ REFIID iid,
_Out_ LPVOID *ppv);
/*****************************************************************************
* Moniker API
*/
HRESULT WINAPI BindMoniker(LPMONIKER pmk, DWORD grfOpt, REFIID iidResult, LPVOID* ppvResult);
HRESULT WINAPI CoGetObject(LPCWSTR pszName, BIND_OPTS *pBindOptions, REFIID riid, void **ppv);
HRESULT WINAPI CreateAntiMoniker(LPMONIKER * ppmk);
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC* ppbc);
HRESULT WINAPI CreateClassMoniker(REFCLSID rclsid, LPMONIKER* ppmk);
HRESULT WINAPI CreateFileMoniker(LPCOLESTR lpszPathName, LPMONIKER* ppmk);
HRESULT WINAPI CreateGenericComposite(LPMONIKER pmkFirst, LPMONIKER pmkRest, LPMONIKER* ppmkComposite);
HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim, LPCOLESTR lpszItem, LPMONIKER* ppmk);
HRESULT WINAPI CreateObjrefMoniker(LPUNKNOWN punk, LPMONIKER * ppmk);
HRESULT WINAPI CreatePointerMoniker(LPUNKNOWN punk, LPMONIKER * ppmk);
HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid);
HRESULT WINAPI GetRunningObjectTable(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot);
HRESULT WINAPI MkParseDisplayName(LPBC pbc, LPCOLESTR szUserName, ULONG * pchEaten, LPMONIKER * ppmk);
HRESULT WINAPI MonikerCommonPrefixWith(IMoniker* pmkThis,IMoniker* pmkOther,IMoniker** ppmkCommon);
HRESULT WINAPI MonikerRelativePathTo(LPMONIKER pmkSrc, LPMONIKER pmkDest, LPMONIKER * ppmkRelPath, BOOL dwReserved);
_Check_return_
HRESULT
WINAPI
BindMoniker(
_In_ LPMONIKER pmk,
_In_ DWORD grfOpt,
_In_ REFIID iidResult,
_Outptr_ LPVOID *ppvResult);
_Check_return_
HRESULT
WINAPI
CoGetObject(
_In_ LPCWSTR pszName,
_In_opt_ BIND_OPTS *pBindOptions,
_In_ REFIID riid,
_Outptr_ void **ppv);
_Check_return_ HRESULT WINAPI CreateAntiMoniker(_Outptr_ LPMONIKER *ppmk);
_Check_return_
HRESULT
WINAPI
CreateBindCtx(
_In_ DWORD reserved,
_Outptr_ LPBC *ppbc);
_Check_return_
HRESULT
WINAPI
CreateClassMoniker(
_In_ REFCLSID rclsid,
_Outptr_ LPMONIKER *ppmk);
_Check_return_
HRESULT
WINAPI
CreateFileMoniker(
_In_ LPCOLESTR lpszPathName,
_Outptr_ LPMONIKER *ppmk);
_Check_return_
HRESULT
WINAPI
CreateGenericComposite(
_In_opt_ LPMONIKER pmkFirst,
_In_opt_ LPMONIKER pmkRest,
_Outptr_ LPMONIKER *ppmkComposite);
_Check_return_
HRESULT
WINAPI
CreateItemMoniker(
_In_ LPCOLESTR lpszDelim,
_In_ LPCOLESTR lpszItem,
_Outptr_ LPMONIKER *ppmk);
_Check_return_
HRESULT
WINAPI
CreateObjrefMoniker(
_In_opt_ LPUNKNOWN punk,
_Outptr_ LPMONIKER *ppmk);
_Check_return_
HRESULT
WINAPI
CreatePointerMoniker(
_In_opt_ LPUNKNOWN punk,
_Outptr_ LPMONIKER *ppmk);
_Check_return_
HRESULT
WINAPI
GetClassFile(
_In_ LPCOLESTR filePathName,
_Out_ CLSID *pclsid);
_Check_return_
HRESULT
WINAPI
GetRunningObjectTable(
_In_ DWORD reserved,
_Outptr_ LPRUNNINGOBJECTTABLE *pprot);
_Check_return_
HRESULT
WINAPI
MkParseDisplayName(
_In_ LPBC pbc,
_In_ LPCOLESTR szUserName,
_Out_ ULONG *pchEaten,
_Outptr_ LPMONIKER *ppmk);
_Check_return_
HRESULT
WINAPI
MonikerCommonPrefixWith(
_In_ IMoniker *pmkThis,
_In_ IMoniker *pmkOther,
_Outptr_ IMoniker **ppmkCommon);
_Check_return_
HRESULT
WINAPI
MonikerRelativePathTo(
_In_ LPMONIKER pmkSrc,
_In_ LPMONIKER pmkDest,
_Outptr_ LPMONIKER *ppmkRelPath,
_In_ BOOL dwReserved);
/*****************************************************************************
* Storage API
@ -510,17 +960,99 @@ typedef struct tagSTGOPTIONS
const WCHAR* pwcsTemplateFile;
} STGOPTIONS;
HRESULT WINAPI StringFromIID(REFIID rclsid, LPOLESTR *lplpsz);
HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName,DWORD grfMode,DWORD reserved,IStorage **ppstgOpen);
HRESULT WINAPI StgCreateStorageEx(const WCHAR*,DWORD,DWORD,DWORD,STGOPTIONS*,void*,REFIID,void**);
HRESULT WINAPI StgIsStorageFile(LPCOLESTR fn);
HRESULT WINAPI StgIsStorageILockBytes(ILockBytes *plkbyt);
HRESULT WINAPI StgOpenStorage(const OLECHAR* pwcsName,IStorage* pstgPriority,DWORD grfMode,SNB snbExclude,DWORD reserved,IStorage**ppstgOpen);
HRESULT WINAPI StgOpenStorageEx(const WCHAR* pwcwName,DWORD grfMode,DWORD stgfmt,DWORD grfAttrs,STGOPTIONS *pStgOptions, void *reserved, REFIID riid, void **ppObjectOpen);
_Check_return_
HRESULT
WINAPI
StringFromIID(
_In_ REFIID rclsid,
_Outptr_ LPOLESTR *lplpsz);
HRESULT WINAPI StgCreateDocfileOnILockBytes(ILockBytes *plkbyt,DWORD grfMode, DWORD reserved, IStorage** ppstgOpen);
HRESULT WINAPI StgOpenStorageOnILockBytes(ILockBytes *plkbyt, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen);
HRESULT WINAPI StgSetTimes( OLECHAR const *lpszName, FILETIME const *pctime, FILETIME const *patime, FILETIME const *pmtime);
_Check_return_
HRESULT
WINAPI
StgCreateDocfile(
_In_opt_ _Null_terminated_ LPCOLESTR pwcsName,
_In_ DWORD grfMode,
_Reserved_ DWORD reserved,
_Outptr_ IStorage **ppstgOpen);
_Check_return_
HRESULT
WINAPI
StgCreateStorageEx(
_In_opt_ _Null_terminated_ const WCHAR*,
_In_ DWORD,
_In_ DWORD,
_In_ DWORD,
_Inout_opt_ STGOPTIONS*,
_In_opt_ void*,
_In_ REFIID,
_Outptr_ void**);
_Check_return_
HRESULT
WINAPI
StgIsStorageFile(
_In_ _Null_terminated_ LPCOLESTR fn);
_Check_return_
HRESULT
WINAPI
StgIsStorageILockBytes(
_In_ ILockBytes *plkbyt);
_Check_return_
HRESULT
WINAPI
StgOpenStorage(
_In_opt_ _Null_terminated_ const OLECHAR *pwcsName,
_In_opt_ IStorage *pstgPriority,
_In_ DWORD grfMode,
_In_opt_z_ SNB snbExclude,
_In_ DWORD reserved,
_Outptr_ IStorage **ppstgOpen);
_Check_return_
HRESULT
WINAPI
StgOpenStorageEx(
_In_ _Null_terminated_ const WCHAR *pwcwName,
_In_ DWORD grfMode,
_In_ DWORD stgfmt,
_In_ DWORD grfAttrs,
_Inout_opt_ STGOPTIONS *pStgOptions,
_In_opt_ void *reserved,
_In_ REFIID riid,
_Outptr_ void **ppObjectOpen);
_Check_return_
HRESULT
WINAPI
StgCreateDocfileOnILockBytes(
_In_ ILockBytes *plkbyt,
_In_ DWORD grfMode,
_In_ DWORD reserved,
_Outptr_ IStorage **ppstgOpen);
_Check_return_
HRESULT
WINAPI
StgOpenStorageOnILockBytes(
_In_ ILockBytes *plkbyt,
_In_opt_ IStorage *pstgPriority,
_In_ DWORD grfMode,
_In_opt_z_ SNB snbExclude,
_Reserved_ DWORD reserved,
_Outptr_ IStorage **ppstgOpen);
_Check_return_
HRESULT
WINAPI
StgSetTimes(
_In_ _Null_terminated_ OLECHAR const *lpszName,
_In_opt_ FILETIME const *pctime,
_In_opt_ FILETIME const *patime,
_In_opt_ FILETIME const *pmtime);
#ifdef __cplusplus
}

File diff suppressed because it is too large Load diff

View file

@ -744,20 +744,38 @@ DECL_WINELIB_TYPE_AW(LPOLEUICHANGESOURCE)
DECLARE_INTERFACE_(IOleUILinkContainerA,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(HRESULT,QueryInterface)(THIS_
_In_ REFIID riid,
_Outptr_ void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IOleUILinkContainerA methods ***/
STDMETHOD_(DWORD,GetNextLink)(THIS_ DWORD dwLink) PURE;
STDMETHOD(SetLinkUpdateOptions)(THIS_ DWORD dwLink, DWORD dwUpdateOpt) PURE;
STDMETHOD(GetLinkUpdateOptions)(THIS_ DWORD dwLink, DWORD *lpdwUpdateOpt) PURE;
STDMETHOD(SetLinkSource)(THIS_ DWORD dwLink, LPSTR lpszDisplayName,
ULONG lenFileName, ULONG *pchEaten, BOOL fValidateSource) PURE;
STDMETHOD(GetLinkSource)(THIS_ DWORD dwLink, LPSTR *lplpszDisplayName, ULONG *lplenFileName,
LPSTR *lplpszFullLinkType, LPSTR *lplpszShortLinkType,
BOOL *lpfSourceAvailable, BOOL *lpfIsSelected) PURE;
STDMETHOD(OpenLinkSource)(THIS_ DWORD dwLink) PURE;
STDMETHOD(UpdateLink)(THIS_ DWORD dwLink, BOOL fErrorMessage, BOOL fReserved) PURE;
STDMETHOD_(DWORD,GetNextLink)(THIS_ _In_ DWORD dwLink) PURE;
STDMETHOD(SetLinkUpdateOptions)(THIS_
_In_ DWORD dwLink,
_In_ DWORD dwUpdateOpt) PURE;
STDMETHOD(GetLinkUpdateOptions)(THIS_
_In_ DWORD dwLink,
_Out_ DWORD *lpdwUpdateOpt) PURE;
STDMETHOD(SetLinkSource)(THIS_
_In_ DWORD dwLink,
_In_ LPSTR lpszDisplayName,
_In_ ULONG lenFileName,
_Out_ ULONG *pchEaten,
_In_ BOOL fValidateSource) PURE;
STDMETHOD(GetLinkSource)(THIS_
_In_ DWORD dwLink,
_Outptr_opt_result_maybenull_ LPSTR *lplpszDisplayName,
_Out_ ULONG *lplenFileName,
_Outptr_opt_result_maybenull_ LPSTR *lplpszFullLinkType,
_Outptr_opt_result_maybenull_ LPSTR *lplpszShortLinkType,
_Out_ BOOL *lpfSourceAvailable,
_Out_ BOOL *lpfIsSelected) PURE;
STDMETHOD(OpenLinkSource)(THIS_ _In_ DWORD dwLink) PURE;
STDMETHOD(UpdateLink)(THIS_
_In_ DWORD dwLink,
_In_ BOOL fErrorMessage,
_In_ BOOL fReserved) PURE;
STDMETHOD(CancelLink)(THIS_ DWORD dwLink) PURE;
};
#undef INTERFACE
@ -766,20 +784,38 @@ DECLARE_INTERFACE_(IOleUILinkContainerA,IUnknown)
DECLARE_INTERFACE_(IOleUILinkContainerW,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(HRESULT,QueryInterface)(THIS_
_In_ REFIID riid,
_Outptr_ void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IOleUILinkContainerW methods ***/
STDMETHOD_(DWORD,GetNextLink)(THIS_ DWORD dwLink) PURE;
STDMETHOD(SetLinkUpdateOptions)(THIS_ DWORD dwLink, DWORD dwUpdateOpt) PURE;
STDMETHOD(GetLinkUpdateOptions)(THIS_ DWORD dwLink, DWORD *lpdwUpdateOpt) PURE;
STDMETHOD(SetLinkSource)(THIS_ DWORD dwLink, LPWSTR lpszDisplayName,
ULONG lenFileName, ULONG *pchEaten, BOOL fValidateSource) PURE;
STDMETHOD(GetLinkSource)(THIS_ DWORD dwLink, LPWSTR *lplpszDisplayName, ULONG *lplenFileName,
LPWSTR *lplpszFullLinkType, LPWSTR *lplpszShortLinkType,
BOOL *lpfSourceAvailable, BOOL *lpfIsSelected) PURE;
STDMETHOD(OpenLinkSource)(THIS_ DWORD dwLink) PURE;
STDMETHOD(UpdateLink)(THIS_ DWORD dwLink, BOOL fErrorMessage, BOOL fReserved) PURE;
STDMETHOD_(DWORD,GetNextLink)(THIS_ _In_ DWORD dwLink) PURE;
STDMETHOD(SetLinkUpdateOptions)(THIS_
_In_ DWORD dwLink,
_In_ DWORD dwUpdateOpt) PURE;
STDMETHOD(GetLinkUpdateOptions)(THIS_
_In_ DWORD dwLink,
_Out_ DWORD *lpdwUpdateOpt) PURE;
STDMETHOD(SetLinkSource)(THIS_
_In_ DWORD dwLink,
_In_ LPWSTR lpszDisplayName,
_In_ ULONG lenFileName,
_Out_ ULONG *pchEaten,
_In_ BOOL fValidateSource) PURE;
STDMETHOD(GetLinkSource)(THIS_
_In_ DWORD dwLink,
_Outptr_opt_result_maybenull_ LPWSTR *lplpszDisplayName,
_Out_ ULONG *lplenFileName,
_Outptr_opt_result_maybenull_ LPWSTR *lplpszFullLinkType,
_Outptr_opt_result_maybenull_ LPWSTR *lplpszShortLinkType,
_Out_ BOOL *lpfSourceAvailable,
_Out_ BOOL *lpfIsSelected) PURE;
STDMETHOD(OpenLinkSource)(THIS_ _In_ DWORD dwLink) PURE;
STDMETHOD(UpdateLink)(THIS_
_In_ DWORD dwLink,
_In_ BOOL fErrorMessage,
_In_ BOOL fReserved) PURE;
STDMETHOD(CancelLink)(THIS_ DWORD dwLink) PURE;
};
#undef INTERFACE
@ -812,23 +848,43 @@ DECL_WINELIB_TYPE_AW(LPOLEUILINKCONTAINER)
DECLARE_INTERFACE_(IOleUILinkInfoA,IOleUILinkContainerA)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(HRESULT, QueryInterface)(THIS_
_In_ REFIID riid,
_Outptr_ void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IOleUILinkContainerA methods ***/
STDMETHOD_(DWORD,GetNextLink)(THIS_ DWORD dwLink) PURE;
STDMETHOD(SetLinkUpdateOptions)(THIS_ DWORD dwLink, DWORD dwUpdateOpt) PURE;
STDMETHOD(GetLinkUpdateOptions)(THIS_ DWORD dwLink, DWORD *lpdwUpdateOpt) PURE;
STDMETHOD(SetLinkSource)(THIS_ DWORD dwLink, LPSTR lpszDisplayName,
ULONG lenFileName, ULONG *pchEaten, BOOL fValidateSource) PURE;
STDMETHOD(GetLinkSource)(THIS_ DWORD dwLink, LPSTR *lplpszDisplayName, ULONG *lplenFileName,
LPSTR *lplpszFullLinkType, LPSTR *lplpszShortLinkType,
BOOL *lpfSourceAvailable, BOOL *lpfIsSelected) PURE;
STDMETHOD(OpenLinkSource)(THIS_ DWORD dwLink) PURE;
STDMETHOD(UpdateLink)(THIS_ DWORD dwLink, BOOL fErrorMessage, BOOL fReserved) PURE;
STDMETHOD_(DWORD, GetNextLink)(THIS_ _In_ DWORD dwLink) PURE;
STDMETHOD(SetLinkUpdateOptions)(THIS_
_In_ DWORD dwLink,
_In_ DWORD dwUpdateOpt) PURE;
STDMETHOD(GetLinkUpdateOptions)(THIS_
_In_ DWORD dwLink,
_Out_ DWORD *lpdwUpdateOpt) PURE;
STDMETHOD(SetLinkSource)(THIS_
_In_ DWORD dwLink,
_In_ LPSTR lpszDisplayName,
_In_ ULONG lenFileName,
_Out_ ULONG *pchEaten,
_In_ BOOL fValidateSource) PURE;
STDMETHOD(GetLinkSource)(THIS_
_In_ DWORD dwLink,
_Outptr_opt_result_maybenull_ LPSTR *lplpszDisplayName,
_Out_ ULONG *lplenFileName,
_Outptr_opt_result_maybenull_ LPSTR *lplpszFullLinkType,
_Outptr_opt_result_maybenull_ LPSTR *lplpszShortLinkType,
_Out_ BOOL *lpfSourceAvailable,
_Out_ BOOL *lpfIsSelected) PURE;
STDMETHOD(OpenLinkSource)(THIS_ _In_ DWORD dwLink) PURE;
STDMETHOD(UpdateLink)(THIS_
_In_ DWORD dwLink,
_In_ BOOL fErrorMessage,
_In_ BOOL fReserved) PURE;
STDMETHOD(CancelLink)(THIS_ DWORD dwLink) PURE;
/*** IOleUILinkInfoA methods ***/
STDMETHOD(GetLastUpdate)(THIS_ DWORD dwLink, FILETIME *lpLastUpdate) PURE;
STDMETHOD(GetLastUpdate)(THIS_
_In_ DWORD dwLink,
_Out_ FILETIME *lpLastUpdate) PURE;
};
#undef INTERFACE
@ -836,23 +892,43 @@ DECLARE_INTERFACE_(IOleUILinkInfoA,IOleUILinkContainerA)
DECLARE_INTERFACE_(IOleUILinkInfoW,IOleUILinkContainerW)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(HRESULT,QueryInterface)(THIS_
_In_ REFIID riid,
_Outptr_ void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IOleUILinkContainerW methods ***/
STDMETHOD_(DWORD,GetNextLink)(THIS_ DWORD dwLink) PURE;
STDMETHOD(SetLinkUpdateOptions)(THIS_ DWORD dwLink, DWORD dwUpdateOpt) PURE;
STDMETHOD(GetLinkUpdateOptions)(THIS_ DWORD dwLink, DWORD *lpdwUpdateOpt) PURE;
STDMETHOD(SetLinkSource)(THIS_ DWORD dwLink, LPWSTR lpszDisplayName,
ULONG lenFileName, ULONG *pchEaten, BOOL fValidateSource) PURE;
STDMETHOD(GetLinkSource)(THIS_ DWORD dwLink, LPWSTR *lplpszDisplayName, ULONG *lplenFileName,
LPWSTR *lplpszFullLinkType, LPWSTR *lplpszShortLinkType,
BOOL *lpfSourceAvailable, BOOL *lpfIsSelected) PURE;
STDMETHOD(OpenLinkSource)(THIS_ DWORD dwLink) PURE;
STDMETHOD(UpdateLink)(THIS_ DWORD dwLink, BOOL fErrorMessage, BOOL fReserved) PURE;
STDMETHOD_(DWORD, GetNextLink)(THIS_ _In_ DWORD dwLink) PURE;
STDMETHOD(SetLinkUpdateOptions)(THIS_
_In_ DWORD dwLink,
_In_ DWORD dwUpdateOpt) PURE;
STDMETHOD(GetLinkUpdateOptions)(THIS_
_In_ DWORD dwLink,
_Out_ DWORD *lpdwUpdateOpt) PURE;
STDMETHOD(SetLinkSource)(THIS_
_In_ DWORD dwLink,
_In_ LPWSTR lpszDisplayName,
_In_ ULONG lenFileName,
_Out_ ULONG *pchEaten,
_In_ BOOL fValidateSource) PURE;
STDMETHOD(GetLinkSource)(THIS_
_In_ DWORD dwLink,
_Outptr_opt_result_maybenull_ LPWSTR *lplpszDisplayName,
_Out_ ULONG *lplenFileName,
_Outptr_opt_result_maybenull_ LPWSTR *lplpszFullLinkType,
_Outptr_opt_result_maybenull_ LPWSTR *lplpszShortLinkType,
_Out_ BOOL *lpfSourceAvailable,
_Out_ BOOL *lpfIsSelected) PURE;
STDMETHOD(OpenLinkSource)(THIS_ _In_ DWORD dwLink) PURE;
STDMETHOD(UpdateLink)(THIS_
_In_ DWORD dwLink,
_In_ BOOL fErrorMessage,
_In_ BOOL fReserved) PURE;
STDMETHOD(CancelLink)(THIS_ DWORD dwLink) PURE;
/*** IOleUILinkInfoW methods ***/
STDMETHOD(GetLastUpdate)(THIS_ DWORD dwLink, FILETIME *lpLastUpdate) PURE;
STDMETHOD(GetLastUpdate)(THIS_
_In_ DWORD dwLink,
_Out_ FILETIME *lpLastUpdate) PURE;
};
#undef INTERFACE
@ -886,18 +962,40 @@ DECL_WINELIB_TYPE_AW(LPOLEUILINKINFO)
DECLARE_INTERFACE_(IOleUIObjInfoA,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(HRESULT,QueryInterface)(THIS_
_In_ REFIID riid,
_Outptr_ void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IOleUIObjInfoA methods ***/
STDMETHOD(GetObjectInfo)(THIS_ DWORD dwObject, DWORD *lpdwObjSize, LPSTR *lplpszLabel,
LPSTR *lplpszType, LPSTR *lplpszShortType, LPSTR *lplpszLocation) PURE;
STDMETHOD(GetConvertInfo)(THIS_ DWORD dwObject, CLSID *lpClassID, WORD *lpwFormat,
CLSID *lpConvertDefaultClassID, LPCLSID *lplpClsidExclude, UINT *lpcClsidExclude) PURE;
STDMETHOD(ConvertObject)(THIS_ DWORD dwObject, REFCLSID clsidNew) PURE;
STDMETHOD(GetViewInfo)(THIS_ DWORD dwObject, HGLOBAL *phMetaPict, DWORD *pdvAspect, INT *pnCurrentScale) PURE;
STDMETHOD(SetViewInfo)(THIS_ DWORD dwObject, HGLOBAL hMetaPict, DWORD dvAspect,
INT nCurrentScale, BOOL bRelativeToOrig) PURE;
STDMETHOD(GetObjectInfo)(THIS_
_In_ DWORD dwObject,
_Out_ DWORD *lpdwObjSize,
_Outptr_opt_result_maybenull_ LPSTR *lplpszLabel,
_Outptr_opt_result_maybenull_ LPSTR *lplpszType,
_Outptr_opt_result_maybenull_ LPSTR *lplpszShortType,
_Outptr_opt_result_maybenull_ LPSTR *lplpszLocation) PURE;
STDMETHOD(GetConvertInfo)(THIS_
_In_ DWORD dwObject,
_Out_ CLSID *lpClassID,
_Out_ WORD *lpwFormat,
_Out_ CLSID *lpConvertDefaultClassID,
_Outptr_result_maybenull_ LPCLSID *lplpClsidExclude,
_Out_opt_ UINT *lpcClsidExclude) PURE;
STDMETHOD(ConvertObject)(THIS_
_In_ DWORD dwObject,
_In_ REFCLSID clsidNew) PURE;
STDMETHOD(GetViewInfo)(THIS_
_In_ DWORD dwObject,
_In_opt_ HGLOBAL *phMetaPict,
_In_opt_ DWORD *pdvAspect,
_In_opt_ INT *pnCurrentScale) PURE;
STDMETHOD(SetViewInfo)(THIS_
_In_ DWORD dwObject,
_In_ HGLOBAL hMetaPict,
_In_ DWORD dvAspect,
_In_ INT nCurrentScale,
_In_ BOOL bRelativeToOrig) PURE;
};
#undef INTERFACE
@ -905,18 +1003,40 @@ DECLARE_INTERFACE_(IOleUIObjInfoA,IUnknown)
DECLARE_INTERFACE_(IOleUIObjInfoW,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(HRESULT,QueryInterface)(THIS_
_In_ REFIID riid,
_Outptr_ void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IOleUIObjInfoW methods ***/
STDMETHOD(GetObjectInfo)(THIS_ DWORD dwObject, DWORD *lpdwObjSize, LPWSTR *lplpszLabel,
LPWSTR *lplpszType, LPWSTR *lplpszShortType, LPWSTR *lplpszLocation) PURE;
STDMETHOD(GetConvertInfo)(THIS_ DWORD dwObject, CLSID *lpClassID, WORD *lpwFormat,
CLSID *lpConvertDefaultClassID, LPCLSID *lplpClsidExclude, UINT *lpcClsidExclude) PURE;
STDMETHOD(ConvertObject)(THIS_ DWORD dwObject, REFCLSID clsidNew) PURE;
STDMETHOD(GetViewInfo)(THIS_ DWORD dwObject, HGLOBAL *phMetaPict, DWORD *pdvAspect, INT *pnCurrentScale) PURE;
STDMETHOD(SetViewInfo)(THIS_ DWORD dwObject, HGLOBAL hMetaPict, DWORD dvAspect,
INT nCurrentScale, BOOL bRelativeToOrig) PURE;
STDMETHOD(GetObjectInfo)(THIS_
_In_ DWORD dwObject,
_Out_ DWORD *lpdwObjSize,
_Outptr_opt_result_maybenull_ LPWSTR *lplpszLabel,
_Outptr_opt_result_maybenull_ LPWSTR *lplpszType,
_Outptr_opt_result_maybenull_ LPWSTR *lplpszShortType,
_Outptr_opt_result_maybenull_ LPWSTR *lplpszLocation) PURE;
STDMETHOD(GetConvertInfo)(THIS_
_In_ DWORD dwObject,
_Out_ CLSID *lpClassID,
_Out_ WORD *lpwFormat,
_Out_ CLSID *lpConvertDefaultClassID,
_Outptr_result_maybenull_ LPCLSID *lplpClsidExclude,
_Out_opt_ UINT *lpcClsidExclude) PURE;
STDMETHOD(ConvertObject)(THIS_
_In_ DWORD dwObject,
_In_ REFCLSID clsidNew) PURE;
STDMETHOD(GetViewInfo)(THIS_
_In_ DWORD dwObject,
_In_opt_ HGLOBAL *phMetaPict,
_In_opt_ DWORD *pdvAspect,
_In_opt_ INT *pnCurrentScale) PURE;
STDMETHOD(SetViewInfo)(THIS_
_In_ DWORD dwObject,
_In_ HGLOBAL hMetaPict,
_In_ DWORD dvAspect,
_In_ INT nCurrentScale,
_In_ BOOL bRelativeToOrig) PURE;
};
#undef INTERFACE
@ -937,37 +1057,76 @@ DECL_WINELIB_TYPE_AW(LPOLEUIOBJINFO)
#define IOleUIObjInfo_SetViewInfo(p,a,b,c,d,e) (p)->lpVtbl->SetViewInfo(p,a,b,c,d,e)
#endif
UINT WINAPI OleUIInsertObjectW(LPOLEUIINSERTOBJECTW);
UINT WINAPI OleUIInsertObjectA(LPOLEUIINSERTOBJECTA);
UINT WINAPI OleUIInsertObjectW(_In_ LPOLEUIINSERTOBJECTW);
UINT WINAPI OleUIInsertObjectA(_In_ LPOLEUIINSERTOBJECTA);
#define OleUIInsertObject WINELIB_NAME_AW(OleUIInsertObject)
UINT WINAPI OleUIConvertA(LPOLEUICONVERTA);
UINT WINAPI OleUIConvertW(LPOLEUICONVERTW);
UINT WINAPI OleUIConvertA(_In_ LPOLEUICONVERTA);
UINT WINAPI OleUIConvertW(_In_ LPOLEUICONVERTW);
#define OleUIConvert WINELIB_NAME_AW(OleUIConvert)
UINT WINAPI OleUIChangeIconA(LPOLEUICHANGEICONA);
UINT WINAPI OleUIChangeIconW(LPOLEUICHANGEICONW);
UINT WINAPI OleUIChangeIconA(_In_ LPOLEUICHANGEICONA);
UINT WINAPI OleUIChangeIconW(_In_ LPOLEUICHANGEICONW);
#define OleUIChangeIcon WINELIB_NAME_AW(OleUIChangeIcon)
UINT WINAPI OleUIBusyA(LPOLEUIBUSYA);
UINT WINAPI OleUIBusyW(LPOLEUIBUSYW);
UINT WINAPI OleUIBusyA(_In_ LPOLEUIBUSYA);
UINT WINAPI OleUIBusyW(_In_ LPOLEUIBUSYW);
#define OleUIBusy WINELIB_NAME_AW(OleUIBusy)
UINT WINAPI OleUIObjectPropertiesA(LPOLEUIOBJECTPROPSA);
UINT WINAPI OleUIObjectPropertiesW(LPOLEUIOBJECTPROPSW);
UINT WINAPI OleUIObjectPropertiesA(_In_ LPOLEUIOBJECTPROPSA);
UINT WINAPI OleUIObjectPropertiesW(_In_ LPOLEUIOBJECTPROPSW);
#define OleUIObjectProperties WINELIB_NAME_AW(OleUIObjectProperties)
UINT WINAPI OleUIChangeSourceW(LPOLEUICHANGESOURCEW);
UINT WINAPI OleUIChangeSourceA(LPOLEUICHANGESOURCEA);
UINT WINAPI OleUIChangeSourceW(_In_ LPOLEUICHANGESOURCEW);
UINT WINAPI OleUIChangeSourceA(_In_ LPOLEUICHANGESOURCEA);
#define OleUIChangeSource WINELIB_NAME_AW(OleUIChangeSource)
UINT WINAPI OleUIEditLinksA(LPOLEUIEDITLINKSA lpOleUIEditLinks);
UINT WINAPI OleUIEditLinksW(LPOLEUIEDITLINKSW lpOleUIEditLinks);
UINT WINAPI OleUIEditLinksA(_In_ LPOLEUIEDITLINKSA lpOleUIEditLinks);
UINT WINAPI OleUIEditLinksW(_In_ LPOLEUIEDITLINKSW lpOleUIEditLinks);
#define OleUIEditLinks WINELIB_NAME_AW(OleUIEditLinks)
BOOL WINAPI OleUIUpdateLinksA(LPOLEUILINKCONTAINERA lpOleUILinkCntr, HWND hwndParent, LPSTR lpszTitle, INT cLinks);
BOOL WINAPI OleUIUpdateLinksW(LPOLEUILINKCONTAINERW lpOleUILinkCntr, HWND hwndParent, LPWSTR lpszTitle, INT cLinks);
#define OleUIUpdateLinks WINELIB_NAME_AW(OleUIUpdateLinks)
BOOL WINAPI OleUIAddVerbMenuA(LPOLEOBJECT lpOleObj, LPCSTR lpszShortType, HMENU hMenu, UINT uPos, UINT uIDVerbMin, UINT uIDVerbMax,
BOOL bAddConvert, UINT idConvert, HMENU *lphMenu);
BOOL WINAPI OleUIAddVerbMenuW(LPOLEOBJECT lpOleObj, LPCWSTR lpszShortType, HMENU hMenu, UINT uPos, UINT uIDVerbMin, UINT uIDVerbMax,
BOOL bAddConvert, UINT idConvert, HMENU *lphMenu);
#define OleUIAddVerbMenu WINELIB_NAME_AW(OleUIAddVerbMenu)
UINT WINAPI OleUIPasteSpecialA(LPOLEUIPASTESPECIALA lpOleUIPasteSpecial);
UINT WINAPI OleUIPasteSpecialW(LPOLEUIPASTESPECIALW lpOleUIPasteSpecial);
BOOL
WINAPI
OleUIUpdateLinksA(
_In_ LPOLEUILINKCONTAINERA lpOleUILinkCntr,
_In_ HWND hwndParent,
_In_ LPSTR lpszTitle,
_In_ INT cLinks);
BOOL
WINAPI
OleUIUpdateLinksW(
_In_ LPOLEUILINKCONTAINERW lpOleUILinkCntr,
_In_ HWND hwndParent,
_In_ LPWSTR lpszTitle,
_In_ INT cLinks);
#define OleUIUpdateLinks WINELIB_NAME_AW(OleUIUpdateLinks)
BOOL
WINAPI
OleUIAddVerbMenuA(
_In_opt_ LPOLEOBJECT lpOleObj,
_In_opt_ LPCSTR lpszShortType,
_In_ HMENU hMenu,
_In_ UINT uPos,
_In_ UINT uIDVerbMin,
_In_ UINT uIDVerbMax,
_In_ BOOL bAddConvert,
_In_ UINT idConvert,
_Out_ HMENU *lphMenu);
BOOL
WINAPI
OleUIAddVerbMenuW(
_In_opt_ LPOLEOBJECT lpOleObj,
_In_opt_ LPCWSTR lpszShortType,
_In_ HMENU hMenu,
_In_ UINT uPos,
_In_ UINT uIDVerbMin,
_In_ UINT uIDVerbMax,
_In_ BOOL bAddConvert,
_In_ UINT idConvert,
_Out_ HMENU *lphMenu);
#define OleUIAddVerbMenu WINELIB_NAME_AW(OleUIAddVerbMenu)
UINT WINAPI OleUIPasteSpecialA(_In_ LPOLEUIPASTESPECIALA lpOleUIPasteSpecial);
UINT WINAPI OleUIPasteSpecialW(_In_ LPOLEUIPASTESPECIALW lpOleUIPasteSpecial);
#define OleUIPasteSpecial WINELIB_NAME_AW(OleUIPasteSpecial)
INT __cdecl OleUIPromptUserA(INT,HWND, ...);
INT __cdecl OleUIPromptUserW(INT,HWND, ...);

View file

@ -704,7 +704,7 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes, _SAL_default};
#define _Inout_updates_bytes_to_opt_(size,count) _SAL2_NAME(_Inout_updates_bytes_to_opt_) _Group_(_Out_writes_bytes_to_opt_(size,count) [SA_Pre(Valid=SA_Yes)] [SA_Pre(ValidBytes="\n" _SA_SPECSTRIZE(count))])
#define _Inout_updates_opt_(size) _SAL2_NAME(_Inout_updates_opt_) _Group_(_Pre_opt_cap_(size) [SA_Pre(Valid=SA_Yes)] [SA_Post(Valid=SA_Yes)])
#define _Inout_updates_opt_z_(size) _SAL2_NAME(_Inout_updates_opt_z_) _Group_(_Pre_opt_cap_(size) [SA_Pre(Valid=SA_Yes)] [SA_Post(Valid=SA_Yes)] [SA_Pre(NullTerminated=SA_Yes)] [SA_Post(NullTerminated=SA_Yes)])
//#define _Inout_updates_to_(size,count)
#define _Inout_updates_to_(size,count) _SAL2_NAME(_Inout_updates_to_) _Group_(_Out_writes_to_(size,count) [SA_Pre(Valid=SA_Yes)] [SA_Pre(ValidElements="\n" _SA_SPECSTRIZE(count))])
//#define _Inout_updates_to_opt_(size,count)
#define _Inout_updates_z_(size) _SAL2_NAME(_Inout_updates_z_) _Group_(_Pre_cap_(size) [SA_Pre(Valid=SA_Yes)] [SA_Post(Valid=SA_Yes)] [SA_Pre(NullTerminated=SA_Yes)] [SA_Post(NullTerminated=SA_Yes)])
#define _Inout_z_ _SAL2_NAME(_Inout_z_) _Group_(_Prepost_z_)
@ -869,7 +869,7 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes, _SAL_default};
#define _Post_maybenull_ _SAL2_NAME(_Post_maybenull_) _Group_([SA_Post(Null=SA_Maybe)])
#define _Post_maybez_ _SAL11_NAME(_Post_maybez_) _Group_([SA_Post(NullTerminated=SA_Maybe)])
#define _Post_notnull_ _SAL2_NAME(_Post_notnull_) _Group_([SA_Post(Null=SA_No)])
//#define _Post_null_
#define _Post_null_ _SAL2_NAME(_Post_null_) _Group_([SA_Post(Null=SA_Yes)])
#define _Post_ptr_invalid_ _SAL2_NAME(_Post_ptr_invalid_) _Group_([SA_Post(Valid=SA_No)])
#define _Post_readable_byte_size_(size) _SAL2_NAME(_Post_readable_byte_size_) _Group_([SA_Post(ValidBytes="\n" _SA_SPECSTRIZE(size))] [SA_Post(Valid=SA_Yes)])
#define _Post_readable_size_(size) _SAL2_NAME(_Post_readable_size_) _Group_([SA_Post(ValidElements="\n" _SA_SPECSTRIZE(size))] [SA_Post(Valid=SA_Yes)])
@ -1003,7 +1003,7 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes, _SAL_default};
//#define _Ret_maybenull_z_
#define _Ret_notnull_ _SAL2_NAME(_Ret_notnull_) _Group_([SA_Post(Null=SA_No)])
//#define _Ret_null_
//#define _Ret_opt_
#define _Ret_opt_ _Ret_opt_valid_
#define _Ret_opt_bytecap_(size) _SAL11_NAME(_Ret_opt_bytecap_) _Group_([SA_Post(Null=SA_Maybe,Notref=1)] [SA_Post(WritableBytes="\n" _SA_SPECSTRIZE(size))])
//#define _Ret_opt_bytecap_c_(size)
//#define _Ret_opt_bytecap_x_(size)
@ -1016,7 +1016,7 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes, _SAL_default};
//#define _Ret_opt_count_(size)
//#define _Ret_opt_count_c_(size)
//#define _Ret_opt_count_x_(size)
//#define _Ret_opt_valid_
#define _Ret_opt_valid_ _SAL11_NAME(_Ret_opt_valid_) _Group_([SA_Post(Null=SA_Maybe,Notref=1)] [SA_Post(Valid=SA_Yes)])
#define _Ret_opt_z_ _SAL11_NAME(_Ret_opt_z_) _Group_([SA_Post(Null=SA_Maybe,NullTerminated=SA_Yes)] [SA_Post(Valid=SA_Yes)] )
//#define _Ret_opt_z_bytecap_(size)
//#define _Ret_opt_z_bytecount_(size)
@ -1030,7 +1030,7 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes, _SAL_default};
//#define _Ret_writes_bytes_to_(size,count)
//#define _Ret_writes_bytes_to_maybenull_(size,count)
//#define _Ret_writes_maybenull_(size)
//#define _Ret_writes_maybenull_z_(size)
#define _Ret_writes_maybenull_z_(size) _SAL2_NAME(_Ret_writes_maybenull_z_) _Group_([SA_Post(Null=SA_Maybe,ValidElements="\n" _SA_SPECSTRIZE(size),NullTerminated=SA_Yes)] [SA_Post(Valid=SA_Yes)])
//#define _Ret_writes_to_(size,count)
//#define _Ret_writes_to_maybenull_(size,count)
//#define _Ret_writes_z_(size)

View file

@ -369,46 +369,223 @@ typedef struct _SHNAMEMAPPINGW {
#define SHGNLI_NOUNIQUE 0x04
#define SHGNLI_NOLNK 0x08
BOOL WINAPI SHGetNewLinkInfoA(LPCSTR,LPCSTR,LPSTR,BOOL*,UINT);
BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR,LPCWSTR,LPWSTR,BOOL*,UINT);
LPWSTR * WINAPI CommandLineToArgvW(_In_ LPCWSTR, _Out_ int*);
void WINAPI DragAcceptFiles(_In_ HWND, _In_ BOOL);
void WINAPI DragFinish(_In_ HDROP);
LPWSTR * WINAPI CommandLineToArgvW(LPCWSTR,int*);
void WINAPI DragAcceptFiles(HWND,BOOL);
void WINAPI DragFinish(HDROP);
UINT WINAPI DragQueryFileA(HDROP,UINT,LPSTR,UINT);
UINT WINAPI DragQueryFileW(HDROP,UINT,LPWSTR,UINT);
BOOL WINAPI DragQueryPoint(HDROP,LPPOINT);
HICON WINAPI ExtractAssociatedIconA(HINSTANCE,LPSTR,PWORD);
HICON WINAPI ExtractAssociatedIconW(HINSTANCE,LPWSTR,PWORD);
HICON WINAPI ExtractIconA(HINSTANCE,LPCSTR,UINT);
HICON WINAPI ExtractIconW(HINSTANCE,LPCWSTR,UINT);
UINT WINAPI ExtractIconExA(LPCSTR,int,HICON*,HICON*,UINT);
UINT WINAPI ExtractIconExW(LPCWSTR,int,HICON*,HICON*,UINT);
HINSTANCE WINAPI FindExecutableA(LPCSTR,LPCSTR,LPSTR);
HINSTANCE WINAPI FindExecutableW(LPCWSTR,LPCWSTR,LPWSTR);
UINT_PTR WINAPI SHAppBarMessage(DWORD,PAPPBARDATA);
BOOL WINAPI Shell_NotifyIconA(DWORD,PNOTIFYICONDATAA);
BOOL WINAPI Shell_NotifyIconW(DWORD,PNOTIFYICONDATAW);
int WINAPI ShellAboutA(HWND,LPCSTR,LPCSTR,HICON);
int WINAPI ShellAboutW(HWND,LPCWSTR,LPCWSTR,HICON);
int WINAPI ShellMessageBoxA(HINSTANCE,HWND,LPCSTR,LPCSTR,UINT,...);
int WINAPI ShellMessageBoxW(HINSTANCE,HWND,LPCWSTR,LPCWSTR,UINT,...);
HINSTANCE WINAPI ShellExecuteA(HWND,LPCSTR,LPCSTR,LPCSTR,LPCSTR,INT);
HINSTANCE WINAPI ShellExecuteW(HWND,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,INT);
BOOL WINAPI ShellExecuteExA(LPSHELLEXECUTEINFOA);
BOOL WINAPI ShellExecuteExW(LPSHELLEXECUTEINFOW);
int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA);
int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW);
void WINAPI SHFreeNameMappings(HANDLE);
DWORD_PTR WINAPI SHGetFileInfoA(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT);
DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR,DWORD,SHFILEINFOW*,UINT,UINT);
BOOL WINAPI SHGetNewLinkInfoA(LPCSTR,LPCSTR,LPSTR,BOOL*,UINT);
BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR,LPCWSTR,LPWSTR,BOOL*,UINT);
HRESULT WINAPI SHQueryRecycleBinA(LPCSTR, LPSHQUERYRBINFO);
HRESULT WINAPI SHQueryRecycleBinW(LPCWSTR, LPSHQUERYRBINFO);
HRESULT WINAPI SHEmptyRecycleBinA(HWND,LPCSTR,DWORD);
HRESULT WINAPI SHEmptyRecycleBinW(HWND,LPCWSTR,DWORD);
BOOL WINAPI SHCreateProcessAsUserW(PSHCREATEPROCESSINFOW);
_Success_(return != 0)
UINT
WINAPI
DragQueryFileA(
_In_ HDROP hDrop,
_In_ UINT iFile,
_Out_writes_opt_(cch) LPSTR lpszFile,
_In_ UINT cch);
_Success_(return != 0)
UINT
WINAPI
DragQueryFileW(
_In_ HDROP hDrop,
_In_ UINT iFile,
_Out_writes_opt_(cch) LPWSTR lpszFile,
_In_ UINT cch);
BOOL WINAPI DragQueryPoint(_In_ HDROP, _Out_ LPPOINT);
HICON
WINAPI
ExtractAssociatedIconA(
_Reserved_ HINSTANCE hInst,
_Inout_updates_(128) LPSTR pszIconPath,
_Inout_ WORD *piIcon);
HICON
WINAPI
ExtractAssociatedIconW(
_Reserved_ HINSTANCE hInst,
_Inout_updates_(128) LPWSTR pszIconPath,
_Inout_ WORD *piIcon);
HICON
WINAPI
ExtractIconA(
_Reserved_ HINSTANCE hInst,
_In_ LPCSTR pszExeFileName,
UINT nIconIndex);
HICON
WINAPI
ExtractIconW(
_Reserved_ HINSTANCE hInst,
_In_ LPCWSTR pszExeFileName,
UINT nIconIndex);
UINT
WINAPI
ExtractIconExA(
_In_ LPCSTR lpszFile,
_In_ int nIconIndex,
_Out_writes_opt_(nIcons) HICON *phiconLarge,
_Out_writes_opt_(nIcons) HICON *phiconSmall,
_In_ UINT nIcons);
UINT
WINAPI
ExtractIconExW(
_In_ LPCWSTR lpszFile,
_In_ int nIconIndex,
_Out_writes_opt_(nIcons) HICON *phiconLarge,
_Out_writes_opt_(nIcons) HICON *phiconSmall,
_In_ UINT nIcons);
_Success_(return > 32)
HINSTANCE
WINAPI
FindExecutableA(
_In_ LPCSTR lpFile,
_In_opt_ LPCSTR lpDirectory,
_Out_writes_(MAX_PATH) LPSTR lpResult);
_Success_(return > 32)
HINSTANCE
WINAPI
FindExecutableW(
_In_ LPCWSTR lpFile,
_In_opt_ LPCWSTR lpDirectory,
_Out_writes_(MAX_PATH) LPWSTR lpResult);
UINT_PTR WINAPI SHAppBarMessage(_In_ DWORD, _Inout_ PAPPBARDATA);
BOOL WINAPI Shell_NotifyIconA(_In_ DWORD, _In_ PNOTIFYICONDATAA);
BOOL WINAPI Shell_NotifyIconW(_In_ DWORD, _In_ PNOTIFYICONDATAW);
int
WINAPI
ShellAboutA(
_In_opt_ HWND hWnd,
_In_ LPCSTR szApp,
_In_opt_ LPCSTR szOtherStuff,
_In_opt_ HICON hIcon);
int
WINAPI
ShellAboutW(
_In_opt_ HWND hWnd,
_In_ LPCWSTR szApp,
_In_opt_ LPCWSTR szOtherStuff,
_In_opt_ HICON hIcon);
int
WINAPI
ShellMessageBoxA(
_In_opt_ HINSTANCE hAppInst,
_In_opt_ HWND hWnd,
_In_ LPCSTR lpcText,
_In_opt_ LPCSTR lpcTitle,
_In_ UINT fuStyle,
...);
int
WINAPI
ShellMessageBoxW(
_In_opt_ HINSTANCE hAppInst,
_In_opt_ HWND hWnd,
_In_ LPCWSTR lpcText,
_In_opt_ LPCWSTR lpcTitle,
_In_ UINT fuStyle,
...);
HINSTANCE
WINAPI
ShellExecuteA(
_In_opt_ HWND hwnd,
_In_opt_ LPCSTR lpOperation,
_In_ LPCSTR lpFile,
_In_opt_ LPCSTR lpParameters,
_In_opt_ LPCSTR lpDirectory,
_In_ INT nShowCmd);
HINSTANCE
WINAPI
ShellExecuteW(
_In_opt_ HWND hwnd,
_In_opt_ LPCWSTR lpOperation,
_In_ LPCWSTR lpFile,
_In_opt_ LPCWSTR lpParameters,
_In_opt_ LPCWSTR lpDirectory,
_In_ INT nShowCmd);
BOOL WINAPI ShellExecuteExA(_Inout_ LPSHELLEXECUTEINFOA);
BOOL WINAPI ShellExecuteExW(_Inout_ LPSHELLEXECUTEINFOW);
int WINAPI SHFileOperationA(_Inout_ LPSHFILEOPSTRUCTA);
int WINAPI SHFileOperationW(_Inout_ LPSHFILEOPSTRUCTW);
void WINAPI SHFreeNameMappings(_In_opt_ HANDLE);
DWORD_PTR
WINAPI
SHGetFileInfoA(
_In_ LPCSTR pszPath,
DWORD dwFileAttributes,
_Inout_updates_bytes_opt_(cbFileInfo) SHFILEINFOA *psfi,
UINT cbFileInfo,
UINT uFlags);
DWORD_PTR
WINAPI
SHGetFileInfoW(
_In_ LPCWSTR pszPath,
DWORD dwFileAttributes,
_Inout_updates_bytes_opt_(cbFileInfo) SHFILEINFOW *psfi,
UINT cbFileInfo,
UINT uFlags);
_Success_(return != 0)
BOOL
WINAPI
SHGetNewLinkInfoA(
_In_ LPCSTR pszLinkTo,
_In_ LPCSTR pszDir,
_Out_writes_(MAX_PATH) LPSTR pszName,
_Out_ BOOL *pfMustCopy,
_In_ UINT uFlags);
_Success_(return != 0)
BOOL
WINAPI
SHGetNewLinkInfoW(
_In_ LPCWSTR pszLinkTo,
_In_ LPCWSTR pszDir,
_Out_writes_(MAX_PATH) LPWSTR pszName,
_Out_ BOOL *pfMustCopy,
_In_ UINT uFlags);
HRESULT
WINAPI
SHQueryRecycleBinA(
_In_opt_ LPCSTR pszRootPath,
_Inout_ LPSHQUERYRBINFO pSHQueryRBInfo);
HRESULT
WINAPI
SHQueryRecycleBinW(
_In_opt_ LPCWSTR pszRootPath,
_Inout_ LPSHQUERYRBINFO pSHQueryRBInfo);
HRESULT
WINAPI
SHEmptyRecycleBinA(
_In_opt_ HWND hwnd,
_In_opt_ LPCSTR pszRootPath,
DWORD dwFlags);
HRESULT
WINAPI
SHEmptyRecycleBinW(
_In_opt_ HWND hwnd,
_In_opt_ LPCWSTR pszRootPath,
DWORD dwFlags);
BOOL WINAPI SHCreateProcessAsUserW(_Inout_ PSHCREATEPROCESSINFOW);
DWORD
WINAPI
@ -444,7 +621,6 @@ typedef LPSHNAMEMAPPINGW LPSHNAMEMAPPING;
#define ShellMessageBox ShellMessageBoxW
#define SHFileOperation SHFileOperationW
#define SHGetFileInfo SHGetFileInfoW
#define SHGetNewLinkInfo SHGetNewLinkInfoW
#define SHQueryRecycleBin SHQueryRecycleBinW
#define SHEmptyRecycleBin SHEmptyRecycleBinW
#define SHGetNewLinkInfo SHGetNewLinkInfoW
@ -472,7 +648,6 @@ typedef LPSHNAMEMAPPINGA LPSHNAMEMAPPING;
#define ShellMessageBox ShellMessageBoxA
#define SHFileOperation SHFileOperationA
#define SHGetFileInfo SHGetFileInfoA
#define SHGetNewLinkInfo SHGetNewLinkInfoA
#define SHQueryRecycleBin SHQueryRecycleBinA
#define SHEmptyRecycleBin SHEmptyRecycleBinA
#define SHGetNewLinkInfo SHGetNewLinkInfoA

View file

@ -81,46 +81,171 @@ typedef struct
DECLARE_HANDLE(HPSXA);
#endif
UINT WINAPI SHAddFromPropSheetExtArray(HPSXA,LPFNADDPROPSHEETPAGE,LPARAM);
UINT
WINAPI
SHAddFromPropSheetExtArray(
_In_ HPSXA,
_In_ LPFNADDPROPSHEETPAGE,
LPARAM);
LPVOID WINAPI SHAlloc(SIZE_T) __WINE_ALLOC_SIZE(1);
HRESULT WINAPI SHCoCreateInstance(LPCWSTR,const CLSID*,IUnknown*,REFIID,LPVOID*);
HPSXA WINAPI SHCreatePropSheetExtArray(HKEY,LPCWSTR,UINT);
HRESULT
WINAPI
SHCoCreateInstance(
_In_opt_ LPCWSTR,
_In_opt_ const CLSID*,
_In_opt_ IUnknown*,
_In_ REFIID,
_Outptr_ LPVOID*);
HPSXA WINAPI SHCreatePropSheetExtArray(_In_ HKEY, _In_opt_ LPCWSTR, UINT);
HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY,LPCWSTR,UINT,IDataObject*);
HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST,IShellFolder*,LPCITEMIDLIST,IShellItem**);
DWORD WINAPI SHCLSIDFromStringA(LPCSTR,CLSID*);
DWORD WINAPI SHCLSIDFromStringW(LPCWSTR,CLSID*);
HRESULT
WINAPI
SHCreateShellItem(
_In_opt_ LPCITEMIDLIST,
_In_opt_ IShellFolder*,
_In_ LPCITEMIDLIST,
_Outptr_ IShellItem**);
DWORD WINAPI SHCLSIDFromStringA(_In_ LPCSTR, _Out_ CLSID*);
DWORD WINAPI SHCLSIDFromStringW(_In_ LPCWSTR, _Out_ CLSID*);
#define SHCLSIDFromString WINELIB_NAME_AW(SHCLSIDFromString)
HRESULT WINAPI SHCreateStdEnumFmtEtc(UINT,const FORMATETC *,IEnumFORMATETC**);
void WINAPI SHDestroyPropSheetExtArray(HPSXA);
BOOL WINAPI SHFindFiles(LPCITEMIDLIST,LPCITEMIDLIST);
DWORD WINAPI SHFormatDrive(HWND,UINT,UINT,UINT);
void WINAPI SHFree(LPVOID);
BOOL WINAPI GetFileNameFromBrowse(HWND,LPWSTR,UINT,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR);
HRESULT WINAPI SHGetInstanceExplorer(IUnknown**);
VOID WINAPI SHSetInstanceExplorer (IUnknown*);
HRESULT WINAPI SHGetFolderPathAndSubDirA(HWND,int,HANDLE,DWORD,LPCSTR,LPSTR);
HRESULT WINAPI SHGetFolderPathAndSubDirW(HWND,int,HANDLE,DWORD,LPCWSTR,LPWSTR);
#define SHGetFolderPathAndSubDir WINELIB_NAME_AW(SHGetFolderPathAndSubDir);
BOOL WINAPI SHGetPathFromIDListA(LPCITEMIDLIST,LPSTR);
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST,LPWSTR);
#define SHGetPathFromIDList WINELIB_NAME_AW(SHGetPathFromIDList)
INT WINAPI SHHandleUpdateImage(LPCITEMIDLIST);
HRESULT WINAPI SHILCreateFromPath(LPCWSTR,LPITEMIDLIST*,DWORD*);
HRESULT
WINAPI
SHCreateStdEnumFmtEtc(
_In_ UINT cfmt,
_In_reads_(cfmt) const FORMATETC *,
_Outptr_ IEnumFORMATETC**);
void WINAPI SHDestroyPropSheetExtArray(_In_ HPSXA);
BOOL WINAPI SHFindFiles(_In_opt_ LPCITEMIDLIST, _In_opt_ LPCITEMIDLIST);
DWORD WINAPI SHFormatDrive(_In_ HWND, UINT, UINT, UINT);
void WINAPI SHFree(_In_opt_ LPVOID);
BOOL
WINAPI
GetFileNameFromBrowse(
_In_opt_ HWND,
_Inout_updates_(cchFilePath) LPWSTR,
UINT cchFilePath,
_In_opt_ LPCWSTR,
_In_ LPCWSTR,
_In_opt_ LPCWSTR,
_In_opt_ LPCWSTR);
_Check_return_ HRESULT WINAPI SHGetInstanceExplorer(_Outptr_ IUnknown**);
VOID WINAPI SHSetInstanceExplorer(_In_opt_ IUnknown*);
HRESULT
WINAPI
SHGetFolderPathAndSubDirA(
_Reserved_ HWND,
_In_ int,
_In_opt_ HANDLE,
_In_ DWORD,
_In_opt_ LPCSTR, _Out_writes_(MAX_PATH) LPSTR);
HRESULT
WINAPI
SHGetFolderPathAndSubDirW(
_Reserved_ HWND,
_In_ int,
_In_opt_ HANDLE,
_In_ DWORD,
_In_opt_ LPCWSTR,
_Out_writes_(MAX_PATH) LPWSTR);
#define SHGetFolderPathAndSubDir WINELIB_NAME_AW(SHGetFolderPathAndSubDir);
_Success_(return != 0)
BOOL
WINAPI
SHGetPathFromIDListA(
_In_ LPCITEMIDLIST,
_Out_writes_(MAX_PATH) LPSTR);
_Success_(return != 0)
BOOL
WINAPI
SHGetPathFromIDListW(
_In_ LPCITEMIDLIST,
_Out_writes_(MAX_PATH) LPWSTR);
#define SHGetPathFromIDList WINELIB_NAME_AW(SHGetPathFromIDList)
INT WINAPI SHHandleUpdateImage(_In_ LPCITEMIDLIST);
HRESULT
WINAPI
SHILCreateFromPath(
_In_ LPCWSTR,
_Outptr_ LPITEMIDLIST*,
_Inout_opt_ DWORD*);
HRESULT WINAPI SHLoadOLE(LPARAM);
HRESULT WINAPI SHParseDisplayName(LPCWSTR,IBindCtx*,LPITEMIDLIST*,SFGAOF,SFGAOF*);
HRESULT WINAPI SHPathPrepareForWriteA(HWND,IUnknown*,LPCSTR,DWORD);
HRESULT WINAPI SHPathPrepareForWriteW(HWND,IUnknown*,LPCWSTR,DWORD);
#define SHPathPrepareForWrite WINELIB_NAME_AW(SHPathPrepareForWrite);
UINT WINAPI SHReplaceFromPropSheetExtArray(HPSXA,UINT,LPFNADDPROPSHEETPAGE,LPARAM);
HRESULT
WINAPI
SHParseDisplayName(
_In_ LPCWSTR,
_In_opt_ IBindCtx*,
_Outptr_ LPITEMIDLIST*,
_In_ SFGAOF,
_Out_opt_ SFGAOF*);
HRESULT
WINAPI
SHPathPrepareForWriteA(
_In_opt_ HWND,
_In_opt_ IUnknown*,
_In_ LPCSTR, DWORD);
HRESULT
WINAPI
SHPathPrepareForWriteW(
_In_opt_ HWND,
_In_opt_ IUnknown*,
_In_ LPCWSTR, DWORD);
#define SHPathPrepareForWrite WINELIB_NAME_AW(SHPathPrepareForWrite);
UINT
WINAPI
SHReplaceFromPropSheetExtArray(
_In_ HPSXA,
UINT,
_In_ LPFNADDPROPSHEETPAGE,
LPARAM);
LPITEMIDLIST WINAPI SHSimpleIDListFromPath(LPCWSTR);
int WINAPI SHMapPIDLToSystemImageListIndex(IShellFolder*,LPCITEMIDLIST,int*);
int
WINAPI
SHMapPIDLToSystemImageListIndex(
_In_ IShellFolder*,
_In_ LPCITEMIDLIST,
_Out_opt_ int*);
HRESULT WINAPI SHStartNetConnectionDialog(HWND,LPCSTR,DWORD);
VOID WINAPI SHUpdateImageA(LPCSTR,INT,UINT,INT);
VOID WINAPI SHUpdateImageW(LPCWSTR,INT,UINT,INT);
INT WINAPI PickIconDlg(HWND,LPWSTR,UINT,int *);
VOID WINAPI SHUpdateImageA(_In_ LPCSTR, INT, UINT, INT);
VOID WINAPI SHUpdateImageW(_In_ LPCWSTR, INT, UINT, INT);
INT
WINAPI
PickIconDlg(
_In_opt_ HWND,
_Inout_updates_(cchIconPath) LPWSTR,
UINT cchIconPath,
_Inout_opt_ int *);
#define SHUpdateImage WINELIB_NAME_AW(SHUpdateImage)
int WINAPI RestartDialog(HWND,LPCWSTR,DWORD);
int WINAPI RestartDialogEx(HWND,LPCWSTR,DWORD,DWORD);
int WINAPI RestartDialog(_In_opt_ HWND, _In_opt_ LPCWSTR, DWORD);
int WINAPI RestartDialogEx(_In_opt_ HWND, _In_opt_ LPCWSTR, DWORD, DWORD);
BOOL WINAPI IsUserAnAdmin(void);
#define SHFMT_ERROR 0xFFFFFFFFL /* Error on last format, drive may be formattable */
@ -146,7 +271,13 @@ BOOL WINAPI IsUserAnAdmin(void);
#define SHOP_FILEPATH 0x02
#define SHOP_VOLUMEGUID 0x04
BOOL WINAPI SHObjectProperties(HWND,DWORD,LPCWSTR,LPCWSTR);
BOOL
WINAPI
SHObjectProperties(
_In_opt_ HWND,
_In_ DWORD,
_In_ LPCWSTR,
_In_opt_ LPCWSTR);
#define PCS_FATAL 0x80000000
#define PCS_REPLACEDCHAR 0x00000001
@ -154,7 +285,7 @@ BOOL WINAPI SHObjectProperties(HWND,DWORD,LPCWSTR,LPCWSTR);
#define PCS_TRUNCATED 0x00000004
#define PCS_PATHTOOLONG 0x00000008
int WINAPI PathCleanupSpec(LPCWSTR,LPWSTR);
int WINAPI PathCleanupSpec(_In_opt_ LPCWSTR, _Inout_ LPWSTR);
/*****************************************************************************
* IContextMenu interface
@ -394,7 +525,7 @@ DECLARE_INTERFACE_(IShellDetails, IUnknown)
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IShellDetails methods ***/
STDMETHOD(GetDetailsOf)(THIS_ PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *pDetails) PURE;
STDMETHOD(GetDetailsOf)(THIS_ _In_opt_ PCUITEMID_CHILD pidl, UINT iColumn, _Out_ SHELLDETAILS *pDetails) PURE;
STDMETHOD(ColumnClick)(THIS_ UINT iColumn) PURE;
};
#undef INTERFACE
@ -418,8 +549,8 @@ DECLARE_INTERFACE_(IQueryInfo,IUnknown)
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IQueryInfo methods ***/
STDMETHOD(GetInfoTip)(THIS_ DWORD dwFlags, WCHAR** lppTips) PURE;
STDMETHOD(GetInfoFlags)(THIS_ DWORD* lpFlags) PURE;
STDMETHOD(GetInfoTip)(THIS_ DWORD dwFlags, _Outptr_ WCHAR** lppTips) PURE;
STDMETHOD(GetInfoFlags)(THIS_ _Out_ DWORD* lpFlags) PURE;
};
#undef INTERFACE
@ -490,8 +621,8 @@ DECLARE_INTERFACE_(IObjMgr,IUnknown)
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IObjMgr methods ***/
STDMETHOD(Append)(THIS_ LPUNKNOWN punk) PURE;
STDMETHOD(Remove)(THIS_ LPUNKNOWN punk) PURE;
STDMETHOD(Append)(THIS_ _In_ LPUNKNOWN punk) PURE;
STDMETHOD(Remove)(THIS_ _In_ LPUNKNOWN punk) PURE;
};
#undef INTERFACE
@ -514,7 +645,7 @@ DECLARE_INTERFACE_(IACList,IUnknown)
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IACList methods ***/
STDMETHOD(Expand)(THIS_ LPCOLESTR str) PURE;
STDMETHOD(Expand)(THIS_ _In_ LPCOLESTR str) PURE;
};
#undef INTERFACE
@ -539,7 +670,7 @@ DECLARE_INTERFACE_(IACList2,IACList)
STDMETHOD(Expand)(THIS_ LPCOLESTR str) PURE;
/*** IACList2 methods ***/
STDMETHOD(SetOptions)(THIS_ DWORD dwFlag) PURE;
STDMETHOD(GetOptions)(THIS_ DWORD* pdwFlag) PURE;
STDMETHOD(GetOptions)(THIS_ _Out_ DWORD* pdwFlag) PURE;
};
#undef INTERFACE
@ -605,33 +736,33 @@ DECLARE_INTERFACE_(IShellFolderView, IUnknown)
/*** IShellFolderView methods ***/
STDMETHOD(Rearrange) (THIS_ LPARAM lParamSort) PURE;
STDMETHOD(GetArrangeParam) (THIS_ LPARAM *plParamSort) PURE;
STDMETHOD(GetArrangeParam) (THIS_ _Out_ LPARAM *plParamSort) PURE;
STDMETHOD(ArrangeGrid) (THIS) PURE;
STDMETHOD(AutoArrange) (THIS) PURE;
STDMETHOD(GetAutoArrange) (THIS) PURE;
STDMETHOD(AddObject) (THIS_ PITEMID_CHILD pidl, UINT *puItem) PURE;
STDMETHOD(GetObject) (THIS_ PITEMID_CHILD *ppidl, UINT uItem) PURE;
STDMETHOD(RemoveObject) (THIS_ PITEMID_CHILD pidl, UINT *puItem) PURE;
STDMETHOD(GetObjectCount) (THIS_ UINT *puCount) PURE;
STDMETHOD(AddObject) (THIS_ _In_ PITEMID_CHILD pidl, _Out_ UINT *puItem) PURE;
STDMETHOD(GetObject) (THIS_ _Outptr_ PITEMID_CHILD *ppidl, UINT uItem) PURE;
STDMETHOD(RemoveObject) (THIS_ _In_opt_ PITEMID_CHILD pidl, _Out_ UINT *puItem) PURE;
STDMETHOD(GetObjectCount) (THIS_ _Out_ UINT *puCount) PURE;
STDMETHOD(SetObjectCount) (THIS_ UINT uCount, UINT dwFlags) PURE;
STDMETHOD(UpdateObject) (THIS_ PITEMID_CHILD pidlOld, PITEMID_CHILD pidlNew, UINT *puItem) PURE;
STDMETHOD(RefreshObject) (THIS_ PITEMID_CHILD pidl, UINT *puItem) PURE;
STDMETHOD(UpdateObject) (THIS_ _In_ PITEMID_CHILD pidlOld, _In_ PITEMID_CHILD pidlNew, _Out_ UINT *puItem) PURE;
STDMETHOD(RefreshObject) (THIS_ _In_ PITEMID_CHILD pidl, _Out_ UINT *puItem) PURE;
STDMETHOD(SetRedraw) (THIS_ BOOL bRedraw) PURE;
STDMETHOD(GetSelectedCount) (THIS_ UINT *puSelected) PURE;
STDMETHOD(GetSelectedObjects) (THIS_ PCITEMID_CHILD **pppidl, UINT *puItems) PURE;
STDMETHOD(IsDropOnSource) (THIS_ IDropTarget *pDropTarget) PURE;
STDMETHOD(GetDragPoint) (THIS_ POINT *ppt) PURE;
STDMETHOD(GetDropPoint) (THIS_ POINT *ppt) PURE;
STDMETHOD(MoveIcons) (THIS_ IDataObject *pDataObject) PURE;
STDMETHOD(SetItemPos) (THIS_ PCUITEMID_CHILD pidl, POINT *ppt) PURE;
STDMETHOD(IsBkDropTarget) (THIS_ IDropTarget *pDropTarget) PURE;
STDMETHOD(GetSelectedCount) (THIS_ _Out_ UINT *puSelected) PURE;
STDMETHOD(GetSelectedObjects) (THIS_ _Outptr_result_buffer_(*puItems) PCITEMID_CHILD **pppidl, _Out_ UINT *puItems) PURE;
STDMETHOD(IsDropOnSource) (THIS_ _In_opt_ IDropTarget *pDropTarget) PURE;
STDMETHOD(GetDragPoint) (THIS_ _Out_ POINT *ppt) PURE;
STDMETHOD(GetDropPoint) (THIS_ _Out_ POINT *ppt) PURE;
STDMETHOD(MoveIcons) (THIS_ _In_ IDataObject *pDataObject) PURE;
STDMETHOD(SetItemPos) (THIS_ _In_ PCUITEMID_CHILD pidl, _In_ POINT *ppt) PURE;
STDMETHOD(IsBkDropTarget) (THIS_ _In_opt_ IDropTarget *pDropTarget) PURE;
STDMETHOD(SetClipboard) (THIS_ BOOL bMove) PURE;
STDMETHOD(SetPoints) (THIS_ IDataObject *pDataObject) PURE;
STDMETHOD(GetItemSpacing) (THIS_ ITEMSPACING *pSpacing) PURE;
STDMETHOD(SetCallback) (THIS_ IShellFolderViewCB* pNewCB, IShellFolderViewCB** ppOldCB) PURE;
STDMETHOD(SetPoints) (THIS_ _In_ IDataObject *pDataObject) PURE;
STDMETHOD(GetItemSpacing) (THIS_ _Out_ ITEMSPACING *pSpacing) PURE;
STDMETHOD(SetCallback) (THIS_ _In_opt_ IShellFolderViewCB* pNewCB, _Outptr_result_maybenull_ IShellFolderViewCB** ppOldCB) PURE;
STDMETHOD(Select) ( THIS_ UINT dwFlags ) PURE;
STDMETHOD(QuerySupport) (THIS_ UINT * pdwSupport ) PURE;
STDMETHOD(SetAutomationObject)(THIS_ IDispatch* pdisp) PURE;
STDMETHOD(QuerySupport) (THIS_ _Inout_ UINT * pdwSupport) PURE;
STDMETHOD(SetAutomationObject)(THIS_ _In_opt_ IDispatch* pdisp) PURE;
};
#undef INTERFACE
@ -693,16 +824,16 @@ DECLARE_INTERFACE_(IProgressDialog,IUnknown)
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IProgressDialog methods ***/
STDMETHOD(StartProgressDialog)(THIS_ HWND hwndParent, IUnknown *punkEnableModeless, DWORD dwFlags, LPCVOID reserved) PURE;
STDMETHOD(StartProgressDialog)(THIS_ _In_opt_ HWND hwndParent, _In_opt_ IUnknown *punkEnableModeless, DWORD dwFlags, _Reserved_ LPCVOID reserved) PURE;
STDMETHOD(StopProgressDialog)(THIS) PURE;
STDMETHOD(SetTitle)(THIS_ LPCWSTR pwzTitle) PURE;
STDMETHOD(SetAnimation)(THIS_ HINSTANCE hInstance, UINT uiResourceId) PURE;
STDMETHOD(SetTitle)(THIS_ _In_ LPCWSTR pwzTitle) PURE;
STDMETHOD(SetAnimation)(THIS_ _In_opt_ HINSTANCE hInstance, UINT uiResourceId) PURE;
STDMETHOD_(BOOL,HasUserCancelled)(THIS) PURE;
STDMETHOD(SetProgress)(THIS_ DWORD dwCompleted, DWORD dwTotal) PURE;
STDMETHOD(SetProgress64)(THIS_ ULONGLONG ullCompleted, ULONGLONG ullTotal) PURE;
STDMETHOD(SetLine)(THIS_ DWORD dwLineNum, LPCWSTR pwzString, BOOL bPath, LPCVOID reserved) PURE;
STDMETHOD(SetCancelMsg)(THIS_ LPCWSTR pwzCancelMsg, LPCVOID reserved) PURE;
STDMETHOD(Timer)(THIS_ DWORD dwTimerAction, LPCVOID reserved) PURE;
STDMETHOD(SetLine)(THIS_ DWORD dwLineNum, _In_ LPCWSTR pwzString, BOOL bPath, _Reserved_ LPCVOID reserved) PURE;
STDMETHOD(SetCancelMsg)(THIS_ _In_ LPCWSTR pwzCancelMsg, _Reserved_ LPCVOID reserved) PURE;
STDMETHOD(Timer)(THIS_ DWORD dwTimerAction, _Reserved_ LPCVOID reserved) PURE;
};
#undef INTERFACE
@ -737,10 +868,10 @@ DECLARE_INTERFACE_(IDeskBarClient,IOleWindow)
STDMETHOD_(HRESULT,GetWindow)(THIS_ HWND*) PURE;
STDMETHOD_(HRESULT,ContextSensitiveHelp)(THIS_ BOOL) PURE;
/*** IDeskBarClient methods ***/
STDMETHOD_(HRESULT,SetDeskBarSite)(THIS_ IUnknown*) PURE;
STDMETHOD_(HRESULT,SetDeskBarSite)(THIS_ _In_opt_ IUnknown*) PURE;
STDMETHOD_(HRESULT,SetModeDBC)(THIS_ DWORD) PURE;
STDMETHOD_(HRESULT,UIActivateDBC)(THIS_ DWORD) PURE;
STDMETHOD_(HRESULT,GetSize)(THIS_ DWORD,LPRECT) PURE;
STDMETHOD_(HRESULT,GetSize)(THIS_ DWORD, _Out_ LPRECT) PURE;
};
#undef INTERFACE
@ -775,7 +906,7 @@ DECLARE_INTERFACE_(IDeskBarClient,IOleWindow)
#define SHARD_PATHW 0x00000003L
#define SHARD_PATH WINELIB_NAME_AW(SHARD_PATH)
void WINAPI SHAddToRecentDocs(UINT,LPCVOID);
void WINAPI SHAddToRecentDocs(UINT, _In_opt_ LPCVOID);
/****************************************************************************
* SHBrowseForFolder API
@ -846,9 +977,10 @@ typedef struct tagBROWSEINFOW {
#define BFFM_SETOKTEXT (WM_USER+105)
#define BFFM_SETEXPANDED (WM_USER+106)
LPITEMIDLIST WINAPI SHBrowseForFolderA(LPBROWSEINFOA lpbi);
LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi);
#define SHBrowseForFolder WINELIB_NAME_AW(SHBrowseForFolder)
LPITEMIDLIST WINAPI SHBrowseForFolderA(_In_ LPBROWSEINFOA lpbi);
LPITEMIDLIST WINAPI SHBrowseForFolderW(_In_ LPBROWSEINFOW lpbi);
#define SHBrowseForFolder WINELIB_NAME_AW(SHBrowseForFolder)
#define BFFM_SETSTATUSTEXT WINELIB_NAME_AW(BFFM_SETSTATUSTEXT)
#define BFFM_SETSELECTION WINELIB_NAME_AW(BFFM_SETSELECTION)
#define BFFM_VALIDATEFAILED WINELIB_NAME_AW(BFFM_VALIDATEFAILED)
@ -857,13 +989,14 @@ LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi);
* SHCreateShellFolderViewEx API
*/
typedef HRESULT (CALLBACK *LPFNVIEWCALLBACK)(
IShellView* dwUser,
IShellFolder* pshf,
HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam);
typedef HRESULT
(CALLBACK *LPFNVIEWCALLBACK)(
_In_ IShellView* dwUser,
_In_ IShellFolder* pshf,
_In_ HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam);
#include <pshpack8.h>
@ -880,7 +1013,11 @@ typedef struct _CSFV
#include <poppack.h>
HRESULT WINAPI SHCreateShellFolderViewEx(LPCSFV pshfvi, IShellView **ppshv);
HRESULT
WINAPI
SHCreateShellFolderViewEx(
_In_ LPCSFV pshfvi,
_Outptr_ IShellView **ppshv);
/* SHCreateShellFolderViewEx callback messages */
#define SFVM_MERGEMENU 1
@ -952,7 +1089,11 @@ typedef struct _SFV_CREATE
#include <poppack.h>
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pscfv, IShellView **ppsv);
HRESULT
WINAPI
SHCreateShellFolderView(
_In_ const SFV_CREATE *pscfv,
_Outptr_ IShellView **ppsv);
/* Types and definitions for the SFM_* parameters */
#include <pshpack8.h>
@ -1000,10 +1141,12 @@ typedef struct _TBINFO
* SHShellFolderView_Message API
*/
LRESULT WINAPI SHShellFolderView_Message(
HWND hwndCabinet,
UINT uMessage,
LPARAM lParam);
LRESULT
WINAPI
SHShellFolderView_Message(
_In_ HWND hwndCabinet,
UINT uMessage,
LPARAM lParam);
/* SHShellFolderView_Message messages */
#define SFVM_REARRANGE 0x0001
@ -1067,16 +1210,54 @@ typedef struct _SHDESCRIPTIONID
#include <poppack.h>
HRESULT WINAPI SHGetDataFromIDListA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID pv, int cb);
HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID pv, int cb);
#define SHGetDataFromIDList WINELIB_NAME_AW(SHGetDataFromIDList)
HRESULT
WINAPI
SHGetDataFromIDListA(
_In_ LPSHELLFOLDER psf,
_In_ LPCITEMIDLIST pidl,
int nFormat,
_Out_writes_bytes_(cb) LPVOID pv,
int cb);
LPITEMIDLIST WINAPI SHCloneSpecialIDList(HWND hwnd, int csidl, BOOL fCreate);
BOOL WINAPI SHGetSpecialFolderPathA (HWND hwndOwner, LPSTR szPath, int nFolder, BOOL bCreate);
BOOL WINAPI SHGetSpecialFolderPathW (HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate);
#define SHGetSpecialFolderPath WINELIB_NAME_AW(SHGetSpecialFolderPath)
HRESULT
WINAPI
SHGetDataFromIDListW(
_In_ LPSHELLFOLDER psf,
_In_ LPCITEMIDLIST pidl,
int nFormat,
_Out_writes_bytes_(cb) LPVOID pv,
int cb);
HRESULT WINAPI SHGetMalloc(LPMALLOC *lpmal) ;
#define SHGetDataFromIDList WINELIB_NAME_AW(SHGetDataFromIDList)
LPITEMIDLIST
WINAPI
SHCloneSpecialIDList(
_Reserved_ HWND hwnd,
_In_ int csidl,
_In_ BOOL fCreate);
_Success_(return != 0)
BOOL
WINAPI
SHGetSpecialFolderPathA(
_Reserved_ HWND hwndOwner,
_Out_writes_(MAX_PATH) LPSTR szPath,
_In_ int nFolder,
_In_ BOOL bCreate);
_Success_(return != 0)
BOOL
WINAPI
SHGetSpecialFolderPathW(
_Reserved_ HWND hwndOwner,
_Out_writes_(MAX_PATH) LPWSTR szPath,
_In_ int nFolder,
_In_ BOOL bCreate);
#define SHGetSpecialFolderPath WINELIB_NAME_AW(SHGetSpecialFolderPath)
_Check_return_ HRESULT WINAPI SHGetMalloc(_Outptr_ LPMALLOC *lpmal);
/**********************************************************************
* SHGetSetSettings ()
@ -1141,7 +1322,7 @@ typedef struct
UINT :15; /* Required for proper binary layout with gcc */
} SHELLFLAGSTATE, * LPSHELLFLAGSTATE;
VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
VOID WINAPI SHGetSettings(_Out_ LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
#define SSF_SHOWALLOBJECTS 0x0001
#define SSF_SHOWEXTENSIONS 0x0002
@ -1520,28 +1701,75 @@ typedef struct _SHChangeProductKeyAsIDList {
USHORT cbZero;
} SHChangeProductKeyAsIDList, *LPSHChangeProductKeyAsIDList;
ULONG WINAPI SHChangeNotifyRegister(HWND hwnd, int fSources, LONG fEvents, UINT wMsg,
int cEntries, SHChangeNotifyEntry *pshcne);
BOOL WINAPI SHChangeNotifyDeregister(ULONG ulID);
HANDLE WINAPI SHChangeNotification_Lock(HANDLE hChangeNotification, DWORD dwProcessId,
LPITEMIDLIST **pppidl, LONG *plEvent);
BOOL WINAPI SHChangeNotification_Unlock(HANDLE hLock);
ULONG
WINAPI
SHChangeNotifyRegister(
_In_ HWND hwnd,
int fSources,
LONG fEvents,
UINT wMsg,
int cEntries,
_In_ SHChangeNotifyEntry *pshcne);
HRESULT WINAPI SHGetRealIDL(IShellFolder *psf, LPCITEMIDLIST pidlSimple, LPITEMIDLIST * ppidlReal);
BOOL WINAPI SHChangeNotifyDeregister(ULONG ulID);
HANDLE
WINAPI
SHChangeNotification_Lock(
_In_ HANDLE hChangeNotification,
DWORD dwProcessId,
_Outptr_opt_result_buffer_(2)_Outptr_opt_result_buffer_(2) LPITEMIDLIST **pppidl,
_Out_opt_ LONG *plEvent);
BOOL WINAPI SHChangeNotification_Unlock(_In_ HANDLE hLock);
HRESULT
WINAPI
SHGetRealIDL(
_In_ IShellFolder *psf,
_In_ LPCITEMIDLIST pidlSimple,
_Outptr_ LPITEMIDLIST * ppidlReal);
/****************************************************************************
* SHCreateDirectory API
*/
int WINAPI SHCreateDirectory(HWND, LPCWSTR);
int WINAPI SHCreateDirectoryExA(HWND, LPCSTR, LPSECURITY_ATTRIBUTES);
int WINAPI SHCreateDirectoryExW(HWND, LPCWSTR, LPSECURITY_ATTRIBUTES);
#define SHCreateDirectoryEx WINELIB_NAME_AW(SHCreateDirectoryEx)
int WINAPI SHCreateDirectory(_In_opt_ HWND, _In_ LPCWSTR);
int
WINAPI
SHCreateDirectoryExA(
_In_opt_ HWND,
_In_ LPCSTR,
_In_opt_ LPSECURITY_ATTRIBUTES);
int
WINAPI
SHCreateDirectoryExW(
_In_opt_ HWND,
_In_ LPCWSTR,
_In_opt_ LPSECURITY_ATTRIBUTES);
#define SHCreateDirectoryEx WINELIB_NAME_AW(SHCreateDirectoryEx)
/****************************************************************************
* SHGetSpecialFolderLocation API
*/
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, int nFolder, LPITEMIDLIST * ppidl);
HRESULT WINAPI SHGetFolderLocation(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPITEMIDLIST *ppidl);
_Check_return_
HRESULT
WINAPI
SHGetSpecialFolderLocation(
_Reserved_ HWND hwndOwner,
_In_ int nFolder,
_Outptr_ LPITEMIDLIST *ppidl);
HRESULT
WINAPI
SHGetFolderLocation(
_Reserved_ HWND hwndOwner,
_In_ int nFolder,
_In_opt_ HANDLE hToken,
_In_ DWORD dwReserved,
_Outptr_ LPITEMIDLIST *ppidl);
/****************************************************************************
* SHGetFolderPath API
@ -1551,9 +1779,25 @@ typedef enum {
SHGFP_TYPE_DEFAULT = 1
} SHGFP_TYPE;
HRESULT WINAPI SHGetFolderPathA(HWND hwnd, int nFolder, HANDLE hToken, DWORD dwFlags, LPSTR pszPath);
HRESULT WINAPI SHGetFolderPathW(HWND hwnd, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath);
#define SHGetFolderPath WINELIB_NAME_AW(SHGetFolderPath)
HRESULT
WINAPI
SHGetFolderPathA(
_Reserved_ HWND hwnd,
_In_ int nFolder,
_In_opt_ HANDLE hToken,
_In_ DWORD dwFlags,
_Out_writes_(MAX_PATH) LPSTR pszPath);
HRESULT
WINAPI
SHGetFolderPathW(
_Reserved_ HWND hwnd,
_In_ int nFolder,
_In_opt_ HANDLE hToken,
_In_ DWORD dwFlags,
_Out_writes_(MAX_PATH) LPWSTR pszPath);
#define SHGetFolderPath WINELIB_NAME_AW(SHGetFolderPath)
#define CSIDL_DESKTOP 0x0000
#define CSIDL_INTERNET 0x0001
@ -1624,21 +1868,43 @@ HRESULT WINAPI SHGetFolderPathW(HWND hwnd, int nFolder, HANDLE hToken, DWORD dwF
/****************************************************************************
* SHGetDesktopFolder API
*/
HRESULT WINAPI SHGetDesktopFolder(IShellFolder * *);
_Check_return_ HRESULT WINAPI SHGetDesktopFolder(_Outptr_ IShellFolder * *);
/****************************************************************************
* SHBindToParent API
*/
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast);
HRESULT
WINAPI
SHBindToParent(
_In_ LPCITEMIDLIST pidl,
_In_ REFIID riid,
_Outptr_ LPVOID *ppv,
_Outptr_opt_ LPCITEMIDLIST *ppidlLast);
/****************************************************************************
* SHDefExtractIcon API
*/
HRESULT WINAPI SHDefExtractIconA(LPCSTR pszIconFile, int iIndex, UINT uFlags,
HICON* phiconLarge, HICON* phiconSmall, UINT nIconSize);
HRESULT WINAPI SHDefExtractIconW(LPCWSTR pszIconFile, int iIndex, UINT uFlags,
HICON* phiconLarge, HICON* phiconSmall, UINT nIconSize);
#define SHDefExtractIcon WINELIB_NAME_AW(SHDefExtractIcon)
HRESULT
WINAPI
SHDefExtractIconA(
_In_ LPCSTR pszIconFile,
int iIndex,
UINT uFlags,
_Out_opt_ HICON* phiconLarge,
_Out_opt_ HICON* phiconSmall,
UINT nIconSize);
HRESULT
WINAPI
SHDefExtractIconW(
_In_ LPCWSTR pszIconFile,
int iIndex,
UINT uFlags,
_Out_opt_ HICON* phiconLarge,
_Out_opt_ HICON* phiconSmall,
UINT nIconSize);
#define SHDefExtractIcon WINELIB_NAME_AW(SHDefExtractIcon)
/*
* DROPFILES for CF_HDROP and CF_PRINTERS
@ -1724,8 +1990,13 @@ typedef struct {
#define CABINETSTATE_VERSION 2
BOOL WINAPI ReadCabinetState(CABINETSTATE *, int);
BOOL WINAPI WriteCabinetState(CABINETSTATE *);
BOOL
WINAPI
ReadCabinetState(
_Out_writes_bytes_(cLength) CABINETSTATE *,
int cLength);
BOOL WINAPI WriteCabinetState(_In_ CABINETSTATE *);
/****************************************************************************
* Path Manipulation Routines
@ -1747,9 +2018,24 @@ BOOL WINAPI WriteCabinetState(CABINETSTATE *);
#define PRF_FIRSTDIRDEF 0x04
#define PRF_DONTFINDLINK 0x08
VOID WINAPI PathGetShortPath(LPWSTR pszPath);
LONG WINAPI PathProcessCommand(LPCWSTR, LPWSTR, int, DWORD);
BOOL WINAPI PathYetAnotherMakeUniqueName(LPWSTR, LPCWSTR, LPCWSTR, LPCWSTR);
VOID WINAPI PathGetShortPath(_Inout_updates_(MAX_PATH) LPWSTR pszPath);
LONG
WINAPI
PathProcessCommand(
_In_ LPCWSTR,
_Out_writes_(cchDest) LPWSTR,
int cchDest,
DWORD);
_Success_(return != 0)
BOOL
WINAPI
PathYetAnotherMakeUniqueName(
_Out_writes_(MAX_PATH) LPWSTR,
_In_ LPCWSTR,
_In_opt_ LPCWSTR,
_In_opt_ LPCWSTR);
/****************************************************************************
* Drag And Drop Routines
@ -1768,11 +2054,19 @@ typedef struct
BOOL WINAPI DAD_SetDragImage(HIMAGELIST,LPPOINT);
BOOL WINAPI DAD_DragEnterEx(HWND,POINT);
BOOL WINAPI DAD_DragEnterEx2(HWND,POINT,IDataObject*);
BOOL WINAPI DAD_DragEnterEx2(_In_ HWND, POINT, _In_opt_ IDataObject*);
BOOL WINAPI DAD_DragMove(POINT);
BOOL WINAPI DAD_DragLeave(void);
BOOL WINAPI DAD_AutoScroll(HWND,AUTO_SCROLL_DATA*,const POINT*);
HRESULT WINAPI SHDoDragDrop(HWND,IDataObject*,IDropSource*,DWORD,LPDWORD);
HRESULT
WINAPI
SHDoDragDrop(
_In_opt_ HWND,
_In_ IDataObject*,
_In_opt_ IDropSource*,
_In_ DWORD,
_Out_ LPDWORD);
/****************************************************************************
* Internet shortcut properties
@ -1791,23 +2085,23 @@ HRESULT WINAPI SHDoDragDrop(HWND,IDataObject*,IDropSource*,DWORD,LPDWORD);
#define PID_IS_COMMENT 13
LPITEMIDLIST WINAPI ILAppendID(LPITEMIDLIST,LPCSHITEMID,BOOL);
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST);
LPITEMIDLIST WINAPI ILCloneFirst(LPCITEMIDLIST);
LPITEMIDLIST WINAPI ILCreateFromPathA(LPCSTR);
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR);
LPITEMIDLIST WINAPI ILAppendID(_In_opt_ LPITEMIDLIST, _In_ LPCSHITEMID, BOOL);
LPITEMIDLIST WINAPI ILClone(_In_ LPCITEMIDLIST);
LPITEMIDLIST WINAPI ILCloneFirst(_In_ LPCITEMIDLIST);
LPITEMIDLIST WINAPI ILCreateFromPathA(_In_ LPCSTR);
LPITEMIDLIST WINAPI ILCreateFromPathW(_In_ LPCWSTR);
#define ILCreateFromPath WINELIB_NAME_AW(ILCreateFromPath)
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST,LPCITEMIDLIST);
LPITEMIDLIST WINAPI ILFindChild(LPCITEMIDLIST,LPCITEMIDLIST);
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST);
void WINAPI ILFree(LPITEMIDLIST);
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST);
UINT WINAPI ILGetSize(LPCITEMIDLIST);
BOOL WINAPI ILIsEqual(LPCITEMIDLIST,LPCITEMIDLIST);
BOOL WINAPI ILIsParent(LPCITEMIDLIST,LPCITEMIDLIST,BOOL);
HRESULT WINAPI ILLoadFromStream(LPSTREAM,LPITEMIDLIST*);
BOOL WINAPI ILRemoveLastID(LPITEMIDLIST);
HRESULT WINAPI ILSaveToStream(LPSTREAM,LPCITEMIDLIST);
LPITEMIDLIST WINAPI ILCombine(_In_opt_ LPCITEMIDLIST, _In_opt_ LPCITEMIDLIST);
LPITEMIDLIST WINAPI ILFindChild(_In_ LPCITEMIDLIST, _In_ LPCITEMIDLIST);
LPITEMIDLIST WINAPI ILFindLastID(_In_ LPCITEMIDLIST);
void WINAPI ILFree(_In_opt_ LPITEMIDLIST);
LPITEMIDLIST WINAPI ILGetNext(_In_opt_ LPCITEMIDLIST);
UINT WINAPI ILGetSize(_In_opt_ LPCITEMIDLIST);
BOOL WINAPI ILIsEqual(_In_ LPCITEMIDLIST, _In_ LPCITEMIDLIST);
BOOL WINAPI ILIsParent(_In_ LPCITEMIDLIST, _In_ LPCITEMIDLIST, BOOL);
HRESULT WINAPI ILLoadFromStream(_In_ LPSTREAM, _Inout_ LPITEMIDLIST*);
BOOL WINAPI ILRemoveLastID(_Inout_opt_ LPITEMIDLIST);
HRESULT WINAPI ILSaveToStream(_In_ LPSTREAM, _In_ LPCITEMIDLIST);
#include <poppack.h>
@ -1818,7 +2112,15 @@ HRESULT WINAPI ILSaveToStream(LPSTREAM,LPCITEMIDLIST);
#define MM_SUBMENUSHAVEIDS 0x00000002L
#define MM_DONTREMOVESEPS 0x00000004L
UINT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags);
UINT
WINAPI
Shell_MergeMenus(
_In_ HMENU hmDst,
_In_ HMENU hmSrc,
UINT uInsert,
UINT uIDAdjust,
UINT uIDAdjustMax,
ULONG uFlags);
/****************************************************************************
@ -1838,12 +2140,37 @@ typedef struct
const HKEY *aKeys;
}DEFCONTEXTMENU;
HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *,REFIID,void **ppv);
HRESULT
WINAPI
SHCreateDefaultContextMenu(
_In_ const DEFCONTEXTMENU *,
_In_ REFIID,
_Outptr_ void **ppv);
typedef HRESULT
(CALLBACK * LPFNDFMCALLBACK)(
_In_opt_ IShellFolder*,
_In_opt_ HWND,
_In_opt_ IDataObject*,
UINT,
WPARAM,
LPARAM);
HRESULT
WINAPI
CDefFolderMenu_Create2(
_In_opt_ LPCITEMIDLIST,
_In_opt_ HWND,
UINT cidl,
_In_reads_opt_(cidl) LPCITEMIDLIST*,
_In_opt_ IShellFolder*,
_In_opt_ LPFNDFMCALLBACK,
UINT nKeys,
_In_reads_opt_(nKeys) const HKEY *,
_Outptr_ IContextMenu **);
typedef HRESULT (CALLBACK * LPFNDFMCALLBACK)(IShellFolder*,HWND,IDataObject*,UINT,WPARAM,LPARAM);
HRESULT WINAPI CDefFolderMenu_Create2(LPCITEMIDLIST,HWND,UINT,LPCITEMIDLIST*,IShellFolder*,LPFNDFMCALLBACK,UINT,const HKEY *,IContextMenu **);
/****************************************************************************
* SHCreateDefaultContextMenu API
* SHCreateDefaultExtractIcon API
*/
HRESULT WINAPI
@ -1855,22 +2182,22 @@ SHCreateDefaultExtractIcon(
*/
HRESULT WINAPI SHCreateDataObject(
LPCITEMIDLIST pidlFolder,
UINT cidl,
LPCITEMIDLIST* apidl,
IDataObject *pdtInner,
REFIID riid,
void **ppv);
_In_opt_ LPCITEMIDLIST pidlFolder,
_In_ UINT cidl,
_In_reads_opt_(cidl) LPCITEMIDLIST* apidl,
_In_opt_ IDataObject *pdtInner,
_In_ REFIID riid,
_Outptr_ void **ppv);
/****************************************************************************
* CIDLData_CreateFromIDArray API
*/
HRESULT WINAPI CIDLData_CreateFromIDArray(
LPCITEMIDLIST pidlFolder,
UINT cidl,
LPCITEMIDLIST* apidl,
IDataObject **ppdtobj);
_In_ LPCITEMIDLIST pidlFolder,
_In_ UINT cidl,
_In_reads_opt_(cidl) LPCITEMIDLIST* apidl,
_Outptr_ IDataObject **ppdtobj);
/****************************************************************************
* SHOpenWithDialog
@ -1896,10 +2223,11 @@ typedef struct tagOPENASINFO {
OPEN_AS_INFO_FLAGS oaifInFlags;
} OPENASINFO;
HRESULT WINAPI SHOpenWithDialog(
HWND hwndParent,
const OPENASINFO *poainfo
);
HRESULT
WINAPI
SHOpenWithDialog(
_In_opt_ HWND hwndParent,
_In_ const OPENASINFO *poainfo);
#define INTERFACE IShellIconOverlayIdentifier
@ -1909,9 +2237,9 @@ DECLARE_INTERFACE_(IShellIconOverlayIdentifier, IUnknown)
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
STDMETHOD (IsMemberOf)(THIS_ LPCWSTR pwszPath, DWORD dwAttrib) PURE;
STDMETHOD (GetOverlayInfo)(THIS_ LPWSTR pwszIconFile, int cchMax, int * pIndex, DWORD * pdwFlags) PURE;
STDMETHOD (GetPriority)(THIS_ int * pIPriority) PURE;
STDMETHOD (IsMemberOf)(THIS_ _In_ LPCWSTR pwszPath, DWORD dwAttrib) PURE;
STDMETHOD (GetOverlayInfo)(THIS_ _Out_writes_(cchMax) LPWSTR pwszIconFile, int cchMax, _Out_ int * pIndex, _Out_ DWORD * pdwFlags) PURE;
STDMETHOD (GetPriority)(THIS_ _Out_ int * pIPriority) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
@ -1959,9 +2287,9 @@ DECLARE_INTERFACE_(IDockingWindowSite, IOleWindow)
STDMETHOD(ContextSensitiveHelp)(THIS_ BOOL fEnterMode) PURE;
// *** IDockingWindowSite methods ***
STDMETHOD(GetBorderDW)(THIS_ IUnknown *punkObj, LPRECT prcBorder) PURE;
STDMETHOD(RequestBorderSpaceDW)(THIS_ IUnknown *punkObj, LPCBORDERWIDTHS pbw) PURE;
STDMETHOD(SetBorderSpaceDW)(THIS_ IUnknown *punkObj, LPCBORDERWIDTHS pbw) PURE;
STDMETHOD(GetBorderDW)(THIS_ _In_ IUnknown *punkObj, _Out_ LPRECT prcBorder) PURE;
STDMETHOD(RequestBorderSpaceDW)(THIS_ _In_ IUnknown *punkObj, _In_ LPCBORDERWIDTHS pbw) PURE;
STDMETHOD(SetBorderSpaceDW)(THIS_ _In_ IUnknown *punkObj, _In_ LPCBORDERWIDTHS pbw) PURE;
};
#undef INTERFACE

File diff suppressed because it is too large Load diff

View file

@ -52,7 +52,6 @@ HRESULT WINAPI IUnknown_Exec(IUnknown* lpUnknown, REFGUID pguidCmdGroup, DWORD n
LONG WINAPI SHSetWindowBits(HWND hwnd, INT offset, UINT wMask, UINT wFlags);
HWND WINAPI SHSetParentHwnd(HWND hWnd, HWND hWndParent);
HRESULT WINAPI ConnectToConnectionPoint(IUnknown *lpUnkSink, REFIID riid, BOOL bAdviseOnly, IUnknown *lpUnknown, LPDWORD lpCookie, IConnectionPoint **lppCP);
DWORD WINAPI IUnknown_AtomicRelease(IUnknown **lpUnknown);
BOOL WINAPI SHIsSameObject(IUnknown *lpInt1, IUnknown *lpInt2);
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd);
HRESULT WINAPI IUnknown_SetOwner(IUnknown *pUnk, ULONG arg);

View file

@ -340,18 +340,55 @@ DWORD WINAPI GetConsoleAliasExesLengthA(VOID);
DWORD WINAPI GetConsoleAliasExesLengthW(VOID);
#endif
HANDLE WINAPI CreateConsoleScreenBuffer(_In_ DWORD, _In_ DWORD, _In_opt_ CONST SECURITY_ATTRIBUTES*, _In_ DWORD, _Reserved_ LPVOID);
BOOL WINAPI FillConsoleOutputAttribute(_In_ HANDLE, _In_ WORD, _In_ DWORD, _In_ COORD, _Out_ PDWORD);
BOOL WINAPI FillConsoleOutputCharacterA(_In_ HANDLE, _In_ CHAR, _In_ DWORD, _In_ COORD, _Out_ PDWORD);
BOOL WINAPI FillConsoleOutputCharacterW(_In_ HANDLE, _In_ WCHAR, _In_ DWORD, _In_ COORD, _Out_ PDWORD);
HANDLE
WINAPI
CreateConsoleScreenBuffer(
_In_ DWORD,
_In_ DWORD,
_In_opt_ CONST SECURITY_ATTRIBUTES*,
_In_ DWORD,
_Reserved_ LPVOID);
BOOL
WINAPI
FillConsoleOutputAttribute(
_In_ HANDLE,
_In_ WORD,
_In_ DWORD,
_In_ COORD,
_Out_ PDWORD);
BOOL
WINAPI
FillConsoleOutputCharacterA(
_In_ HANDLE,
_In_ CHAR,
_In_ DWORD,
_In_ COORD,
_Out_ PDWORD);
BOOL
WINAPI
FillConsoleOutputCharacterW(
_In_ HANDLE,
_In_ WCHAR,
_In_ DWORD,
_In_ COORD,
_Out_ PDWORD);
BOOL WINAPI FlushConsoleInputBuffer(_In_ HANDLE);
BOOL WINAPI FreeConsole(VOID);
BOOL WINAPI GenerateConsoleCtrlEvent(_In_ DWORD, _In_ DWORD);
UINT WINAPI GetConsoleCP(VOID);
BOOL WINAPI GetConsoleCursorInfo(_In_ HANDLE, _Out_ PCONSOLE_CURSOR_INFO);
BOOL WINAPI GetConsoleMode(HANDLE,PDWORD);
BOOL WINAPI GetConsoleMode(_In_ HANDLE, _Out_ PDWORD);
UINT WINAPI GetConsoleOutputCP(VOID);
BOOL WINAPI GetConsoleScreenBufferInfo(_In_ HANDLE, _Out_ PCONSOLE_SCREEN_BUFFER_INFO);
BOOL
WINAPI
GetConsoleScreenBufferInfo(
_In_ HANDLE,
_Out_ PCONSOLE_SCREEN_BUFFER_INFO);
/* Undocumented, see http://blog.airesoft.co.uk/2012/10/things-ms-can-do-that-they-dont-tell-you-about-console-graphics/ */
BOOL WINAPI InvalidateConsoleDIBits(_In_ HANDLE, _In_ PSMALL_RECT);
@ -382,15 +419,29 @@ GetCurrentConsoleFont(
_Out_ PCONSOLE_FONT_INFO lpConsoleCurrentFont);
#if (_WIN32_WINNT >= 0x0500)
HWND WINAPI GetConsoleWindow(VOID);
BOOL APIENTRY GetConsoleDisplayMode(_Out_ LPDWORD lpModeFlags);
BOOL APIENTRY SetConsoleDisplayMode(_In_ HANDLE hConsoleOutput, _In_ DWORD dwFlags, _Out_opt_ PCOORD lpNewScreenBufferDimensions);
BOOL
APIENTRY
SetConsoleDisplayMode(
_In_ HANDLE hConsoleOutput,
_In_ DWORD dwFlags,
_Out_opt_ PCOORD lpNewScreenBufferDimensions);
#endif
COORD WINAPI GetLargestConsoleWindowSize(_In_ HANDLE);
BOOL WINAPI GetNumberOfConsoleInputEvents(HANDLE,PDWORD);
BOOL WINAPI GetNumberOfConsoleInputEvents(_In_ HANDLE, _Out_ PDWORD);
BOOL WINAPI GetNumberOfConsoleMouseButtons(_Out_ PDWORD);
BOOL WINAPI PeekConsoleInputA(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
BOOL
WINAPI PeekConsoleInputA(
_In_ HANDLE hConsoleInput,
_Out_writes_(nLength) PINPUT_RECORD lpBuffer,
_In_ DWORD nLength,
_Out_ LPDWORD lpNumberOfEventsRead);
BOOL
WINAPI
@ -400,10 +451,43 @@ PeekConsoleInputW(
_In_ DWORD nLength,
_Out_ LPDWORD lpNumberOfEventsRead);
BOOL WINAPI ReadConsoleA(HANDLE,PVOID,DWORD,PDWORD,PCONSOLE_READCONSOLE_CONTROL);
BOOL WINAPI ReadConsoleW(HANDLE,PVOID,DWORD,PDWORD,PCONSOLE_READCONSOLE_CONTROL);
BOOL WINAPI ReadConsoleInputA(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
BOOL WINAPI ReadConsoleInputW(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
_Success_(return != 0)
BOOL
WINAPI
ReadConsoleA(
_In_ HANDLE hConsoleInput,
_Out_writes_bytes_to_(nNumberOfCharsToRead * sizeof(CHAR), *lpNumberOfCharsRead * sizeof(CHAR)) LPVOID lpBuffer,
_In_ DWORD nNumberOfCharsToRead,
_Out_ _Deref_out_range_(<= , nNumberOfCharsToRead) LPDWORD lpNumberOfCharsRead,
_In_opt_ PCONSOLE_READCONSOLE_CONTROL pInputControl);
_Success_(return != 0)
BOOL
WINAPI
ReadConsoleW(
_In_ HANDLE hConsoleInput,
_Out_writes_bytes_to_(nNumberOfCharsToRead * sizeof(WCHAR), *lpNumberOfCharsRead * sizeof(WCHAR)) LPVOID lpBuffer,
_In_ DWORD nNumberOfCharsToRead,
_Out_ _Deref_out_range_(<= , nNumberOfCharsToRead) LPDWORD lpNumberOfCharsRead,
_In_opt_ PCONSOLE_READCONSOLE_CONTROL pInputControl);
_Success_(return != 0)
BOOL
WINAPI
ReadConsoleInputA(
_In_ HANDLE hConsoleInput,
_Out_writes_to_(nLength, *lpNumberOfEventsRead) PINPUT_RECORD lpBuffer,
_In_ DWORD nLength,
_Out_ _Deref_out_range_(<= , nLength) LPDWORD lpNumberOfEventsRead);
_Success_(return != 0)
BOOL
WINAPI
ReadConsoleInputW(
_In_ HANDLE hConsoleInput,
_Out_writes_to_(nLength, *lpNumberOfEventsRead) PINPUT_RECORD lpBuffer,
_In_ DWORD nLength,
_Out_ _Deref_out_range_(<= , nLength) LPDWORD lpNumberOfEventsRead);
BOOL
WINAPI
@ -450,20 +534,42 @@ ReadConsoleOutputW(
_In_ COORD dwBufferCoord,
_Inout_ PSMALL_RECT lpReadRegion);
BOOL WINAPI ScrollConsoleScreenBufferA(_In_ HANDLE, _In_ const SMALL_RECT*, _In_opt_ const SMALL_RECT*, _In_ COORD, _In_ const CHAR_INFO*);
BOOL WINAPI ScrollConsoleScreenBufferW(_In_ HANDLE, _In_ const SMALL_RECT*, _In_opt_ const SMALL_RECT*, _In_ COORD, _In_ const CHAR_INFO*);
BOOL
WINAPI
ScrollConsoleScreenBufferA(
_In_ HANDLE,
_In_ const SMALL_RECT*,
_In_opt_ const SMALL_RECT*,
_In_ COORD,
_In_ const CHAR_INFO*);
BOOL
WINAPI
ScrollConsoleScreenBufferW(
_In_ HANDLE,
_In_ const SMALL_RECT*,
_In_opt_ const SMALL_RECT*,
_In_ COORD,
_In_ const CHAR_INFO*);
BOOL WINAPI SetConsoleActiveScreenBuffer(_In_ HANDLE);
BOOL WINAPI SetConsoleCP(_In_ UINT);
BOOL WINAPI SetConsoleCtrlHandler(PHANDLER_ROUTINE,BOOL);
BOOL WINAPI SetConsoleCtrlHandler(_In_opt_ PHANDLER_ROUTINE, _In_ BOOL);
BOOL WINAPI SetConsoleCursorInfo(_In_ HANDLE, _In_ const CONSOLE_CURSOR_INFO*);
BOOL WINAPI SetConsoleCursorPosition(_In_ HANDLE, _In_ COORD);
BOOL WINAPI SetConsoleMode(HANDLE,DWORD);
BOOL WINAPI SetConsoleMode(_In_ HANDLE, _In_ DWORD);
BOOL WINAPI SetConsoleOutputCP(_In_ UINT);
BOOL WINAPI SetConsoleScreenBufferSize(_In_ HANDLE, _In_ COORD);
BOOL WINAPI SetConsoleTextAttribute(_In_ HANDLE, _In_ WORD);
BOOL WINAPI SetConsoleTitleA(_In_ LPCSTR);
BOOL WINAPI SetConsoleTitleW(_In_ LPCWSTR);
BOOL WINAPI SetConsoleWindowInfo(_In_ HANDLE, _In_ BOOL, _In_ const SMALL_RECT*);
BOOL
WINAPI
SetConsoleWindowInfo(
_In_ HANDLE,
_In_ BOOL,
_In_ const SMALL_RECT*);
/* Undocumented, see http://undoc.airesoft.co.uk/kernel32.dll/ConsoleMenuControl.php */
HMENU WINAPI ConsoleMenuControl(_In_ HANDLE, _In_ DWORD, _In_ DWORD);
@ -476,8 +582,23 @@ INT WINAPI ShowConsoleCursor(_In_ HANDLE, _In_ BOOL);
/* Undocumented, see http://comments.gmane.org/gmane.comp.lang.harbour.devel/27844 */
BOOL WINAPI SetConsolePalette(_In_ HANDLE, _In_ HPALETTE, _In_ UINT);
BOOL WINAPI WriteConsoleA(HANDLE,CONST VOID*,DWORD,LPDWORD,LPVOID);
BOOL WINAPI WriteConsoleW(HANDLE,CONST VOID*,DWORD,LPDWORD,LPVOID);
BOOL
WINAPI
WriteConsoleA(
_In_ HANDLE hConsoleOutput,
_In_reads_(nNumberOfCharsToWrite) CONST VOID *lpBuffer,
_In_ DWORD nNumberOfCharsToWrite,
_Out_opt_ LPDWORD lpNumberOfCharsWritten,
_Reserved_ LPVOID lpReserved);
BOOL
WINAPI
WriteConsoleW(
_In_ HANDLE hConsoleOutput,
_In_reads_(nNumberOfCharsToWrite) CONST VOID *lpBuffer,
_In_ DWORD nNumberOfCharsToWrite,
_Out_opt_ LPDWORD lpNumberOfCharsWritten,
_Reserved_ LPVOID lpReserved);
BOOL
WINAPI
@ -590,4 +711,5 @@ WriteConsoleOutputCharacterW(
#ifdef __cplusplus
}
#endif
#endif
#endif /* _WINCON_H */

View file

@ -546,207 +546,207 @@ struct sockproto {
SOCKET
PASCAL FAR
accept(
IN SOCKET s,
OUT struct sockaddr FAR *addr OPTIONAL,
IN OUT int FAR *addrlen OPTIONAL);
_In_ SOCKET s,
_Out_writes_bytes_opt_(*addrlen) struct sockaddr FAR *addr,
_Inout_opt_ int FAR *addrlen);
int
PASCAL FAR
bind(
IN SOCKET s,
IN const struct sockaddr FAR *addr,
IN int namelen);
_In_ SOCKET s,
_In_reads_bytes_(namelen) const struct sockaddr FAR *addr,
_In_ int namelen);
int
PASCAL FAR
closesocket(
IN SOCKET s);
_In_ SOCKET s);
int
PASCAL FAR
connect(
IN SOCKET s,
IN const struct sockaddr FAR *name,
IN int namelen);
_In_ SOCKET s,
_In_reads_bytes_(namelen) const struct sockaddr FAR *name,
_In_ int namelen);
int
PASCAL FAR
ioctlsocket(
IN SOCKET s,
IN long cmd,
IN OUT u_long FAR *argp);
_In_ SOCKET s,
_In_ long cmd,
_Inout_ u_long FAR *argp);
int
PASCAL FAR
getpeername(
IN SOCKET s,
OUT struct sockaddr FAR *name,
IN OUT int FAR *namelen);
_In_ SOCKET s,
_Out_writes_bytes_to_(*namelen, *namelen) struct sockaddr FAR *name,
_Inout_ int FAR *namelen);
int
PASCAL FAR
getsockname(
IN SOCKET s,
OUT struct sockaddr FAR *name,
IN OUT int FAR *namelen);
_In_ SOCKET s,
_Out_writes_bytes_to_(*namelen, *namelen) struct sockaddr FAR *name,
_Inout_ int FAR *namelen);
int
PASCAL FAR
getsockopt(
IN SOCKET s,
IN int level,
IN int optname,
OUT char FAR *optval,
IN OUT int FAR *optlen);
_In_ SOCKET s,
_In_ int level,
_In_ int optname,
_Out_writes_bytes_(*optlen) char FAR *optval,
_Inout_ int FAR *optlen);
u_long
PASCAL FAR
htonl(
IN u_long hostlong);
_In_ u_long hostlong);
u_short
PASCAL FAR
htons(
IN u_short hostshort);
_In_ u_short hostshort);
unsigned long
PASCAL FAR
inet_addr(
IN const char FAR *cp);
_In_z_ const char FAR *cp);
char FAR
*PASCAL FAR
inet_ntoa(
IN struct in_addr in);
_In_ struct in_addr in);
int
PASCAL FAR
listen(
IN SOCKET s,
IN int backlog);
_In_ SOCKET s,
_In_ int backlog);
u_long
PASCAL FAR
ntohl(
IN u_long netlong);
_In_ u_long netlong);
u_short
PASCAL FAR
ntohs(
IN u_short netshort);
_In_ u_short netshort);
int
PASCAL FAR
recv(
IN SOCKET s,
OUT char FAR *buf,
IN int len,
IN int flags);
_In_ SOCKET s,
_Out_writes_bytes_to_(len, return) __out_data_source(NETWORK) char FAR *buf,
_In_ int len,
_In_ int flags);
int
PASCAL FAR
recvfrom(
IN SOCKET s,
OUT char FAR *buf,
IN int len,
IN int flags,
OUT struct sockaddr FAR *from OPTIONAL,
IN OUT int FAR * fromlen OPTIONAL);
_In_ SOCKET s,
_Out_writes_bytes_to_(len, return) __out_data_source(NETWORK) char FAR *buf,
_In_ int len,
_In_ int flags,
_Out_writes_bytes_to_opt_(*fromlen, *fromlen) struct sockaddr FAR *from,
_Inout_opt_ int FAR * fromlen);
int
PASCAL FAR
select(
IN int nfds,
IN OUT fd_set FAR *readfds OPTIONAL,
IN OUT fd_set FAR *writefds OPTIONAL,
IN OUT fd_set FAR *exceptfds OPTIONAL,
IN const struct timeval FAR *timeout OPTIONAL);
_In_ int nfds,
_Inout_opt_ fd_set FAR *readfds,
_Inout_opt_ fd_set FAR *writefds,
_Inout_opt_ fd_set FAR *exceptfds,
_In_opt_ const struct timeval FAR *timeout);
int
PASCAL FAR
send(
IN SOCKET s,
IN const char FAR *buf,
IN int len,
IN int flags);
_In_ SOCKET s,
_In_reads_bytes_(len) const char FAR *buf,
_In_ int len,
_In_ int flags);
int
PASCAL FAR
sendto(
IN SOCKET s,
IN const char FAR *buf,
IN int len,
IN int flags,
IN const struct sockaddr FAR *to OPTIONAL,
IN int tolen);
_In_ SOCKET s,
_In_reads_bytes_(len) const char FAR *buf,
_In_ int len,
_In_ int flags,
_In_reads_bytes_opt_(tolen) const struct sockaddr FAR *to,
_In_ int tolen);
int
PASCAL FAR
setsockopt(
IN SOCKET s,
IN int level,
IN int optname,
IN const char FAR *optval OPTIONAL,
IN int optlen);
_In_ SOCKET s,
_In_ int level,
_In_ int optname,
_In_reads_bytes_opt_(optlen) const char FAR *optval,
_In_ int optlen);
int
PASCAL FAR
shutdown(
IN SOCKET s,
IN int how);
_In_ SOCKET s,
_In_ int how);
SOCKET
PASCAL FAR
socket(
IN int af,
IN int type,
IN int protocol);
_In_ int af,
_In_ int type,
_In_ int protocol);
struct hostent FAR
*PASCAL FAR
gethostbyaddr(
IN const char FAR *addr,
IN int len,
IN int type);
_In_reads_bytes_(len) const char FAR *addr,
_In_ int len,
_In_ int type);
struct hostent FAR
*PASCAL FAR
gethostbyname(
IN const char FAR *name);
_In_z_ const char FAR *name);
int
PASCAL FAR
gethostname(
OUT char FAR *name,
IN int namelen);
_Out_writes_bytes_to_(namelen, return) char FAR *name,
_In_ int namelen);
struct servent FAR
*PASCAL FAR
getservbyport(
IN int port,
IN const char FAR *proto);
_In_ int port,
_In_z_ const char FAR *proto);
struct servent FAR
*PASCAL FAR
getservbyname(
IN const char FAR *name,
IN const char FAR *proto);
_In_z_ const char FAR *name,
_In_z_ const char FAR *proto);
struct protoent FAR
*PASCAL FAR
getprotobynumber(
IN int number);
_In_ int number);
struct protoent FAR
*PASCAL FAR
getprotobyname(
IN const char FAR *name);
_In_z_ const char FAR *name);
int
PASCAL FAR
WSAStartup(
IN WORD wVersionRequired,
OUT LPWSADATA lpWSAData);
_In_ WORD wVersionRequired,
_Out_ LPWSADATA lpWSAData);
int
PASCAL FAR
@ -755,7 +755,7 @@ WSACleanup(void);
void
PASCAL FAR
WSASetLastError(
IN int iError);
_In_ int iError);
int
PASCAL FAR
@ -772,7 +772,7 @@ WSAUnhookBlockingHook(void);
FARPROC
PASCAL FAR
WSASetBlockingHook(
IN FARPROC lpBlockFunc);
_In_ FARPROC lpBlockFunc);
int
PASCAL FAR
@ -781,81 +781,81 @@ WSACancelBlockingCall(void);
HANDLE
PASCAL FAR
WSAAsyncGetServByName(
IN HWND hWnd,
IN u_int wMsg,
IN const char FAR *name,
IN const char FAR *proto,
OUT char FAR *buf,
IN int buflen);
_In_ HWND hWnd,
_In_ u_int wMsg,
_In_z_ const char FAR *name,
_In_z_ const char FAR *proto,
_Out_writes_bytes_(buflen) char FAR *buf,
_In_ int buflen);
HANDLE
PASCAL FAR
WSAAsyncGetServByPort(
IN HWND hWnd,
IN u_int wMsg,
IN int port,
IN const char FAR *proto,
OUT char FAR *buf,
IN int buflen);
_In_ HWND hWnd,
_In_ u_int wMsg,
_In_ int port,
_In_ const char FAR *proto,
_Out_writes_bytes_(buflen) char FAR *buf,
_In_ int buflen);
HANDLE
PASCAL FAR
WSAAsyncGetProtoByName(
IN HWND hWnd,
IN u_int wMsg,
IN const char FAR *name,
OUT char FAR *buf,
IN int buflen);
_In_ HWND hWnd,
_In_ u_int wMsg,
_In_z_ const char FAR *name,
_Out_writes_bytes_(buflen) char FAR *buf,
_In_ int buflen);
HANDLE
PASCAL FAR
WSAAsyncGetProtoByNumber(
IN HWND hWnd,
IN u_int wMsg,
IN int number,
OUT char FAR *buf,
IN int buflen);
_In_ HWND hWnd,
_In_ u_int wMsg,
_In_ int number,
_Out_writes_bytes_(buflen) char FAR *buf,
_In_ int buflen);
HANDLE
PASCAL FAR
WSAAsyncGetHostByName(
IN HWND hWnd,
IN u_int wMsg,
IN const char FAR *name,
OUT char FAR *buf,
IN int buflen);
_In_ HWND hWnd,
_In_ u_int wMsg,
_In_z_ const char FAR *name,
_Out_writes_bytes_(buflen) char FAR *buf,
_In_ int buflen);
HANDLE
PASCAL FAR
WSAAsyncGetHostByAddr(
IN HWND hWnd,
IN u_int wMsg,
IN const char FAR *addr,
IN int len,
IN int type,
OUT char FAR *buf,
IN int buflen);
_In_ HWND hWnd,
_In_ u_int wMsg,
_In_ const char FAR *addr,
_In_ int len,
_In_ int type,
_Out_writes_bytes_(buflen) char FAR *buf,
_In_ int buflen);
int
PASCAL FAR
WSACancelAsyncRequest(
IN HANDLE hAsyncTaskHandle);
_In_ HANDLE hAsyncTaskHandle);
int
PASCAL FAR
WSAAsyncSelect(
IN SOCKET s,
IN HWND hWnd,
IN u_int wMsg,
IN long lEvent);
_In_ SOCKET s,
_In_ HWND hWnd,
_In_ u_int wMsg,
_In_ long lEvent);
int
PASCAL FAR
WSARecvEx(
IN SOCKET s,
OUT char FAR *buf,
IN int len,
IN OUT int FAR *flags);
_In_ SOCKET s,
_Out_writes_bytes_to_(len, return) __out_data_source(NETWORK) char FAR *buf,
_In_ int len,
_Inout_ int FAR *flags);
typedef struct _TRANSMIT_FILE_BUFFERS {
PVOID Head;
@ -867,37 +867,37 @@ typedef struct _TRANSMIT_FILE_BUFFERS {
BOOL
PASCAL FAR
TransmitFile(
IN SOCKET hSocket,
IN HANDLE hFile,
IN DWORD nNumberOfBytesToWrite,
IN DWORD nNumberOfBytesPerSend,
IN OUT LPOVERLAPPED lpOverlapped OPTIONAL,
IN LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers OPTIONAL,
IN DWORD dwReserved);
_In_ SOCKET hSocket,
_In_ HANDLE hFile,
_In_ DWORD nNumberOfBytesToWrite,
_In_ DWORD nNumberOfBytesPerSend,
_Inout_opt_ LPOVERLAPPED lpOverlapped,
_In_opt_ LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers,
_In_ DWORD dwReserved);
BOOL
PASCAL FAR
AcceptEx(
IN SOCKET sListenSocket,
IN SOCKET sAcceptSocket,
OUT PVOID lpOutputBuffer,
IN DWORD dwReceiveDataLength,
IN DWORD dwLocalAddressLength,
IN DWORD dwRemoteAddressLength,
OUT LPDWORD lpdwBytesReceived,
IN OUT LPOVERLAPPED lpOverlapped);
_In_ SOCKET sListenSocket,
_In_ SOCKET sAcceptSocket,
_Out_writes_bytes_to_(dwReceiveDataLength + dwLocalAddressLength + dwRemoteAddressLength, *lpdwBytesReceived) PVOID lpOutputBuffer,
_In_ DWORD dwReceiveDataLength,
_In_ DWORD dwLocalAddressLength,
_In_ DWORD dwRemoteAddressLength,
_Out_ LPDWORD lpdwBytesReceived,
_Inout_ LPOVERLAPPED lpOverlapped);
VOID
PASCAL FAR
GetAcceptExSockaddrs(
IN PVOID lpOutputBuffer,
IN DWORD dwReceiveDataLength,
IN DWORD dwLocalAddressLength,
IN DWORD dwRemoteAddressLength,
OUT struct sockaddr **LocalSockaddr,
OUT LPINT LocalSockaddrLength,
OUT struct sockaddr **RemoteSockaddr,
OUT LPINT RemoteSockaddrLength);
_In_reads_bytes_(dwReceiveDataLength + dwLocalAddressLength + dwRemoteAddressLength) PVOID lpOutputBuffer,
_In_ DWORD dwReceiveDataLength,
_In_ DWORD dwLocalAddressLength,
_In_ DWORD dwRemoteAddressLength,
_Outptr_result_bytebuffer_(*LocalSockaddrLength) struct sockaddr **LocalSockaddr,
_Out_ LPINT LocalSockaddrLength,
_Outptr_result_bytebuffer_(*RemoteSockaddrLength) struct sockaddr **RemoteSockaddr,
_Out_ LPINT RemoteSockaddrLength);
#if(_WIN32_WINNT >= 0x0501)

File diff suppressed because it is too large Load diff

View file

@ -62,10 +62,10 @@ WINSOCK_API_LINKAGE
INT
WSAAPI
getaddrinfo(
IN PCSTR pNodeName OPTIONAL,
IN PCSTR pServiceName OPTIONAL,
IN const ADDRINFOA *pHints OPTIONAL,
OUT PADDRINFOA *ppResult);
_In_opt_ PCSTR pNodeName,
_In_opt_ PCSTR pServiceName,
_In_opt_ const ADDRINFOA *pHints,
_Outptr_ PADDRINFOA *ppResult);
#if (NTDDI_VERSION >= NTDDI_WINXPSP2) || (_WIN32_WINNT >= 0x0502)
@ -73,10 +73,10 @@ WINSOCK_API_LINKAGE
INT
WSAAPI
GetAddrInfoW(
IN PCWSTR pNodeName OPTIONAL,
IN PCWSTR pServiceName OPTIONAL,
IN const ADDRINFOW *pHints OPTIONAL,
OUT PADDRINFOW *ppResult);
_In_opt_ PCWSTR pNodeName,
_In_opt_ PCWSTR pServiceName,
_In_opt_ const ADDRINFOW *pHints,
_Outptr_ PADDRINFOW *ppResult);
#define GetAddrInfoA getaddrinfo
@ -92,17 +92,17 @@ GetAddrInfoW(
typedef INT
(WSAAPI *LPFN_GETADDRINFO)(
IN PCSTR pNodeName OPTIONAL,
IN PCSTR pServiceName OPTIONAL,
IN const ADDRINFOA *pHints OPTIONAL,
OUT PADDRINFOA *ppResult);
_In_opt_ PCSTR pNodeName,
_In_opt_ PCSTR pServiceName,
_In_opt_ const ADDRINFOA *pHints,
_Outptr_ PADDRINFOA *ppResult);
typedef INT
(WSAAPI *LPFN_GETADDRINFOW)(
IN PCWSTR pNodeName OPTIONAL,
IN PCWSTR pServiceName OPTIONAL,
IN const ADDRINFOW *pHints OPTIONAL,
OUT PADDRINFOW *ppResult);
_In_opt_ PCWSTR pNodeName,
_In_opt_ PCWSTR pServiceName,
_In_opt_ const ADDRINFOW *pHints,
_Outptr_ PADDRINFOW *ppResult);
#define LPFN_GETADDRINFOA LPFN_GETADDRINFO
@ -118,39 +118,39 @@ typedef INT
typedef void
(CALLBACK *LPLOOKUPSERVICE_COMPLETION_ROUTINE)(
IN DWORD dwError,
IN DWORD dwBytes,
IN LPWSAOVERLAPPED lpOverlapped);
_In_ DWORD dwError,
_In_ DWORD dwBytes,
_In_ LPWSAOVERLAPPED lpOverlapped);
WINSOCK_API_LINKAGE
INT
WSAAPI
GetAddrInfoExA(
IN PCSTR pName OPTIONAL,
IN PCSTR pServiceName OPTIONAL,
IN DWORD dwNameSpace,
IN LPGUID lpNspId OPTIONAL,
IN const ADDRINFOEXA *hints,
OUT PADDRINFOEXA *ppResult,
IN struct timeval *timeout OPTIONAL,
IN LPOVERLAPPED lpOverlapped OPTIONAL,
IN LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine OPTIONAL,
OUT LPHANDLE lpNameHandle OPTIONAL);
_In_opt_ PCSTR pName,
_In_opt_ PCSTR pServiceName,
_In_ DWORD dwNameSpace,
_In_opt_ LPGUID lpNspId,
_In_opt_ const ADDRINFOEXA *hints,
_Outptr_ PADDRINFOEXA *ppResult,
_In_opt_ struct timeval *timeout,
_In_opt_ LPOVERLAPPED lpOverlapped,
_In_opt_ LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
_Out_opt_ LPHANDLE lpNameHandle);
WINSOCK_API_LINKAGE
INT
WSAAPI
GetAddrInfoExW(
IN PCWSTR pName OPTIONAL,
IN PCWSTR pServiceName OPTIONAL,
IN DWORD dwNameSpace,
IN LPGUID lpNspId OPTIONAL,
IN const ADDRINFOEXW *hints OPTIONAL,
OUT PADDRINFOEXW *ppResult,
IN struct timeval *timeout OPTIONAL,
IN LPOVERLAPPED lpOverlapped OPTIONAL,
IN LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine OPTIONAL,
OUT LPHANDLE lpHandle OPTIONAL);
_In_opt_ PCWSTR pName,
_In_opt_ PCWSTR pServiceName,
_In_ DWORD dwNameSpace,
_In_opt_ LPGUID lpNspId,
_In_opt_ const ADDRINFOEXW *hints,
_Outptr_ PADDRINFOEXW *ppResult,
_In_opt_ struct timeval *timeout,
_In_opt_ LPOVERLAPPED lpOverlapped,
_In_opt_ LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
_Out_opt_ LPHANDLE lpHandle);
#ifdef UNICODE
#define GetAddrInfoEx GetAddrInfoExW
@ -162,29 +162,29 @@ GetAddrInfoExW(
typedef INT
(WSAAPI *LPFN_GETADDRINFOEXA)(
IN PCSTR pName,
IN PCSTR pServiceName OPTIONAL,
IN DWORD dwNameSpace,
IN LPGUID lpNspId OPTIONAL,
IN const ADDRINFOEXA *hints OPTIONAL,
OUT PADDRINFOEXA *ppResult,
IN struct timeval *timeout OPTIONAL,
IN LPOVERLAPPED lpOverlapped OPTIONAL,
IN LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine OPTIONAL,
OUT LPHANDLE lpNameHandle OPTIONAL);
_In_ PCSTR pName,
_In_opt_ PCSTR pServiceName,
_In_ DWORD dwNameSpace,
_In_opt_ LPGUID lpNspId,
_In_opt_ const ADDRINFOEXA *hints,
_Outptr_ PADDRINFOEXA *ppResult,
_In_opt_ struct timeval *timeout,
_In_opt_ LPOVERLAPPED lpOverlapped,
_In_opt_ LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
_Out_opt_ LPHANDLE lpNameHandle);
typedef INT
(WSAAPI *LPFN_GETADDRINFOEXW)(
IN PCWSTR pName,
IN PCWSTR pServiceName OPTIONAL,
IN DWORD dwNameSpace,
IN LPGUID lpNspId OPTIONAL,
IN const ADDRINFOEXW *hints OPTIONAL,
OUT PADDRINFOEXW *ppResult,
IN struct timeval *timeout OPTIONAL,
IN LPOVERLAPPED lpOverlapped OPTIONAL,
IN LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine OPTIONAL,
OUT LPHANDLE lpHandle OPTIONAL);
_In_ PCWSTR pName,
_In_opt_ PCWSTR pServiceName,
_In_ DWORD dwNameSpace,
_In_opt_ LPGUID lpNspId,
_In_opt_ const ADDRINFOEXW *hints,
_Outptr_ PADDRINFOEXW *ppResult,
_In_opt_ struct timeval *timeout,
_In_opt_ LPOVERLAPPED lpOverlapped,
_In_opt_ LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
_Out_opt_ LPHANDLE lpHandle);
#ifdef UNICODE
#define LPFN_GETADDRINFOEX LPFN_GETADDRINFOEXW
@ -201,35 +201,35 @@ WINSOCK_API_LINKAGE
INT
WSAAPI
SetAddrInfoExA(
IN PCSTR pName,
IN PCSTR pServiceName OPTIONAL,
IN SOCKET_ADDRESS *pAddresses OPTIONAL,
IN DWORD dwAddressCount,
IN LPBLOB lpBlob OPTIONAL,
IN DWORD dwFlags,
IN DWORD dwNameSpace,
IN LPGUID lpNspId OPTIONAL,
IN struct timeval *timeout OPTIONAL,
IN LPOVERLAPPED lpOverlapped OPTIONAL,
IN LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine OPTIONAL,
OUT LPHANDLE lpNameHandle OPTIONAL);
_In_ PCSTR pName,
_In_opt_ PCSTR pServiceName,
_In_opt_ SOCKET_ADDRESS *pAddresses,
_In_ DWORD dwAddressCount,
_In_opt_ LPBLOB lpBlob,
_In_ DWORD dwFlags,
_In_ DWORD dwNameSpace,
_In_opt_ LPGUID lpNspId,
_In_opt_ struct timeval *timeout,
_In_opt_ LPOVERLAPPED lpOverlapped,
_In_opt_ LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
_Out_opt_ LPHANDLE lpNameHandle);
WINSOCK_API_LINKAGE
INT
WSAAPI
SetAddrInfoExW(
IN PCWSTR pName,
IN PCWSTR pServiceName OPTIONAL,
IN SOCKET_ADDRESS *pAddresses OPTIONAL,
IN DWORD dwAddressCount,
IN LPBLOB lpBlob OPTIONAL,
IN DWORD dwFlags,
IN DWORD dwNameSpace,
IN LPGUID lpNspId OPTIONAL,
IN struct timeval *timeout OPTIONAL,
IN LPOVERLAPPED lpOverlapped OPTIONAL,
IN LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine OPTIONAL,
OUT LPHANDLE lpNameHandle OPTIONAL);
_In_ PCWSTR pName,
_In_opt_ PCWSTR pServiceName,
_In_opt_ SOCKET_ADDRESS *pAddresses,
_In_ DWORD dwAddressCount,
_In_opt_ LPBLOB lpBlob,
_In_ DWORD dwFlags,
_In_ DWORD dwNameSpace,
_In_opt_ LPGUID lpNspId,
_In_opt_ struct timeval *timeout,
_In_opt_ LPOVERLAPPED lpOverlapped,
_In_opt_ LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
_Out_opt_ LPHANDLE lpNameHandle);
#ifdef UNICODE
#define SetAddrInfoEx SetAddrInfoExW
@ -241,33 +241,33 @@ SetAddrInfoExW(
typedef INT
(WSAAPI *LPFN_SETADDRINFOEXA)(
IN PCSTR pName,
IN PCSTR pServiceName OPTIONAL,
IN SOCKET_ADDRESS *pAddresses OPTIONAL,
IN DWORD dwAddressCount,
IN LPBLOB lpBlob OPTIONAL,
IN DWORD dwFlags,
IN DWORD dwNameSpace,
IN LPGUID lpNspId OPTIONAL,
IN struct timeval *timeout OPTIONAL,
IN LPOVERLAPPED lpOverlapped OPTIONAL,
IN LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine OPTIONAL,
OUT LPHANDLE lpNameHandle OPTIONAL);
_In_ PCSTR pName,
_In_opt_ PCSTR pServiceName,
_In_opt_ SOCKET_ADDRESS *pAddresses,
_In_ DWORD dwAddressCount,
_In_opt_ LPBLOB lpBlob,
_In_ DWORD dwFlags,
_In_ DWORD dwNameSpace,
_In_opt_ LPGUID lpNspId,
_In_opt_ struct timeval *timeout,
_In_opt_ LPOVERLAPPED lpOverlapped,
_In_opt_ LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
_Out_opt_ LPHANDLE lpNameHandle);
typedef INT
(WSAAPI *LPFN_SETADDRINFOEXW)(
IN PCWSTR pName,
IN PCWSTR pServiceName OPTIONAL,
IN SOCKET_ADDRESS *pAddresses OPTIONAL,
IN DWORD dwAddressCount,
IN LPBLOB lpBlob OPTIONAL,
IN DWORD dwFlags,
IN DWORD dwNameSpace,
IN LPGUID lpNspId OPTIONAL,
IN struct timeval *timeout OPTIONAL,
IN LPOVERLAPPED lpOverlapped OPTIONAL,
IN LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine OPTIONAL,
OUT LPHANDLE lpNameHandle OPTIONAL);
_In_ PCWSTR pName,
_In_opt_ PCWSTR pServiceName,
_In_opt_ SOCKET_ADDRESS *pAddresses,
_In_ DWORD dwAddressCount,
_In_opt_ LPBLOB lpBlob,
_In_ DWORD dwFlags,
_In_ DWORD dwNameSpace,
_In_opt_ LPGUID lpNspId,
_In_opt_ struct timeval *timeout,
_In_opt_ LPOVERLAPPED lpOverlapped,
_In_opt_ LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
_Out_opt_ LPHANDLE lpNameHandle);
#ifdef UNICODE
#define LPFN_SETADDRINFOEX LPFN_SETADDRINFOEXW
@ -282,7 +282,7 @@ WINSOCK_API_LINKAGE
VOID
WSAAPI
freeaddrinfo(
IN PADDRINFOA pAddrInfo OPTIONAL);
_In_opt_ PADDRINFOA pAddrInfo);
#if (NTDDI_VERSION >= NTDDI_WINXPSP2) || (_WIN32_WINNT >= 0x0502)
@ -290,7 +290,7 @@ WINSOCK_API_LINKAGE
VOID
WSAAPI
FreeAddrInfoW(
IN PADDRINFOW pAddrInfo OPTIONAL);
_In_opt_ PADDRINFOW pAddrInfo);
#define FreeAddrInfoA freeaddrinfo
@ -305,11 +305,11 @@ FreeAddrInfoW(
typedef VOID
(WSAAPI *LPFN_FREEADDRINFO)(
IN PADDRINFOA pAddrInfo OPTIONAL);
_In_opt_ PADDRINFOA pAddrInfo);
typedef VOID
(WSAAPI *LPFN_FREEADDRINFOW)(
IN PADDRINFOW pAddrInfo OPTIONAL);
_In_opt_ PADDRINFOW pAddrInfo);
#define LPFN_FREEADDRINFOA LPFN_FREEADDRINFO
@ -327,13 +327,13 @@ WINSOCK_API_LINKAGE
void
WSAAPI
FreeAddrInfoEx(
IN PADDRINFOEXA pAddrInfoEx OPTIONAL);
_In_opt_ PADDRINFOEXA pAddrInfoEx);
WINSOCK_API_LINKAGE
void
WSAAPI
FreeAddrInfoExW(
IN PADDRINFOEXW pAddrInfoEx OPTIONAL);
_In_opt_ PADDRINFOEXW pAddrInfoEx);
#define FreeAddrInfoExA FreeAddrInfoEx
@ -345,11 +345,11 @@ FreeAddrInfoExW(
typedef void
(WSAAPI *LPFN_FREEADDRINFOEXA)(
IN PADDRINFOEXA pAddrInfoEx);
_In_ PADDRINFOEXA pAddrInfoEx);
typedef void
(WSAAPI *LPFN_FREEADDRINFOEXW)(
IN PADDRINFOEXW pAddrInfoEx);
_In_ PADDRINFOEXW pAddrInfoEx);
#ifdef UNICODE
@ -367,13 +367,13 @@ WINSOCK_API_LINKAGE
INT
WSAAPI
getnameinfo(
IN const SOCKADDR *pSockaddr,
IN socklen_t SockaddrLength,
OUT PCHAR pNodeBuffer OPTIONAL,
IN DWORD NodeBufferSize,
OUT PCHAR pServiceBuffer,
IN DWORD ServiceBufferSize,
IN INT Flags);
_In_reads_bytes_(SockaddrLength) const SOCKADDR *pSockaddr,
_In_ socklen_t SockaddrLength,
_Out_writes_opt_(NodeBufferSize) PCHAR pNodeBuffer,
_In_ DWORD NodeBufferSize,
_Out_writes_opt_(ServiceBufferSize) PCHAR pServiceBuffer,
_In_ DWORD ServiceBufferSize,
_In_ INT Flags);
#if (NTDDI_VERSION >= NTDDI_WINXPSP2) || (_WIN32_WINNT >= 0x0502)
@ -381,13 +381,13 @@ WINSOCK_API_LINKAGE
INT
WSAAPI
GetNameInfoW(
IN const SOCKADDR *pSockaddr,
IN socklen_t SockaddrLength,
OUT PWCHAR pNodeBuffer,
IN DWORD NodeBufferSize,
OUT PWCHAR pServiceBuffer OPTIONAL,
IN DWORD ServiceBufferSize,
IN INT Flags);
_In_reads_bytes_(SockaddrLength) const SOCKADDR *pSockaddr,
_In_ socklen_t SockaddrLength,
_Out_writes_opt_(NodeBufferSize) PWCHAR pNodeBuffer,
_In_ DWORD NodeBufferSize,
_Out_writes_opt_(ServiceBufferSize) PWCHAR pServiceBuffer,
_In_ DWORD ServiceBufferSize,
_In_ INT Flags);
#define GetNameInfoA getnameinfo
@ -403,23 +403,23 @@ GetNameInfoW(
typedef int
(WSAAPI *LPFN_GETNAMEINFO)(
IN const SOCKADDR *pSockaddr,
IN socklen_t SockaddrLength,
OUT PCHAR pNodeBuffer,
IN DWORD NodeBufferSize,
OUT PCHAR pServiceBuffer OPTIONAL,
IN DWORD ServiceBufferSize,
IN INT Flags);
_In_reads_bytes_(SockaddrLength) const SOCKADDR *pSockaddr,
_In_ socklen_t SockaddrLength,
_Out_writes_opt_(NodeBufferSize) PCHAR pNodeBuffer,
_In_ DWORD NodeBufferSize,
_Out_writes_opt_(ServiceBufferSize) PCHAR pServiceBuffer,
_In_ DWORD ServiceBufferSize,
_In_ INT Flags);
typedef INT
(WSAAPI *LPFN_GETNAMEINFOW)(
IN const SOCKADDR *pSockaddr,
IN socklen_t SockaddrLength,
OUT PWCHAR pNodeBuffer,
IN DWORD NodeBufferSize,
OUT PWCHAR pServiceBuffer OPTIONAL,
IN DWORD ServiceBufferSize,
IN INT Flags);
_In_reads_bytes_(SockaddrLength) const SOCKADDR *pSockaddr,
_In_ socklen_t SockaddrLength,
_Out_writes_opt_(NodeBufferSize) PWCHAR pNodeBuffer,
_In_ DWORD NodeBufferSize,
_Out_writes_opt_(ServiceBufferSize) PWCHAR pServiceBuffer,
_In_ DWORD ServiceBufferSize,
_In_ INT Flags);
#define LPFN_GETNAMEINFOA LPFN_GETNAMEINFO
@ -436,32 +436,32 @@ WINSOCK_API_LINKAGE
INT
WSAAPI
inet_pton(
IN INT Family,
IN PCSTR pszAddrString,
OUT PVOID pAddrBuf);
_In_ INT Family,
_In_ PCSTR pszAddrString,
_Out_writes_bytes_(sizeof(IN6_ADDR)) PVOID pAddrBuf);
INT
WSAAPI
InetPtonW(
IN INT Family,
IN PCWSTR pszAddrString,
OUT PVOID pAddrBuf);
_In_ INT Family,
_In_ PCWSTR pszAddrString,
_Out_writes_bytes_(sizeof(IN6_ADDR)) PVOID pAddrBuf);
PCSTR
WSAAPI
inet_ntop(
IN INT Family,
IN PVOID pAddr,
OUT PSTR pStringBuf,
IN size_t StringBufSize);
_In_ INT Family,
_In_ PVOID pAddr,
_Out_writes_(StringBufSize) PSTR pStringBuf,
_In_ size_t StringBufSize);
PCWSTR
WSAAPI
InetNtopW(
IN INT Family,
IN PVOID pAddr,
OUT PWSTR pStringBuf,
IN size_t StringBufSize);
_In_ INT Family,
_In_ PVOID pAddr,
_Out_writes_(StringBufSize) PWSTR pStringBuf,
_In_ size_t StringBufSize);
#define InetPtonA inet_pton
#define InetNtopA inet_ntop
@ -478,29 +478,29 @@ InetNtopW(
typedef INT
(WSAAPI *LPFN_INET_PTONA)(
IN INT Family,
IN PCSTR pszAddrString,
OUT PVOID pAddrBuf);
_In_ INT Family,
_In_ PCSTR pszAddrString,
_Out_writes_bytes_(sizeof(IN6_ADDR)) PVOID pAddrBuf);
typedef INT
(WSAAPI *LPFN_INET_PTONW)(
IN INT Family,
IN PCWSTR pszAddrString,
OUT PVOID pAddrBuf);
_In_ INT Family,
_In_ PCWSTR pszAddrString,
_Out_writes_bytes_(sizeof(IN6_ADDR)) PVOID pAddrBuf);
typedef PCSTR
(WSAAPI *LPFN_INET_NTOPA)(
IN INT Family,
IN PVOID pAddr,
OUT PSTR pStringBuf,
IN size_t StringBufSize);
_In_ INT Family,
_In_ PVOID pAddr,
_Out_writes_(StringBufSize) PSTR pStringBuf,
_In_ size_t StringBufSize);
typedef PCWSTR
(WSAAPI *LPFN_INET_NTOPW)(
IN INT Family,
IN PVOID pAddr,
OUT PWSTR pStringBuf,
IN size_t StringBufSize);
_In_ INT Family,
_In_ PVOID pAddr,
_Out_writes_(StringBufSize) PWSTR pStringBuf,
_In_ size_t StringBufSize);
#ifdef UNICODE
#define LPFN_INET_PTON LPFN_INET_PTONW
@ -526,7 +526,7 @@ typedef PCWSTR
static __inline
char *
gai_strerrorA(
IN int ecode)
_In_ int ecode)
{
static char buff[GAI_STRERROR_BUFFER_SIZE + 1];
@ -546,7 +546,7 @@ gai_strerrorA(
static __inline
WCHAR *
gai_strerrorW(
IN int ecode)
_In_ int ecode)
{
static WCHAR buff[GAI_STRERROR_BUFFER_SIZE + 1];
@ -568,12 +568,12 @@ gai_strerrorW(
WS2TCPIP_INLINE
int
setipv4sourcefilter(
IN SOCKET Socket,
IN IN_ADDR Interface,
IN IN_ADDR Group,
IN MULTICAST_MODE_TYPE FilterMode,
IN ULONG SourceCount,
IN CONST IN_ADDR *SourceList)
_In_ SOCKET Socket,
_In_ IN_ADDR Interface,
_In_ IN_ADDR Group,
_In_ MULTICAST_MODE_TYPE FilterMode,
_In_ ULONG SourceCount,
_In_reads_(SourceCount) CONST IN_ADDR *SourceList)
{
int Error;
DWORD Size, Returned;
@ -609,15 +609,16 @@ setipv4sourcefilter(
return Error;
}
_Success_(return == 0)
WS2TCPIP_INLINE
int
getipv4sourcefilter(
IN SOCKET Socket,
IN IN_ADDR Interface,
IN IN_ADDR Group,
OUT MULTICAST_MODE_TYPE *FilterMode,
IN OUT ULONG *SourceCount,
OUT IN_ADDR *SourceList)
_In_ SOCKET Socket,
_In_ IN_ADDR Interface,
_In_ IN_ADDR Group,
_Out_ MULTICAST_MODE_TYPE *FilterMode,
_Inout_ ULONG *SourceCount,
_Out_writes_(*SourceCount) IN_ADDR *SourceList)
{
int Error;
DWORD Size, Returned;
@ -662,13 +663,13 @@ getipv4sourcefilter(
WS2TCPIP_INLINE
int
setsourcefilter(
IN SOCKET Socket,
IN ULONG Interface,
IN CONST SOCKADDR *Group,
IN int GroupLength,
IN MULTICAST_MODE_TYPE FilterMode,
IN ULONG SourceCount,
IN CONST SOCKADDR_STORAGE *SourceList)
_In_ SOCKET Socket,
_In_ ULONG Interface,
_In_ CONST SOCKADDR *Group,
_In_ int GroupLength,
_In_ MULTICAST_MODE_TYPE FilterMode,
_In_ ULONG SourceCount,
_In_reads_(SourceCount) CONST SOCKADDR_STORAGE *SourceList)
{
int Error;
DWORD Size, Returned;
@ -701,16 +702,17 @@ setsourcefilter(
return Error;
}
_Success_(return == 0)
WS2TCPIP_INLINE
int
getsourcefilter(
IN SOCKET Socket,
IN ULONG Interface,
IN CONST SOCKADDR *Group,
IN int GroupLength,
OUT MULTICAST_MODE_TYPE *FilterMode,
IN OUT ULONG *SourceCount,
OUT SOCKADDR_STORAGE *SourceList)
_In_ SOCKET Socket,
_In_ ULONG Interface,
_In_ CONST SOCKADDR *Group,
_In_ int GroupLength,
_Out_ MULTICAST_MODE_TYPE *FilterMode,
_Inout_ ULONG *SourceCount,
_Out_writes_(*SourceCount) SOCKADDR_STORAGE *SourceList)
{
int Error;
DWORD Size, Returned;
@ -753,8 +755,8 @@ getsourcefilter(
WS2TCPIP_INLINE
int
idealsendbacklogquery(
IN SOCKET s,
OUT ULONG *pISB)
_In_ SOCKET s,
_Out_ ULONG *pISB)
{
DWORD bytes;
@ -765,9 +767,9 @@ idealsendbacklogquery(
WS2TCPIP_INLINE
int
idealsendbacklognotify(
IN SOCKET s,
IN LPWSAOVERLAPPED lpOverlapped OPTIONAL,
IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine OPTIONAL)
_In_ SOCKET s,
_In_opt_ LPWSAOVERLAPPED lpOverlapped,
_In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
{
DWORD bytes;
@ -786,51 +788,51 @@ WINSOCK_API_LINKAGE
INT
WSAAPI
WSASetSocketSecurity(
IN SOCKET Socket,
IN const SOCKET_SECURITY_SETTINGS *SecuritySettings OPTIONAL,
IN ULONG SecuritySettingsLen,
IN LPWSAOVERLAPPED Overlapped OPTIONAL,
IN LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine OPTIONAL);
_In_ SOCKET Socket,
_In_reads_bytes_opt_(SecuritySettingsLen) const SOCKET_SECURITY_SETTINGS *SecuritySettings,
_In_ ULONG SecuritySettingsLen,
_In_opt_ LPWSAOVERLAPPED Overlapped,
_In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine);
WINSOCK_API_LINKAGE
INT
WSAAPI
WSAQuerySocketSecurity(
IN SOCKET Socket,
IN const SOCKET_SECURITY_QUERY_TEMPLATE *SecurityQueryTemplate OPTIONAL,
IN ULONG SecurityQueryTemplateLen,
OUT SOCKET_SECURITY_QUERY_INFO* SecurityQueryInfo OPTIONAL,
IN OUT ULONG *SecurityQueryInfoLen,
IN LPWSAOVERLAPPED Overlapped OPTIONAL,
IN LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine OPTIONAL);
_In_ SOCKET Socket,
_In_reads_bytes_opt_(SecurityQueryTemplateLen) const SOCKET_SECURITY_QUERY_TEMPLATE *SecurityQueryTemplate,
_In_ ULONG SecurityQueryTemplateLen,
_Out_writes_bytes_to_opt_(*SecurityQueryInfoLen, *SecurityQueryInfoLen) SOCKET_SECURITY_QUERY_INFO* SecurityQueryInfo,
_Inout_ ULONG *SecurityQueryInfoLen,
_In_opt_ LPWSAOVERLAPPED Overlapped,
_In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine);
WINSOCK_API_LINKAGE
INT
WSAAPI
WSASetSocketPeerTargetName(
IN SOCKET Socket,
IN const SOCKET_PEER_TARGET_NAME *PeerTargetName,
IN ULONG PeerTargetNameLen,
IN LPWSAOVERLAPPED Overlapped OPTIONAL,
IN LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine OPTIONAL);
_In_ SOCKET Socket,
_In_reads_bytes_(PeerTargetNameLen) const SOCKET_PEER_TARGET_NAME *PeerTargetName,
_In_ ULONG PeerTargetNameLen,
_In_opt_ LPWSAOVERLAPPED Overlapped,
_In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine);
WINSOCK_API_LINKAGE
INT
WSAAPI
WSADeleteSocketPeerTargetName(
IN SOCKET Socket,
IN const struct sockaddr *PeerAddr,
IN ULONG PeerAddrLen,
IN LPWSAOVERLAPPED Overlapped OPTIONAL,
IN LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine OPTIONAL);
_In_ SOCKET Socket,
_In_reads_bytes_(PeerAddrLen) const struct sockaddr *PeerAddr,
_In_ ULONG PeerAddrLen,
_In_opt_ LPWSAOVERLAPPED Overlapped,
_In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine);
WINSOCK_API_LINKAGE
INT
WSAAPI
WSAImpersonateSocketPeer(
IN SOCKET Socket,
IN const struct sockaddr *PeerAddr OPTIONAL,
IN ULONG PeerAddrLen);
_In_ SOCKET Socket,
_In_reads_bytes_opt_(PeerAddrLen) const struct sockaddr *PeerAddr,
_In_ ULONG PeerAddrLen);
WINSOCK_API_LINKAGE
INT

View file

@ -71,7 +71,8 @@ NTAPI
CpGetByte(
IN PCPPORT Port,
OUT PUCHAR Byte,
IN BOOLEAN Wait
IN BOOLEAN Wait,
IN BOOLEAN Poll
);
VOID

View file

@ -7,9 +7,12 @@ list(APPEND UNICODE_SOURCE
neteventmsg.mc
ntiologc.mc
ntstatus.mc
pciclass.mc
pciclass.mc)
list(APPEND UNICODE_SOURCE_REALLY
sacmsg.mc)
add_message_headers(ANSI ${ANSI_SOURCE})
# FIXME: this needs testing before switching to unicode
add_message_headers(ANSI ${UNICODE_SOURCE})
add_message_headers(UNICODE ${UNICODE_SOURCE_REALLY})

View file

@ -1,7 +1,12 @@
MessageId=1
SymbolicName=SAC_INIT_STATUS
Language=English
Computer is booting, SAC started and initialized.\n\nUse the \"ch -?\" command for information about using channels.\nUse the \"?\" command for general help.
Computer is booting, SAC started and initialized.
Use the "ch -?" command for information about using channels.
Use the "?" command for general help.
.
MessageId=2
@ -25,7 +30,8 @@ The SAC is unavailable, it was directly unloaded.
MessageId=5
SymbolicName=SACDRV_5
Language=English
The SAC will become unavailable soon. The computer is shutting down.\n
The SAC will become unavailable soon. The computer is shutting down.
.
MessageId=6
@ -295,7 +301,9 @@ SAC failed to retrieve the task list.
MessageId=69
SymbolicName=SACDRV_69
Language=English
memory: %%4ld kb uptime:%%3ld %%2ld:%%02ld:%%02ld.%%03ld\n\n
memory: %%4ld kb uptime:%%3ld %%2ld:%%02ld:%%02ld.%%03ld
.
MessageId=70
@ -319,7 +327,8 @@ Language=English
MessageId=73
SymbolicName=SACDRV_73
Language=English
\n Memory:%%7ldK Avail:%%7ldK TotalWs:%%7ldK InRam Kernel:%%5ldK P:%%5ldK
Memory:%%7ldK Avail:%%7ldK TotalWs:%%7ldK InRam Kernel:%%5ldK P:%%5ldK
.
MessageId=74
@ -421,7 +430,8 @@ That process has been killed and is being cleaned up by the system.
MessageId=90
SymbolicName=SACDRV_90
Language=English
A duplicate process id is being cleaned up by the system. Try the \ncommand again in a few seconds.
A duplicate process id is being cleaned up by the system. Try the
command again in a few seconds.
.
MessageId=92
@ -461,7 +471,7 @@ Language=English
.
MessageId=98
SymbolicName=SACDRV_98
SymbolicName=SAC_NO_DATA_MSG
Language=English
None%0
.
@ -473,25 +483,25 @@ Language=English
.
MessageId=100
SymbolicName=SACDRV_100
SymbolicName=SAC_DATACENTER_SUITE_MSG
Language=English
Windows Server 2003 Datacenter Edition%0
.
MessageId=101
SymbolicName=SACDRV_101
SymbolicName=SAC_EMBEDDED_SUITE_MSG
Language=English
Windows Server 2003 Embedded%0
.
MessageId=102
SymbolicName=SACDRV_102
SymbolicName=SAC_ENTERPRISE_SUITE_MSG
Language=English
Windows Server 2003 Enterprise Edition%0
.
MessageId=103
SymbolicName=SACDRV_103
SymbolicName=SAC_NO_SUITE_MSG
Language=English
Windows Server 2003%0
.
@ -523,31 +533,46 @@ Error: Could not find a channel with that name.
MessageId=108
SymbolicName=SACDRV_108
Language=English
Channel List\n \n(Use \"ch -?\" for information on using channels)\n\n# Status Channel Name
Channel List
(Use "ch -?" for information on using channels)
# Status Channel Name
.
MessageId=109
SymbolicName=SACDRV_109
Language=English
EVENT: A new channel has been created. Use \"ch -?\" for channel help.\nChannel: %%s
EVENT: A new channel has been created. Use "ch -?" for channel help.
Channel: %%s
.
MessageId=110
SymbolicName=SACDRV_110
Language=English
EVENT: A channel has been closed.\nChannel: %%s
EVENT: A channel has been closed.
Channel: %%s
.
MessageId=111
SymbolicName=SACDRV_111
Language=English
Name: %%s\nDescription: %%s\nType: %%s\nChannel GUID: %%08lx-%%04x-%%04x-%%02x%%02x-%%02x%%02x%%02x%%02x%%02x%%02x\nApplication Type GUID: %%08lx-%%04x-%%04x-%%02x%%02x-%%02x%%02x%%02x%%02x%%02x%%02x\n\nPress <esc><tab> for next channel.\nPress <esc><tab>0 to return to the SAC channel.\nUse any other key to view this channel.\n
Name: %%s
Description: %%s
Type: %%s
Channel GUID: %%08lx-%%04x-%%04x-%%02x%%02x-%%02x%%02x%%02x%%02x%%02x%%02x
Application Type GUID: %%08lx-%%04x-%%04x-%%02x%%02x-%%02x%%02x%%02x%%02x%%02x%%02x
Press <esc><tab> for next channel.
Press <esc><tab>0 to return to the SAC channel.
Use any other key to view this channel.
.
MessageId=112
SymbolicName=SACDRV_112
Language=English
ch Channel management commands. Use ch -? for more help.
ch Channel management commands. Use ch -? for more help.
.
MessageId=113
@ -571,7 +596,10 @@ SAC preparing to shutdown the system.
MessageId=116
SymbolicName=SACDRV_116
Language=English
Error! Failed to remove channel! \n\nPlease contact your system administrator.\n
Error! Failed to remove channel!
Please contact your system administrator.
.
MessageId=119
@ -583,7 +611,9 @@ cmd Create a Command Prompt channel.
MessageId=120
SymbolicName=SACDRV_120
Language=English
Timeout: Unable to launch a Command Prompt. The service responsible for \n launching Command Prompt channels has timed out. This may be \n because the service is malfunctioning or is unresponsive.
Timeout: Unable to launch a Command Prompt. The service responsible for
launching Command Prompt channels has timed out. This may be
because the service is malfunctioning or is unresponsive.
.
MessageId=121
@ -601,7 +631,10 @@ Error: The SAC Command Console session failed to be created.
MessageId=131
SymbolicName=SACDRV_131
Language=English
Error: Unable to launch a Command Prompt. The service responsible for launching\n Command Prompt channels has not yet registered. This may be because the\n service is not yet started, is disabled by the administrator, is\n malfunctioning or is unresponsive.
Error: Unable to launch a Command Prompt. The service responsible for launching
Command Prompt channels has not yet registered. This may be because the
service is not yet started, is disabled by the administrator, is
malfunctioning or is unresponsive.
.
MessageId=132
@ -619,19 +652,39 @@ EVENT: The CMD command is unavailable.
MessageId=134
SymbolicName=SACDRV_134
Language=English
EVENT: An attempt was made to close a channel but failed.\nChannel: %%s
EVENT: An attempt was made to close a channel but failed.
Channel: %%s
.
MessageId=135
SymbolicName=SACDRV_135
Language=English
EVENT: An attempt to close a channel failed because it is already closed.\nChannel: %%s
EVENT: An attempt to close a channel failed because it is already closed.
Channel: %%s
.
MessageId=136
SymbolicName=SACDRV_136
Language=English
Channel management commands:\n\nch List all channels.\n\nStatus Legend: (AB)\nA: Channel operational status\n 'A' = Channel is active.\n 'I' = Channel is inactive.\nB: Channel Type\n 'V' = VT-UTF8 emulation.\n 'R' = Raw - no emulation.\n\nch -si <#> Switch to a channel by its number.\nch -sn <name> Switch to a channel by its name.\nch -ci <#> Close a channel by its number.\nch -cn <name> Close a channel by its name.\n\nPress <esc><tab> to select a channel.\nPress <esc><tab>0 to return to the SAC channel.
Channel management commands:
ch List all channels.
Status Legend: (AB)
A: Channel operational status
'A' = Channel is active.
'I' = Channel is inactive.
B: Channel Type
'V' = VT-UTF8 emulation.
'R' = Raw - no emulation.
ch -si <#> Switch to a channel by its number.
ch -sn <name> Switch to a channel by its name.
ch -ci <#> Close a channel by its number.
ch -cn <name> Close a channel by its name.
Press <esc><tab> to select a channel.
Press <esc><tab>0 to return to the SAC channel.
.
MessageId=137
@ -695,7 +748,7 @@ The specified gateway IP address is invalid.
.
MessageId=153
SymbolicName=SACDRV_153
SymbolicName=SAC_UNINITIALIZED_MSG
Language=English
not yet initialized%0
.
@ -703,5 +756,5 @@ not yet initialized%0
MessageId=154
SymbolicName=SACDRV_154
Language=English
The maximum number of channels has been reached.
The maximum number of channels has been reached.
.

View file

@ -32,13 +32,6 @@ typedef enum _CSRSRV_API_NUMBER
} CSRSRV_API_NUMBER, *PCSRSRV_API_NUMBER;
/*
typedef struct _CSR_API_NUMBER
{
WORD Index;
WORD Subsystem;
} CSR_API_NUMBER, *PCSR_API_NUMBER;
*/
typedef ULONG CSR_API_NUMBER;
#define CSR_CREATE_API_NUMBER(ServerId, ApiId) \
@ -51,7 +44,7 @@ typedef ULONG CSR_API_NUMBER;
(ULONG)((ULONG)(ApiNumber) & 0xFFFF)
typedef struct _CSR_CONNECTION_INFO
typedef struct _CSR_API_CONNECTINFO
{
ULONG Version;
ULONG Unknown;
@ -62,10 +55,12 @@ typedef struct _CSR_CONNECTION_INFO
ULONG DebugFlags;
ULONG Unknown2[3];
HANDLE ProcessId;
} CSR_CONNECTION_INFO, *PCSR_CONNECTION_INFO;
} CSR_API_CONNECTINFO, *PCSR_API_CONNECTINFO;
#define CSRSRV_VERSION 0x10000
// We must have a size at most equal to the maximum acceptable LPC data size.
C_ASSERT(sizeof(CSR_CONNECTION_INFO) <= LPC_MAX_DATA_LENGTH);
C_ASSERT(sizeof(CSR_API_CONNECTINFO) <= LPC_MAX_DATA_LENGTH);
typedef struct _CSR_IDENTIFY_ALTERTABLE_THREAD
@ -107,7 +102,7 @@ typedef struct _CSR_API_MESSAGE
PORT_MESSAGE Header;
union
{
CSR_CONNECTION_INFO ConnectionInfo; // Uniquely used in CSRSRV for internal signaling (opening a new connection).
CSR_API_CONNECTINFO ConnectionInfo; // Uniquely used in CSRSRV for internal signaling (opening a new connection).
struct
{
PCSR_CAPTURE_BUFFER CsrCaptureData;

View file

@ -52,6 +52,21 @@ typedef enum _BASESRV_API_NUMBER
BasepMaxApiNumber
} BASESRV_API_NUMBER, *PBASESRV_API_NUMBER;
typedef struct _BASESRV_API_CONNECTINFO
{
ULONG ExpectedVersion;
HANDLE DefaultObjectDirectory;
ULONG WindowsVersion;
ULONG CurrentVersion;
ULONG DebugFlags;
WCHAR WindowsDirectory[MAX_PATH];
WCHAR WindowsSystemDirectory[MAX_PATH];
} BASESRV_API_CONNECTINFO, *PBASESRV_API_CONNECTINFO;
#define BASESRV_VERSION 0x10000
typedef struct _BASE_SXS_CREATEPROCESS_MSG
{
ULONG Flags;
@ -94,11 +109,6 @@ typedef struct
HANDLE ThreadHandle;
} BASE_CREATE_THREAD, *PBASE_CREATE_THREAD;
typedef struct
{
UINT uExitCode;
} BASE_EXIT_PROCESS, *PBASE_EXIT_PROCESS;
typedef struct
{
UINT UniqueID;
@ -106,28 +116,33 @@ typedef struct
typedef struct
{
ULONG iTask;
UINT uExitCode;
} BASE_EXIT_PROCESS, *PBASE_EXIT_PROCESS;
typedef struct
{
ULONG iTask;
HANDLE ConsoleHandle;
ULONG BinaryType;
ULONG BinaryType;
HANDLE WaitObjectForParent;
HANDLE StdIn;
HANDLE StdOut;
HANDLE StdErr;
ULONG CodePage;
ULONG dwCreationFlags;
PCHAR CmdLine;
PCHAR appName;
PCHAR PifFile;
PCHAR CurDirectory;
PCHAR Env;
ULONG EnvLen;
PVOID StartupInfo;
PCHAR Desktop;
ULONG DesktopLen;
PCHAR Title;
ULONG TitleLen;
PCHAR Reserved;
ULONG ReservedLen;
ULONG CodePage;
ULONG dwCreationFlags;
PCHAR CmdLine;
PCHAR appName;
PCHAR PifFile;
PCHAR CurDirectory;
PCHAR Env;
ULONG EnvLen;
LPSTARTUPINFOA StartupInfo;
PCHAR Desktop;
ULONG DesktopLen;
PCHAR Title;
ULONG TitleLen;
PCHAR Reserved;
ULONG ReservedLen;
USHORT CmdLen;
USHORT AppLen;
USHORT PifLen;
@ -138,8 +153,8 @@ typedef struct
typedef struct
{
ULONG iTask;
ULONG BinaryType;
ULONG iTask;
ULONG BinaryType;
HANDLE ConsoleHandle;
HANDLE VDMProcessHandle;
HANDLE WaitObjectForParent;
@ -147,24 +162,87 @@ typedef struct
USHORT VDMCreationState;
} BASE_UPDATE_VDM_ENTRY, *PBASE_UPDATE_VDM_ENTRY;
typedef struct
{
ULONG iTask;
HANDLE ConsoleHandle;
HANDLE WaitObjectForVDM;
HANDLE StdIn;
HANDLE StdOut;
HANDLE StdErr;
ULONG CodePage;
ULONG dwCreationFlags;
ULONG ExitCode;
PCHAR CmdLine;
PCHAR AppName;
PCHAR PifFile;
PCHAR CurDirectory;
PCHAR Env;
ULONG EnvLen;
LPSTARTUPINFOA StartupInfo;
PCHAR Desktop;
ULONG DesktopLen;
PCHAR Title;
ULONG TitleLen;
PCHAR Reserved;
ULONG ReservedLen;
USHORT CurrentDrive;
USHORT CmdLen;
USHORT AppLen;
USHORT PifLen;
USHORT CurDirectoryLen;
USHORT VDMState;
ULONG fComingFromBat;
} BASE_GET_NEXT_VDM_COMMAND, *PBASE_GET_NEXT_VDM_COMMAND;
typedef struct
{
HANDLE ConsoleHandle;
ULONG iWowTask;
HANDLE WaitObjectForVDM;
} BASE_EXIT_VDM, *PBASE_EXIT_VDM;
typedef struct
{
ULONG FirstVDM;
} BASE_IS_FIRST_VDM, *PBASE_IS_FIRST_VDM;
typedef struct
{
HANDLE ConsoleHandle;
HANDLE hParent;
ULONG ExitCode;
ULONG ExitCode;
} BASE_GET_VDM_EXIT_CODE, *PBASE_GET_VDM_EXIT_CODE;
typedef struct
{
DWORD Level;
DWORD Flags;
} BASE_SET_PROCESS_SHUTDOWN_PARAMS, *PBASE_SET_PROCESS_SHUTDOWN_PARAMS;
HANDLE ConsoleHandle;
ULONG fIncDec;
} BASE_SET_REENTER_COUNT, *PBASE_SET_REENTER_COUNT;
typedef struct
{
DWORD Level;
DWORD Flags;
} BASE_GET_PROCESS_SHUTDOWN_PARAMS, *PBASE_GET_PROCESS_SHUTDOWN_PARAMS;
ULONG ShutdownLevel;
ULONG ShutdownFlags;
} BASE_GETSET_PROCESS_SHUTDOWN_PARAMS, *PBASE_GETSET_PROCESS_SHUTDOWN_PARAMS;
typedef struct
{
HANDLE ConsoleHandle;
PCHAR lpszzCurDirs;
ULONG cchCurDirs;
} BASE_GETSET_VDM_CURDIRS, *PBASE_GETSET_VDM_CURDIRS;
typedef struct
{
HANDLE ConsoleHandle;
ULONG fBeginEnd;
} BASE_BAT_NOTIFICATION, *PBASE_BAT_NOTIFICATION;
typedef struct
{
HANDLE hwndWowExec;
} BASE_REGISTER_WOWEXEC, *PBASE_REGISTER_WOWEXEC;
typedef struct
{
@ -173,9 +251,14 @@ typedef struct
typedef struct
{
UNICODE_STRING IniFileName;
} BASE_REFRESH_INIFILE_MAPPING, *PBASE_REFRESH_INIFILE_MAPPING;
typedef struct
{
ULONG Flags;
UNICODE_STRING DeviceName;
UNICODE_STRING TargetName;
DWORD dwFlags;
UNICODE_STRING TargetPath;
} BASE_DEFINE_DOS_DEVICE, *PBASE_DEFINE_DOS_DEVICE;
typedef struct _BASE_API_MESSAGE
@ -190,14 +273,21 @@ typedef struct _BASE_API_MESSAGE
{
BASE_CREATE_PROCESS CreateProcessRequest;
BASE_CREATE_THREAD CreateThreadRequest;
BASE_GET_TEMP_FILE GetTempFileRequest;
BASE_EXIT_PROCESS ExitProcessRequest;
BASE_GET_TEMP_FILE GetTempFile;
BASE_CHECK_VDM CheckVdm;
BASE_UPDATE_VDM_ENTRY UpdateVdmEntry;
BASE_GET_VDM_EXIT_CODE GetVdmExitCode;
BASE_SET_PROCESS_SHUTDOWN_PARAMS SetShutdownParametersRequest;
BASE_GET_PROCESS_SHUTDOWN_PARAMS GetShutdownParametersRequest;
BASE_CHECK_VDM CheckVDMRequest;
BASE_UPDATE_VDM_ENTRY UpdateVDMEntryRequest;
BASE_GET_NEXT_VDM_COMMAND GetNextVDMCommandRequest;
BASE_EXIT_VDM ExitVDMRequest;
BASE_IS_FIRST_VDM IsFirstVDMRequest;
BASE_GET_VDM_EXIT_CODE GetVDMExitCodeRequest;
BASE_SET_REENTER_COUNT SetReenterCountRequest;
BASE_GETSET_PROCESS_SHUTDOWN_PARAMS ShutdownParametersRequest;
BASE_GETSET_VDM_CURDIRS VDMCurrentDirsRequest;
BASE_BAT_NOTIFICATION BatNotificationRequest;
BASE_REGISTER_WOWEXEC RegisterWowExecRequest;
BASE_SOUND_SENTRY SoundSentryRequest;
BASE_REFRESH_INIFILE_MAPPING RefreshIniFileMappingRequest;
BASE_DEFINE_DOS_DEVICE DefineDosDeviceRequest;
} Data;
} BASE_API_MESSAGE, *PBASE_API_MESSAGE;

View file

@ -126,7 +126,7 @@ typedef struct _CONSOLE_START_INFO
INT IconIndex; // Index of the icon
} CONSOLE_START_INFO, *PCONSOLE_START_INFO;
typedef struct _CONSOLE_CONNECTION_INFO
typedef struct _CONSRV_API_CONNECTINFO
{
BOOL ConsoleNeeded; // Used for GUI apps only.
@ -140,7 +140,7 @@ typedef struct _CONSOLE_CONNECTION_INFO
HANDLE InputWaitHandle;
LPTHREAD_START_ROUTINE CtrlDispatcher;
LPTHREAD_START_ROUTINE PropDispatcher;
} CONSOLE_CONNECTION_INFO, *PCONSOLE_CONNECTION_INFO;
} CONSRV_API_CONNECTINFO, *PCONSRV_API_CONNECTINFO;
typedef struct

View file

@ -255,7 +255,8 @@ USHORT
NTAPI
CpGetByte(IN PCPPORT Port,
OUT PUCHAR Byte,
IN BOOLEAN Wait)
IN BOOLEAN Wait,
IN BOOLEAN Poll)
{
UCHAR Lsr;
ULONG LimitCount = Wait ? TIMEOUT_COUNT : 1;
@ -277,6 +278,9 @@ CpGetByte(IN PCPPORT Port,
return CP_GET_ERROR;
}
/* If only polling was requested by caller, return now */
if (Poll) return CP_GET_SUCCESS;
/* Otherwise read the byte and return it */
*Byte = READ_PORT_UCHAR(Port->Address + RECEIVE_BUFFER_REGISTER);

View file

@ -42,7 +42,7 @@ RtlpMapFile(PUNICODE_STRING ImageFileName,
FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE);
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to read image file from disk\n");
DPRINT1("Failed to read image file from disk, Status = 0x%08X\n", Status);
return Status;
}
@ -56,7 +56,7 @@ RtlpMapFile(PUNICODE_STRING ImageFileName,
hFile);
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to create section for image file\n");
DPRINT1("Failed to create section for image file, Status = 0x%08X\n", Status);
}
ZwClose(hFile);

View file

@ -17,118 +17,173 @@ PHEADLESS_GLOBALS HeadlessGlobals;
/* FUNCTIONS *****************************************************************/
FORCEINLINE
KIRQL
HdlspAcquireGlobalLock(VOID)
{
KIRQL OldIrql;
/* Don't acquire the lock if we are bugchecking */
if (!HeadlessGlobals->InBugCheck)
{
KeAcquireSpinLock(&HeadlessGlobals->SpinLock, &OldIrql);
}
else
{
OldIrql = 0xFF;
}
return OldIrql;
}
FORCEINLINE
VOID
HdlspReleaselobalLock(IN KIRQL OldIrql)
{
/* Only release the lock if we aren't bugchecking */
if (OldIrql != 0xFF)
{
KeReleaseSpinLock(&HeadlessGlobals->SpinLock, OldIrql);
}
else
{
ASSERT(HeadlessGlobals->InBugCheck == TRUE);
}
}
VOID
NTAPI
HdlspSendStringAtBaud(
IN PUCHAR String
)
HdlspSendStringAtBaud(IN PUCHAR String)
{
/* Send every byte */
while (*String++ != ANSI_NULL)
{
InbvPortPutByte(HeadlessGlobals->TerminalPort, *String);
}
/* Send every byte */
while (*String++ != ANSI_NULL)
{
InbvPortPutByte(HeadlessGlobals->TerminalPort, *String);
}
}
NTSTATUS
NTAPI
HdlspEnableTerminal(
IN BOOLEAN Enable
)
HdlspEnableTerminal(IN BOOLEAN Enable)
{
/* Enable if requested, as long as this isn't a PCI serial port crashing */
if ((Enable) &&
!(HeadlessGlobals->TerminalEnabled) &&
!((HeadlessGlobals->IsMMIODevice) && (HeadlessGlobals->InBugCheck)))
{
/* Initialize the COM port with cportlib */
HeadlessGlobals->TerminalEnabled = InbvPortInitialize(
HeadlessGlobals->TerminalBaudRate,
HeadlessGlobals->TerminalPortNumber,
HeadlessGlobals->TerminalPortAddress,
&HeadlessGlobals->TerminalPort,
HeadlessGlobals->IsMMIODevice);
if (!HeadlessGlobals->TerminalEnabled) return STATUS_UNSUCCESSFUL;
/* Enable if requested, as long as this isn't a PCI serial port crashing */
if ((Enable) &&
!(HeadlessGlobals->TerminalEnabled) &&
!((HeadlessGlobals->IsMMIODevice) && (HeadlessGlobals->InBugCheck)))
{
/* Initialize the COM port with cportlib */
HeadlessGlobals->TerminalEnabled = InbvPortInitialize(HeadlessGlobals->
TerminalBaudRate,
HeadlessGlobals->
TerminalPortNumber,
HeadlessGlobals->
TerminalPortAddress,
&HeadlessGlobals->
TerminalPort,
HeadlessGlobals->
IsMMIODevice);
if (!HeadlessGlobals->TerminalEnabled)
{
DPRINT1("Failed to initialize port through cportlib\n");
return STATUS_UNSUCCESSFUL;
}
/* Cleanup the screen and reset the cursor */
HdlspSendStringAtBaud((PUCHAR)"\x1B[2J");
HdlspSendStringAtBaud((PUCHAR)"\x1B[H");
/* Cleanup the screen and reset the cursor */
HdlspSendStringAtBaud((PUCHAR)"\x1B[2J");
HdlspSendStringAtBaud((PUCHAR)"\x1B[H");
/* Enable FIFO */
InbvPortEnableFifo(HeadlessGlobals->TerminalPort, TRUE);
}
else if (!Enable)
{
/* Specific case when headless is being disabled */
InbvPortTerminate(HeadlessGlobals->TerminalPort);
HeadlessGlobals->TerminalPort = 0;
HeadlessGlobals->TerminalEnabled = FALSE;
}
return STATUS_SUCCESS;
/* Enable FIFO */
InbvPortEnableFifo(HeadlessGlobals->TerminalPort, TRUE);
}
else if (!Enable)
{
/* Specific case when headless is being disabled */
InbvPortTerminate(HeadlessGlobals->TerminalPort);
HeadlessGlobals->TerminalPort = 0;
HeadlessGlobals->TerminalEnabled = FALSE;
}
/* All done */
return STATUS_SUCCESS;
}
VOID
NTAPI
INIT_FUNCTION
HeadlessInit(
IN PLOADER_PARAMETER_BLOCK LoaderBlock
)
HeadlessInit(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
PHEADLESS_LOADER_BLOCK HeadlessBlock;
PHEADLESS_LOADER_BLOCK HeadlessBlock;
HeadlessBlock = LoaderBlock->Extension->HeadlessLoaderBlock;
if (!HeadlessBlock) return;
if ((HeadlessBlock->PortNumber > 4) && (HeadlessBlock->UsedBiosSettings)) return;
/* Only initialize further if the loader found EMS enabled */
HeadlessBlock = LoaderBlock->Extension->HeadlessLoaderBlock;
if (!HeadlessBlock) return;
HeadlessGlobals = ExAllocatePoolWithTag(
NonPagedPool,
sizeof(HEADLESS_GLOBALS),
'sldH');
if (!HeadlessGlobals) return;
/* Ignore invalid EMS settings */
if ((HeadlessBlock->PortNumber > 4) && (HeadlessBlock->UsedBiosSettings)) return;
/* Zero and copy loader data */
RtlZeroMemory(HeadlessGlobals, sizeof(HEADLESS_GLOBALS));
HeadlessGlobals->TerminalPortNumber = HeadlessBlock->PortNumber;
HeadlessGlobals->TerminalPortAddress = HeadlessBlock->PortAddress;
HeadlessGlobals->TerminalBaudRate = HeadlessBlock->BaudRate;
HeadlessGlobals->TerminalParity = HeadlessBlock->Parity;
HeadlessGlobals->TerminalStopBits = HeadlessBlock->StopBits;
HeadlessGlobals->UsedBiosSettings = HeadlessBlock->UsedBiosSettings;
HeadlessGlobals->IsMMIODevice = HeadlessBlock->IsMMIODevice;
HeadlessGlobals->TerminalType = HeadlessBlock->TerminalType;
HeadlessGlobals->SystemGUID = HeadlessBlock->SystemGUID;
/* Allocate the global headless data */
HeadlessGlobals = ExAllocatePoolWithTag(NonPagedPool,
sizeof(*HeadlessGlobals),
'sldH');
if (!HeadlessGlobals) return;
/* These two are opposites of each other */
if (HeadlessGlobals->IsMMIODevice) HeadlessGlobals->IsNonLegacyDevice = TRUE;
/* Zero and copy loader data */
RtlZeroMemory(HeadlessGlobals, sizeof(*HeadlessGlobals));
HeadlessGlobals->TerminalPortNumber = HeadlessBlock->PortNumber;
HeadlessGlobals->TerminalPortAddress = HeadlessBlock->PortAddress;
HeadlessGlobals->TerminalBaudRate = HeadlessBlock->BaudRate;
HeadlessGlobals->TerminalParity = HeadlessBlock->Parity;
HeadlessGlobals->TerminalStopBits = HeadlessBlock->StopBits;
HeadlessGlobals->UsedBiosSettings = HeadlessBlock->UsedBiosSettings;
HeadlessGlobals->IsMMIODevice = HeadlessBlock->IsMMIODevice;
HeadlessGlobals->TerminalType = HeadlessBlock->TerminalType;
HeadlessGlobals->SystemGUID = HeadlessBlock->SystemGUID;
DPRINT1("EMS on Port %d (0x%lx) at %d bps\n",
HeadlessGlobals->TerminalPortNumber,
HeadlessGlobals->TerminalPortAddress,
HeadlessGlobals->TerminalBaudRate);
/* Check for a PCI device, warn that this isn't supported */
if (HeadlessBlock->PciDeviceId != PCI_INVALID_VENDORID)
{
DPRINT1("PCI Serial Ports not supported\n");
}
/* These two are opposites of each other */
if (HeadlessGlobals->IsMMIODevice) HeadlessGlobals->IsNonLegacyDevice = TRUE;
/* Log entries are not yet supported */
DPRINT1("FIXME: No Headless logging support\n");
/* Check for a PCI device, warn that this isn't supported */
if (HeadlessBlock->PciDeviceId != PCI_INVALID_VENDORID)
{
DPRINT1("PCI Serial Ports not supported\n");
}
/* Allocate temporary buffer */
HeadlessGlobals->TmpBuffer = ExAllocatePoolWithTag(NonPagedPool, 80, 'sldH');
if (!HeadlessGlobals->TmpBuffer) return;
/* Log entries are not yet supported */
DPRINT1("FIXME: No Headless logging support\n");
/* Windows seems to apply some special hacks for 9600 bps */
if (HeadlessGlobals->TerminalBaudRate == 9600)
{
DPRINT1("Please use other baud rate than 9600bps for now\n");
}
/* Allocate temporary buffer */
HeadlessGlobals->TmpBuffer = ExAllocatePoolWithTag(NonPagedPool, 80, 'sldH');
if (!HeadlessGlobals->TmpBuffer) return;
/* Enable the terminal */
HdlspEnableTerminal(TRUE);
/* Windows seems to apply some special hacks for 9600 bps */
if (HeadlessGlobals->TerminalBaudRate == 9600)
{
DPRINT1("Please use other baud rate than 9600bps for now\n");
}
/* Enable the terminal */
HdlspEnableTerminal(TRUE);
}
VOID
NTAPI
HdlspPutString(
IN PUCHAR String
)
HdlspPutData(IN PUCHAR Data,
IN ULONG DataSize)
{
ULONG i;
for (i = 0; i < DataSize; i++)
{
InbvPortPutByte(HeadlessGlobals->TerminalPort, Data[i]++);
}
}
VOID
NTAPI
HdlspPutString(IN PUCHAR String)
{
PUCHAR Dest = HeadlessGlobals->TmpBuffer;
UCHAR Char = 0;
@ -197,62 +252,95 @@ HdlspPutString(
NTSTATUS
NTAPI
HdlspDispatch(
IN HEADLESS_CMD Command,
IN PVOID InputBuffer,
IN SIZE_T InputBufferSize,
OUT PVOID OutputBuffer,
OUT PSIZE_T OutputBufferSize
)
HdlspDispatch(IN HEADLESS_CMD Command,
IN PVOID InputBuffer,
IN SIZE_T InputBufferSize,
OUT PVOID OutputBuffer,
OUT PSIZE_T OutputBufferSize)
{
//NTSTATUS Status = STATUS_NOT_IMPLEMENTED;
ASSERT(HeadlessGlobals != NULL);
KIRQL OldIrql;
PHEADLESS_RSP_QUERY_INFO HeadlessInfo;
PHEADLESS_CMD_PUT_STRING PutString;
PHEADLESS_CMD_ENABLE_TERMINAL EnableTerminal;
PHEADLESS_RSP_GET_BYTE GetByte;
NTSTATUS Status = STATUS_NOT_IMPLEMENTED;
ASSERT(HeadlessGlobals != NULL);
// ASSERT(HeadlessGlobals->PageLockHandle != NULL);
/* FIXME: This should be using the headless spinlock */
/* Ignore non-reentrant commands */
if ((Command != HeadlessCmdAddLogEntry) &&
(Command != HeadlessCmdStartBugCheck) &&
(Command != HeadlessCmdSendBlueScreenData) &&
(Command != HeadlessCmdDoBugCheckProcessing))
{
OldIrql = HdlspAcquireGlobalLock();
/* Ignore non-reentrant commands */
if ((Command != HeadlessCmdAddLogEntry) &&
(Command != HeadlessCmdStartBugCheck) &&
(Command != HeadlessCmdSendBlueScreenData) &&
(Command != HeadlessCmdDoBugCheckProcessing))
{
if (HeadlessGlobals->ProcessingCmd) return STATUS_UNSUCCESSFUL;
if (HeadlessGlobals->ProcessingCmd)
{
HdlspReleaselobalLock(OldIrql);
return STATUS_UNSUCCESSFUL;
}
/* Don't allow these commands next time */
HeadlessGlobals->ProcessingCmd = TRUE;
}
/* Don't allow these commands next time */
HeadlessGlobals->ProcessingCmd = TRUE;
HdlspReleaselobalLock(OldIrql);
}
/* Handle each command */
switch (Command)
{
case HeadlessCmdEnableTerminal:
/* Make sure the caller passed valid data */
if (!(InputBuffer) ||
(InputBufferSize != sizeof(*EnableTerminal)))
{
DPRINT1("Invalid buffer\n");
Status = STATUS_INVALID_PARAMETER;
break;
}
/* Go and enable it */
EnableTerminal = InputBuffer;
Status = HdlspEnableTerminal(EnableTerminal->Enable);
break;
/* Handle each command */
switch (Command)
{
case HeadlessCmdEnableTerminal:
break;
case HeadlessCmdCheckForReboot:
break;
case HeadlessCmdPutString:
/* Validate the existence of an input buffer */
if (!InputBuffer)
{
//Status = STATUS_INVALID_PARAMETER;
goto Reset;
}
/* Validate the existence of an input buffer */
if (!InputBuffer)
{
Status = STATUS_INVALID_PARAMETER;
break;
}
/* Terminal should be on */
if (HeadlessGlobals->TerminalEnabled)
{
/* Print each byte in the string making sure VT100 chars are used */
PHEADLESS_CMD_PUT_STRING PutString = (PVOID)InputBuffer;
HdlspPutString(PutString->String);
}
/* Terminal should be on */
if (HeadlessGlobals->TerminalEnabled)
{
/* Print each byte in the string making sure VT100 chars are used */
PutString = InputBuffer;
HdlspPutString(PutString->String);
}
/* Return success either way */
Status = STATUS_SUCCESS;
break;
case HeadlessCmdClearDisplay:
/* Send the VT100 clear screen command if the terminal is enabled */
if (HeadlessGlobals->TerminalEnabled)
{
HdlspSendStringAtBaud((PUCHAR)"\033[2J");
}
/* Return success either way */
Status = STATUS_SUCCESS;
break;
/* Return success either way */
//Status = STATUS_SUCCESS;
break;
case HeadlessCmdClearDisplay:
break;
case HeadlessCmdClearToEndOfDisplay:
break;
case HeadlessCmdClearToEndOfLine:
@ -267,8 +355,46 @@ HdlspDispatch(
break;
case HeadlessCmdTerminalPoll:
break;
case HeadlessCmdGetByte:
break;
case HeadlessCmdGetByte:
/* Make sure the caller passed valid data */
if (!(OutputBuffer) ||
!(OutputBufferSize) ||
(*OutputBufferSize < sizeof(*GetByte)))
{
DPRINT1("Invalid buffer\n");
Status = STATUS_INVALID_PARAMETER;
break;
}
/* Make sure the terminal is enabled */
GetByte = OutputBuffer;
if (HeadlessGlobals->TerminalEnabled)
{
/* Poll if something is on the wire */
if (InbvPortPollOnly(HeadlessGlobals->TerminalPort))
{
/* If so, read it */
InbvPortGetByte(HeadlessGlobals->TerminalPort,
&GetByte->Value);
}
else
{
/* Nothing is there, return 0 */
GetByte->Value = 0;
}
}
else
{
/* Otherwise return nothing */
GetByte->Value = 0;
}
/* Return success either way */
Status = STATUS_SUCCESS;
break;
case HeadlessCmdGetLine:
break;
case HeadlessCmdStartBugCheck:
@ -276,77 +402,145 @@ HdlspDispatch(
case HeadlessCmdDoBugCheckProcessing:
break;
case HeadlessCmdQueryInformation:
break;
/* Make sure the caller passed valid data */
if (!(OutputBuffer) ||
!(OutputBufferSize) ||
(*OutputBufferSize < sizeof(*HeadlessInfo)))
{
DPRINT1("Invalid buffer\n");
Status = STATUS_INVALID_PARAMETER;
break;
}
/* If we got here, headless is enabled -- we know this much */
HeadlessInfo = OutputBuffer;
HeadlessInfo->PortType = HeadlessSerialPort;
HeadlessInfo->Serial.TerminalAttached = TRUE;
HeadlessInfo->Serial.UsedBiosSettings = HeadlessGlobals->UsedBiosSettings;
HeadlessInfo->Serial.TerminalBaudRate = HeadlessGlobals->TerminalBaudRate;
HeadlessInfo->Serial.TerminalType = HeadlessGlobals->TerminalType;
/* Now check on what port/baud it's enabled on */
if ((HeadlessGlobals->TerminalPortNumber >= 1) ||
(HeadlessGlobals->UsedBiosSettings))
{
/* Get the EMS information */
HeadlessInfo->Serial.TerminalPort = HeadlessGlobals->
TerminalPortNumber;
HeadlessInfo->Serial.TerminalPortBaseAddress = HeadlessGlobals->
TerminalPortAddress;
}
else
{
/* We don't know for sure */
HeadlessInfo->Serial.TerminalPort = SerialPortUndefined;
HeadlessInfo->Serial.TerminalPortBaseAddress = 0;
}
/* All done */
Status = STATUS_SUCCESS;
break;
case HeadlessCmdAddLogEntry:
break;
case HeadlessCmdDisplayLog:
break;
case HeadlessCmdSetBlueScreenData:
break;
case HeadlessCmdSetBlueScreenData:
/* Validate the existence of an input buffer */
if (!InputBuffer)
{
Status = STATUS_INVALID_PARAMETER;
break;
}
/* Lie so that we can get Hdl bringup a little bit further */
UNIMPLEMENTED;
Status = STATUS_SUCCESS;
break;
case HeadlessCmdSendBlueScreenData:
break;
case HeadlessCmdQueryGUID:
break;
case HeadlessCmdPutData:
break;
default:
break;
}
Reset:
/* Unset prcessing state */
if ((Command != HeadlessCmdAddLogEntry) &&
(Command != HeadlessCmdStartBugCheck) &&
(Command != HeadlessCmdSendBlueScreenData) &&
(Command != HeadlessCmdDoBugCheckProcessing))
{
ASSERT(HeadlessGlobals->ProcessingCmd == TRUE);
HeadlessGlobals->ProcessingCmd = FALSE;
}
/* Validate the existence of an input buffer */
if (!(InputBuffer) || !(InputBufferSize))
{
Status = STATUS_INVALID_PARAMETER;
break;
}
//UNIMPLEMENTED;
return STATUS_SUCCESS;
/* Terminal should be on */
if (HeadlessGlobals->TerminalEnabled)
{
/* Print each byte in the string making sure VT100 chars are used */
PutString = InputBuffer;
HdlspPutData(PutString->String, InputBufferSize);
}
/* Return success either way */
Status = STATUS_SUCCESS;
break;
default:
break;
}
/* Unset processing state */
if ((Command != HeadlessCmdAddLogEntry) &&
(Command != HeadlessCmdStartBugCheck) &&
(Command != HeadlessCmdSendBlueScreenData) &&
(Command != HeadlessCmdDoBugCheckProcessing))
{
ASSERT(HeadlessGlobals->ProcessingCmd == TRUE);
HeadlessGlobals->ProcessingCmd = FALSE;
}
/* All done */
return Status;
}
/*
* @unimplemented
* @implemented
*/
NTSTATUS
NTAPI
HeadlessDispatch(
IN HEADLESS_CMD Command,
IN PVOID InputBuffer,
IN SIZE_T InputBufferSize,
OUT PVOID OutputBuffer,
OUT PSIZE_T OutputBufferSize
)
HeadlessDispatch(IN HEADLESS_CMD Command,
IN PVOID InputBuffer,
IN SIZE_T InputBufferSize,
OUT PVOID OutputBuffer,
OUT PSIZE_T OutputBufferSize)
{
/* Check for stubs that will expect something even with headless off */
if (!HeadlessGlobals)
{
/* Don't allow the SAC to connect */
if (Command == HeadlessCmdEnableTerminal) return STATUS_UNSUCCESSFUL;
/* Check for stubs that will expect something even with headless off */
if (!HeadlessGlobals)
{
/* Don't allow the SAC to connect */
if (Command == HeadlessCmdEnableTerminal) return STATUS_UNSUCCESSFUL;
/* Send bogus reply */
if ((Command == HeadlessCmdQueryInformation) ||
(Command == HeadlessCmdGetByte) ||
(Command == HeadlessCmdGetLine) ||
(Command == HeadlessCmdCheckForReboot) ||
(Command == HeadlessCmdTerminalPoll))
{
if (!(OutputBuffer) || !(OutputBufferSize)) return STATUS_INVALID_PARAMETER;
RtlZeroMemory(OutputBuffer, *OutputBufferSize);
}
return STATUS_SUCCESS;
}
/* Do the real work */
return HdlspDispatch(
Command,
InputBuffer,
InputBufferSize,
OutputBuffer,
OutputBufferSize);
}
/* Send bogus reply */
if ((Command == HeadlessCmdQueryInformation) ||
(Command == HeadlessCmdGetByte) ||
(Command == HeadlessCmdGetLine) ||
(Command == HeadlessCmdCheckForReboot) ||
(Command == HeadlessCmdTerminalPoll))
{
if (!(OutputBuffer) || !(OutputBufferSize))
{
return STATUS_INVALID_PARAMETER;
}
RtlZeroMemory(OutputBuffer, *OutputBufferSize);
}
return STATUS_SUCCESS;
}
/* Do the real work */
return HdlspDispatch(Command,
InputBuffer,
InputBufferSize,
OutputBuffer,
OutputBufferSize);
}
/* EOF */

View file

@ -23,6 +23,25 @@ CPPORT Port[4] =
/* FUNCTIONS *****************************************************************/
BOOLEAN
NTAPI
InbvPortPollOnly(IN ULONG PortId)
{
UCHAR Dummy;
/* Poll a byte from the port */
return CpGetByte(&Port[PortId], &Dummy, FALSE, TRUE) == CP_GET_SUCCESS;
}
BOOLEAN
NTAPI
InbvPortGetByte(IN ULONG PortId,
OUT PUCHAR Char)
{
/* Read a byte from the port */
return CpGetByte(&Port[PortId], Char, TRUE, FALSE) == CP_GET_SUCCESS;
}
VOID
NTAPI
InbvPortEnableFifo(IN ULONG PortId,

View file

@ -72,12 +72,11 @@ typedef struct _HEADLESS_LOG_ENTRY
//
// Headless Bugcheck Information
//
typedef struct _HEADLESS_BLUE_SCREEN_DATA
typedef struct _HEADLESS_CMD_SET_BLUE_SCREEN_DATA
{
PUCHAR Property;
PUCHAR XMLData;
struct _HEADLESS_BLUE_SCREEN_DATA *Next;
} HEADLESS_BLUE_SCREEN_DATA, * PHEADLESS_BLUE_SCREEN_DATA;
ULONG ValueIndex;
UCHAR Data[ANYSIZE_ARRAY];
} HEADLESS_CMD_SET_BLUE_SCREEN_DATA, *PHEADLESS_CMD_SET_BLUE_SCREEN_DATA;
//
// Headless Control Structure, mostly for !SAC
@ -89,7 +88,7 @@ typedef struct _HEADLESS_GLOBALS
PHEADLESS_LOG_ENTRY LogEntries;
PUCHAR TmpBuffer;
PUCHAR InputBuffer;
PHEADLESS_BLUE_SCREEN_DATA BlueScreenData;
PHEADLESS_CMD_SET_BLUE_SCREEN_DATA BlueScreenData;
union
{
struct
@ -183,11 +182,21 @@ typedef struct _HEADLESS_RSP_QUERY_INFO
};
} HEADLESS_RSP_QUERY_INFO, *PHEADLESS_RSP_QUERY_INFO;
typedef struct _HEADLESS_CMD_ENABLE_TERMINAL
{
BOOLEAN Enable;
} HEADLESS_CMD_ENABLE_TERMINAL, *PHEADLESS_CMD_ENABLE_TERMINAL;
typedef struct _HEADLESS_CMD_PUT_STRING
{
UCHAR String[1];
} HEADLESS_CMD_PUT_STRING, *PHEADLESS_CMD_PUT_STRING;
typedef struct _HEADLESS_RSP_GET_BYTE
{
UCHAR Value;
} HEADLESS_RSP_GET_BYTE, *PHEADLESS_RSP_GET_BYTE;
NTSTATUS
NTAPI
HeadlessDispatch(

View file

@ -107,4 +107,17 @@ InbvPortInitialize(
IN BOOLEAN IsMMIODevice
);
BOOLEAN
NTAPI
InbvPortPollOnly(
IN ULONG PortId
);
BOOLEAN
NTAPI
InbvPortGetByte(
IN ULONG PortId,
OUT PUCHAR Char
);
extern BOOLEAN InbvBootDriverInstalled;

View file

@ -136,7 +136,7 @@ KdPortGetByteEx(
IN PCPPORT PortInformation,
OUT PUCHAR ByteReceived)
{
return (CpGetByte(PortInformation, ByteReceived, FALSE) == CP_GET_SUCCESS);
return (CpGetByte(PortInformation, ByteReceived, FALSE, TRUE) == CP_GET_SUCCESS);
}
VOID

View file

@ -33,51 +33,33 @@ RtlGetNtGlobalFlags(VOID)
}
/*
* @implemented
*/
NTSTATUS NTAPI
* @implemented
*/
NTSTATUS
NTAPI
RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
{
LONG i;
ULONG MaxLength;
PAGED_CODE();
if (lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOW) ||
lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOEXW))
/* Return the basics */
lpVersionInformation->dwMajorVersion = NtMajorVersion;
lpVersionInformation->dwMinorVersion = NtMinorVersion;
lpVersionInformation->dwBuildNumber = NtBuildNumber & 0x3FFF;
lpVersionInformation->dwPlatformId = VER_PLATFORM_WIN32_NT;
/* Check if this is the extended version */
if (lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOEXW))
{
lpVersionInformation->dwMajorVersion = NtMajorVersion;
lpVersionInformation->dwMinorVersion = NtMinorVersion;
lpVersionInformation->dwBuildNumber = NtBuildNumber;
lpVersionInformation->dwPlatformId = VER_PLATFORM_WIN32_NT;
RtlZeroMemory(lpVersionInformation->szCSDVersion, sizeof(lpVersionInformation->szCSDVersion));
if(((CmNtCSDVersion >> 8) & 0xFF) != 0)
{
MaxLength = (sizeof(lpVersionInformation->szCSDVersion) / sizeof(lpVersionInformation->szCSDVersion[0])) - 1;
i = _snwprintf(lpVersionInformation->szCSDVersion,
MaxLength,
L"Service Pack %d",
((CmNtCSDVersion >> 8) & 0xFF));
if (i < 0)
{
/* Null-terminate if it was overflowed */
lpVersionInformation->szCSDVersion[MaxLength] = L'\0';
}
}
if (lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOEXW))
{
PRTL_OSVERSIONINFOEXW InfoEx = (PRTL_OSVERSIONINFOEXW)lpVersionInformation;
InfoEx->wServicePackMajor = (USHORT)(CmNtCSDVersion >> 8) & 0xFF;
InfoEx->wServicePackMinor = (USHORT)(CmNtCSDVersion & 0xFF);
InfoEx->wSuiteMask = (USHORT)(SharedUserData->SuiteMask & 0xFFFF);
InfoEx->wProductType = SharedUserData->NtProductType;
InfoEx->wReserved = 0;
}
return STATUS_SUCCESS;
PRTL_OSVERSIONINFOEXW InfoEx = (PRTL_OSVERSIONINFOEXW)lpVersionInformation;
InfoEx->wServicePackMajor = (USHORT)(CmNtCSDVersion >> 8) & 0xFF;
InfoEx->wServicePackMinor = (USHORT)(CmNtCSDVersion & 0xFF);
InfoEx->wSuiteMask = (USHORT)(SharedUserData->SuiteMask & 0xFFFF);
InfoEx->wProductType = SharedUserData->NtProductType;
InfoEx->wReserved = 0;
}
return STATUS_INVALID_PARAMETER;
/* Always succeed */
return STATUS_SUCCESS;
}
/* EOF */

View file

@ -99,17 +99,17 @@ CSR_API(BaseSrvDefineDosDevice)
DWORD dwFlags;
PWSTR lpBuffer;
DPRINT("BaseSrvDefineDosDevice entered, Flags:%d, DeviceName:%wZ, TargetName:%wZ\n",
DefineDosDeviceRequest->dwFlags,
DPRINT("BaseSrvDefineDosDevice entered, Flags:%d, DeviceName:%wZ, TargetPath:%wZ\n",
DefineDosDeviceRequest->Flags,
&DefineDosDeviceRequest->DeviceName,
&DefineDosDeviceRequest->TargetName);
&DefineDosDeviceRequest->TargetPath);
Matched = AddHistory = FALSE;
HistoryEntry = NULL;
AdminSid = SystemSid = WorldSid = NULL;
SecurityDescriptor = NULL;
ListHead = &DosDeviceHistory;
dwFlags = DefineDosDeviceRequest->dwFlags;
dwFlags = DefineDosDeviceRequest->Flags;
/* Validate the flags */
if ( (dwFlags & 0xFFFFFFF0) ||
@ -136,7 +136,7 @@ CSR_API(BaseSrvDefineDosDevice)
if (!NT_SUCCESS(Status))
_SEH2_LEAVE;
RequestLinkTarget = &DefineDosDeviceRequest->TargetName;
RequestLinkTarget = &DefineDosDeviceRequest->TargetPath;
lpBuffer = (PWSTR)RtlAllocateHeap(BaseSrvHeap,
HEAP_ZERO_MEMORY,
RequestDeviceName.MaximumLength + 5 * sizeof(WCHAR));

View file

@ -18,7 +18,7 @@
CSR_API(BaseSrvGetTempFile)
{
static UINT BaseGetTempFileUnique = 0;
PBASE_GET_TEMP_FILE GetTempFile = &((PBASE_API_MESSAGE)ApiMessage)->Data.GetTempFile;
PBASE_GET_TEMP_FILE GetTempFile = &((PBASE_API_MESSAGE)ApiMessage)->Data.GetTempFileRequest;
/* Return 16-bits ID */
GetTempFile->UniqueID = (++BaseGetTempFileUnique & 0xFFFF);
@ -211,24 +211,24 @@ CSR_API(BaseSrvExitProcess)
CSR_API(BaseSrvGetProcessShutdownParam)
{
PBASE_GET_PROCESS_SHUTDOWN_PARAMS GetShutdownParametersRequest = &((PBASE_API_MESSAGE)ApiMessage)->Data.GetShutdownParametersRequest;
PBASE_GETSET_PROCESS_SHUTDOWN_PARAMS ShutdownParametersRequest = &((PBASE_API_MESSAGE)ApiMessage)->Data.ShutdownParametersRequest;
PCSR_THREAD CsrThread = CsrGetClientThread();
ASSERT(CsrThread);
GetShutdownParametersRequest->Level = CsrThread->Process->ShutdownLevel;
GetShutdownParametersRequest->Flags = CsrThread->Process->ShutdownFlags;
ShutdownParametersRequest->ShutdownLevel = CsrThread->Process->ShutdownLevel;
ShutdownParametersRequest->ShutdownFlags = CsrThread->Process->ShutdownFlags;
return STATUS_SUCCESS;
}
CSR_API(BaseSrvSetProcessShutdownParam)
{
PBASE_SET_PROCESS_SHUTDOWN_PARAMS SetShutdownParametersRequest = &((PBASE_API_MESSAGE)ApiMessage)->Data.SetShutdownParametersRequest;
PBASE_GETSET_PROCESS_SHUTDOWN_PARAMS ShutdownParametersRequest = &((PBASE_API_MESSAGE)ApiMessage)->Data.ShutdownParametersRequest;
PCSR_THREAD CsrThread = CsrGetClientThread();
ASSERT(CsrThread);
CsrThread->Process->ShutdownLevel = SetShutdownParametersRequest->Level;
CsrThread->Process->ShutdownFlags = SetShutdownParametersRequest->Flags;
CsrThread->Process->ShutdownLevel = ShutdownParametersRequest->ShutdownLevel;
CsrThread->Process->ShutdownFlags = ShutdownParametersRequest->ShutdownFlags;
return STATUS_SUCCESS;
}

View file

@ -0,0 +1,16 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Base API Server DLL
* FILE: subsystems/win/basesrv/vdm.c
* PURPOSE: Virtual DOS Machines (VDM) Support
* PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
*/
/* INCLUDES *******************************************************************/
#include "basesrv.h"
#define NDEBUG
#include <debug.h>
/* EOF */

View file

@ -134,7 +134,7 @@ CsrApiHandleConnectionRequest(IN PCSR_API_MESSAGE ApiMessage)
PCSR_THREAD CsrThread = NULL;
PCSR_PROCESS CsrProcess = NULL;
NTSTATUS Status = STATUS_SUCCESS;
PCSR_CONNECTION_INFO ConnectInfo = &ApiMessage->ConnectionInfo;
PCSR_API_CONNECTINFO ConnectInfo = &ApiMessage->ConnectionInfo;
BOOLEAN AllowConnection = FALSE;
REMOTE_PORT_VIEW RemotePortView;
HANDLE ServerPort;
@ -913,7 +913,7 @@ CsrApiPortInitialize(VOID)
{
DPRINT1("CSRSS: Creating %wZ port and associated threads\n", &CsrApiPortName);
DPRINT1("CSRSS: sizeof( CONNECTINFO ) == %ld sizeof( API_MSG ) == %ld\n",
sizeof(CSR_CONNECTION_INFO), sizeof(CSR_API_MESSAGE));
sizeof(CSR_API_CONNECTINFO), sizeof(CSR_API_MESSAGE));
}
/* FIXME: Create a Security Descriptor */
@ -928,7 +928,7 @@ CsrApiPortInitialize(VOID)
/* Create the Port Object */
Status = NtCreatePort(&CsrApiPort,
&ObjectAttributes,
sizeof(CSR_CONNECTION_INFO),
sizeof(CSR_API_CONNECTINFO),
sizeof(CSR_API_MESSAGE),
16 * PAGE_SIZE);
if (NT_SUCCESS(Status))

View file

@ -172,7 +172,7 @@ CsrInitializeNtSessionList(VOID);
NTSTATUS
NTAPI
CsrSrvAttachSharedSection(IN PCSR_PROCESS CsrProcess OPTIONAL,
OUT PCSR_CONNECTION_INFO ConnectInfo);
OUT PCSR_API_CONNECTINFO ConnectInfo);
NTSTATUS
NTAPI

View file

@ -444,7 +444,7 @@ CsrSrvCreateSharedSection(IN PCHAR ParameterValue)
NTSTATUS
NTAPI
CsrSrvAttachSharedSection(IN PCSR_PROCESS CsrProcess OPTIONAL,
OUT PCSR_CONNECTION_INFO ConnectInfo)
OUT PCSR_API_CONNECTINFO ConnectInfo)
{
NTSTATUS Status;
ULONG ViewSize = 0;

View file

@ -307,7 +307,7 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics)
FT_Face Face;
ANSI_STRING AnsiFaceName;
PFONT_ENTRY Entry;
PSECTION_OBJECT SectionObject;
PVOID SectionObject;
ULONG ViewSize = 0;
LARGE_INTEGER SectionSize;
UNICODE_STRING FontRegPath = RTL_CONSTANT_STRING(L"\\REGISTRY\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts");
@ -330,7 +330,7 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics)
}
SectionSize.QuadPart = 0LL;
Status = MmCreateSection((PVOID)&SectionObject, SECTION_ALL_ACCESS,
Status = MmCreateSection(&SectionObject, SECTION_ALL_ACCESS,
NULL, &SectionSize, PAGE_READONLY,
SEC_COMMIT, FileHandle, NULL);
if (!NT_SUCCESS(Status))

View file

@ -11,7 +11,7 @@ typedef struct _DESKTOP
PWND spwndTray;
PWND spwndMessage;
PWND spwndTooltip;
PSECTION_OBJECT hsectionDesktop;
PVOID hsectionDesktop;
PWIN32HEAP pheapDesktop;
ULONG_PTR ulHeapSize;
LIST_ENTRY PtiList;

View file

@ -15,12 +15,12 @@
HANDLE hModuleWin;
PGDI_HANDLE_TABLE NTAPI GDIOBJ_iAllocHandleTable(OUT PSECTION_OBJECT *SectionObject);
PGDI_HANDLE_TABLE NTAPI GDIOBJ_iAllocHandleTable(OUT PVOID *SectionObject);
BOOL NTAPI GDI_CleanupForProcess (struct _EPROCESS *Process);
NTSTATUS NTAPI UserDestroyThreadInfo(struct _ETHREAD *Thread);
HANDLE GlobalUserHeap = NULL;
PSECTION_OBJECT GlobalUserHeapSection = NULL;
PVOID GlobalUserHeapSection = NULL;
PSERVERINFO gpsi = NULL; // Global User Server Information.

View file

@ -30,7 +30,7 @@ BOOL FASTCALL UserIsEnteredExclusive(VOID);
extern HANDLE GlobalUserHeap;
PWIN32HEAP
UserCreateHeap(OUT PSECTION_OBJECT *SectionObject,
UserCreateHeap(OUT PVOID *SectionObject,
IN OUT PVOID *SystemBase,
IN SIZE_T HeapSize);

View file

@ -63,7 +63,7 @@ IntUserHeapCommitRoutine(
{
SIZE_T ViewSize = 0;
LARGE_INTEGER Offset;
extern PSECTION_OBJECT GlobalUserHeapSection;
extern PVOID GlobalUserHeapSection;
/* HACK: This needs to be handled during startup only... */
ASSERT(Base == (PVOID)GlobalUserHeap);
@ -114,7 +114,7 @@ IntUserHeapCommitRoutine(
}
static PWIN32HEAP
IntUserHeapCreate(IN PSECTION_OBJECT SectionObject,
IntUserHeapCreate(IN PVOID SectionObject,
IN PVOID *SystemMappedBase,
IN ULONG HeapSize)
{
@ -172,7 +172,7 @@ IntUserHeapCreate(IN PSECTION_OBJECT SectionObject,
}
PWIN32HEAP
UserCreateHeap(OUT PSECTION_OBJECT *SectionObject,
UserCreateHeap(OUT PVOID *SectionObject,
IN OUT PVOID *SystemBase,
IN SIZE_T HeapSize)
{

View file

@ -397,12 +397,12 @@ ConSrvConnect(IN PCSR_PROCESS CsrProcess,
**************************************************************************/
NTSTATUS Status = STATUS_SUCCESS;
PCONSOLE_CONNECTION_INFO ConnectInfo = (PCONSOLE_CONNECTION_INFO)ConnectionInfo;
PCONSRV_API_CONNECTINFO ConnectInfo = (PCONSRV_API_CONNECTINFO)ConnectionInfo;
PCONSOLE_PROCESS_DATA ProcessData = ConsoleGetPerProcessData(CsrProcess);
if ( ConnectionInfo == NULL ||
ConnectionInfoLength == NULL ||
*ConnectionInfoLength != sizeof(CONSOLE_CONNECTION_INFO) )
*ConnectionInfoLength != sizeof(CONSRV_API_CONNECTINFO) )
{
DPRINT1("CONSRV: Connection failed\n");
return STATUS_UNSUCCESSFUL;