Compare commits
17 Commits
shell32_rc
...
backups/Re
Author | SHA1 | Date | |
---|---|---|---|
|
7d7a459001 | ||
|
2c1648e5f9 | ||
|
9b9a5609dd | ||
|
85c2c6dd94 | ||
|
6bb13bc0d3 | ||
|
2a3428d7d1 | ||
|
128f19486c | ||
|
0118cfff6b | ||
|
434e256e43 | ||
|
9eef31a413 | ||
|
dd1295246d | ||
|
9ea9b7db36 | ||
|
8b8de8b853 | ||
|
45d79c2a20 | ||
|
c0f99c646f | ||
|
95aa925ed9 | ||
|
09dc089cfe |
@@ -1,8 +1,5 @@
|
||||
|
||||
include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils)
|
||||
|
||||
add_executable(ping ping.c ping.rc)
|
||||
set_module_type(ping win32cui UNICODE)
|
||||
target_link_libraries(ping conutils ${PSEH_LIB})
|
||||
add_importlibs(ping ws2_32 iphlpapi msvcrt kernel32 ntdll)
|
||||
add_importlibs(ping ws2_32 iphlpapi user32 msvcrt kernel32 ntdll)
|
||||
add_cd_file(TARGET ping DESTINATION reactos/system32 FOR all)
|
||||
|
@@ -19,6 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* PROJECT: ReactOS Ping Command
|
||||
* LICENSE: MIT
|
||||
@@ -27,20 +28,15 @@
|
||||
* PROGRAMMERS: Tim Crawford <crawfxrd@gmail.com>
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
||||
#define WIN32_NO_STATUS
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <iphlpapi.h>
|
||||
#include <icmpapi.h>
|
||||
|
||||
#include <conutils.h>
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
#define NDEBUG
|
||||
@@ -56,7 +52,9 @@ static BOOL ResolveTarget(PCWSTR target);
|
||||
static void Ping(void);
|
||||
static void PrintStats(void);
|
||||
static BOOL WINAPI ConsoleCtrlHandler(DWORD ControlType);
|
||||
static void PrintString(UINT id, ...);
|
||||
|
||||
static HANDLE hStdOut;
|
||||
static HANDLE hIcmpFile = INVALID_HANDLE_VALUE;
|
||||
static ULONG Timeout = 4000;
|
||||
static int Family = AF_UNSPEC;
|
||||
@@ -86,30 +84,34 @@ wmain(int argc, WCHAR *argv[])
|
||||
DWORD StrLen = 46;
|
||||
int Status;
|
||||
|
||||
/* Initialize the Console Standard Streams */
|
||||
ConInitStdStreams();
|
||||
|
||||
IpOptions.Ttl = 128;
|
||||
|
||||
hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
|
||||
if (!ParseCmdLine(argc, argv))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!SetConsoleCtrlHandler(ConsoleCtrlHandler, TRUE))
|
||||
{
|
||||
DPRINT("Failed to set control handler: %lu\n", GetLastError());
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
Status = WSAStartup(MAKEWORD(2, 2), &wsaData);
|
||||
if (Status != 0)
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_WINSOCK_FAIL, Status);
|
||||
PrintString(IDS_WINSOCK_FAIL, Status);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!ResolveTarget(TargetName))
|
||||
{
|
||||
WSACleanup();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -118,13 +120,18 @@ wmain(int argc, WCHAR *argv[])
|
||||
DPRINT("WSAAddressToStringW failed: %d\n", WSAGetLastError());
|
||||
FreeAddrInfoW(Target);
|
||||
WSACleanup();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (Family == AF_INET6)
|
||||
{
|
||||
hIcmpFile = Icmp6CreateFile();
|
||||
}
|
||||
else
|
||||
{
|
||||
hIcmpFile = IcmpCreateFile();
|
||||
}
|
||||
|
||||
|
||||
if (hIcmpFile == INVALID_HANDLE_VALUE)
|
||||
@@ -132,19 +139,24 @@ wmain(int argc, WCHAR *argv[])
|
||||
DPRINT("IcmpCreateFile failed: %lu\n", GetLastError());
|
||||
FreeAddrInfoW(Target);
|
||||
WSACleanup();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (*CanonName)
|
||||
ConResPrintf(StdOut, IDS_PINGING_HOSTNAME, CanonName, Address);
|
||||
{
|
||||
PrintString(IDS_PINGING_HOSTNAME, CanonName, Address);
|
||||
}
|
||||
else
|
||||
ConResPrintf(StdOut, IDS_PINGING_ADDRESS, Address);
|
||||
{
|
||||
PrintString(IDS_PINGING_ADDRESS, Address);
|
||||
}
|
||||
|
||||
ConResPrintf(StdOut, IDS_PING_SIZE, RequestSize);
|
||||
PrintString(IDS_PING_SIZE, RequestSize);
|
||||
|
||||
Ping();
|
||||
|
||||
i = 1;
|
||||
|
||||
while (i < PingCount)
|
||||
{
|
||||
Sleep(1000);
|
||||
@@ -163,6 +175,41 @@ wmain(int argc, WCHAR *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
PrintString(UINT id, ...)
|
||||
{
|
||||
#define RC_STRING_MAX_SIZE 4096
|
||||
|
||||
WCHAR Format[RC_STRING_MAX_SIZE];
|
||||
LPWSTR lpMsgBuf = NULL;
|
||||
DWORD Len;
|
||||
va_list args;
|
||||
|
||||
if (!LoadStringW(GetModuleHandleW(NULL), id, Format, _countof(Format)))
|
||||
{
|
||||
DPRINT("LoadStringW failed: %lu\n", GetLastError());
|
||||
return;
|
||||
}
|
||||
|
||||
va_start(args, id);
|
||||
|
||||
Len = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
|
||||
Format, 0, 0, (PWSTR)&lpMsgBuf, 0, &args);
|
||||
if (lpMsgBuf /* && Len != 0 */)
|
||||
{
|
||||
// TODO: Handle writing to file. Well, use the ConUtils lib!
|
||||
WriteConsoleW(hStdOut, lpMsgBuf, Len, &Len, NULL);
|
||||
LocalFree(lpMsgBuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT("FormatMessageW failed: %lu\n", GetLastError());
|
||||
}
|
||||
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
static
|
||||
BOOL
|
||||
ParseCmdLine(int argc, PWSTR argv[])
|
||||
@@ -171,7 +218,7 @@ ParseCmdLine(int argc, PWSTR argv[])
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
ConResPrintf(StdOut, IDS_USAGE);
|
||||
PrintString(IDS_USAGE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -190,66 +237,69 @@ ParseCmdLine(int argc, PWSTR argv[])
|
||||
break;
|
||||
|
||||
case L'n':
|
||||
{
|
||||
if (i + 1 < argc)
|
||||
{
|
||||
PingForever = FALSE;
|
||||
PingCount = wcstoul(argv[++i], NULL, 0);
|
||||
|
||||
if (PingCount == 0)
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_BAD_VALUE, argv[i - 1], 1, UINT_MAX);
|
||||
PrintString(IDS_BAD_VALUE, argv[i - 1], 1, UINT_MAX);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_MISSING_VALUE, argv[i]);
|
||||
PrintString(IDS_MISSING_VALUE, argv[i]);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case L'l':
|
||||
{
|
||||
if (i + 1 < argc)
|
||||
{
|
||||
RequestSize = wcstoul(argv[++i], NULL, 0);
|
||||
|
||||
if (RequestSize > MAX_SEND_SIZE)
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_BAD_VALUE, argv[i - 1], 0, MAX_SEND_SIZE);
|
||||
PrintString(IDS_BAD_VALUE, argv[i - 1], 0, MAX_SEND_SIZE);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_MISSING_VALUE, argv[i]);
|
||||
PrintString(IDS_MISSING_VALUE, argv[i]);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case L'f':
|
||||
{
|
||||
if (Family == AF_INET6)
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_WRONG_FAMILY, argv[i], L"IPv4");
|
||||
PrintString(IDS_WRONG_FAMILY, argv[i], L"IPv4");
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Family = AF_INET;
|
||||
IpOptions.Flags |= IP_FLAG_DF;
|
||||
break;
|
||||
}
|
||||
|
||||
case L'i':
|
||||
{
|
||||
if (i + 1 < argc)
|
||||
{
|
||||
ULONG Ttl = wcstoul(argv[++i], NULL, 0);
|
||||
|
||||
if ((Ttl == 0) || (Ttl > UCHAR_MAX))
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_BAD_VALUE, argv[i - 1], 1, UCHAR_MAX);
|
||||
PrintString(IDS_BAD_VALUE, argv[i - 1], 1, UCHAR_MAX);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -257,17 +307,18 @@ ParseCmdLine(int argc, PWSTR argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_MISSING_VALUE, argv[i]);
|
||||
PrintString(IDS_MISSING_VALUE, argv[i]);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case L'v':
|
||||
{
|
||||
if (Family == AF_INET6)
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_WRONG_FAMILY, argv[i], L"IPv4");
|
||||
PrintString(IDS_WRONG_FAMILY, argv[i], L"IPv4");
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -280,34 +331,37 @@ ParseCmdLine(int argc, PWSTR argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_MISSING_VALUE, argv[i]);
|
||||
PrintString(IDS_MISSING_VALUE, argv[i]);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case L'w':
|
||||
{
|
||||
if (i + 1 < argc)
|
||||
{
|
||||
Timeout = wcstoul(argv[++i], NULL, 0);
|
||||
|
||||
if (Timeout < DEFAULT_TIMEOUT)
|
||||
{
|
||||
Timeout = DEFAULT_TIMEOUT;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_MISSING_VALUE, argv[i]);
|
||||
PrintString(IDS_MISSING_VALUE, argv[i]);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case L'R':
|
||||
{
|
||||
if (Family == AF_INET)
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_WRONG_FAMILY, argv[i], L"IPv6");
|
||||
PrintString(IDS_WRONG_FAMILY, argv[i], L"IPv6");
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -315,39 +369,36 @@ ParseCmdLine(int argc, PWSTR argv[])
|
||||
|
||||
/* This option has been deprecated. Don't do anything. */
|
||||
break;
|
||||
}
|
||||
|
||||
case L'4':
|
||||
{
|
||||
if (Family == AF_INET6)
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_WRONG_FAMILY, argv[i], L"IPv4");
|
||||
PrintString(IDS_WRONG_FAMILY, argv[i], L"IPv4");
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Family = AF_INET;
|
||||
break;
|
||||
}
|
||||
|
||||
case L'6':
|
||||
{
|
||||
if (Family == AF_INET)
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_WRONG_FAMILY, argv[i], L"IPv6");
|
||||
PrintString(IDS_WRONG_FAMILY, argv[i], L"IPv6");
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Family = AF_INET6;
|
||||
break;
|
||||
}
|
||||
|
||||
case L'?':
|
||||
ConResPrintf(StdOut, IDS_USAGE);
|
||||
PrintString(IDS_USAGE);
|
||||
return FALSE;
|
||||
|
||||
default:
|
||||
ConResPrintf(StdErr, IDS_BAD_OPTION, argv[i]);
|
||||
ConResPrintf(StdErr, IDS_USAGE);
|
||||
PrintString(IDS_BAD_OPTION, argv[i]);
|
||||
PrintString(IDS_USAGE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -355,7 +406,8 @@ ParseCmdLine(int argc, PWSTR argv[])
|
||||
{
|
||||
if (TargetName != NULL)
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_BAD_PARAMETER, argv[i]);
|
||||
PrintString(IDS_BAD_PARAMETER, argv[i]);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -365,7 +417,8 @@ ParseCmdLine(int argc, PWSTR argv[])
|
||||
|
||||
if (TargetName == NULL)
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_MISSING_ADDRESS);
|
||||
PrintString(IDS_MISSING_ADDRESS);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -391,7 +444,8 @@ ResolveTarget(PCWSTR target)
|
||||
Status = GetAddrInfoW(target, NULL, &hints, &Target);
|
||||
if (Status != 0)
|
||||
{
|
||||
ConResPrintf(StdOut, IDS_UNKNOWN_HOST, target);
|
||||
PrintString(IDS_UNKNOWN_HOST, target);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -399,10 +453,12 @@ ResolveTarget(PCWSTR target)
|
||||
}
|
||||
else if (ResolveAddress)
|
||||
{
|
||||
Status = GetNameInfoW(Target->ai_addr, Target->ai_addrlen,
|
||||
CanonName, _countof(CanonName),
|
||||
NULL, 0,
|
||||
NI_NAMEREQD);
|
||||
Status = GetNameInfoW(
|
||||
Target->ai_addr, Target->ai_addrlen,
|
||||
CanonName, _countof(CanonName),
|
||||
NULL, 0,
|
||||
NI_NAMEREQD);
|
||||
|
||||
if (Status != 0)
|
||||
{
|
||||
DPRINT("GetNameInfoW failed: %d\n", WSAGetLastError());
|
||||
@@ -426,24 +482,30 @@ Ping(void)
|
||||
SendBuffer = malloc(RequestSize);
|
||||
if (SendBuffer == NULL)
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_NO_RESOURCES);
|
||||
PrintString(IDS_NO_RESOURCES);
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ZeroMemory(SendBuffer, RequestSize);
|
||||
|
||||
if (Family == AF_INET6)
|
||||
{
|
||||
ReplySize += sizeof(ICMPV6_ECHO_REPLY);
|
||||
}
|
||||
else
|
||||
{
|
||||
ReplySize += sizeof(ICMP_ECHO_REPLY);
|
||||
}
|
||||
|
||||
ReplySize += RequestSize + SIZEOF_ICMP_ERROR + SIZEOF_IO_STATUS_BLOCK;
|
||||
|
||||
ReplyBuffer = malloc(ReplySize);
|
||||
if (ReplyBuffer == NULL)
|
||||
{
|
||||
ConResPrintf(StdErr, IDS_NO_RESOURCES);
|
||||
PrintString(IDS_NO_RESOURCES);
|
||||
free(SendBuffer);
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -458,18 +520,20 @@ Ping(void)
|
||||
ZeroMemory(&Source, sizeof(Source));
|
||||
Source.sin6_family = AF_INET6;
|
||||
|
||||
Status = Icmp6SendEcho2(hIcmpFile, NULL, NULL, NULL,
|
||||
&Source,
|
||||
(struct sockaddr_in6 *)Target->ai_addr,
|
||||
SendBuffer, (USHORT)RequestSize, &IpOptions,
|
||||
ReplyBuffer, ReplySize, Timeout);
|
||||
Status = Icmp6SendEcho2(
|
||||
hIcmpFile, NULL, NULL, NULL,
|
||||
&Source,
|
||||
(struct sockaddr_in6 *)Target->ai_addr,
|
||||
SendBuffer, (USHORT)RequestSize, &IpOptions,
|
||||
ReplyBuffer, ReplySize, Timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = IcmpSendEcho2(hIcmpFile, NULL, NULL, NULL,
|
||||
((PSOCKADDR_IN)Target->ai_addr)->sin_addr.s_addr,
|
||||
SendBuffer, (USHORT)RequestSize, &IpOptions,
|
||||
ReplyBuffer, ReplySize, Timeout);
|
||||
Status = IcmpSendEcho2(
|
||||
hIcmpFile, NULL, NULL, NULL,
|
||||
((PSOCKADDR_IN)Target->ai_addr)->sin_addr.s_addr,
|
||||
SendBuffer, (USHORT)RequestSize, &IpOptions,
|
||||
ReplyBuffer, ReplySize, Timeout);
|
||||
}
|
||||
|
||||
free(SendBuffer);
|
||||
@@ -480,19 +544,19 @@ Ping(void)
|
||||
switch (Status)
|
||||
{
|
||||
case IP_DEST_HOST_UNREACHABLE:
|
||||
ConResPrintf(StdOut, IDS_DEST_HOST_UNREACHABLE);
|
||||
PrintString(IDS_DEST_HOST_UNREACHABLE);
|
||||
break;
|
||||
|
||||
case IP_DEST_NET_UNREACHABLE:
|
||||
ConResPrintf(StdOut, IDS_DEST_NET_UNREACHABLE);
|
||||
PrintString(IDS_DEST_NET_UNREACHABLE);
|
||||
break;
|
||||
|
||||
case IP_REQ_TIMED_OUT:
|
||||
ConResPrintf(StdOut, IDS_REQUEST_TIMED_OUT);
|
||||
PrintString(IDS_REQUEST_TIMED_OUT);
|
||||
break;
|
||||
|
||||
default:
|
||||
ConResPrintf(StdOut, IDS_TRANSMIT_FAILED, Status);
|
||||
PrintString(IDS_TRANSMIT_FAILED, Status);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -500,7 +564,7 @@ Ping(void)
|
||||
{
|
||||
EchosReceived++;
|
||||
|
||||
ConResPrintf(StdOut, IDS_REPLY_FROM, Address);
|
||||
PrintString(IDS_REPLY_FROM, Address);
|
||||
|
||||
if (Family == AF_INET6)
|
||||
{
|
||||
@@ -511,32 +575,38 @@ Ping(void)
|
||||
switch (pEchoReply->Status)
|
||||
{
|
||||
case IP_SUCCESS:
|
||||
{
|
||||
EchosSuccessful++;
|
||||
|
||||
if (pEchoReply->RoundTripTime == 0)
|
||||
ConResPrintf(StdOut, IDS_REPLY_TIME_0MS);
|
||||
{
|
||||
PrintString(IDS_REPLY_TIME_0MS);
|
||||
}
|
||||
else
|
||||
ConResPrintf(StdOut, IDS_REPLY_TIME_MS, pEchoReply->RoundTripTime);
|
||||
{
|
||||
PrintString(IDS_REPLY_TIME_MS, pEchoReply->RoundTripTime);
|
||||
}
|
||||
|
||||
if (pEchoReply->RoundTripTime < RTTMin || RTTMin == 0)
|
||||
{
|
||||
RTTMin = pEchoReply->RoundTripTime;
|
||||
}
|
||||
|
||||
if (pEchoReply->RoundTripTime > RTTMax || RTTMax == 0)
|
||||
{
|
||||
RTTMax = pEchoReply->RoundTripTime;
|
||||
}
|
||||
|
||||
ConPuts(StdOut, L"\n");
|
||||
wprintf(L"\n");
|
||||
|
||||
RTTTotal += pEchoReply->RoundTripTime;
|
||||
break;
|
||||
}
|
||||
|
||||
case IP_TTL_EXPIRED_TRANSIT:
|
||||
ConResPrintf(StdOut, IDS_TTL_EXPIRED);
|
||||
PrintString(IDS_TTL_EXPIRED);
|
||||
break;
|
||||
|
||||
default:
|
||||
ConResPrintf(StdOut, IDS_REPLY_STATUS, pEchoReply->Status);
|
||||
PrintString(IDS_REPLY_STATUS, pEchoReply->Status);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -549,34 +619,40 @@ Ping(void)
|
||||
switch (pEchoReply->Status)
|
||||
{
|
||||
case IP_SUCCESS:
|
||||
{
|
||||
EchosSuccessful++;
|
||||
|
||||
ConResPrintf(StdOut, IDS_REPLY_BYTES, pEchoReply->DataSize);
|
||||
PrintString(IDS_REPLY_BYTES, pEchoReply->DataSize);
|
||||
|
||||
if (pEchoReply->RoundTripTime == 0)
|
||||
ConResPrintf(StdOut, IDS_REPLY_TIME_0MS);
|
||||
{
|
||||
PrintString(IDS_REPLY_TIME_0MS);
|
||||
}
|
||||
else
|
||||
ConResPrintf(StdOut, IDS_REPLY_TIME_MS, pEchoReply->RoundTripTime);
|
||||
{
|
||||
PrintString(IDS_REPLY_TIME_MS, pEchoReply->RoundTripTime);
|
||||
}
|
||||
|
||||
ConResPrintf(StdOut, IDS_REPLY_TTL, pEchoReply->Options.Ttl);
|
||||
PrintString(IDS_REPLY_TTL, pEchoReply->Options.Ttl);
|
||||
|
||||
if (pEchoReply->RoundTripTime < RTTMin || RTTMin == 0)
|
||||
{
|
||||
RTTMin = pEchoReply->RoundTripTime;
|
||||
}
|
||||
|
||||
if (pEchoReply->RoundTripTime > RTTMax || RTTMax == 0)
|
||||
{
|
||||
RTTMax = pEchoReply->RoundTripTime;
|
||||
}
|
||||
|
||||
RTTTotal += pEchoReply->RoundTripTime;
|
||||
break;
|
||||
}
|
||||
|
||||
case IP_TTL_EXPIRED_TRANSIT:
|
||||
ConResPrintf(StdOut, IDS_TTL_EXPIRED);
|
||||
PrintString(IDS_TTL_EXPIRED);
|
||||
break;
|
||||
|
||||
default:
|
||||
ConResPrintf(StdOut, IDS_REPLY_STATUS, pEchoReply->Status);
|
||||
PrintString(IDS_REPLY_STATUS, pEchoReply->Status);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -592,12 +668,13 @@ PrintStats(void)
|
||||
ULONG EchosLost = EchosSent - EchosReceived;
|
||||
ULONG PercentLost = (ULONG)((EchosLost / (double)EchosSent) * 100.0);
|
||||
|
||||
ConResPrintf(StdOut, IDS_STATISTICS, Address, EchosSent, EchosReceived, EchosLost, PercentLost);
|
||||
PrintString(IDS_STATISTICS, Address, EchosSent, EchosReceived, EchosLost, PercentLost);
|
||||
|
||||
if (EchosSuccessful > 0)
|
||||
{
|
||||
ULONG RTTAverage = RTTTotal / EchosSuccessful;
|
||||
ConResPrintf(StdOut, IDS_APPROXIMATE_RTT, RTTMin, RTTMax, RTTAverage);
|
||||
|
||||
PrintString(IDS_APPROXIMATE_RTT, RTTMin, RTTMax, RTTAverage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -610,12 +687,12 @@ ConsoleCtrlHandler(DWORD ControlType)
|
||||
{
|
||||
case CTRL_C_EVENT:
|
||||
PrintStats();
|
||||
ConResPrintf(StdOut, IDS_CTRL_C);
|
||||
PrintString(IDS_CTRL_C);
|
||||
return FALSE;
|
||||
|
||||
case CTRL_BREAK_EVENT:
|
||||
PrintStats();
|
||||
ConResPrintf(StdOut, IDS_CTRL_BREAK);
|
||||
PrintString(IDS_CTRL_BREAK);
|
||||
return TRUE;
|
||||
|
||||
case CTRL_CLOSE_EVENT:
|
||||
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -197,7 +197,7 @@ VOID TranslateEscapes(IN OUT LPTSTR lpString)
|
||||
}
|
||||
|
||||
static BOOL
|
||||
LoadTopicsFromINI(LCID Locale, LPTSTR lpResPath)
|
||||
LoadLocalizedResourcesFromINI(LCID Locale, LPTSTR lpResPath)
|
||||
{
|
||||
DWORD dwRet;
|
||||
DWORD dwSize;
|
||||
@@ -236,6 +236,8 @@ LoadTopicsFromINI(LCID Locale, LPTSTR lpResPath)
|
||||
return FALSE; // TODO: For localized resource, see the general function.
|
||||
|
||||
/* Try to load the default localized strings */
|
||||
GetPrivateProfileString(TEXT("Defaults"), TEXT("AppTitle"), TEXT("ReactOS Welcome") /* default */,
|
||||
szAppTitle, ARRAYSIZE(szAppTitle), szIniPath);
|
||||
if (!GetPrivateProfileString(TEXT("Defaults"), TEXT("DefaultTopicTitle"), NULL /* default */,
|
||||
szDefaultTitle, ARRAYSIZE(szDefaultTitle), szIniPath))
|
||||
{
|
||||
@@ -325,7 +327,7 @@ LoadTopicsFromINI(LCID Locale, LPTSTR lpResPath)
|
||||
}
|
||||
|
||||
static BOOL
|
||||
LoadTopics(LPTSTR lpResPath)
|
||||
LoadLocalizedResources(LPTSTR lpResPath)
|
||||
{
|
||||
#define MAX_NUMBER_INTERNAL_TOPICS 3
|
||||
|
||||
@@ -339,13 +341,15 @@ LoadTopics(LPTSTR lpResPath)
|
||||
* First, try to load the default internal (localized) strings.
|
||||
* They can be redefined by the localized INI files.
|
||||
*/
|
||||
if (!LoadString(hInstance, IDS_APPTITLE, szAppTitle, ARRAYSIZE(szAppTitle)))
|
||||
StringCchCopy(szAppTitle, ARRAYSIZE(szAppTitle), TEXT("ReactOS Welcome"));
|
||||
if (!LoadString(hInstance, IDS_DEFAULTTOPICTITLE, szDefaultTitle, ARRAYSIZE(szDefaultTitle)))
|
||||
*szDefaultTitle = 0;
|
||||
if (!LoadString(hInstance, IDS_DEFAULTTOPICDESC, szDefaultDesc, ARRAYSIZE(szDefaultDesc)))
|
||||
*szDefaultDesc = 0;
|
||||
|
||||
/* Try to load the topics from INI file */
|
||||
if (*lpResPath && LoadTopicsFromINI(LOCALE_USER_DEFAULT, lpResPath))
|
||||
/* Try to load the resources from INI file */
|
||||
if (*lpResPath && LoadLocalizedResourcesFromINI(LOCALE_USER_DEFAULT, lpResPath))
|
||||
return TRUE;
|
||||
|
||||
/* We failed, fall back to internal (localized) resource */
|
||||
@@ -381,7 +385,7 @@ LoadTopics(LPTSTR lpResPath)
|
||||
}
|
||||
|
||||
static VOID
|
||||
FreeTopics(VOID)
|
||||
FreeResources(VOID)
|
||||
{
|
||||
if (!pTopics)
|
||||
return;
|
||||
@@ -421,8 +425,8 @@ LoadConfiguration(VOID)
|
||||
/* Verify that the file exists, otherwise use the default configuration */
|
||||
if (GetFileAttributes(szIniPath) == INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
/* Use the default configuration and retrieve the default topics */
|
||||
return LoadTopics(TEXT(""));
|
||||
/* Use the default configuration and retrieve the default resources */
|
||||
return LoadLocalizedResources(TEXT(""));
|
||||
}
|
||||
|
||||
/* Load the settings from the INI configuration file */
|
||||
@@ -435,9 +439,9 @@ LoadConfiguration(VOID)
|
||||
*szResPath = 0;
|
||||
}
|
||||
|
||||
/* Set the current directory to the one of this application, and retrieve the topics */
|
||||
/* Set the current directory to the one of this application, and retrieve the resources */
|
||||
SetCurrentDirectory(szAppPath);
|
||||
return LoadTopics(szResPath);
|
||||
return LoadLocalizedResources(szResPath);
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -556,10 +560,7 @@ _tWinMain(HINSTANCE hInst,
|
||||
rcRightPanel.left = rcLeftPanel.right;
|
||||
rcRightPanel.right = ulInnerWidth - 1;
|
||||
|
||||
if (!LoadString(hInstance, IDS_APPTITLE, szAppTitle, ARRAYSIZE(szAppTitle)))
|
||||
StringCchCopy(szAppTitle, ARRAYSIZE(szAppTitle), TEXT("ReactOS Welcome"));
|
||||
|
||||
/* Load the configuration and the topics */
|
||||
/* Load the configuration and the resources */
|
||||
LoadConfiguration();
|
||||
|
||||
/* Create main window */
|
||||
@@ -592,7 +593,7 @@ _tWinMain(HINSTANCE hInst,
|
||||
}
|
||||
|
||||
/* Cleanup */
|
||||
FreeTopics();
|
||||
FreeResources();
|
||||
|
||||
return msg.wParam;
|
||||
}
|
||||
|
@@ -160,4 +160,3 @@ END
|
||||
#ifdef LANGUAGE_ZH_TW
|
||||
#include "lang/zh-TW.rc"
|
||||
#endif
|
||||
|
||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
BIN
reactos/base/shell/explorer/res/src/logov.psd
Normal file
BIN
reactos/base/shell/explorer/res/src/logov_old.psd
Normal file
@@ -1,219 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="21pt"
|
||||
height="233pt"
|
||||
viewBox="0 0 26.250001 291.25001"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="Logo.svg"
|
||||
inkscape:export-filename="F:\reactos\Logo.png"
|
||||
inkscape:export-xdpi="72"
|
||||
inkscape:export-ydpi="72">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient4745">
|
||||
<stop
|
||||
style="stop-color:#8ab3db;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4747" />
|
||||
<stop
|
||||
style="stop-color:#8ab3db;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop4749" />
|
||||
</linearGradient>
|
||||
<clipPath
|
||||
id="clipPath5851">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 49.8125,31.83884 c -3.255639,0.0909 -5.959696,1.08533 -7.8125,3.0625 -1.852812,1.97712 -2.651641,4.74531 -2.53125,8 0.120391,3.25469 1.159967,6.99107 2.96875,11.03125 3.617567,8.08035 10.384054,17.29707 19.4375,25.78125 9.053319,8.48356 18.670786,14.63275 26.96875,17.71875 4.148982,1.543 7.963087,2.3409 11.21875,2.25 3.25566,-0.091 5.9597,-1.0853 7.8125,-3.0625 1.85283,-1.9772 2.65165,-4.7453 2.53125,-8 -0.1204,-3.25471 -1.12869,-6.99108 -2.9375,-11.03125 -3.61762,-8.08034 -10.384044,-17.29712 -19.4375,-25.78125 -9.053372,-8.4838 -18.702095,-14.63285 -27,-17.71875 -4.148953,-1.54295 -7.963111,-2.34093 -11.21875,-2.25 z m 0.03125,0.75 c 3.122295,-0.0872 6.850784,0.66769 10.9375,2.1875 8.173432,3.03961 17.757149,9.13541 26.75,17.5625 8.992932,8.42742 15.68665,17.57212 19.25,25.53125 1.78168,3.97956 2.79078,7.65984 2.90625,10.78125 0.11547,3.12145 -0.65234,5.66385 -2.34375,7.46875 -1.69138,1.8049 -4.15893,2.7253 -7.28125,2.8125 -3.122321,0.087 -6.882003,-0.6677 -10.96875,-2.1875 C 80.920255,93.70539 71.367797,87.60944 62.375,79.18259 53.382079,70.75513 46.65705,61.61048 43.09375,53.65134 c -1.78165,-3.97957 -2.75954,-7.65986 -2.875,-10.78125 -0.11546,-3.12139 0.621108,-5.66388 2.3125,-7.46875 1.691387,-1.80492 4.190205,-2.72529 7.3125,-2.8125 z"
|
||||
id="path5853"
|
||||
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.73234254;marker:none;enable-background:accumulate" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipPath5827">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 92.4375,31.83884 c -3.255663,-0.0909 -7.069767,0.70705 -11.21875,2.25 -8.297966,3.08589 -17.946678,9.23495 -27,17.71875 -9.053446,8.48418 -15.788683,17.70088 -19.40625,25.78125 -1.808783,4.04018 -2.848359,7.77655 -2.96875,11.03125 -0.120391,3.2547 0.678439,6.0229 2.53125,8 1.852812,1.9772 4.556857,2.9716 7.8125,3.0625 3.255643,0.091 7.069798,-0.707 11.21875,-2.25 8.297904,-3.086 17.946639,-9.23515 27,-17.71875 9.053456,-8.48414 15.81988,-17.70092 19.4375,-25.78125 1.80881,-4.04017 2.8171,-7.77654 2.9375,-11.03125 0.1204,-3.25471 -0.67842,-6.02283 -2.53125,-8 -1.852802,-1.97715 -4.556837,-2.97157 -7.8125,-3.0625 z m -0.03125,0.75 c 3.122321,0.0872 5.621118,1.00761 7.3125,2.8125 1.69142,1.80493 2.45922,4.34735 2.34375,7.46875 -0.11547,3.1214 -1.12457,6.80169 -2.90625,10.78125 -3.563352,7.95912 -10.257067,17.10382 -19.25,25.53125 -8.992842,8.42688 -18.576566,14.5228 -26.75,17.5625 -4.086717,1.5198 -7.815202,2.2747 -10.9375,2.1875 -3.122298,-0.087 -5.621108,-1.0076 -7.3125,-2.8125 -1.691393,-1.8049 -2.42796,-4.3474 -2.3125,-7.46875 0.11546,-3.1214 1.09335,-6.80167 2.875,-10.78125 3.5633,-7.95915 10.257078,-17.10379 19.25,-25.53125 8.992797,-8.42709 18.576507,-14.5229 26.75,-17.5625 4.086746,-1.5198 7.815179,-2.27471 10.9375,-2.1875 z"
|
||||
id="path5829"
|
||||
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.73234254;marker:none;enable-background:accumulate" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipPath5835">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 96.40625,35.74509 c -3.255662,-0.0909 -7.069767,0.70705 -11.21875,2.25 -8.297965,3.08589 -17.946677,9.23494 -27,17.71875 -9.053446,8.48418 -15.788683,17.70089 -19.40625,25.78125 -1.808783,4.04018 -2.848359,7.77655 -2.96875,11.0312 -0.120391,3.2547 0.678438,6.0229 2.53125,8 1.852812,1.9772 4.556859,2.9717 7.8125,3.0626 3.255641,0.091 7.0698,-0.7071 11.21875,-2.25 8.2979,-3.086 17.946628,-9.2352 27,-17.7188 9.053457,-8.48415 15.81988,-17.70092 19.4375,-25.78125 1.80881,-4.04017 2.8171,-7.77654 2.9375,-11.03125 0.1204,-3.25471 -0.67842,-6.02283 -2.53125,-8 -1.8528,-1.97715 -4.556838,-2.97157 -7.8125,-3.0625 z m -0.03125,0.75 c 3.12232,0.0872 5.62112,1.0076 7.3125,2.8125 1.69142,1.80493 2.45922,4.34735 2.34375,7.46875 -0.11547,3.1214 -1.12457,6.80169 -2.90625,10.78125 -3.563352,7.95912 -10.257065,17.10381 -19.25,25.53125 -8.992854,8.42685 -18.576569,14.52285 -26.75,17.56245 -4.086715,1.5199 -7.815204,2.2747 -10.9375,2.1876 -3.122296,-0.087 -5.621107,-1.0076 -7.3125,-2.8126 -1.691392,-1.8048 -2.42796,-4.3473 -2.3125,-7.4687 0.11546,-3.1214 1.09335,-6.80168 2.875,-10.78125 3.5633,-7.95915 10.257079,-17.10378 19.25,-25.53125 8.992798,-8.42709 18.576508,-14.5229 26.75,-17.5625 4.086746,-1.5198 7.81518,-2.27471 10.9375,-2.1875 z"
|
||||
id="path5837"
|
||||
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.73234254;marker:none;enable-background:accumulate" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipPath5859">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 45.84375,35.74509 c -3.25564,0.0909 -5.959689,1.08533 -7.8125,3.0625 -1.852812,1.97712 -2.651641,4.74531 -2.53125,8 0.120391,3.25469 1.159967,6.99108 2.96875,11.03125 3.617567,8.08035 10.384055,17.29708 19.4375,25.78125 9.053321,8.4836 18.670786,14.6328 26.96875,17.7188 4.148982,1.5429 7.963087,2.3408 11.21875,2.25 3.255663,-0.091 5.99095,-1.0854 7.84375,-3.0626 1.85283,-1.9771 2.6204,-4.7452 2.5,-8 C 106.3171,89.27164 105.30881,85.53526 103.5,81.49509 99.882381,73.41475 93.115959,64.198 84.0625,55.71384 c -9.053373,-8.4838 -18.702098,-14.63285 -27,-17.71875 -4.148951,-1.54295 -7.96311,-2.34094 -11.21875,-2.25 z m 0.03125,0.75 c 3.122296,-0.0872 6.850786,0.66769 10.9375,2.1875 8.173428,3.03961 17.757148,9.13542 26.75,17.5625 8.992936,8.42745 15.686648,17.57212 19.25,25.53125 1.78168,3.97957 2.79078,7.65985 2.90625,10.78125 0.11547,3.1214 -0.65234,5.6638 -2.34375,7.4687 -1.69138,1.805 -4.15893,2.7254 -7.28125,2.8126 -3.12232,0.087 -6.882003,-0.6677 -10.96875,-2.1876 C 76.951506,97.61169 67.399051,91.51569 58.40625,83.08884 49.413329,74.66138 42.6883,65.51673 39.125,57.55759 37.34335,53.57802 36.36546,49.89773 36.25,46.77634 c -0.11546,-3.12139 0.621108,-5.66388 2.3125,-7.46875 1.691394,-1.80492 4.190204,-2.72529 7.3125,-2.8125 z"
|
||||
id="path5861"
|
||||
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.73234254;marker:none;enable-background:accumulate" />
|
||||
</clipPath>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4745"
|
||||
id="linearGradient4751"
|
||||
x1="13.21739"
|
||||
y1="761.34583"
|
||||
x2="13.433139"
|
||||
y2="1052.5289"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,-761.11214)" />
|
||||
<filter
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow"
|
||||
id="filter4197">
|
||||
<feFlood
|
||||
flood-opacity="0.68999999999999995"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood"
|
||||
id="feFlood4199" />
|
||||
<feComposite
|
||||
in="flood"
|
||||
in2="SourceGraphic"
|
||||
operator="in"
|
||||
result="composite1"
|
||||
id="feComposite4201" />
|
||||
<feGaussianBlur
|
||||
in="composite1"
|
||||
stdDeviation="1"
|
||||
result="blur"
|
||||
id="feGaussianBlur4203" />
|
||||
<feOffset
|
||||
dx="-0.1"
|
||||
dy="1"
|
||||
result="offset"
|
||||
id="feOffset4205" />
|
||||
<feComposite
|
||||
in="SourceGraphic"
|
||||
in2="offset"
|
||||
operator="over"
|
||||
result="composite2"
|
||||
id="feComposite4207" />
|
||||
</filter>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="2.4967109"
|
||||
inkscape:cx="-34.214085"
|
||||
inkscape:cy="142.13217"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="svg2"
|
||||
showgrid="false"
|
||||
units="pt"
|
||||
inkscape:window-width="1397"
|
||||
inkscape:window-height="974"
|
||||
inkscape:window-x="437"
|
||||
inkscape:window-y="214"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<rect
|
||||
y="0"
|
||||
x="0"
|
||||
height="291.25"
|
||||
width="26.250004"
|
||||
id="rect4697-4"
|
||||
style="opacity:1;fill:#5a7fb1;fill-opacity:1;stroke:none;stroke-width:10;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<rect
|
||||
y="-1.8417968e-005"
|
||||
x="0"
|
||||
height="291.25"
|
||||
width="26.250002"
|
||||
id="rect4697"
|
||||
style="opacity:1;fill:url(#linearGradient4751);fill-opacity:1;stroke:none;stroke-width:10;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
inkscape:export-xdpi="72"
|
||||
inkscape:export-ydpi="72" />
|
||||
<text
|
||||
transform="matrix(0,-0.93191339,1.0473001,0,-16.177787,-724.38567)"
|
||||
sodipodi:linespacing="100%"
|
||||
id="text4707"
|
||||
y="34.69656"
|
||||
x="-1058.8489"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:18.14050674px;line-height:100%;font-family:'AvantGarde Bk BT';-inkscape-font-specification:'AvantGarde Bk BT, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4197)"
|
||||
xml:space="preserve"><tspan
|
||||
y="34.69656"
|
||||
x="-1058.8489"
|
||||
id="tspan4709"
|
||||
sodipodi:role="line"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:20.00007629px;line-height:100%;font-family:'AvantGarde Bk BT';-inkscape-font-specification:'AvantGarde Bk BT, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start"
|
||||
id="tspan4213">ReactOS</tspan><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:17.50006676px;line-height:100%;font-family:'AvantGarde Bk BT';-inkscape-font-specification:'AvantGarde Bk BT, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start"
|
||||
id="tspan4209"> 0.5 - SVN</tspan></tspan></text>
|
||||
<g
|
||||
style="fill:#ffffff;fill-opacity:1"
|
||||
id="layer1-2"
|
||||
transform="matrix(-4.4824609e-5,-0.056,0.05634648,-4.4824609e-5,-16.777709,291.46496)">
|
||||
<g
|
||||
style="fill:#ffffff;fill-opacity:1"
|
||||
id="g5951"
|
||||
transform="matrix(4.7811132,0,0,4.7811132,-80.056681,-4146.679)">
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none"
|
||||
id="rect5844"
|
||||
clip-path="url(#clipPath5851)"
|
||||
transform="translate(0,910.62991)"
|
||||
d="m 30.90625,30.78125 0,74.28125 80.625,0 0,-74.28125 -80.625,0 z m 70,6.90625 c 1.65415,0.468885 3.03874,1.278331 4.125,2.4375 4.53076,4.834816 2.50248,14.697373 -4.25,25.59375 0.0794,0.891468 0.125,1.806031 0.125,2.71875 0,3.994823 -0.77287,7.795485 -2.1875,11.28125 l 0,-2.5 c 0.873252,-2.77007 1.34375,-5.722186 1.34375,-8.78125 0,-0.502872 -0.0374,-1.003316 -0.0625,-1.5 -1.924954,2.972465 -4.175511,6.006582 -6.75,9.03125 l -11.71875,0 c 14.084231,-14.069184 21.8079,-29.622248 19.375,-38.28125 z M 70.875,38.375 c 5.033902,0 9.771221,1.246554 13.9375,3.4375 l -1.9375,0 c -3.67044,-1.662594 -7.741998,-2.59375 -12.03125,-2.59375 -4.289252,0 -8.364055,0.931156 -12.03125,2.59375 l -1.875,0 C 61.107787,39.621554 65.841098,38.375 70.875,38.375 Z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none"
|
||||
id="path4850"
|
||||
transform="translate(0,910.62991)"
|
||||
d="m 70.875,39.21875 c -11.274354,0 -21.070517,6.395096 -25.9375,15.75 -0.0042,0.0081 0.0042,0.02317 0,0.03125 0.07754,0.153219 0.170333,0.314865 0.25,0.46875 0.189002,0.364736 0.392934,0.725451 0.59375,1.09375 0.385013,0.706117 0.791088,1.407542 1.21875,2.125 0.516928,0.867214 1.047412,1.74494 1.625,2.625 0.154507,0.235419 0.309984,0.482596 0.46875,0.71875 0.504797,0.750853 1.04663,1.49337 1.59375,2.25 0.597456,0.8257 1.197122,1.63927 1.84375,2.46875 0.558756,0.717849 1.155527,1.43784 1.75,2.15625 0.231929,0.279843 0.45024,0.564036 0.6875,0.84375 0.274984,0.324693 0.561677,0.644424 0.84375,0.96875 0.526712,0.604812 1.042782,1.209866 1.59375,1.8125 0.08069,0.08836 0.168791,0.161707 0.25,0.25 0.855682,0.929554 1.744704,1.861076 2.65625,2.78125 0.932914,0.942152 1.885719,1.885424 2.875,2.8125 2.611939,2.447565 5.275184,4.680384 7.9375,6.71875 0.664977,-0.509507 1.335146,-1.028218 2,-1.5625 1.994569,-1.602764 3.978844,-3.32086 5.9375,-5.15625 0.987964,-0.925838 1.942821,-1.87215 2.875,-2.8125 0.01048,-0.01058 0.02078,-0.02067 0.03125,-0.03125 1.661121,-1.678574 3.245777,-3.358318 4.71875,-5.0625 0.176801,-0.204204 0.357258,-0.420665 0.53125,-0.625 0.0193,-0.02271 0.04324,-0.03979 0.0625,-0.0625 1.043449,-1.227628 1.99838,-2.461329 2.9375,-3.6875 0.536054,-0.701261 1.092937,-1.395631 1.59375,-2.09375 0.605677,-0.8429 1.166138,-1.696008 1.71875,-2.53125 0.61629,-0.932661 1.201625,-1.862854 1.75,-2.78125 0.548375,-0.918396 1.052967,-1.819459 1.53125,-2.71875 0.08534,-0.160453 0.166936,-0.308996 0.25,-0.46875 C 92.297354,45.854598 82.359657,39.21875 70.875,39.21875 Z M 41.75,66.1875 c -0.06116,0.747306 -0.09375,1.492751 -0.09375,2.25 0,11.038093 6.116011,20.633219 15.15625,25.59375 C 57.484142,93.709774 58.16207,93.356975 58.84375,93 59.52543,92.643025 60.2155,92.266364 60.90625,91.875 61.597,91.483636 62.301149,91.080895 63,90.65625 63.242636,90.508816 63.475216,90.338856 63.71875,90.1875 61.484219,88.417439 59.256528,86.493446 57.0625,84.4375 50.722229,78.495899 45.533329,72.192164 41.75,66.1875 Z m 58.25,0.75 c -3.738782,5.775651 -8.738133,11.807594 -14.8125,17.5 -2.200161,2.061695 -4.446658,3.975926 -6.6875,5.75 0.643501,0.399108 1.299839,0.784778 1.9375,1.15625 0.596366,0.347415 1.15992,0.677219 1.75,1 0.114658,0.06272 0.229355,0.125721 0.34375,0.1875 0.420773,0.224919 0.833546,0.443626 1.25,0.65625 0.460034,0.236796 0.92014,0.466515 1.375,0.6875 8.89311,-5.005567 14.90625,-14.50549 14.90625,-25.4375 0,-0.50123 -0.0329,-1.005816 -0.0625,-1.5 z M 71.125,95.5 c -1.088659,0.70236 -2.176541,1.344854 -3.25,1.96875 0.982666,0.103354 1.987211,0.15625 3,0.15625 1.157589,0 2.286621,-0.08928 3.40625,-0.21875 C 73.239784,96.798923 72.180662,96.181072 71.125,95.5 Z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none"
|
||||
id="rect5820"
|
||||
clip-path="url(#clipPath5827)"
|
||||
transform="translate(0,910.62991)"
|
||||
d="m 30.90625,30.78125 0,74.28125 80.625,0 0,-74.28125 -80.625,0 z M 41.375,37.6875 c -2.574058,9.154336 6.161768,26.020861 21.8125,40.6875 15.281157,14.319459 32.235311,21.93527 41.375,19.34375 -0.39394,1.402094 -1.05856,2.65164 -2,3.65625 -7.088395,7.5642 -27.453878,-0.0271 -45.5,-16.9375 -6.340271,-5.941601 -11.529171,-12.245336 -15.3125,-18.25 -0.05634,0.740037 -0.09375,1.495693 -0.09375,2.25 0,3.059064 0.47232,6.01118 1.34375,8.78125 l 0,2.4375 c -1.401864,-3.469359 -2.1875,-7.247022 -2.1875,-11.21875 0,-1.153795 0.09116,-2.286656 0.21875,-3.40625 C 34.61001,54.397204 32.778489,44.863171 37.21875,40.125 38.305614,38.965187 39.719677,38.156282 41.375,37.6875 Z m 29.5,0.6875 c 5.033902,0 9.771221,1.246554 13.9375,3.4375 l -1.9375,0 c -3.67044,-1.662594 -7.741998,-2.59375 -12.03125,-2.59375 -4.289252,0 -8.364055,0.931156 -12.03125,2.59375 l -1.875,0 C 61.107787,39.621554 65.841098,38.375 70.875,38.375 Z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none"
|
||||
id="path5823"
|
||||
clip-path="url(#clipPath5835)"
|
||||
transform="translate(0,910.62991)"
|
||||
d="m 30.90625,30.78125 0,74.28125 80.625,0 0,-74.28125 -80.625,0 z M 41.375,37.6875 c -2.574058,9.154336 6.161768,26.020861 21.8125,40.6875 15.281157,14.319459 32.235311,21.93527 41.375,19.34375 -0.39394,1.402094 -1.05856,2.65164 -2,3.65625 -7.088395,7.5642 -27.453878,-0.0271 -45.5,-16.9375 -6.340271,-5.941601 -11.529171,-12.245336 -15.3125,-18.25 -0.05634,0.740037 -0.09375,1.495693 -0.09375,2.25 0,3.059064 0.47232,6.01118 1.34375,8.78125 l 0,2.4375 c -1.401864,-3.469359 -2.1875,-7.247022 -2.1875,-11.21875 0,-1.153795 0.09116,-2.286656 0.21875,-3.40625 C 34.61001,54.397204 32.778489,44.863171 37.21875,40.125 38.305614,38.965187 39.719677,38.156282 41.375,37.6875 Z m 29.5,0.6875 c 5.033902,0 9.771221,1.246554 13.9375,3.4375 l -1.9375,0 c -3.67044,-1.662594 -7.741998,-2.59375 -12.03125,-2.59375 -4.289252,0 -8.364055,0.931156 -12.03125,2.59375 l -1.875,0 C 61.107787,39.621554 65.841098,38.375 70.875,38.375 Z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none"
|
||||
id="path5847"
|
||||
clip-path="url(#clipPath5859)"
|
||||
transform="translate(0,910.62991)"
|
||||
d="m 30.90625,30.78125 0,74.28125 80.625,0 0,-74.28125 -80.625,0 z m 70,6.90625 c 1.65415,0.468885 3.03874,1.278331 4.125,2.4375 4.53076,4.834816 2.50248,14.697373 -4.25,25.59375 0.0794,0.891468 0.125,1.806031 0.125,2.71875 0,3.994823 -0.77287,7.795485 -2.1875,11.28125 l 0,-2.5 c 0.873252,-2.77007 1.34375,-5.722186 1.34375,-8.78125 0,-0.502872 -0.0374,-1.003316 -0.0625,-1.5 -1.924954,2.972465 -4.175511,6.006582 -6.75,9.03125 l -11.71875,0 c 14.084231,-14.069184 21.8079,-29.622248 19.375,-38.28125 z M 70.875,38.375 c 5.033902,0 9.771221,1.246554 13.9375,3.4375 l -1.9375,0 c -3.67044,-1.662594 -7.741998,-2.59375 -12.03125,-2.59375 -4.289252,0 -8.364055,0.931156 -12.03125,2.59375 l -1.875,0 C 61.107787,39.621554 65.841098,38.375 70.875,38.375 Z"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 20 KiB |
@@ -131,32 +131,32 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "")
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
|
||||
# Create the empty Desktop, Favorites, and Start Menu folders. And many more.
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/All Users/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/All Users/Documents/My Music=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/All Users/Documents/My Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/All Users/Documents/My Videos=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/All Users/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/All Users/My Documents=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/All Users/Start Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/All Users/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Cookies=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Desktop=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Local Settings/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Local Settings/History=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Local Settings/Temporary Internet Files=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/My Music=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/My Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/My Videos=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/NetHood=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/PrintHood=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Recent=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/SendTo=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Start Menu/Programs=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Start Menu/Programs/Administrative Tools=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Start Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/All Users/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/All Users/Documents/My Music=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/All Users/Documents/My Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/All Users/Documents/My Videos=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/All Users/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/All Users/My Documents=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/All Users/Start Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/All Users/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Cookies=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Desktop=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Local Settings/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Local Settings/History=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Local Settings/Temporary Internet Files=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/My Music=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/My Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/My Videos=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/NetHood=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/PrintHood=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Recent=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/SendTo=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Start Menu/Programs=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Start Menu/Programs/Administrative Tools=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Start Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
|
||||
|
||||
add_custom_target(hybridcd
|
||||
COMMAND native-mkisofs -quiet -o ${REACTOS_BINARY_DIR}/hybridcd.iso -iso-level 4
|
||||
|
@@ -32,7 +32,7 @@ add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/readme.txt DESTINATION reactos FOR
|
||||
# Welcome.exe optional custom configuration (only for HybridCD)
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/welcome_config/)
|
||||
# Copy the main configuration file
|
||||
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/welcome_config/welcome.ini DESTINATION bootcd/reactos NO_CAB FOR hybridcd)
|
||||
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/welcome_config/welcome.ini DESTINATION setup/reactos NO_CAB FOR hybridcd)
|
||||
|
||||
# Convert the translation files (name format: xx-YY.ini) into UTF-16
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/welcome_config)
|
||||
@@ -43,7 +43,7 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/welcome_config/)
|
||||
add_custom_command(OUTPUT "${_converted_file}"
|
||||
COMMAND native-utf16le "${_source_file}" "${_converted_file}"
|
||||
DEPENDS native-utf16le "${_source_file}")
|
||||
add_cd_file(TARGET converted_welcome_i18n_files FILE ${_converted_file} DESTINATION bootcd/reactos/welcome NO_CAB NAME_ON_CD ${_file} FOR hybridcd)
|
||||
add_cd_file(TARGET converted_welcome_i18n_files FILE ${_converted_file} DESTINATION setup/reactos/welcome NO_CAB NAME_ON_CD ${_file} FOR hybridcd)
|
||||
list(APPEND _converted_welcome_i18n_files ${_converted_file})
|
||||
endforeach(_file)
|
||||
add_custom_target(converted_welcome_i18n_files DEPENDS ${_converted_welcome_i18n_files})
|
||||
|
@@ -1,3 +1,3 @@
|
||||
[autorun]
|
||||
open=bootcd\reactos\welcome.exe
|
||||
open=setup\reactos\welcome.exe
|
||||
icon=icon.ico
|
||||
|
@@ -64,9 +64,9 @@ HKCU,"Control Panel\Desktop","ScreenSaverIsSecure",2,"1"
|
||||
HKCU,"Control Panel\Desktop","ScreenSaveTimeOut",0,"600"
|
||||
HKCU,"Control Panel\Desktop","WaitToKillAppTimeout",2,"20000"
|
||||
HKCU,"Control Panel\Desktop","Pattern",2,"(None)"
|
||||
HKCU,"Control Panel\Desktop","Wallpaper",0x00000000,""
|
||||
HKCU,"Control Panel\Desktop","Wallpaper",0x00000000,"%SystemRoot%\Web\Wallpaper\ReactOS_FOSDEM_1.bmp"
|
||||
HKCU,"Control Panel\Desktop","TileWallpaper",2,"0"
|
||||
HKCU,"Control Panel\Desktop","WallpaperStyle",2,"2"
|
||||
HKCU,"Control Panel\Desktop","WallpaperStyle",2,"0"
|
||||
HKCU,"Control Panel\Desktop","FontSmoothing",0,"1"
|
||||
HKCU,"Control Panel\Desktop","FontSmoothingOrientation",0x00010003,0x00000001
|
||||
HKCU,"Control Panel\Desktop","FontSmoothingType",0x00010003,0x00000001
|
||||
|
@@ -1,9 +1,9 @@
|
||||
[FREELOADER]
|
||||
DefaultOS=Setup
|
||||
TimeOut=5
|
||||
DefaultOS=LiveCD_RamDisk
|
||||
TimeOut=20
|
||||
|
||||
[Display]
|
||||
TitleText=ReactOS Hybrid-CD
|
||||
TitleText=ReactOS 0.4.4-RC for FOSDEM 2017
|
||||
StatusBarColor=Cyan
|
||||
StatusBarTextColor=Black
|
||||
BackdropTextColor=White
|
||||
@@ -13,62 +13,33 @@ TitleBoxTextColor=White
|
||||
TitleBoxColor=Red
|
||||
MessageBoxTextColor=White
|
||||
MessageBoxColor=Blue
|
||||
MenuTextColor=Gray
|
||||
MenuColor=Black
|
||||
TextColor=Gray
|
||||
MenuTextColor=White
|
||||
MenuColor=Blue
|
||||
TextColor=Yellow
|
||||
SelectedTextColor=Black
|
||||
SelectedColor=Gray
|
||||
ShowTime=No
|
||||
MenuBox=No
|
||||
CenterMenu=No
|
||||
MinimalUI=Yes
|
||||
TimeText=Seconds until highlighted choice will be started automatically:
|
||||
SpecialEffects=Yes
|
||||
|
||||
[Operating Systems]
|
||||
Setup="Setup"
|
||||
LiveCD="LiveCD"
|
||||
LiveCD_Debug="LiveCD (Debug)"
|
||||
LiveCD_Screen="LiveCD (Screen)"
|
||||
LiveCD_LogFile="LiveCD (Log file)"
|
||||
LiveCD_RamDisk="LiveCD in RAM"
|
||||
LiveCD_RamDisk_Debug="LiveCD in RAM (Debug)"
|
||||
LiveCD_RamDisk_Screen="LiveCD in RAM (Screen)"
|
||||
Setup="ReactOS Setup"
|
||||
LiveCD="ReactOS Live"
|
||||
LiveCD_RamDisk="ReactOS Live in RAM"
|
||||
HddBoot="Boot from first hard disk"
|
||||
|
||||
[Setup]
|
||||
BootType=ReactOSSetup
|
||||
SystemPath=\bootcd
|
||||
SystemPath=\setup
|
||||
|
||||
[LiveCD]
|
||||
BootType=Windows2003
|
||||
SystemPath=\livecd\reactos
|
||||
SystemPath=\reactos
|
||||
Options=/MININT
|
||||
|
||||
[LiveCD_Debug]
|
||||
BootType=Windows2003
|
||||
SystemPath=\livecd\reactos
|
||||
Options=/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /MININT
|
||||
|
||||
[LiveCD_Screen]
|
||||
BootType=Windows2003
|
||||
SystemPath=\livecd\reactos
|
||||
Options=/DEBUG /DEBUGPORT=SCREEN /SOS /MININT
|
||||
|
||||
[LiveCD_LogFile]
|
||||
BootType=Windows2003
|
||||
SystemPath=\livecd\reactos
|
||||
Options=/DEBUG /DEBUGPORT=FILE:\Device\HarddiskX\PartitionY\debug.log /SOS /MININT
|
||||
|
||||
[LiveCD_RamDisk]
|
||||
BootType=Windows2003
|
||||
SystemPath=ramdisk(0)\reactos
|
||||
Options=/MININT /RDPATH=livecd\livecd.iso /RDEXPORTASCD
|
||||
Options=/MININT /RDPATH=livecd.iso /RDEXPORTASCD
|
||||
|
||||
[LiveCD_RamDisk_Debug]
|
||||
BootType=Windows2003
|
||||
SystemPath=ramdisk(0)\reactos
|
||||
Options=/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /MININT /RDPATH=livecd\livecd.iso /RDEXPORTASCD
|
||||
|
||||
[LiveCD_RamDisk_Screen]
|
||||
BootType=Windows2003
|
||||
SystemPath=ramdisk(0)\reactos
|
||||
Options=/DEBUG /DEBUGPORT=SCREEN /SOS /MININT /RDPATH=livecd\livecd.iso /RDEXPORTASCD
|
||||
[HddBoot]
|
||||
BootType=Drive
|
||||
BootDrive=hd0
|
||||
|
@@ -1,7 +1,23 @@
|
||||
========================
|
||||
ReactOS<EFBFBD> Version 0.4.x
|
||||
Updated August 31, 2016
|
||||
========================
|
||||
================================================================================
|
||||
ReactOS<EFBFBD> Version 0.4.4-RC Preview
|
||||
for FOSDEM 2017
|
||||
================================================================================
|
||||
|
||||
0. CD-ROM Contents
|
||||
------------------
|
||||
|
||||
* ReactOS LiveCD and Installation
|
||||
* ReactOS on QEMU virtual machine
|
||||
* ReactOS Build Environment (RosBE) for Windows and Unix-like OSes
|
||||
* ReactOS source code
|
||||
|
||||
This CD-ROM starts an AutoRun program under Windows. Alternatively you can
|
||||
browse the contents of this CD-ROM with any file browser. The folder names
|
||||
should be self-explanatory.
|
||||
|
||||
The source code of ReactOS can be compiled using the ReactOS Build Environment
|
||||
under Windows or Unix-like operating systems such as Linux.
|
||||
|
||||
|
||||
1. What is ReactOS?
|
||||
-------------------
|
||||
|
47
reactos/boot/bootdata/welcome_config/de-DE.ini
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
[Defaults]
|
||||
AppTitle = "ReactOS 0.4.4-RC für FOSDEM 2017"
|
||||
DefaultTopicTitle = "ReactOS"
|
||||
DefaultTopicDescription = "ReactOS ist ein modernes Open-Source-Betriebssystem, welches auf dem Design von Windows® XP/2003 basiert. Dazu gehört sowohl die volle Kompatibilität mit Windows-Anwendungen und -Treibern als auch eine ähnliche Benutzeroberfläche, damit sich die meisten Anwender sofort zurechtfinden. Der Quellcode des gesamten Systems ist frei verfügbar und steht größtenteils unter der GNU General Public License."
|
||||
|
||||
[Topic0]
|
||||
Button = "ReactOS installieren"
|
||||
Title = "ReactOS installieren"
|
||||
Description = "Installiert ReactOS auf ihrem Computer.\n\nBitte beachten Sie, dass Sie Ihren Computer mit der ReactOS-CD im Laufwerk neu starten müssen, um die Installation zu starten.\n\nAlternativ können Sie ReactOS problemlos in einer virtuellen QEMU-Maschine ausprobieren, wenn Sie den entsprechenden Menüpunkt auf der linken Seite wählen."
|
||||
Action = "<msg>Sie müssen Ihren Computer mit der ReactOS-CD im Laufwerk neu starten, um die Installation zu starten.\n\nBITTE BEACHTEN SIE: Es wird dringend davon abgeraten, ReactOS auf einem Computer zu installieren, welcher wichtige Daten enthält!"
|
||||
|
||||
[Topic1]
|
||||
Button = "ReactOS in QEMU ausprobieren"
|
||||
Title = "ReactOS in QEMU ausprobieren"
|
||||
Description = "Möglicherweise möchten Sie ein Betriebssystem im Alpha-Stadium nicht auf Ihrem eigenen Computer testen oder es gibt Probleme bei der Installation. Daher haben wir ReactOS auf einer virtuellen QEMU-Maschine vorinstalliert, mit der Sie das Betriebssystem problemlos testen können, ohne dass es direkt auf Ihrem Computer installiert werden muss.\n\nEin Klick auf diesen Menüpunkt öffnet das QEMU-Paket in 7-Zip."
|
||||
Action = "\extras\ReactOS on QEMU\ReactOS-044-FOSDEM2017RC-QEMU.7z"
|
||||
|
||||
[Topic2]
|
||||
Button = "ReactOS Build Environment installieren"
|
||||
Title = "ReactOS Build Environment installieren"
|
||||
Description = "Damit ReactOS so einfach wie möglich kompiliert werden kann, wurde das ReactOS Build Environment geschaffen. Dieses enthält die passenden Compiler-Versionen und alle nötigen Tools, um den gesamten ReactOS-Quellcode zu kompilieren.\n\nDie Windows-Version des Build Environments ist kompatibel mit Windows XP oder neueren Versionen. Sie wird über diesen Menüpunkt installiert.\nDie CD enthält auch das Build Environment für Unix-ähnliche Betriebssysteme, wie z.B. Linux oder Mac OS X.\n\nZusätzlich befindet sich auf dieser CD der Quellcode dieser ReactOS-Version."
|
||||
Action = "\extras\ReactOS Build Environment\RosBE-2.1.3.exe"
|
||||
|
||||
[Topic3]
|
||||
Button = "ReactOS-Quellcodepaket öffnen"
|
||||
Title = "ReactOS-Quellcodepaket öffnen"
|
||||
Description = "Die CD enthält auch den gesamten Quellcode dieser ReactOS-Version, welcher mit dem ReactOS Build Environment kompiliert werden kann.\n\nEin Klick auf diesen Menüpunkt öffnet ihn in 7-Zip."
|
||||
Action = "\extras\ReactOS Source Code\ReactOS-044-FOSDEM2017RC-Source.7z"
|
||||
|
||||
[Topic4]
|
||||
Button = "Die ReactOS-Website besuchen"
|
||||
Title = "Die ReactOS-Website besuchen"
|
||||
Description = "Die ReactOS-Website liefert viele weitere Informationen über das Projekt. Hier finden Sie die neusten ReactOS-Versionen und Neuigkeiten bezüglich der Entwicklung."
|
||||
Action = "https://www.reactos.org/"
|
||||
|
||||
[Topic5]
|
||||
Button = "Die CD durchsuchen"
|
||||
Title = "Die CD durchsuchen"
|
||||
Description = "Durchsuchen Sie den Inhalt dieser CD."
|
||||
Action = "explorer.exe"
|
||||
|
||||
[Topic6]
|
||||
Button = "Beenden"
|
||||
Title = "Beenden"
|
||||
Description = "Beendet das AutoRun-Programm."
|
||||
Action = "<exit>"
|
47
reactos/boot/bootdata/welcome_config/en-US.ini
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
[Defaults]
|
||||
AppTitle = "ReactOS 0.4.4-RC for FOSDEM 2017"
|
||||
DefaultTopicTitle = "ReactOS"
|
||||
DefaultTopicDescription = "ReactOS is a modern open source operating system based on the design of Windows® XP/2003. This encompasses full compatibility with Windows applications and drivers as well as a familiar user interface, such that people accustomed to Windows would find using ReactOS straightforward. The source code of the entire system is available for free under several open source licenses, mostly the GNU General Public License."
|
||||
|
||||
[Topic0]
|
||||
Button = "Install ReactOS"
|
||||
Title = "Install ReactOS"
|
||||
Description = "Installs ReactOS on your computer.\n\nPlease note that you have to restart your computer with the ReactOS CD in the drive to start the installation.\n\nAlternatively, you can easily try out ReactOS in a QEMU virtual machine by choosing the respective menu entry on the left side."
|
||||
Action = "<msg>You have to restart your computer with the ReactOS CD in the drive to start the installation.\n\nPLEASE NOTE: You're highly advised to not install ReactOS on a computer that contains important data!"
|
||||
|
||||
[Topic1]
|
||||
Button = "Try out ReactOS in QEMU"
|
||||
Title = "Try out ReactOS in QEMU"
|
||||
Description = "Perhaps you don't want to try out an alpha-stage operating system on your own computer or you face problems during the installation. For these cases, we have preinstalled ReactOS on a QEMU virtual machine. This way, you can try out the operating system without needing to install it on your computer.\n\nA click on this menu entry opens the QEMU package in 7-Zip."
|
||||
Action = "\extras\ReactOS on QEMU\ReactOS-044-FOSDEM2017RC-QEMU.7z"
|
||||
|
||||
[Topic2]
|
||||
Button = "Install ReactOS Build Environment"
|
||||
Title = "Install ReactOS Build Environment"
|
||||
Description = "To make building ReactOS as easy as possible, the ReactOS Build Environment has been created. This contains the right compiler versions and all needed tools to compile the entire ReactOS Source Code.\n\nThe Windows version of the Build Environment is compatible with Windows XP or newer versions. It is installed using this menu entry.\n\nAdditionally, the source code of this ReactOS version is included on this CD."
|
||||
Action = "\extras\ReactOS Build Environment\RosBE-2.1.3.exe"
|
||||
|
||||
[Topic3]
|
||||
Button = "Open the ReactOS Source Code Package"
|
||||
Title = "Open the ReactOS Source Code Package"
|
||||
Description = "The CD also contains the entire source code of this ReactOS version, which can be compiled using the ReactOS Build Environment.\n\nA click on this menu entry opens it in 7-Zip."
|
||||
Action = "\extras\ReactOS Source Code\ReactOS-044-FOSDEM2017RC-Source.7z"
|
||||
|
||||
[Topic4]
|
||||
Button = "Visit the ReactOS Website"
|
||||
Title = "Visit the ReactOS Website"
|
||||
Description = "The ReactOS Website offers many more information about the project. Here you find the latest ReactOS releases and news regarding the development."
|
||||
Action = "https://www.reactos.org/"
|
||||
|
||||
[Topic5]
|
||||
Button = "Browse the CD"
|
||||
Title = "Browse the CD"
|
||||
Description = "Browse the contents of this CD."
|
||||
Action = "explorer.exe"
|
||||
|
||||
[Topic6]
|
||||
Button = "Exit"
|
||||
Title = "Exit"
|
||||
Description = "Exits the AutoRun program."
|
||||
Action = "<exit>"
|
47
reactos/boot/bootdata/welcome_config/fr-FR.ini
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
[Defaults]
|
||||
AppTitle = "ReactOS 0.4.4-RC pour FOSDEM 2017"
|
||||
DefaultTopicTitle = "ReactOS"
|
||||
DefaultTopicDescription = "ReactOS est un système d'exploitation moderne basé sur le design de Windows® XP/2003. Cela signifie une compatibilité totale avec les applications écrites pour Windows, les pilotes de périphériques ainsi qu'une interface utilisateur familière, afin que les personnes habituées à utiliser Windows trouvent ReactOS simple d'utilisation. L'intégralité du code source du système d'exploitation est disponible gratuitement sous diverses licences open source, en majorité la GNU General Public License."
|
||||
|
||||
[Topic0]
|
||||
Button = "Installer ReactOS"
|
||||
Title = "Installer ReactOS"
|
||||
Description = "Installe ReactOS sur votre ordinateur.\n\nVeuillez noter que vous aurez besoin de redémarrer votre ordinateur tout en ayant le CD de ReactOS inséré dans le lecteur afin de démarrer l'installation.\n\nAutrement, vous pouvez aisément essayer ReactOS dans une machine virtuelle QEMU en sélectionnant le bouton adéquat dans le menu à gauche."
|
||||
Action = "<msg>Vous ne pouvez pas encore installer ReactOS directement depuis ce CD ! Veuillez redémarrer votre ordinateur depuis ce CD pour pouvoir installer ReactOS."
|
||||
|
||||
[Topic1]
|
||||
Button = "Essayer ReactOS sous QEMU"
|
||||
Title = "Essayer ReactOS sous QEMU"
|
||||
Description = "Peut-être vous ne voulez pas essayer un système d'exploitation alpha sur votre propre ordinateur, ou bien vous faites face à des problèmes lors de l'installation. Afin de pallier à ces inconvénients, nous avons préinstallé ReactOS sur une machine virtuelle QEMU. Ainsi, vous pouvez essayer le système d'exploitation sans avoir besoin de l'installer sur votre ordinateur.\n\nUn clic sur ce bouton ouvre le package QEMU avec 7-Zip."
|
||||
Action = "\extras\ReactOS on QEMU\ReactOS-044-FOSDEM2017RC-QEMU.7z"
|
||||
|
||||
[Topic2]
|
||||
Button = "Installer ReactOS Build Environment"
|
||||
Title = "Installer ReactOS Build Environment"
|
||||
Description = "Afin de rendre la compilation de ReactOS aussi simple que possible, l'environnement de développement ReactOS (ReactOS Build Environment) a été créé. Il comprend les correctes versions des compilateurs ainsi que les outils nécessaires afin de compiler l'intégralité du code source de ReactOS.\n\nLa version Windows de l'environnement de développement est compatible avec Windows XP ou ultérieur. Elle est installée en cliquant sur ce bouton.\n\nEn supplément, le code source de cette version de ReactOS est inclus dans ce CD."
|
||||
Action = "\extras\ReactOS Build Environment\RosBE-2.1.3.exe"
|
||||
|
||||
[Topic3]
|
||||
Button = "Découvrir le code source de ReactOS"
|
||||
Title = "Découvrir le code source de ReactOS"
|
||||
Description = "Ce CD contient aussi l'intégralité du code source de cette version de ReactOS qui peut être compilé en utilisant l'environnement de développement ReactOS.\n\nUn clic sur ce bouton ouvre l'archive avec 7-Zip."
|
||||
Action = "\extras\ReactOS Source Code\ReactOS-044-FOSDEM2017RC-Source.7z"
|
||||
|
||||
[Topic4]
|
||||
Button = "Visiter le site Web de ReactOS"
|
||||
Title = "Visiter le site Web de ReactOS"
|
||||
Description = "Le site Web de ReactOS fournit plus d'informations à propos du projet. Vous y trouverez les dernières versions de ReactOS ainsi que des nouvelles concernant son développement."
|
||||
Action = "https://www.reactos.org/"
|
||||
|
||||
[Topic5]
|
||||
Button = "Parcourir le CD"
|
||||
Title = "Parcourir le CD"
|
||||
Description = "Parcourir le contenu du CD."
|
||||
Action = "explorer.exe"
|
||||
|
||||
[Topic6]
|
||||
Button = "Quitter"
|
||||
Title = "Quitter"
|
||||
Description = "Quitte le programme AutoRun."
|
||||
Action = "<exit>"
|
@@ -121,7 +121,7 @@ PVOID MmAllocateHighestMemoryBelowAddress(SIZE_T MemorySize, PVOID DesiredAdd
|
||||
|
||||
/* Heap */
|
||||
#define DEFAULT_HEAP_SIZE (1024 * 1024)
|
||||
#define TEMP_HEAP_SIZE (32 * 1024 * 1024)
|
||||
#define TEMP_HEAP_SIZE (10 * 1024 * 1024)
|
||||
|
||||
extern PVOID FrLdrDefaultHeap;
|
||||
extern PVOID FrLdrTempHeap;
|
||||
|
@@ -277,5 +277,9 @@ VOID AppendBootTimeOptions(PCHAR BootOptions)
|
||||
strcat(BootOptions, " /BASEVIDEO");
|
||||
|
||||
if (DebuggingMode)
|
||||
#if 0
|
||||
strcat(BootOptions, " /DEBUG");
|
||||
#else
|
||||
strcat(BootOptions, " /DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /DEBUGPORT=SCREEN /SOS");
|
||||
#endif
|
||||
}
|
||||
|
@@ -96,7 +96,6 @@ class CDefView :
|
||||
LONG m_iDragOverItem; /* Dragged over item's index, iff m_pCurDropTarget != NULL */
|
||||
UINT m_cScrollDelay; /* Send a WM_*SCROLL msg every 250 ms during drag-scroll */
|
||||
POINT m_ptLastMousePos; /* Mouse position at last DragOver call */
|
||||
POINT m_ptFirstMousePos; /* Mouse position when the drag operation started */
|
||||
//
|
||||
CComPtr<IContextMenu> m_pCM;
|
||||
|
||||
@@ -1757,8 +1756,6 @@ LRESULT CDefView::OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandl
|
||||
DWORD dwEffect2;
|
||||
|
||||
m_pSourceDataObject = pda;
|
||||
m_ptFirstMousePos = ((LPNMLISTVIEW)lParam)->ptAction;
|
||||
ClientToScreen(&m_ptFirstMousePos);
|
||||
|
||||
DoDragDrop(pda, this, dwEffect, &dwEffect2);
|
||||
|
||||
@@ -2419,7 +2416,7 @@ HRESULT STDMETHODCALLTYPE CDefView::SelectItem(int iItem, DWORD dwFlags)
|
||||
|
||||
m_ListView.SetItemState(iItem, lvItem.state, lvItem.stateMask);
|
||||
|
||||
if ((dwFlags & SVSI_EDIT) == SVSI_EDIT)
|
||||
if (dwFlags & SVSI_EDIT)
|
||||
m_ListView.EditLabel(iItem);
|
||||
|
||||
return S_OK;
|
||||
@@ -2822,14 +2819,17 @@ HRESULT WINAPI CDefView::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCm
|
||||
|
||||
HRESULT CDefView::drag_notify_subitem(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
|
||||
{
|
||||
LVHITTESTINFO htinfo;
|
||||
LONG lResult;
|
||||
HRESULT hr;
|
||||
RECT clientRect;
|
||||
|
||||
/* Map from global to client coordinates and query the index of the listview-item, which is
|
||||
* currently under the mouse cursor. */
|
||||
LVHITTESTINFO htinfo = {{pt.x, pt.y}, LVHT_ONITEM};
|
||||
ScreenToClient(&htinfo.pt);
|
||||
htinfo.pt.x = pt.x;
|
||||
htinfo.pt.y = pt.y;
|
||||
htinfo.flags = LVHT_ONITEM;
|
||||
::ScreenToClient(m_ListView, &htinfo.pt);
|
||||
lResult = m_ListView.HitTest(&htinfo);
|
||||
|
||||
/* Send WM_*SCROLL messages every 250 ms during drag-scrolling */
|
||||
@@ -2862,22 +2862,6 @@ HRESULT CDefView::drag_notify_subitem(DWORD grfKeyState, POINTL pt, DWORD *pdwEf
|
||||
|
||||
m_ptLastMousePos = htinfo.pt;
|
||||
|
||||
/* We need to check if we drag the selection over itself */
|
||||
if (lResult != -1 && m_pSourceDataObject.p != NULL)
|
||||
{
|
||||
PCUITEMID_CHILD pidl = _PidlByItem(lResult);
|
||||
|
||||
for (UINT i = 0; i < m_cidl; i++)
|
||||
{
|
||||
if (pidl == m_apidl[i])
|
||||
{
|
||||
/* The item that is being draged is hovering itself. */
|
||||
lResult = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* If we are still over the previous sub-item, notify it via DragOver and return. */
|
||||
if (m_pCurDropTarget && lResult == m_iDragOverItem)
|
||||
return m_pCurDropTarget->DragOver(grfKeyState, pt, pdwEffect);
|
||||
@@ -2885,16 +2869,11 @@ HRESULT CDefView::drag_notify_subitem(DWORD grfKeyState, POINTL pt, DWORD *pdwEf
|
||||
/* We've left the previous sub-item, notify it via DragLeave and Release it. */
|
||||
if (m_pCurDropTarget)
|
||||
{
|
||||
PCUITEMID_CHILD pidl = _PidlByItem(m_iDragOverItem);
|
||||
if (pidl)
|
||||
SelectItem(pidl, 0);
|
||||
|
||||
m_pCurDropTarget->DragLeave();
|
||||
m_pCurDropTarget.Release();
|
||||
}
|
||||
|
||||
m_iDragOverItem = lResult;
|
||||
|
||||
if (lResult == -1)
|
||||
{
|
||||
/* We are not above one of the listview's subitems. Bind to the parent folder's
|
||||
@@ -2916,20 +2895,14 @@ HRESULT CDefView::drag_notify_subitem(DWORD grfKeyState, POINTL pt, DWORD *pdwEf
|
||||
return hr;
|
||||
|
||||
/* Notify the item just entered via DragEnter. */
|
||||
hr = m_pCurDropTarget->DragEnter(m_pCurDataObject, grfKeyState, pt, pdwEffect);
|
||||
|
||||
if (m_iDragOverItem != -1 && pdwEffect != DROPEFFECT_NONE)
|
||||
{
|
||||
SelectItem(m_iDragOverItem, SVSI_SELECT);
|
||||
}
|
||||
|
||||
return hr;
|
||||
return m_pCurDropTarget->DragEnter(m_pCurDataObject, grfKeyState, pt, pdwEffect);
|
||||
}
|
||||
|
||||
HRESULT WINAPI CDefView::DragEnter(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
|
||||
{
|
||||
/* Get a hold on the data object for later calls to DragEnter on the sub-folders */
|
||||
m_pCurDataObject = pDataObject;
|
||||
pDataObject->AddRef();
|
||||
|
||||
return drag_notify_subitem(grfKeyState, pt, pdwEffect);
|
||||
}
|
||||
@@ -2961,35 +2934,19 @@ HRESULT WINAPI CDefView::Drop(IDataObject* pDataObject, DWORD grfKeyState, POINT
|
||||
{
|
||||
ERR("GetKeyState(VK_LBUTTON): %d\n", GetKeyState(VK_LBUTTON));
|
||||
|
||||
if ((m_iDragOverItem == -1 || m_pCurDropTarget == NULL) &&
|
||||
if ((m_iDragOverItem == -1) &&
|
||||
(*pdwEffect & DROPEFFECT_MOVE) &&
|
||||
/*(GetKeyState(VK_LBUTTON) != 0) &&*/
|
||||
(GetKeyState(VK_LBUTTON) != 0) &&
|
||||
(m_pSourceDataObject.p) &&
|
||||
(SHIsSameObject(pDataObject, m_pSourceDataObject)))
|
||||
{
|
||||
ERR("Should implement moving items here!\n");
|
||||
|
||||
if (m_pCurDropTarget)
|
||||
{
|
||||
m_pCurDropTarget->DragLeave();
|
||||
m_pCurDropTarget.Release();
|
||||
}
|
||||
|
||||
/* Restore the selection */
|
||||
m_ListView.SetItemState(-1, 0, LVIS_SELECTED);
|
||||
for (UINT i = 0 ; i < m_cidl; i++)
|
||||
SelectItem(m_apidl[i], SVSI_SELECT);
|
||||
|
||||
/* Reposition the items */
|
||||
int lvIndex = -1;
|
||||
while ((lvIndex = m_ListView.GetNextItem(lvIndex, LVNI_SELECTED)) > -1)
|
||||
{
|
||||
POINT ptItem;
|
||||
if (m_ListView.GetItemPosition(lvIndex, &ptItem))
|
||||
{
|
||||
ptItem.x += pt.x - m_ptFirstMousePos.x;
|
||||
ptItem.y += pt.y - m_ptFirstMousePos.y;
|
||||
m_ListView.SetItemPosition(lvIndex, &ptItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_pCurDropTarget)
|
||||
{
|
||||
|
@@ -76,8 +76,6 @@ class CDefaultContextMenu :
|
||||
PStaticShellEntry m_pStaticEntries; /* first static shell extension entry */
|
||||
UINT m_iIdSCMFirst; /* first static used id */
|
||||
UINT m_iIdSCMLast; /* last static used id */
|
||||
UINT m_iIdCBFirst; /* first callback used id */
|
||||
UINT m_iIdCBLast; /* last callback used id */
|
||||
|
||||
HRESULT _DoCallback(UINT uMsg, WPARAM wParam, LPVOID lParam);
|
||||
void AddStaticEntry(const HKEY hkeyClass, const WCHAR *szVerb);
|
||||
@@ -86,7 +84,8 @@ class CDefaultContextMenu :
|
||||
HRESULT LoadDynamicContextMenuHandler(HKEY hKey, const CLSID *pclsid);
|
||||
BOOL EnumerateDynamicContextHandlerForKey(HKEY hRootKey);
|
||||
UINT InsertMenuItemsOfDynamicContextMenuExtension(HMENU hMenu, UINT IndexMenu, UINT idCmdFirst, UINT idCmdLast);
|
||||
UINT AddStaticContextMenusToMenu(HMENU hMenu, UINT IndexMenu, UINT iIdCmdFirst, UINT iIdCmdLast);
|
||||
UINT AddStaticContextMenusToMenu(HMENU hMenu, UINT IndexMenu);
|
||||
UINT BuildShellItemContextMenu(HMENU hMenu, UINT iIdCmdFirst, UINT iIdCmdLast, UINT uFlags);
|
||||
HRESULT DoPaste(LPCMINVOKECOMMANDINFO lpcmi, BOOL bLink);
|
||||
HRESULT DoOpenOrExplore(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
HRESULT DoCreateLink(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
@@ -147,9 +146,7 @@ CDefaultContextMenu::CDefaultContextMenu() :
|
||||
m_iIdSHELast(0),
|
||||
m_pStaticEntries(NULL),
|
||||
m_iIdSCMFirst(0),
|
||||
m_iIdSCMLast(0),
|
||||
m_iIdCBFirst(0),
|
||||
m_iIdCBLast(0)
|
||||
m_iIdSCMLast(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -473,6 +470,8 @@ CDefaultContextMenu::InsertMenuItemsOfDynamicContextMenuExtension(HMENU hMenu, U
|
||||
}
|
||||
|
||||
PDynamicShellEntry pEntry = m_pDynamicEntries;
|
||||
idCmdFirst = 0x5000;
|
||||
idCmdLast = 0x6000;
|
||||
m_iIdSHEFirst = idCmdFirst;
|
||||
do
|
||||
{
|
||||
@@ -483,13 +482,6 @@ CDefaultContextMenu::InsertMenuItemsOfDynamicContextMenuExtension(HMENU hMenu, U
|
||||
pEntry->NumIds = LOWORD(hr);
|
||||
IndexMenu += pEntry->NumIds;
|
||||
idCmdFirst += pEntry->NumIds + 0x10;
|
||||
|
||||
if(idCmdFirst >= idCmdLast)
|
||||
{
|
||||
/* There is no more room for items */
|
||||
idCmdFirst = idCmdLast;
|
||||
break;
|
||||
}
|
||||
}
|
||||
TRACE("pEntry %p hr %x contextmenu %p cmdfirst %x num ids %x\n", pEntry, hr, pEntry->pCM, pEntry->iIdCmdFirst, pEntry->NumIds);
|
||||
pEntry = pEntry->pNext;
|
||||
@@ -503,9 +495,7 @@ CDefaultContextMenu::InsertMenuItemsOfDynamicContextMenuExtension(HMENU hMenu, U
|
||||
UINT
|
||||
CDefaultContextMenu::AddStaticContextMenusToMenu(
|
||||
HMENU hMenu,
|
||||
UINT IndexMenu,
|
||||
UINT iIdCmdFirst,
|
||||
UINT iIdCmdLast)
|
||||
UINT IndexMenu)
|
||||
{
|
||||
MENUITEMINFOW mii;
|
||||
UINT idResource;
|
||||
@@ -515,7 +505,7 @@ CDefaultContextMenu::AddStaticContextMenusToMenu(
|
||||
mii.cbSize = sizeof(mii);
|
||||
mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_DATA;
|
||||
mii.fType = MFT_STRING;
|
||||
mii.wID = iIdCmdFirst;
|
||||
mii.wID = 0x4000;
|
||||
mii.dwTypeData = NULL;
|
||||
m_iIdSCMFirst = mii.wID;
|
||||
|
||||
@@ -600,9 +590,6 @@ CDefaultContextMenu::AddStaticContextMenusToMenu(
|
||||
|
||||
mii.wID++;
|
||||
pEntry = pEntry->pNext;
|
||||
|
||||
if (mii.wID >= iIdCmdLast)
|
||||
break;
|
||||
}
|
||||
|
||||
m_iIdSCMLast = mii.wID - 1;
|
||||
@@ -658,11 +645,6 @@ CDefaultContextMenu::QueryContextMenu(
|
||||
UINT uFlags)
|
||||
{
|
||||
HRESULT hr;
|
||||
UINT idCmdNext = idCmdFirst;
|
||||
|
||||
/* Add a tiny hack to make all the shell happy until we understand how we should handle 0 ids */
|
||||
if (!idCmdNext)
|
||||
idCmdNext = 1;
|
||||
|
||||
TRACE("BuildShellItemContextMenu entered\n");
|
||||
|
||||
@@ -674,40 +656,35 @@ CDefaultContextMenu::QueryContextMenu(
|
||||
}
|
||||
|
||||
/* Add static context menu handlers */
|
||||
IndexMenu = AddStaticContextMenusToMenu(hMenu, IndexMenu, idCmdNext, idCmdLast);
|
||||
if (m_iIdSCMLast && m_iIdSCMFirst != m_iIdSCMLast)
|
||||
idCmdNext = m_iIdSCMLast + 1;
|
||||
IndexMenu = AddStaticContextMenusToMenu(hMenu, IndexMenu);
|
||||
|
||||
/* Add dynamic context menu handlers */
|
||||
BOOL bAddSep = FALSE;
|
||||
IndexMenu = InsertMenuItemsOfDynamicContextMenuExtension(hMenu, IndexMenu, idCmdNext, idCmdLast);
|
||||
if (m_iIdSHELast && m_iIdSHELast != m_iIdSHEFirst)
|
||||
idCmdNext = m_iIdSHELast + 1;
|
||||
IndexMenu = InsertMenuItemsOfDynamicContextMenuExtension(hMenu, IndexMenu, idCmdFirst, idCmdLast);
|
||||
TRACE("IndexMenu %d\n", IndexMenu);
|
||||
|
||||
/* Now let the callback add its own items */
|
||||
QCMINFO qcminfo = {hMenu, IndexMenu, idCmdNext, idCmdLast, NULL};
|
||||
if (SUCCEEDED(_DoCallback(DFM_MERGECONTEXTMENU, uFlags, &qcminfo)))
|
||||
{
|
||||
m_iIdCBFirst = idCmdNext;
|
||||
m_iIdCBLast = qcminfo.idCmdFirst;
|
||||
idCmdNext = m_iIdCBLast + 1;
|
||||
}
|
||||
|
||||
/* The rest of the items will be added in the end of the menu */
|
||||
QCMINFO qcminfo;
|
||||
qcminfo.hmenu = hMenu;
|
||||
qcminfo.indexMenu = IndexMenu;
|
||||
qcminfo.idCmdFirst = idCmdFirst;
|
||||
qcminfo.idCmdLast = idCmdLast;
|
||||
qcminfo.pIdMap = NULL;
|
||||
_DoCallback(DFM_MERGECONTEXTMENU, uFlags, &qcminfo);
|
||||
IndexMenu = GetMenuItemCount(hMenu);
|
||||
|
||||
if (uFlags & CMF_VERBSONLY)
|
||||
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, idCmdNext - idCmdFirst);
|
||||
return S_OK;
|
||||
|
||||
/* If this is a background context menu we are done */
|
||||
if (!m_cidl)
|
||||
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, idCmdNext - idCmdFirst);
|
||||
return S_OK;
|
||||
|
||||
/* Get the attributes of the items */
|
||||
SFGAOF rfg = SFGAO_BROWSABLE | SFGAO_CANCOPY | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANDELETE | SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_FILESYSTEM | SFGAO_FOLDER;
|
||||
hr = m_psf->GetAttributesOf(m_cidl, m_apidl, &rfg);
|
||||
if (FAILED_UNEXPECTEDLY(hr))
|
||||
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, idCmdNext - idCmdFirst);
|
||||
return S_OK;
|
||||
|
||||
/* Add the standard menu entries based on the attributes of the items */
|
||||
BOOL bClipboardData = (HasClipboardData() && (rfg & SFGAO_FILESYSTEM));
|
||||
@@ -1229,6 +1206,9 @@ CDefaultContextMenu::InvokeCommand(
|
||||
Result = DoCreateNewFolder(&LocalInvokeInfo);
|
||||
break;
|
||||
default:
|
||||
|
||||
_DoCallback(DFM_INVOKECOMMAND, LOWORD(LocalInvokeInfo.lpVerb), NULL);
|
||||
|
||||
Result = E_UNEXPECTED;
|
||||
break;
|
||||
}
|
||||
@@ -1236,27 +1216,21 @@ CDefaultContextMenu::InvokeCommand(
|
||||
/* Check for ID's we didn't find a handler for */
|
||||
if (Result == E_UNEXPECTED)
|
||||
{
|
||||
if (m_pDynamicEntries)
|
||||
if (m_iIdSHEFirst && m_iIdSHELast)
|
||||
{
|
||||
if (LOWORD(LocalInvokeInfo.lpVerb) >= m_iIdSHEFirst && LOWORD(LocalInvokeInfo.lpVerb) <= m_iIdSHELast)
|
||||
Result = DoDynamicShellExtensions(&LocalInvokeInfo);
|
||||
}
|
||||
|
||||
if (m_pStaticEntries)
|
||||
if (m_iIdSCMFirst && m_iIdSCMLast)
|
||||
{
|
||||
if (LOWORD(LocalInvokeInfo.lpVerb) >= m_iIdSCMFirst && LOWORD(LocalInvokeInfo.lpVerb) <= m_iIdSCMLast)
|
||||
Result = DoStaticShellExtensions(&LocalInvokeInfo);
|
||||
}
|
||||
|
||||
if (m_iIdCBFirst != m_iIdCBLast)
|
||||
{
|
||||
if (LOWORD(LocalInvokeInfo.lpVerb) >= m_iIdCBFirst && LOWORD(LocalInvokeInfo.lpVerb) <= m_iIdCBLast)
|
||||
Result = _DoCallback(DFM_INVOKECOMMAND, LOWORD(LocalInvokeInfo.lpVerb), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (Result == E_UNEXPECTED)
|
||||
ERR("Unhandled Verb %xl\n", LOWORD(LocalInvokeInfo.lpVerb));
|
||||
FIXME("Unhandled Verb %xl\n", LOWORD(LocalInvokeInfo.lpVerb));
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
@@ -76,13 +76,17 @@ HRESULT CALLBACK DrivesContextMenuCallback(IShellFolder *psf,
|
||||
if (!(dwFlags & FILE_READ_ONLY_VOLUME) && GetDriveTypeA(szDrive) != DRIVE_REMOTE)
|
||||
{
|
||||
_InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0);
|
||||
_InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, pqcminfo->idCmdFirst++, MFT_STRING, MAKEINTRESOURCEW(IDS_FORMATDRIVE), MFS_ENABLED);
|
||||
_InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, 0x7ABC, MFT_STRING, MAKEINTRESOURCEW(IDS_FORMATDRIVE), MFS_ENABLED);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (uMsg == DFM_INVOKECOMMAND)
|
||||
{
|
||||
if (wParam == DFM_CMD_PROPERTIES)
|
||||
if(wParam == 0x7ABC)
|
||||
{
|
||||
SHFormatDrive(hwnd, szDrive[0] - 'A', SHFMT_ID_DEFAULT, 0);
|
||||
}
|
||||
else if (wParam == DFM_CMD_PROPERTIES)
|
||||
{
|
||||
WCHAR wszBuf[4];
|
||||
wcscpy(wszBuf, L"A:\\");
|
||||
@@ -90,10 +94,6 @@ HRESULT CALLBACK DrivesContextMenuCallback(IShellFolder *psf,
|
||||
if (!SH_ShowDriveProperties(wszBuf, pidlFolder, apidl))
|
||||
hr = E_FAIL;
|
||||
}
|
||||
else
|
||||
{
|
||||
SHFormatDrive(hwnd, szDrive[0] - 'A', SHFMT_ID_DEFAULT, 0);
|
||||
}
|
||||
}
|
||||
|
||||
SHFree(pidlFolder);
|
||||
|
@@ -453,9 +453,6 @@ INT SIC_GetIconIndex (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags )
|
||||
sice.dwSourceIndex = dwSourceIndex;
|
||||
sice.dwFlags = dwFlags;
|
||||
|
||||
if (!sic_hdpa)
|
||||
SIC_Initialize();
|
||||
|
||||
EnterCriticalSection(&SHELL32_SicCS);
|
||||
|
||||
if (NULL != DPA_GetPtr (sic_hdpa, 0))
|
||||
@@ -690,9 +687,6 @@ static int SIC_LoadOverlayIcon(int icon_idx)
|
||||
RegCloseKey(hKeyShellIcons);
|
||||
}
|
||||
|
||||
if (!sic_hdpa)
|
||||
SIC_Initialize();
|
||||
|
||||
return SIC_LoadIcon(iconPath, iconIdx, 0);
|
||||
}
|
||||
|
||||
@@ -704,17 +698,13 @@ static int SIC_LoadOverlayIcon(int icon_idx)
|
||||
*
|
||||
*/
|
||||
BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList)
|
||||
{
|
||||
TRACE("(%p,%p)\n",lpBigList,lpSmallList);
|
||||
|
||||
if (!sic_hdpa)
|
||||
SIC_Initialize();
|
||||
|
||||
{ TRACE("(%p,%p)\n",lpBigList,lpSmallList);
|
||||
if (lpBigList)
|
||||
*lpBigList = ShellBigIconList;
|
||||
|
||||
{ *lpBigList = ShellBigIconList;
|
||||
}
|
||||
if (lpSmallList)
|
||||
*lpSmallList = ShellSmallIconList;
|
||||
{ *lpSmallList = ShellSmallIconList;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -745,9 +735,6 @@ BOOL PidlToSicIndex (
|
||||
|
||||
TRACE("sf=%p pidl=%p %s\n", sh, pidl, bBigIcon?"Big":"Small");
|
||||
|
||||
if (!sic_hdpa)
|
||||
SIC_Initialize();
|
||||
|
||||
if (SUCCEEDED (sh->GetUIObjectOf(0, 1, &pidl, IID_NULL_PPV_ARG(IExtractIconW, &ei))))
|
||||
{
|
||||
if (SUCCEEDED(ei->GetIconLocation(uFlags, szIconFile, MAX_PATH, &iSourceIndex, &dwFlags)))
|
||||
|
@@ -347,6 +347,7 @@ STDAPI_(BOOL) DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID fImpLoad)
|
||||
InitCommonControlsEx(&InitCtrls);
|
||||
|
||||
/* Bad idea, initialization in DllMain! */
|
||||
SIC_Initialize();
|
||||
InitChangeNotifications();
|
||||
}
|
||||
else if (dwReason == DLL_PROCESS_DETACH)
|
||||
|
@@ -1292,8 +1292,8 @@ BOOL WINAPI WriteCabinetState(CABINETSTATE *cs)
|
||||
*
|
||||
*/
|
||||
BOOL WINAPI FileIconInit(BOOL bFullInit)
|
||||
{
|
||||
return SIC_Initialize();
|
||||
{ FIXME("(%s)\n", bFullInit ? "true" : "false");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@@ -1470,8 +1470,8 @@ acpi_bus_remove (
|
||||
if (device->pnp.cid_list)
|
||||
ExFreePoolWithTag(device->pnp.cid_list, 'DpcA');
|
||||
|
||||
if (device->pnp.hardware_id)
|
||||
ExFreePoolWithTag(device->pnp.hardware_id, 'DpcA');
|
||||
if (device->pnp.hardware_id)
|
||||
ExFreePoolWithTag(device->pnp.hardware_id, 'DpcA');
|
||||
|
||||
if (device)
|
||||
ExFreePoolWithTag(device, 'DpcA');
|
||||
|
@@ -685,77 +685,77 @@ Bus_PDO_QueryDeviceText(
|
||||
case DeviceTextDescription:
|
||||
|
||||
if (!Irp->IoStatus.Information) {
|
||||
if (wcsstr (DeviceData->HardwareIDs, L"PNP000") != 0)
|
||||
Temp = L"Programmable interrupt controller";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP010") != 0)
|
||||
Temp = L"System timer";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP020") != 0)
|
||||
Temp = L"DMA controller";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP03") != 0)
|
||||
Temp = L"Keyboard";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP040") != 0)
|
||||
Temp = L"Parallel port";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP05") != 0)
|
||||
Temp = L"Serial port";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP06") != 0)
|
||||
Temp = L"Disk controller";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP07") != 0)
|
||||
Temp = L"Disk controller";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP09") != 0)
|
||||
Temp = L"Display adapter";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0A0") != 0)
|
||||
Temp = L"Bus controller";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0E0") != 0)
|
||||
Temp = L"PCMCIA controller";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0F") != 0)
|
||||
Temp = L"Mouse device";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP8") != 0)
|
||||
Temp = L"Network adapter";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNPA0") != 0)
|
||||
Temp = L"SCSI controller";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNPB0") != 0)
|
||||
Temp = L"Multimedia device";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNPC00") != 0)
|
||||
Temp = L"Modem";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0C0C") != 0)
|
||||
Temp = L"Power Button";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0C0E") != 0)
|
||||
Temp = L"Sleep Button";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0C0D") != 0)
|
||||
Temp = L"Lid Switch";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0C09") != 0)
|
||||
Temp = L"ACPI Embedded Controller";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0C0B") != 0)
|
||||
Temp = L"ACPI Fan";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0A03") != 0 ||
|
||||
wcsstr(DeviceData->HardwareIDs, L"PNP0A08") != 0)
|
||||
Temp = L"PCI Root Bridge";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0C0A") != 0)
|
||||
Temp = L"ACPI Battery";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0C0F") != 0)
|
||||
Temp = L"PCI Interrupt Link";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"ACPI_PWR") != 0)
|
||||
Temp = L"ACPI Power Resource";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"Processor") != 0)
|
||||
{
|
||||
if (ProcessorNameString != NULL)
|
||||
Temp = ProcessorNameString;
|
||||
else
|
||||
Temp = L"Processor";
|
||||
}
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"ThermalZone") != 0)
|
||||
Temp = L"ACPI Thermal Zone";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"ACPI0002") != 0)
|
||||
Temp = L"Smart Battery";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"ACPI0003") != 0)
|
||||
Temp = L"AC Adapter";
|
||||
/* Simply checking if AcpiHandle is NULL eliminates the need to check
|
||||
* for the 4 different names that ACPI knows the fixed feature button as internally
|
||||
*/
|
||||
else if (!DeviceData->AcpiHandle)
|
||||
Temp = L"ACPI Fixed Feature Button";
|
||||
else
|
||||
Temp = L"Other ACPI device";
|
||||
if (wcsstr (DeviceData->HardwareIDs, L"PNP000") != 0)
|
||||
Temp = L"Programmable interrupt controller";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP010") != 0)
|
||||
Temp = L"System timer";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP020") != 0)
|
||||
Temp = L"DMA controller";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP03") != 0)
|
||||
Temp = L"Keyboard";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP040") != 0)
|
||||
Temp = L"Parallel port";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP05") != 0)
|
||||
Temp = L"Serial port";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP06") != 0)
|
||||
Temp = L"Disk controller";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP07") != 0)
|
||||
Temp = L"Disk controller";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP09") != 0)
|
||||
Temp = L"Display adapter";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0A0") != 0)
|
||||
Temp = L"Bus controller";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0E0") != 0)
|
||||
Temp = L"PCMCIA controller";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0F") != 0)
|
||||
Temp = L"Mouse device";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP8") != 0)
|
||||
Temp = L"Network adapter";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNPA0") != 0)
|
||||
Temp = L"SCSI controller";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNPB0") != 0)
|
||||
Temp = L"Multimedia device";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNPC00") != 0)
|
||||
Temp = L"Modem";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0C0C") != 0)
|
||||
Temp = L"Power Button";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0C0E") != 0)
|
||||
Temp = L"Sleep Button";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0C0D") != 0)
|
||||
Temp = L"Lid Switch";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0C09") != 0)
|
||||
Temp = L"ACPI Embedded Controller";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0C0B") != 0)
|
||||
Temp = L"ACPI Fan";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0A03") != 0 ||
|
||||
wcsstr(DeviceData->HardwareIDs, L"PNP0A08") != 0 )
|
||||
Temp = L"PCI Root Bridge";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0C0A") != 0)
|
||||
Temp = L"ACPI Battery";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"PNP0C0F") != 0)
|
||||
Temp = L"PCI Interrupt Link";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"ACPI_PWR") != 0)
|
||||
Temp = L"ACPI Power Resource";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"Processor") != 0)
|
||||
{
|
||||
if (ProcessorNameString != NULL)
|
||||
Temp = ProcessorNameString;
|
||||
else
|
||||
Temp = L"Processor";
|
||||
}
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"ThermalZone") != 0)
|
||||
Temp = L"ACPI Thermal Zone";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"ACPI0002") != 0)
|
||||
Temp = L"Smart Battery";
|
||||
else if (wcsstr(DeviceData->HardwareIDs, L"ACPI0003") != 0)
|
||||
Temp = L"AC Adapter";
|
||||
/* Simply checking if AcpiHandle is NULL eliminates the need to check
|
||||
* for the 4 different names that ACPI knows the fixed feature button as internally
|
||||
*/
|
||||
else if (!DeviceData->AcpiHandle)
|
||||
Temp = L"ACPI Fixed Feature Button";
|
||||
else
|
||||
Temp = L"Other ACPI device";
|
||||
|
||||
Buffer = ExAllocatePoolWithTag(PagedPool, (wcslen(Temp) + 1) * sizeof(WCHAR), 'IpcA');
|
||||
|
||||
|
@@ -125,29 +125,6 @@ HidP_GetCaps(
|
||||
return HidParser_GetCaps(&Parser, PreparsedData, Capabilities);
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
TranslateStatusForUpperLayer(
|
||||
IN HIDPARSER_STATUS Status)
|
||||
{
|
||||
//
|
||||
// now we are handling only this values, for others just return
|
||||
// status as it is.
|
||||
//
|
||||
switch (Status)
|
||||
{
|
||||
case HIDPARSER_STATUS_INSUFFICIENT_RESOURCES:
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
case HIDPARSER_STATUS_INVALID_REPORT_TYPE:
|
||||
return HIDP_STATUS_INVALID_REPORT_TYPE;
|
||||
case HIDPARSER_STATUS_BUFFER_TOO_SMALL:
|
||||
return STATUS_BUFFER_TOO_SMALL;
|
||||
case HIDPARSER_STATUS_COLLECTION_NOT_FOUND:
|
||||
return STATUS_NO_DATA_DETECTED;
|
||||
default:
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
HidP_GetCollectionDescription(
|
||||
@@ -157,7 +134,6 @@ HidP_GetCollectionDescription(
|
||||
OUT PHIDP_DEVICE_DESC DeviceDescription)
|
||||
{
|
||||
HID_PARSER Parser;
|
||||
NTSTATUS Status;
|
||||
|
||||
//
|
||||
// init parser
|
||||
@@ -167,8 +143,7 @@ HidP_GetCollectionDescription(
|
||||
//
|
||||
// get description;
|
||||
//
|
||||
Status = HidParser_GetCollectionDescription(&Parser, ReportDesc, DescLength, PoolType, DeviceDescription);
|
||||
return TranslateStatusForUpperLayer(Status);
|
||||
return HidParser_GetCollectionDescription(&Parser, ReportDesc, DescLength, PoolType, DeviceDescription);
|
||||
}
|
||||
|
||||
HIDAPI
|
||||
|
@@ -6,4 +6,3 @@ add_subdirectory(floppy)
|
||||
add_subdirectory(ide)
|
||||
add_subdirectory(port)
|
||||
add_subdirectory(scsiport)
|
||||
#add_subdirectory(storahci)
|
||||
|
@@ -1,11 +0,0 @@
|
||||
add_definitions(-DDEBUG)
|
||||
|
||||
list(APPEND SOURCE
|
||||
storahci.c)
|
||||
|
||||
add_library(storahci SHARED ${SOURCE} storahci.rc)
|
||||
|
||||
set_module_type(storahci kernelmodedriver)
|
||||
add_importlibs(storahci storport ntoskrnl hal)
|
||||
add_cd_file(TARGET storahci DESTINATION reactos/system32/drivers NO_CAB FOR all)
|
||||
add_registry_inf(storahci.inf)
|
@@ -1,168 +0,0 @@
|
||||
AhciPortInitialize
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
FULLY_SUPPORTED
|
||||
TESTED
|
||||
Comment
|
||||
NONE
|
||||
|
||||
AhciAllocateResourceForAdapter
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
FULLY_SUPPORTED
|
||||
TESTED
|
||||
Comment
|
||||
NONE
|
||||
|
||||
AhciHwInitialize
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
FULLY_SUPPORTED
|
||||
TESTED
|
||||
Comment
|
||||
NONE
|
||||
|
||||
AhciInterruptHandler
|
||||
Flags
|
||||
NOT_IMPLEMENTED
|
||||
TESTED
|
||||
Comment
|
||||
Fatal Error not supported
|
||||
Error Recovery not supported
|
||||
Complete Request Routine
|
||||
|
||||
AhciHwInterrupt
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
FULLY_SUPPORTED
|
||||
TESTED
|
||||
Comment
|
||||
NONE
|
||||
|
||||
AhciHwStartIo
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
TESTED
|
||||
Comment
|
||||
Adapter based IO request not supported
|
||||
Need to implement more srb functions
|
||||
|
||||
AhciHwResetBus
|
||||
Flags
|
||||
NOT_IMPLEMENTED
|
||||
Comment
|
||||
Adapter master bus reset not implemented
|
||||
|
||||
AhciHwFindAdapter
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
FULLY_SUPPORTED
|
||||
TESTED
|
||||
Comment
|
||||
NONE
|
||||
|
||||
DriverEntry
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
FULLY_SUPPORTED
|
||||
TESTED
|
||||
Comment
|
||||
NONE
|
||||
|
||||
AhciATA_CFIS
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
Comment
|
||||
Need to implement NCQ
|
||||
|
||||
AhciATAPI_CFIS
|
||||
Flags
|
||||
NOT_IMPLEMENTED
|
||||
Comment
|
||||
Need to configure command table according to Srb function
|
||||
|
||||
AhciBuild_PRDT
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
Comment
|
||||
NONE
|
||||
|
||||
AhciProcessSrb
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
Comment
|
||||
Only ATA/ATAPI type CFIS supported
|
||||
Also I am not sure about FIS alignment in SrbExtension.
|
||||
|
||||
AhciActivatePort
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
Comment
|
||||
NCQ not supported
|
||||
|
||||
AhciProcessIO
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
FULLY_SUPPORTED
|
||||
TESTED
|
||||
Comment
|
||||
NONE
|
||||
|
||||
DeviceInquiryRequest
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
TESTED
|
||||
Comment
|
||||
EVPD is not sending Data buffer for IDENTIFY command.
|
||||
Need to implement VPD
|
||||
|
||||
AhciAdapterReset
|
||||
Flags
|
||||
NOT_IMPLEMENTED
|
||||
Comment
|
||||
NONE
|
||||
|
||||
AhciZeroMemory
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
FULLY_SUPPORTED
|
||||
TESTED
|
||||
Comment
|
||||
NONE
|
||||
|
||||
IsPortValid
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
FULLY_SUPPORTED
|
||||
TESTED
|
||||
Comment
|
||||
NONE
|
||||
|
||||
AddQueue
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
FULLY_SUPPORTED
|
||||
TESTED
|
||||
Comment
|
||||
NONE
|
||||
|
||||
RemoveQueue
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
FULLY_SUPPORTED
|
||||
TESTED
|
||||
Comment
|
||||
NONE
|
||||
|
||||
AhciCompleteIssuedSrb
|
||||
Flags
|
||||
IMPLEMENTED
|
||||
FULLY_SUPPORTED
|
||||
Comment
|
||||
NONE
|
||||
|
||||
InquiryCompletion
|
||||
Flags
|
||||
NOT_IMPLEMENTED
|
||||
Comment
|
||||
NONE
|
@@ -1,2 +0,0 @@
|
||||
MINIMUM_NT_TARGET_VERSION=0x502
|
||||
!INCLUDE $(NTMAKEENV)\makefile.def
|
@@ -1,10 +0,0 @@
|
||||
TARGETNAME = storahci
|
||||
TARGETTYPE = MINIPORT
|
||||
|
||||
MSC_WARNING_LEVEL=/W4
|
||||
TARGETLIBS=$(DDK_LIB_PATH)\storport.lib
|
||||
|
||||
INCLUDES = %BUILD%\inc
|
||||
LIBS = %BUILD%\lib
|
||||
SOURCES = storahci.c \
|
||||
storahci.rc
|
@@ -1,711 +0,0 @@
|
||||
/*
|
||||
* PROJECT: ReactOS Kernel
|
||||
* LICENSE: GNU GPLv2 only as published by the Free Software Foundation
|
||||
* PURPOSE: To Implement AHCI Miniport driver targeting storport NT 5.2
|
||||
* PROGRAMMERS: Aman Priyadarshi (aman.eureka@gmail.com)
|
||||
*/
|
||||
|
||||
#include <ntddk.h>
|
||||
#include <ata.h>
|
||||
#include <storport.h>
|
||||
|
||||
#define DEBUG 1
|
||||
#pragma warning(disable:4214) // bit field types other than int
|
||||
#pragma warning(disable:4201) // nameless struct/union
|
||||
|
||||
#define MAXIMUM_AHCI_PORT_COUNT 32
|
||||
#define MAXIMUM_AHCI_PRDT_ENTRIES 32
|
||||
#define MAXIMUM_AHCI_PORT_NCS 30
|
||||
#define MAXIMUM_QUEUE_BUFFER_SIZE 255
|
||||
#define MAXIMUM_TRANSFER_LENGTH (128*1024) // 128 KB
|
||||
|
||||
#define DEVICE_ATA_BLOCK_SIZE 512
|
||||
|
||||
// device type (DeviceParams)
|
||||
#define AHCI_DEVICE_TYPE_ATA 1
|
||||
#define AHCI_DEVICE_TYPE_ATAPI 2
|
||||
#define AHCI_DEVICE_TYPE_NODEVICE 3
|
||||
|
||||
// section 3.1.2
|
||||
#define AHCI_Global_HBA_CAP_S64A (1 << 31)
|
||||
|
||||
// FIS Types : http://wiki.osdev.org/AHCI
|
||||
#define FIS_TYPE_REG_H2D 0x27 // Register FIS - host to device
|
||||
#define FIS_TYPE_REG_D2H 0x34 // Register FIS - device to host
|
||||
#define FIS_TYPE_DMA_ACT 0x39 // DMA activate FIS - device to host
|
||||
#define FIS_TYPE_DMA_SETUP 0x41 // DMA setup FIS - bidirectional
|
||||
#define FIS_TYPE_BIST 0x58 // BIST activate FIS - bidirectional
|
||||
#define FIS_TYPE_PIO_SETUP 0x5F // PIO setup FIS - device to host
|
||||
#define FIS_TYPE_DEV_BITS 0xA1 // Set device bits FIS - device to host
|
||||
|
||||
#define AHCI_ATA_CFIS_FisType 0
|
||||
#define AHCI_ATA_CFIS_PMPort_C 1
|
||||
#define AHCI_ATA_CFIS_CommandReg 2
|
||||
#define AHCI_ATA_CFIS_FeaturesLow 3
|
||||
#define AHCI_ATA_CFIS_LBA0 4
|
||||
#define AHCI_ATA_CFIS_LBA1 5
|
||||
#define AHCI_ATA_CFIS_LBA2 6
|
||||
#define AHCI_ATA_CFIS_Device 7
|
||||
#define AHCI_ATA_CFIS_LBA3 8
|
||||
#define AHCI_ATA_CFIS_LBA4 9
|
||||
#define AHCI_ATA_CFIS_LBA5 10
|
||||
#define AHCI_ATA_CFIS_FeaturesHigh 11
|
||||
#define AHCI_ATA_CFIS_SectorCountLow 12
|
||||
#define AHCI_ATA_CFIS_SectorCountHigh 13
|
||||
|
||||
// ATA Functions
|
||||
#define ATA_FUNCTION_ATA_COMMAND 0x100
|
||||
#define ATA_FUNCTION_ATA_IDENTIFY 0x101
|
||||
#define ATA_FUNCTION_ATA_READ 0x102
|
||||
|
||||
// ATAPI Functions
|
||||
#define ATA_FUNCTION_ATAPI_COMMAND 0x200
|
||||
|
||||
// ATA Flags
|
||||
#define ATA_FLAGS_DATA_IN (1 << 1)
|
||||
#define ATA_FLAGS_DATA_OUT (1 << 2)
|
||||
#define ATA_FLAGS_48BIT_COMMAND (1 << 3)
|
||||
#define ATA_FLAGS_USE_DMA (1 << 4)
|
||||
|
||||
#define IsAtaCommand(AtaFunction) (AtaFunction & ATA_FUNCTION_ATA_COMMAND)
|
||||
#define IsAtapiCommand(AtaFunction) (AtaFunction & ATA_FUNCTION_ATAPI_COMMAND)
|
||||
#define IsDataTransferNeeded(SrbExtension) (SrbExtension->Flags & (ATA_FLAGS_DATA_IN | ATA_FLAGS_DATA_OUT))
|
||||
#define IsAdapterCAPS64(CAP) (CAP & AHCI_Global_HBA_CAP_S64A)
|
||||
|
||||
// 3.1.1 NCS = CAP[12:08] -> Align
|
||||
#define AHCI_Global_Port_CAP_NCS(x) (((x) & 0xF00) >> 8)
|
||||
|
||||
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
|
||||
#define AhciDebugPrint(format, ...) StorPortDebugPrint(0, format, __VA_ARGS__)
|
||||
|
||||
typedef
|
||||
VOID
|
||||
(*PAHCI_COMPLETION_ROUTINE) (
|
||||
__in PVOID PortExtension,
|
||||
__in PVOID Srb
|
||||
);
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// ---- Support Structures --- //
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
// section 3.3.5
|
||||
typedef union _AHCI_INTERRUPT_STATUS
|
||||
{
|
||||
struct
|
||||
{
|
||||
ULONG DHRS:1; //Device to Host Register FIS Interrupt
|
||||
ULONG PSS :1; //PIO Setup FIS Interrupt
|
||||
ULONG DSS :1; //DMA Setup FIS Interrupt
|
||||
ULONG SDBS :1; //Set Device Bits Interrupt
|
||||
ULONG UFS :1; //Unknown FIS Interrupt
|
||||
ULONG DPS :1; //Descriptor Processed
|
||||
ULONG PCS :1; //Port Connect Change Status
|
||||
ULONG DMPS :1; //Device Mechanical Presence Status (DMPS)
|
||||
ULONG Reserved :14;
|
||||
ULONG PRCS :1; //PhyRdy Change Status
|
||||
ULONG IPMS :1; //Incorrect Port Multiplier Status
|
||||
ULONG OFS :1; //Overflow Status
|
||||
ULONG Reserved2 :1;
|
||||
ULONG INFS :1; //Interface Non-fatal Error Status
|
||||
ULONG IFS :1; //Interface Fatal Error Status
|
||||
ULONG HBDS :1; //Host Bus Data Error Status
|
||||
ULONG HBFS :1; //Host Bus Fatal Error Status
|
||||
ULONG TFES :1; //Task File Error Status
|
||||
ULONG CPDS :1; //Cold Port Detect Status
|
||||
};
|
||||
|
||||
ULONG Status;
|
||||
} AHCI_INTERRUPT_STATUS;
|
||||
|
||||
typedef struct _AHCI_FIS_DMA_SETUP
|
||||
{
|
||||
ULONG ULONG0_1; // FIS_TYPE_DMA_SETUP
|
||||
// Port multiplier
|
||||
// Reserved
|
||||
// Data transfer direction, 1 - device to host
|
||||
// Interrupt bit
|
||||
// Auto-activate. Specifies if DMA Activate FIS is needed
|
||||
UCHAR Reserved[2]; // Reserved
|
||||
ULONG DmaBufferLow; // DMA Buffer Identifier. Used to Identify DMA buffer in host memory. SATA Spec says host specific and not in Spec. Trying AHCI spec might work.
|
||||
ULONG DmaBufferHigh;
|
||||
ULONG Reserved2; // More reserved
|
||||
ULONG DmaBufferOffset; // Byte offset into buffer. First 2 bits must be 0
|
||||
ULONG TranferCount; // Number of bytes to transfer. Bit 0 must be 0
|
||||
ULONG Reserved3; // Reserved
|
||||
} AHCI_FIS_DMA_SETUP;
|
||||
|
||||
typedef struct _AHCI_PIO_SETUP_FIS
|
||||
{
|
||||
UCHAR FisType;
|
||||
UCHAR Reserved1 :5;
|
||||
UCHAR D :1;
|
||||
UCHAR I :1;
|
||||
UCHAR Reserved2 :1;
|
||||
UCHAR Status;
|
||||
UCHAR Error;
|
||||
|
||||
UCHAR SectorNumber;
|
||||
UCHAR CylLow;
|
||||
UCHAR CylHigh;
|
||||
UCHAR Dev_Head;
|
||||
|
||||
UCHAR SectorNumb_Exp;
|
||||
UCHAR CylLow_Exp;
|
||||
UCHAR CylHigh_Exp;
|
||||
UCHAR Reserved3;
|
||||
|
||||
UCHAR SectorCount;
|
||||
UCHAR SectorCount_Exp;
|
||||
UCHAR Reserved4;
|
||||
UCHAR E_Status;
|
||||
|
||||
USHORT TransferCount;
|
||||
UCHAR Reserved5[2];
|
||||
} AHCI_PIO_SETUP_FIS;
|
||||
|
||||
typedef struct _AHCI_D2H_REGISTER_FIS
|
||||
{
|
||||
UCHAR FisType;
|
||||
UCHAR Reserved1 :6;
|
||||
UCHAR I:1;
|
||||
UCHAR Reserved2 :1;
|
||||
UCHAR Status;
|
||||
UCHAR Error;
|
||||
|
||||
UCHAR SectorNumber;
|
||||
UCHAR CylLow;
|
||||
UCHAR CylHigh;
|
||||
UCHAR Dev_Head;
|
||||
|
||||
UCHAR SectorNum_Exp;
|
||||
UCHAR CylLow_Exp;
|
||||
UCHAR CylHigh_Exp;
|
||||
UCHAR Reserved;
|
||||
|
||||
UCHAR SectorCount;
|
||||
UCHAR SectorCount_Exp;
|
||||
UCHAR Reserved3[2];
|
||||
|
||||
UCHAR Reserved4[4];
|
||||
} AHCI_D2H_REGISTER_FIS;
|
||||
|
||||
typedef struct _AHCI_SET_DEVICE_BITS_FIS
|
||||
{
|
||||
UCHAR FisType;
|
||||
|
||||
UCHAR PMPort: 4;
|
||||
UCHAR Reserved1 :2;
|
||||
UCHAR I :1;
|
||||
UCHAR N :1;
|
||||
|
||||
UCHAR Status_Lo :3;
|
||||
UCHAR Reserved2 :1;
|
||||
UCHAR Status_Hi :3;
|
||||
UCHAR Reserved3 :1;
|
||||
|
||||
UCHAR Error;
|
||||
|
||||
UCHAR Reserved5[4];
|
||||
} AHCI_SET_DEVICE_BITS_FIS;
|
||||
|
||||
typedef struct _AHCI_QUEUE
|
||||
{
|
||||
PVOID Buffer[MAXIMUM_QUEUE_BUFFER_SIZE]; // because Storahci hold Srb queue of 255 size
|
||||
ULONG Head;
|
||||
ULONG Tail;
|
||||
} AHCI_QUEUE, *PAHCI_QUEUE;
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// --------------------------- //
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
typedef union _AHCI_COMMAND_HEADER_DESCRIPTION
|
||||
{
|
||||
struct
|
||||
{
|
||||
ULONG CFL : 5; // Command FIS Length
|
||||
ULONG A : 1; // IsATAPI
|
||||
ULONG W : 1; // Write
|
||||
ULONG P : 1; // Prefetchable
|
||||
|
||||
ULONG R : 1; // Reset
|
||||
ULONG B : 1; // BIST
|
||||
ULONG C : 1; //Clear Busy upon R_OK
|
||||
ULONG RSV : 1;
|
||||
ULONG PMP : 4; //Port Multiplier Port
|
||||
|
||||
ULONG PRDTL : 16; //Physical Region Descriptor Table Length
|
||||
};
|
||||
|
||||
ULONG Status;
|
||||
} AHCI_COMMAND_HEADER_DESCRIPTION;
|
||||
|
||||
typedef union _AHCI_GHC
|
||||
{
|
||||
struct
|
||||
{
|
||||
ULONG HR : 1;
|
||||
ULONG IE : 1;
|
||||
ULONG MRSM : 1;
|
||||
ULONG RSV0 : 28;
|
||||
ULONG AE : 1;
|
||||
};
|
||||
|
||||
ULONG Status;
|
||||
} AHCI_GHC;
|
||||
|
||||
// section 3.3.7
|
||||
typedef union _AHCI_PORT_CMD
|
||||
{
|
||||
struct
|
||||
{
|
||||
ULONG ST : 1;
|
||||
ULONG SUD : 1;
|
||||
ULONG POD : 1;
|
||||
ULONG CLO : 1;
|
||||
ULONG FRE : 1;
|
||||
ULONG RSV0 : 3;
|
||||
ULONG CCS : 5;
|
||||
ULONG MPSS : 1;
|
||||
ULONG FR : 1;
|
||||
ULONG CR : 1;
|
||||
ULONG CPS : 1;
|
||||
ULONG PMA : 1;
|
||||
ULONG HPCP : 1;
|
||||
ULONG MPSP : 1;
|
||||
ULONG CPD : 1;
|
||||
ULONG ESP : 1;
|
||||
ULONG FBSCP : 1;
|
||||
ULONG APSTE : 1;
|
||||
ULONG ATAPI : 1;
|
||||
ULONG DLAE : 1;
|
||||
ULONG ALPE : 1;
|
||||
ULONG ASP : 1;
|
||||
ULONG ICC : 4;
|
||||
};
|
||||
|
||||
ULONG Status;
|
||||
} AHCI_PORT_CMD;
|
||||
|
||||
typedef union _AHCI_SERIAL_ATA_CONTROL
|
||||
{
|
||||
struct
|
||||
{
|
||||
ULONG DET :4;
|
||||
ULONG SPD :4;
|
||||
ULONG IPM :4;
|
||||
ULONG SPM :4;
|
||||
ULONG PMP :4;
|
||||
ULONG DW11_Reserved :12;
|
||||
};
|
||||
|
||||
ULONG Status;
|
||||
} AHCI_SERIAL_ATA_CONTROL;
|
||||
|
||||
typedef union _AHCI_SERIAL_ATA_STATUS
|
||||
{
|
||||
struct
|
||||
{
|
||||
ULONG DET :4;
|
||||
ULONG SPD :4;
|
||||
ULONG IPM :4;
|
||||
ULONG RSV0 :20;
|
||||
};
|
||||
|
||||
ULONG Status;
|
||||
} AHCI_SERIAL_ATA_STATUS;
|
||||
|
||||
typedef union _AHCI_TASK_FILE_DATA
|
||||
{
|
||||
struct
|
||||
{
|
||||
struct _STS
|
||||
{
|
||||
UCHAR ERR : 1;
|
||||
UCHAR CS1 : 2;
|
||||
UCHAR DRQ : 1;
|
||||
UCHAR CS2 : 3;
|
||||
UCHAR BSY : 1;
|
||||
} STS;
|
||||
UCHAR ERR;
|
||||
USHORT RSV;
|
||||
};
|
||||
|
||||
ULONG Status;
|
||||
} AHCI_TASK_FILE_DATA;
|
||||
|
||||
typedef struct _AHCI_PRDT
|
||||
{
|
||||
ULONG DBA;
|
||||
ULONG DBAU;
|
||||
ULONG RSV0;
|
||||
|
||||
ULONG DBC : 22;
|
||||
ULONG RSV1 : 9;
|
||||
ULONG I : 1;
|
||||
} AHCI_PRDT, *PAHCI_PRDT;
|
||||
|
||||
// 4.2.3 Command Table
|
||||
typedef struct _AHCI_COMMAND_TABLE
|
||||
{
|
||||
// (16 * 32) + 64 + 16 + 48 = 648
|
||||
// 128 byte aligned :D
|
||||
UCHAR CFIS[64];
|
||||
UCHAR ACMD[16];
|
||||
UCHAR RSV0[48];
|
||||
AHCI_PRDT PRDT[MAXIMUM_AHCI_PRDT_ENTRIES];
|
||||
} AHCI_COMMAND_TABLE, *PAHCI_COMMAND_TABLE;
|
||||
|
||||
// 4.2.2 Command Header
|
||||
typedef struct _AHCI_COMMAND_HEADER
|
||||
{
|
||||
AHCI_COMMAND_HEADER_DESCRIPTION DI; // DW 0
|
||||
ULONG PRDBC; // DW 1
|
||||
ULONG CTBA; // DW 2
|
||||
ULONG CTBA_U; // DW 3
|
||||
ULONG Reserved[4]; // DW 4-7
|
||||
} AHCI_COMMAND_HEADER, *PAHCI_COMMAND_HEADER;
|
||||
|
||||
// Received FIS
|
||||
typedef struct _AHCI_RECEIVED_FIS
|
||||
{
|
||||
struct _AHCI_FIS_DMA_SETUP DmaSetupFIS; // 0x00 -- DMA Setup FIS
|
||||
ULONG pad0; // 4 BYTE padding
|
||||
struct _AHCI_PIO_SETUP_FIS PioSetupFIS; // 0x20 -- PIO Setup FIS
|
||||
ULONG pad1[3]; // 12 BYTE padding
|
||||
struct _AHCI_D2H_REGISTER_FIS RegisterFIS; // 0x40 -- Register – Device to Host FIS
|
||||
ULONG pad2; // 4 BYTE padding
|
||||
struct _AHCI_SET_DEVICE_BITS_FIS SetDeviceFIS; // 0x58 -- Set Device Bit FIS
|
||||
ULONG UnknowFIS[16]; // 0x60 -- Unknown FIS
|
||||
ULONG Reserved[24]; // 0xA0 -- Reserved
|
||||
} AHCI_RECEIVED_FIS, *PAHCI_RECEIVED_FIS;
|
||||
|
||||
// Holds Port Information
|
||||
typedef struct _AHCI_PORT
|
||||
{
|
||||
ULONG CLB; // 0x00, command list base address, 1K-byte aligned
|
||||
ULONG CLBU; // 0x04, command list base address upper 32 bits
|
||||
ULONG FB; // 0x08, FIS base address, 256-byte aligned
|
||||
ULONG FBU; // 0x0C, FIS base address upper 32 bits
|
||||
ULONG IS; // 0x10, interrupt status
|
||||
ULONG IE; // 0x14, interrupt enable
|
||||
ULONG CMD; // 0x18, command and status
|
||||
ULONG RSV0; // 0x1C, Reserved
|
||||
ULONG TFD; // 0x20, task file data
|
||||
ULONG SIG; // 0x24, signature
|
||||
ULONG SSTS; // 0x28, SATA status (SCR0:SStatus)
|
||||
ULONG SCTL; // 0x2C, SATA control (SCR2:SControl)
|
||||
ULONG SERR; // 0x30, SATA error (SCR1:SError)
|
||||
ULONG SACT; // 0x34, SATA active (SCR3:SActive)
|
||||
ULONG CI; // 0x38, command issue
|
||||
ULONG SNTF; // 0x3C, SATA notification (SCR4:SNotification)
|
||||
ULONG FBS; // 0x40, FIS-based switch control
|
||||
ULONG RSV1[11]; // 0x44 ~ 0x6F, Reserved
|
||||
ULONG Vendor[4]; // 0x70 ~ 0x7F, vendor specific
|
||||
} AHCI_PORT, *PAHCI_PORT;
|
||||
|
||||
typedef union _AHCI_INTERRUPT_ENABLE
|
||||
{
|
||||
struct
|
||||
{
|
||||
ULONG DHRE :1;
|
||||
ULONG PSE :1;
|
||||
ULONG DSE :1;
|
||||
ULONG SDBE :1;
|
||||
ULONG UFE :1;
|
||||
ULONG DPE :1;
|
||||
ULONG PCE :1;
|
||||
ULONG DMPE :1;
|
||||
ULONG DW5_Reserved :14;
|
||||
ULONG PRCE :1;
|
||||
ULONG IPME :1;
|
||||
ULONG OFE :1;
|
||||
ULONG DW5_Reserved2 :1;
|
||||
ULONG INFE :1;
|
||||
ULONG IFE :1;
|
||||
ULONG HBDE :1;
|
||||
ULONG HBFE :1;
|
||||
ULONG TFEE :1;
|
||||
ULONG CPDE :1;
|
||||
};
|
||||
|
||||
ULONG Status;
|
||||
} AHCI_INTERRUPT_ENABLE;
|
||||
|
||||
typedef struct _AHCI_MEMORY_REGISTERS
|
||||
{
|
||||
// 0x00 - 0x2B, Generic Host Control
|
||||
ULONG CAP; // 0x00, Host capability
|
||||
ULONG GHC; // 0x04, Global host control
|
||||
ULONG IS; // 0x08, Interrupt status
|
||||
ULONG PI; // 0x0C, Port implemented
|
||||
ULONG VS; // 0x10, Version
|
||||
ULONG CCC_CTL; // 0x14, Command completion coalescing control
|
||||
ULONG CCC_PTS; // 0x18, Command completion coalescing ports
|
||||
ULONG EM_LOC; // 0x1C, Enclosure management location
|
||||
ULONG EM_CTL; // 0x20, Enclosure management control
|
||||
ULONG CAP2; // 0x24, Host capabilities extended
|
||||
ULONG BOHC; // 0x28, BIOS/OS handoff control and status
|
||||
ULONG Reserved[0x1d]; // 0x2C - 0x9F, Reserved
|
||||
ULONG VendorSpecific[0x18]; // 0xA0 - 0xFF, Vendor specific registers
|
||||
AHCI_PORT PortList[MAXIMUM_AHCI_PORT_COUNT];
|
||||
} AHCI_MEMORY_REGISTERS, *PAHCI_MEMORY_REGISTERS;
|
||||
|
||||
// Holds information for each attached attached port to a given adapter.
|
||||
typedef struct _AHCI_PORT_EXTENSION
|
||||
{
|
||||
ULONG PortNumber;
|
||||
ULONG QueueSlots; // slots which we have already assigned task (Slot)
|
||||
ULONG CommandIssuedSlots; // slots which has been programmed
|
||||
ULONG MaxPortQueueDepth;
|
||||
|
||||
struct
|
||||
{
|
||||
UCHAR RemovableDevice;
|
||||
UCHAR Lba48BitMode;
|
||||
UCHAR AccessType;
|
||||
UCHAR DeviceType;
|
||||
UCHAR IsActive;
|
||||
LARGE_INTEGER MaxLba;
|
||||
ULONG BytesPerLogicalSector;
|
||||
ULONG BytesPerPhysicalSector;
|
||||
UCHAR VendorId[41];
|
||||
UCHAR RevisionID[9];
|
||||
UCHAR SerialNumber[21];
|
||||
} DeviceParams;
|
||||
|
||||
STOR_DPC CommandCompletion;
|
||||
PAHCI_PORT Port; // AHCI Port Infomation
|
||||
AHCI_QUEUE SrbQueue; // pending Srbs
|
||||
AHCI_QUEUE CompletionQueue;
|
||||
PSCSI_REQUEST_BLOCK Slot[MAXIMUM_AHCI_PORT_NCS]; // Srbs which has been alloted a port
|
||||
PAHCI_RECEIVED_FIS ReceivedFIS;
|
||||
PAHCI_COMMAND_HEADER CommandList;
|
||||
STOR_DEVICE_POWER_STATE DevicePowerState; // Device Power State
|
||||
PIDENTIFY_DEVICE_DATA IdentifyDeviceData;
|
||||
STOR_PHYSICAL_ADDRESS IdentifyDeviceDataPhysicalAddress;
|
||||
struct _AHCI_ADAPTER_EXTENSION* AdapterExtension; // Port's Adapter Information
|
||||
} AHCI_PORT_EXTENSION, *PAHCI_PORT_EXTENSION;
|
||||
|
||||
// Holds Adapter Information
|
||||
typedef struct _AHCI_ADAPTER_EXTENSION
|
||||
{
|
||||
ULONG SystemIoBusNumber;
|
||||
ULONG SlotNumber;
|
||||
ULONG AhciBaseAddress;
|
||||
PULONG IS;// Interrupt Status, In case of MSIM == `1`
|
||||
ULONG PortImplemented;// bit-mapping of ports which are implemented
|
||||
ULONG PortCount;
|
||||
|
||||
USHORT VendorID;
|
||||
USHORT DeviceID;
|
||||
USHORT RevisionID;
|
||||
|
||||
ULONG Version;
|
||||
ULONG CAP;
|
||||
ULONG CAP2;
|
||||
ULONG LastInterruptPort;
|
||||
ULONG CurrentCommandSlot;
|
||||
|
||||
PVOID NonCachedExtension; // holds virtual address to noncached buffer allocated for Port Extension
|
||||
|
||||
struct
|
||||
{
|
||||
// Message per port or shared port?
|
||||
ULONG MessagePerPort : 1;
|
||||
ULONG Removed : 1;
|
||||
ULONG Reserved : 30; // not in use -- maintain 4 byte alignment
|
||||
} StateFlags;
|
||||
|
||||
PAHCI_MEMORY_REGISTERS ABAR_Address;
|
||||
AHCI_PORT_EXTENSION PortExtension[MAXIMUM_AHCI_PORT_COUNT];
|
||||
} AHCI_ADAPTER_EXTENSION, *PAHCI_ADAPTER_EXTENSION;
|
||||
|
||||
typedef struct _LOCAL_SCATTER_GATHER_LIST
|
||||
{
|
||||
ULONG NumberOfElements;
|
||||
ULONG_PTR Reserved;
|
||||
STOR_SCATTER_GATHER_ELEMENT List[MAXIMUM_AHCI_PRDT_ENTRIES];
|
||||
} LOCAL_SCATTER_GATHER_LIST, *PLOCAL_SCATTER_GATHER_LIST;
|
||||
|
||||
typedef struct _AHCI_SRB_EXTENSION
|
||||
{
|
||||
AHCI_COMMAND_TABLE CommandTable;
|
||||
ULONG AtaFunction;
|
||||
ULONG Flags;
|
||||
|
||||
UCHAR CommandReg;
|
||||
UCHAR FeaturesLow;
|
||||
UCHAR LBA0;
|
||||
UCHAR LBA1;
|
||||
UCHAR LBA2;
|
||||
UCHAR Device;
|
||||
UCHAR LBA3;
|
||||
UCHAR LBA4;
|
||||
UCHAR LBA5;
|
||||
UCHAR FeaturesHigh;
|
||||
|
||||
UCHAR SectorCountLow;
|
||||
UCHAR SectorCountHigh;
|
||||
|
||||
ULONG SlotIndex;
|
||||
LOCAL_SCATTER_GATHER_LIST Sgl;
|
||||
PLOCAL_SCATTER_GATHER_LIST pSgl;
|
||||
PAHCI_COMPLETION_ROUTINE CompletionRoutine;
|
||||
|
||||
// for alignment purpose -- 128 byte alignment
|
||||
// do not try to access (R/W) this field
|
||||
UCHAR Reserved[128];
|
||||
} AHCI_SRB_EXTENSION, *PAHCI_SRB_EXTENSION;
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Declarations //
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
VOID
|
||||
AhciProcessIO (
|
||||
__in PAHCI_ADAPTER_EXTENSION AdapterExtension,
|
||||
__in UCHAR PathId,
|
||||
__in PSCSI_REQUEST_BLOCK Srb
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
AhciAdapterReset (
|
||||
__in PAHCI_ADAPTER_EXTENSION AdapterExtension
|
||||
);
|
||||
|
||||
__inline
|
||||
VOID
|
||||
AhciZeroMemory (
|
||||
__out PCHAR Buffer,
|
||||
__in ULONG BufferSize
|
||||
);
|
||||
|
||||
__inline
|
||||
BOOLEAN
|
||||
IsPortValid (
|
||||
__in PAHCI_ADAPTER_EXTENSION AdapterExtension,
|
||||
__in ULONG pathId
|
||||
);
|
||||
|
||||
UCHAR DeviceRequestSense (
|
||||
__in PAHCI_ADAPTER_EXTENSION AdapterExtension,
|
||||
__in PSCSI_REQUEST_BLOCK Srb,
|
||||
__in PCDB Cdb
|
||||
);
|
||||
|
||||
UCHAR DeviceRequestReadWrite (
|
||||
__in PAHCI_ADAPTER_EXTENSION AdapterExtension,
|
||||
__in PSCSI_REQUEST_BLOCK Srb,
|
||||
__in PCDB Cdb
|
||||
);
|
||||
|
||||
UCHAR DeviceRequestCapacity (
|
||||
__in PAHCI_ADAPTER_EXTENSION AdapterExtension,
|
||||
__in PSCSI_REQUEST_BLOCK Srb,
|
||||
__in PCDB Cdb
|
||||
);
|
||||
|
||||
UCHAR
|
||||
DeviceInquiryRequest (
|
||||
__in PAHCI_ADAPTER_EXTENSION AdapterExtension,
|
||||
__in PSCSI_REQUEST_BLOCK Srb,
|
||||
__in PCDB Cdb
|
||||
);
|
||||
|
||||
UCHAR DeviceRequestComplete (
|
||||
__in PAHCI_ADAPTER_EXTENSION AdapterExtension,
|
||||
__in PSCSI_REQUEST_BLOCK Srb,
|
||||
__in PCDB Cdb
|
||||
);
|
||||
|
||||
UCHAR DeviceReportLuns (
|
||||
__in PAHCI_ADAPTER_EXTENSION AdapterExtension,
|
||||
__in PSCSI_REQUEST_BLOCK Srb,
|
||||
__in PCDB Cdb
|
||||
);
|
||||
|
||||
__inline
|
||||
BOOLEAN
|
||||
AddQueue (
|
||||
__inout PAHCI_QUEUE Queue,
|
||||
__in PVOID Srb
|
||||
);
|
||||
|
||||
__inline
|
||||
PVOID
|
||||
RemoveQueue (
|
||||
__inout PAHCI_QUEUE Queue
|
||||
);
|
||||
|
||||
__inline
|
||||
PAHCI_SRB_EXTENSION
|
||||
GetSrbExtension(
|
||||
__in PSCSI_REQUEST_BLOCK Srb
|
||||
);
|
||||
|
||||
__inline
|
||||
ULONG64
|
||||
AhciGetLba (
|
||||
__in PCDB Cdb,
|
||||
__in ULONG CdbLength
|
||||
);
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Assertions //
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
// I assert every silly mistake I can do while coding
|
||||
// because god never help me debugging the code
|
||||
// but these asserts do :')
|
||||
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_MEMORY_REGISTERS, CAP) == 0x00);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_MEMORY_REGISTERS, GHC) == 0x04);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_MEMORY_REGISTERS, IS) == 0x08);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_MEMORY_REGISTERS, PI) == 0x0C);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_MEMORY_REGISTERS, VS) == 0x10);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_MEMORY_REGISTERS, CCC_CTL) == 0x14);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_MEMORY_REGISTERS, CCC_PTS) == 0x18);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_MEMORY_REGISTERS, EM_LOC) == 0x1C);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_MEMORY_REGISTERS, EM_CTL) == 0x20);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_MEMORY_REGISTERS, CAP2) == 0x24);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_MEMORY_REGISTERS, BOHC) == 0x28);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_MEMORY_REGISTERS, Reserved) == 0x2C);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_MEMORY_REGISTERS, VendorSpecific) == 0xA0);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_MEMORY_REGISTERS, PortList) == 0x100);
|
||||
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, CLB) == 0x00);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, CLBU) == 0x04);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, FB) == 0x08);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, FBU) == 0x0C);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, IS) == 0x10);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, IE) == 0x14);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, CMD) == 0x18);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, RSV0) == 0x1C);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, TFD) == 0x20);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, SIG) == 0x24);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, SSTS) == 0x28);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, SCTL) == 0x2C);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, SERR) == 0x30);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, SACT) == 0x34);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, CI) == 0x38);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, SNTF) == 0x3C);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, FBS) == 0x40);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, RSV1) == 0x44);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_PORT, Vendor) == 0x70);
|
||||
|
||||
C_ASSERT((sizeof(AHCI_COMMAND_TABLE) % 128) == 0);
|
||||
|
||||
C_ASSERT(sizeof(AHCI_GHC) == sizeof(ULONG));
|
||||
C_ASSERT(sizeof(AHCI_PORT_CMD) == sizeof(ULONG));
|
||||
C_ASSERT(sizeof(AHCI_TASK_FILE_DATA) == sizeof(ULONG));
|
||||
C_ASSERT(sizeof(AHCI_INTERRUPT_ENABLE) == sizeof(ULONG));
|
||||
C_ASSERT(sizeof(AHCI_SERIAL_ATA_STATUS) == sizeof(ULONG));
|
||||
C_ASSERT(sizeof(AHCI_SERIAL_ATA_CONTROL) == sizeof(ULONG));
|
||||
C_ASSERT(sizeof(AHCI_COMMAND_HEADER_DESCRIPTION) == sizeof(ULONG));
|
||||
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_COMMAND_TABLE, CFIS) == 0x00);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_COMMAND_TABLE, ACMD) == 0x40);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_COMMAND_TABLE, RSV0) == 0x50);
|
||||
C_ASSERT(FIELD_OFFSET(AHCI_COMMAND_TABLE, PRDT) == 0x80);
|
@@ -1,77 +0,0 @@
|
||||
;
|
||||
; PROJECT: ROS Kernel
|
||||
; LICENSE: GNU GPLv2 only as published by the Free Software Foundation
|
||||
; PURPOSE: Storahci Driver INF
|
||||
; PROGRAMMERS: Aman Priyadarshi (aman.eureka@gmail.com)
|
||||
;
|
||||
|
||||
[version]
|
||||
signature="$Windows NT$"
|
||||
Class=hdc
|
||||
ClassGuid={4D36E96A-E325-11CE-BFC1-08002BE10318}
|
||||
Provider=%ROS%
|
||||
|
||||
[SourceDisksNames]
|
||||
1 = %DeviceDesc%,,,
|
||||
|
||||
[SourceDisksFiles]
|
||||
storahci.sys = 1
|
||||
|
||||
[DestinationDirs]
|
||||
DefaultDestDir = 12 ; DIRID_DRIVERS
|
||||
|
||||
[Manufacturer]
|
||||
%ROS%=STORAHCI,NTx86
|
||||
|
||||
[STORAHCI]
|
||||
|
||||
[STORAHCI.NTx86]
|
||||
%SATA_AHCI.DeviceDesc%=storahci_Inst, PCI\CC_010601; Standard SATA AHCI Controller
|
||||
|
||||
[ControlFlags]
|
||||
ExcludeFromSelect = *
|
||||
|
||||
[storahci_Inst]
|
||||
CopyFiles = storahci_CopyFiles
|
||||
|
||||
[storahci_Inst.HW]
|
||||
; Enables Storport IPM for this adapter
|
||||
HKR, "StorPort", "EnableIdlePowerManagement", %REG_DWORD%, 0x01
|
||||
|
||||
[storahci_Inst.Services]
|
||||
AddService = storahci, %SPSVCINST_ASSOCSERVICE%, storahci_Service_Inst, Miniport_EventLog_Inst
|
||||
|
||||
[storahci_Service_Inst]
|
||||
DisplayName = %DeviceDesc%
|
||||
ServiceType = %SERVICE_KERNEL_DRIVER%
|
||||
StartType = %SERVICE_BOOT_START%
|
||||
ErrorControl = %SERVICE_ERROR_CRITICAL%
|
||||
ServiceBinary = %12%\storahci.sys
|
||||
LoadOrderGroup = SCSI Miniport
|
||||
AddReg = ahci_addreg
|
||||
|
||||
[storahci_CopyFiles]
|
||||
storahci.sys,,,1
|
||||
|
||||
[ahci_addreg]
|
||||
HKR, "Parameters\PnpInterface", "5", %REG_DWORD%, 0x00000001
|
||||
HKR, "Parameters", "BusType", %REG_DWORD%, 0x0000000B
|
||||
|
||||
[Miniport_EventLog_Inst]
|
||||
AddReg = Miniport_EventLog_AddReg
|
||||
|
||||
[Miniport_EventLog_AddReg]
|
||||
HKR,,EventMessageFile,%REG_EXPAND_SZ%,"%%SystemRoot%%\System32\IoLogMsg.dll"
|
||||
HKR,,TypesSupported,%REG_DWORD%,7
|
||||
|
||||
[Strings]
|
||||
ROS = "ReactOS"
|
||||
DeviceDesc = "AHCI SATA Driver"
|
||||
SATA_AHCI.DeviceDesc = "Standard SATA AHCI Controller"
|
||||
|
||||
SPSVCINST_ASSOCSERVICE = 0x00000002
|
||||
SERVICE_KERNEL_DRIVER = 1
|
||||
SERVICE_BOOT_START = 0
|
||||
SERVICE_ERROR_CRITICAL = 3
|
||||
REG_EXPAND_SZ = 0x00020000
|
||||
REG_DWORD = 0x00010001
|
@@ -1,22 +0,0 @@
|
||||
//
|
||||
// PROJECT: ReactOS Kernel
|
||||
// LICENSE: GNU GPLv2 only as published by the Free Software Foundation
|
||||
// PURPOSE: To Implement AHCI Miniport driver targeting storport NT 5.2
|
||||
// PROGRAMMERS: Aman Priyadarshi (aman.eureka@gmail.com)
|
||||
//
|
||||
|
||||
#define VERSION 1
|
||||
#define VERSION_STR "1.0"
|
||||
|
||||
#define REACTOS_FILETYPE VFT_DRV
|
||||
#define REACTOS_FILESUBTYPE VFT2_DRV_SYSTEM
|
||||
#define REACTOS_FILEVERSION VERSION
|
||||
#define REACTOS_PRODUCTVERSION VERSION
|
||||
#define REACTOS_STR_COMPANY_NAME "ReactOS Development Team"
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "AHCI Storport Miniport Driver"
|
||||
#define REACTOS_STR_FILE_VERSION VERSION_STR
|
||||
#define REACTOS_STR_INTERNAL_NAME "storahci.sys"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "storahci.sys"
|
||||
#define REACTOS_STR_LEGAL_COPYRIGHT "Copyright 2016 ReactOS Team"
|
||||
#define REACTOS_STR_PRODUCT_NAME "AHCI Driver for ReactOS"
|
||||
#define REACTOS_STR_PRODUCT_VERSION VERSION_STR
|
@@ -601,6 +601,7 @@ CUSBRequest::InitDescriptor(
|
||||
//
|
||||
// get address
|
||||
//
|
||||
*(volatile char *)TransferBuffer; // HACK for CORE-9224
|
||||
Address = MmGetPhysicalAddress(TransferBuffer);
|
||||
|
||||
//
|
||||
|
@@ -1,6 +1,5 @@
|
||||
|
||||
add_definitions(-DDEBUG_MODE)
|
||||
add_definitions(-DNTDDI_VERSION=0x05020400)
|
||||
include_directories(${REACTOS_SOURCE_DIR}/ntoskrnl/include)
|
||||
|
||||
list(APPEND SOURCE
|
||||
|
@@ -569,11 +569,6 @@ QueryInterface(
|
||||
Stack->Parameters.QueryInterface.Interface = Interface;
|
||||
Stack->Parameters.QueryInterface.InterfaceSpecificData = NULL;
|
||||
|
||||
//
|
||||
// Initialize the status block before sending the IRP
|
||||
//
|
||||
Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
|
||||
|
||||
Status = IoCallDriver(DeviceObject, Irp);
|
||||
|
||||
if (Status == STATUS_PENDING)
|
||||
@@ -1094,7 +1089,8 @@ DestroyUsbChildDeviceObject(
|
||||
PDEVICE_OBJECT ChildDeviceObject = NULL;
|
||||
ULONG Index = 0;
|
||||
|
||||
KeAcquireGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
DPRINT("Removing device on port %d (Child index: %d)\n", PortId, Index);
|
||||
|
||||
for (Index = 0; Index < USB_MAXCHILDREN; Index++)
|
||||
{
|
||||
if (HubDeviceExtension->ChildDeviceObject[Index])
|
||||
@@ -1115,17 +1111,12 @@ DestroyUsbChildDeviceObject(
|
||||
if (!ChildDeviceObject)
|
||||
{
|
||||
DPRINT1("Removal request for non-existant device!\n");
|
||||
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
DPRINT("Removing device on port %d (Child index: %d)\n", PortId, Index);
|
||||
|
||||
/* Remove the device from the table */
|
||||
HubDeviceExtension->ChildDeviceObject[Index] = NULL;
|
||||
|
||||
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
|
||||
/* Invalidate device relations for the root hub */
|
||||
IoInvalidateDeviceRelations(HubDeviceExtension->RootHubPhysicalDeviceObject, BusRelations);
|
||||
|
||||
@@ -1156,6 +1147,26 @@ CreateUsbChildDeviceObject(
|
||||
HubInterface = &HubDeviceExtension->HubInterface;
|
||||
RootHubDeviceObject = HubDeviceExtension->RootHubPhysicalDeviceObject;
|
||||
HubInterfaceBusContext = HubDeviceExtension->UsbDInterface.BusContext;
|
||||
//
|
||||
// Find an empty slot in the child device array
|
||||
//
|
||||
for (ChildDeviceCount = 0; ChildDeviceCount < USB_MAXCHILDREN; ChildDeviceCount++)
|
||||
{
|
||||
if (HubDeviceExtension->ChildDeviceObject[ChildDeviceCount] == NULL)
|
||||
{
|
||||
DPRINT("Found unused entry at %d\n", ChildDeviceCount);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Check if the limit has been reached for maximum usb devices
|
||||
//
|
||||
if (ChildDeviceCount == USB_MAXCHILDREN)
|
||||
{
|
||||
DPRINT1("USBHUB: Too many child devices!\n");
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
@@ -1215,6 +1226,10 @@ CreateUsbChildDeviceObject(
|
||||
UsbChildExtension->ParentDeviceObject = UsbHubDeviceObject;
|
||||
UsbChildExtension->PortNumber = PortId;
|
||||
|
||||
// copy device interface
|
||||
RtlCopyMemory(&UsbChildExtension->DeviceInterface, &HubDeviceExtension->DeviceInterface, sizeof(USB_BUS_INTERFACE_USBDI_V2));
|
||||
|
||||
|
||||
//
|
||||
// Create the UsbDeviceObject
|
||||
//
|
||||
@@ -1229,6 +1244,12 @@ CreateUsbChildDeviceObject(
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
// copy device interface
|
||||
RtlCopyMemory(&UsbChildExtension->DeviceInterface, &HubDeviceExtension->DeviceInterface, sizeof(USB_BUS_INTERFACE_USBDI_V2));
|
||||
|
||||
// FIXME replace buscontext
|
||||
UsbChildExtension->DeviceInterface.BusContext = UsbChildExtension->UsbDeviceHandle;
|
||||
|
||||
//
|
||||
// Initialize UsbDevice
|
||||
//
|
||||
@@ -1318,43 +1339,8 @@ CreateUsbChildDeviceObject(
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
// copy device interface
|
||||
RtlCopyMemory(&UsbChildExtension->DeviceInterface, &HubDeviceExtension->UsbDInterface, sizeof(USB_BUS_INTERFACE_USBDI_V2));
|
||||
UsbChildExtension->DeviceInterface.InterfaceReference(UsbChildExtension->DeviceInterface.BusContext);
|
||||
|
||||
INITIALIZE_PNP_STATE(UsbChildExtension->Common);
|
||||
|
||||
IoInitializeRemoveLock(&UsbChildExtension->Common.RemoveLock, 'pbuH', 0, 0);
|
||||
|
||||
KeAcquireGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
|
||||
//
|
||||
// Find an empty slot in the child device array
|
||||
//
|
||||
for (ChildDeviceCount = 0; ChildDeviceCount < USB_MAXCHILDREN; ChildDeviceCount++)
|
||||
{
|
||||
if (HubDeviceExtension->ChildDeviceObject[ChildDeviceCount] == NULL)
|
||||
{
|
||||
DPRINT("Found unused entry at %d\n", ChildDeviceCount);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Check if the limit has been reached for maximum usb devices
|
||||
//
|
||||
if (ChildDeviceCount == USB_MAXCHILDREN)
|
||||
{
|
||||
DPRINT1("USBHUB: Too many child devices!\n");
|
||||
Status = STATUS_UNSUCCESSFUL;
|
||||
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
UsbChildExtension->DeviceInterface.InterfaceDereference(UsbChildExtension->DeviceInterface.BusContext);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
HubDeviceExtension->ChildDeviceObject[ChildDeviceCount] = NewChildDeviceObject;
|
||||
HubDeviceExtension->InstanceCount++;
|
||||
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
|
||||
IoInvalidateDeviceRelations(RootHubDeviceObject, BusRelations);
|
||||
return STATUS_SUCCESS;
|
||||
@@ -1398,20 +1384,16 @@ Cleanup:
|
||||
NTSTATUS
|
||||
USBHUB_FdoQueryBusRelations(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PDEVICE_RELATIONS RelationsFromTop,
|
||||
OUT PDEVICE_RELATIONS* pDeviceRelations)
|
||||
{
|
||||
PHUB_DEVICE_EXTENSION HubDeviceExtension;
|
||||
PDEVICE_RELATIONS DeviceRelations;
|
||||
ULONG i;
|
||||
ULONG ChildrenFromTop = 0;
|
||||
ULONG Children = 0;
|
||||
ULONG NeededSize;
|
||||
|
||||
HubDeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||
|
||||
KeAcquireGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
|
||||
//
|
||||
// Count the number of children
|
||||
//
|
||||
@@ -1425,19 +1407,9 @@ USBHUB_FdoQueryBusRelations(
|
||||
Children++;
|
||||
}
|
||||
|
||||
if (RelationsFromTop)
|
||||
{
|
||||
ChildrenFromTop = RelationsFromTop->Count;
|
||||
if (!Children)
|
||||
{
|
||||
// We have nothing to add
|
||||
*pDeviceRelations = RelationsFromTop;
|
||||
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
NeededSize = sizeof(DEVICE_RELATIONS) + (Children + ChildrenFromTop - 1) * sizeof(PDEVICE_OBJECT);
|
||||
NeededSize = sizeof(DEVICE_RELATIONS);
|
||||
if (Children > 1)
|
||||
NeededSize += (Children - 1) * sizeof(PDEVICE_OBJECT);
|
||||
|
||||
//
|
||||
// Allocate DeviceRelations
|
||||
@@ -1446,22 +1418,9 @@ USBHUB_FdoQueryBusRelations(
|
||||
NeededSize);
|
||||
|
||||
if (!DeviceRelations)
|
||||
{
|
||||
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
if (!RelationsFromTop)
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
else
|
||||
return STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
// Copy the objects coming from top
|
||||
if (ChildrenFromTop)
|
||||
{
|
||||
RtlCopyMemory(DeviceRelations->Objects, RelationsFromTop->Objects,
|
||||
ChildrenFromTop * sizeof(PDEVICE_OBJECT));
|
||||
}
|
||||
|
||||
DeviceRelations->Count = Children + ChildrenFromTop;
|
||||
Children = ChildrenFromTop;
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
DeviceRelations->Count = Children;
|
||||
Children = 0;
|
||||
|
||||
//
|
||||
// Fill in return structure
|
||||
@@ -1470,19 +1429,12 @@ USBHUB_FdoQueryBusRelations(
|
||||
{
|
||||
if (HubDeviceExtension->ChildDeviceObject[i])
|
||||
{
|
||||
// The PnP Manager removes the reference when appropriate.
|
||||
ObReferenceObject(HubDeviceExtension->ChildDeviceObject[i]);
|
||||
HubDeviceExtension->ChildDeviceObject[i]->Flags &= ~DO_DEVICE_INITIALIZING;
|
||||
DeviceRelations->Objects[Children++] = HubDeviceExtension->ChildDeviceObject[i];
|
||||
}
|
||||
}
|
||||
|
||||
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
|
||||
// We should do this, because replaced this with our's one
|
||||
if (RelationsFromTop)
|
||||
ExFreePool(RelationsFromTop);
|
||||
|
||||
ASSERT(Children == DeviceRelations->Count);
|
||||
*pDeviceRelations = DeviceRelations;
|
||||
|
||||
@@ -1599,8 +1551,7 @@ USBHUB_FdoStartDevice(
|
||||
if (!Urb)
|
||||
{
|
||||
// no memory
|
||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||
goto cleanup;
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
// zero urb
|
||||
@@ -1615,7 +1566,8 @@ USBHUB_FdoStartDevice(
|
||||
{
|
||||
// failed to obtain hub pdo
|
||||
DPRINT1("IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO failed with %x\n", Status);
|
||||
goto cleanup;
|
||||
ExFreePool(Urb);
|
||||
return Status;
|
||||
}
|
||||
|
||||
// sanity checks
|
||||
@@ -1626,13 +1578,14 @@ USBHUB_FdoStartDevice(
|
||||
RootHubDeviceObject = HubDeviceExtension->RootHubPhysicalDeviceObject;
|
||||
|
||||
// Send the StartDevice to RootHub
|
||||
Status = ForwardIrpAndWait(HubDeviceExtension->LowerDeviceObject, Irp);
|
||||
Status = ForwardIrpAndWait(RootHubDeviceObject, Irp);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
// failed to start pdo
|
||||
DPRINT1("Failed to start the RootHub PDO\n");
|
||||
goto cleanup;
|
||||
ExFreePool(Urb);
|
||||
return Status;
|
||||
}
|
||||
|
||||
// Get the current number of hubs
|
||||
@@ -1643,7 +1596,8 @@ USBHUB_FdoStartDevice(
|
||||
{
|
||||
// failed to get number of hubs
|
||||
DPRINT1("IOCTL_INTERNAL_USB_GET_HUB_COUNT failed with %x\n", Status);
|
||||
goto cleanup;
|
||||
ExFreePool(Urb);
|
||||
return Status;
|
||||
}
|
||||
|
||||
// Get the Hub Interface
|
||||
@@ -1657,7 +1611,8 @@ USBHUB_FdoStartDevice(
|
||||
{
|
||||
// failed to get root hub interface
|
||||
DPRINT1("Failed to get HUB_GUID interface with status 0x%08lx\n", Status);
|
||||
goto cleanup;
|
||||
ExFreePool(Urb);
|
||||
return Status;
|
||||
}
|
||||
|
||||
HubInterfaceBusContext = HubDeviceExtension->HubInterface.BusContext;
|
||||
@@ -1673,7 +1628,8 @@ USBHUB_FdoStartDevice(
|
||||
{
|
||||
// failed to get usbdi interface
|
||||
DPRINT1("Failed to get USBDI_GUID interface with status 0x%08lx\n", Status);
|
||||
goto cleanup;
|
||||
ExFreePool(Urb);
|
||||
return Status;
|
||||
}
|
||||
|
||||
// Get Root Hub Device Handle
|
||||
@@ -1686,7 +1642,8 @@ USBHUB_FdoStartDevice(
|
||||
{
|
||||
// failed
|
||||
DPRINT1("IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE failed with status 0x%08lx\n", Status);
|
||||
goto cleanup;
|
||||
ExFreePool(Urb);
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1730,7 +1687,8 @@ USBHUB_FdoStartDevice(
|
||||
{
|
||||
// failed to get device descriptor of hub
|
||||
DPRINT1("Failed to get HubDeviceDescriptor!\n");
|
||||
goto cleanup;
|
||||
ExFreePool(Urb);
|
||||
return Status;
|
||||
}
|
||||
|
||||
// build configuration request
|
||||
@@ -1757,7 +1715,8 @@ USBHUB_FdoStartDevice(
|
||||
{
|
||||
// failed to get configuration descriptor
|
||||
DPRINT1("Failed to get RootHub Configuration with status %x\n", Status);
|
||||
goto cleanup;
|
||||
ExFreePool(Urb);
|
||||
return Status;
|
||||
}
|
||||
|
||||
// sanity checks
|
||||
@@ -1783,15 +1742,16 @@ USBHUB_FdoStartDevice(
|
||||
{
|
||||
// failed to get hub information
|
||||
DPRINT1("Failed to extended hub information. Unable to determine the number of ports!\n");
|
||||
goto cleanup;
|
||||
ExFreePool(Urb);
|
||||
return Status;
|
||||
}
|
||||
|
||||
if (!HubDeviceExtension->UsbExtHubInfo.NumberOfPorts)
|
||||
{
|
||||
// bogus port driver
|
||||
DPRINT1("Failed to retrieve the number of ports\n");
|
||||
Status = STATUS_UNSUCCESSFUL;
|
||||
goto cleanup;
|
||||
ExFreePool(Urb);
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
DPRINT("HubDeviceExtension->UsbExtHubInfo.NumberOfPorts %x\n", HubDeviceExtension->UsbExtHubInfo.NumberOfPorts);
|
||||
@@ -1822,8 +1782,8 @@ USBHUB_FdoStartDevice(
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("Failed to get Hub Descriptor!\n");
|
||||
Status = STATUS_UNSUCCESSFUL;
|
||||
goto cleanup;
|
||||
ExFreePool(Urb);
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
// sanity checks
|
||||
@@ -1851,8 +1811,8 @@ USBHUB_FdoStartDevice(
|
||||
{
|
||||
// failed to get hub status
|
||||
DPRINT1("Failed to get Hub Status!\n");
|
||||
Status = STATUS_UNSUCCESSFUL;
|
||||
goto cleanup;
|
||||
ExFreePool(Urb);
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
// Allocate memory for PortStatusChange to hold 2 USHORTs for each port on hub
|
||||
@@ -1860,13 +1820,6 @@ USBHUB_FdoStartDevice(
|
||||
sizeof(ULONG) * HubDeviceExtension->UsbExtHubInfo.NumberOfPorts,
|
||||
USB_HUB_TAG);
|
||||
|
||||
if (!HubDeviceExtension->PortStatusChange)
|
||||
{
|
||||
DPRINT1("Failed to allocate pool for PortStatusChange!\n");
|
||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
// Get the first Configuration Descriptor
|
||||
Pid = USBD_ParseConfigurationDescriptorEx(&HubDeviceExtension->HubConfigDescriptor,
|
||||
&HubDeviceExtension->HubConfigDescriptor,
|
||||
@@ -1875,8 +1828,8 @@ USBHUB_FdoStartDevice(
|
||||
{
|
||||
// failed parse hub descriptor
|
||||
DPRINT1("Failed to parse configuration descriptor\n");
|
||||
Status = STATUS_UNSUCCESSFUL;
|
||||
goto cleanup;
|
||||
ExFreePool(Urb);
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
// create configuration request
|
||||
@@ -1887,8 +1840,8 @@ USBHUB_FdoStartDevice(
|
||||
{
|
||||
// failed to build urb
|
||||
DPRINT1("Failed to allocate urb\n");
|
||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||
goto cleanup;
|
||||
ExFreePool(Urb);
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
// send request
|
||||
@@ -1900,7 +1853,9 @@ USBHUB_FdoStartDevice(
|
||||
{
|
||||
// failed to select configuration
|
||||
DPRINT1("Failed to select configuration with %x\n", Status);
|
||||
goto cleanup;
|
||||
ExFreePool(Urb);
|
||||
ExFreePool(ConfigUrb);
|
||||
return Status;
|
||||
}
|
||||
|
||||
// store configuration & pipe handle
|
||||
@@ -1908,6 +1863,12 @@ USBHUB_FdoStartDevice(
|
||||
HubDeviceExtension->PipeHandle = ConfigUrb->UrbSelectConfiguration.Interface.Pipes[0].PipeHandle;
|
||||
DPRINT("Configuration Handle %x\n", HubDeviceExtension->ConfigurationHandle);
|
||||
|
||||
FDO_QueryInterface(DeviceObject, &HubDeviceExtension->DeviceInterface);
|
||||
|
||||
|
||||
// free urb
|
||||
ExFreePool(ConfigUrb);
|
||||
|
||||
// check if function is available
|
||||
if (HubDeviceExtension->UsbDInterface.IsDeviceHighSpeed)
|
||||
{
|
||||
@@ -1947,7 +1908,8 @@ USBHUB_FdoStartDevice(
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("Failed to set callback\n");
|
||||
goto cleanup;
|
||||
ExFreePool(Urb);
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1999,30 +1961,8 @@ USBHUB_FdoStartDevice(
|
||||
// free urb
|
||||
ExFreePool(Urb);
|
||||
|
||||
// free ConfigUrb
|
||||
ExFreePool(ConfigUrb);
|
||||
|
||||
// done
|
||||
return Status;
|
||||
|
||||
cleanup:
|
||||
if (Urb)
|
||||
ExFreePool(Urb);
|
||||
|
||||
// Dereference interfaces
|
||||
if (HubDeviceExtension->HubInterface.Size)
|
||||
HubDeviceExtension->HubInterface.InterfaceDereference(HubDeviceExtension->HubInterface.BusContext);
|
||||
|
||||
if (HubDeviceExtension->UsbDInterface.Size)
|
||||
HubDeviceExtension->UsbDInterface.InterfaceDereference(HubDeviceExtension->UsbDInterface.BusContext);
|
||||
|
||||
if (HubDeviceExtension->PortStatusChange)
|
||||
ExFreePool(HubDeviceExtension->PortStatusChange);
|
||||
|
||||
if (ConfigUrb)
|
||||
ExFreePool(ConfigUrb);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
@@ -2032,31 +1972,17 @@ USBHUB_FdoHandlePnp(
|
||||
{
|
||||
PIO_STACK_LOCATION Stack;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
PDEVICE_OBJECT ChildDeviceObject;
|
||||
ULONG_PTR Information = 0;
|
||||
PHUB_DEVICE_EXTENSION HubDeviceExtension;
|
||||
PUSB_BUS_INTERFACE_HUB_V5 HubInterface;
|
||||
PHUB_CHILDDEVICE_EXTENSION ChildDeviceExtension;
|
||||
|
||||
HubDeviceExtension = (PHUB_DEVICE_EXTENSION) DeviceObject->DeviceExtension;
|
||||
|
||||
HubInterface = &HubDeviceExtension->HubInterface;
|
||||
Stack = IoGetCurrentIrpStackLocation(Irp);
|
||||
|
||||
Status = IoAcquireRemoveLock(&HubDeviceExtension->Common.RemoveLock, Irp);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
Irp->IoStatus.Status = Status;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return Status;
|
||||
}
|
||||
|
||||
switch (Stack->MinorFunction)
|
||||
{
|
||||
int i;
|
||||
|
||||
case IRP_MN_START_DEVICE:
|
||||
{
|
||||
DPRINT("IRP_MN_START_DEVICE\n");
|
||||
if (USBHUB_IsRootHubFDO(DeviceObject))
|
||||
{
|
||||
// start root hub fdo
|
||||
@@ -2066,13 +1992,7 @@ USBHUB_FdoHandlePnp(
|
||||
{
|
||||
Status = USBHUB_ParentFDOStartDevice(DeviceObject, Irp);
|
||||
}
|
||||
|
||||
SET_NEW_PNP_STATE(HubDeviceExtension->Common, Started);
|
||||
|
||||
Irp->IoStatus.Status = Status;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
IoReleaseRemoveLock(&HubDeviceExtension->Common.RemoveLock, Irp);
|
||||
return Status;
|
||||
break;
|
||||
}
|
||||
|
||||
case IRP_MN_QUERY_DEVICE_RELATIONS:
|
||||
@@ -2082,197 +2002,66 @@ USBHUB_FdoHandlePnp(
|
||||
case BusRelations:
|
||||
{
|
||||
PDEVICE_RELATIONS DeviceRelations = NULL;
|
||||
PDEVICE_RELATIONS RelationsFromTop = (PDEVICE_RELATIONS)Irp->IoStatus.Information;
|
||||
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
|
||||
|
||||
Status = USBHUB_FdoQueryBusRelations(DeviceObject, RelationsFromTop, &DeviceRelations);
|
||||
Status = USBHUB_FdoQueryBusRelations(DeviceObject, &DeviceRelations);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
if (Status == STATUS_NOT_SUPPORTED)
|
||||
{
|
||||
// We should process this to not lose relations from top.
|
||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||
break;
|
||||
}
|
||||
// We should fail an IRP
|
||||
Irp->IoStatus.Status = Status;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
IoReleaseRemoveLock(&HubDeviceExtension->Common.RemoveLock, Irp);
|
||||
return Status;
|
||||
}
|
||||
|
||||
Irp->IoStatus.Information = (ULONG_PTR)DeviceRelations;
|
||||
Irp->IoStatus.Status = Status;
|
||||
Information = (ULONG_PTR)DeviceRelations;
|
||||
break;
|
||||
}
|
||||
case RemovalRelations:
|
||||
{
|
||||
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n");
|
||||
break;
|
||||
return ForwardIrpAndForget(DeviceObject, Irp);
|
||||
}
|
||||
default:
|
||||
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
|
||||
Stack->Parameters.QueryDeviceRelations.Type);
|
||||
break;
|
||||
return ForwardIrpAndForget(DeviceObject, Irp);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case IRP_MN_QUERY_STOP_DEVICE:
|
||||
{
|
||||
//
|
||||
// We should fail this request, because we're not handling
|
||||
// IRP_MN_STOP_DEVICE for now.We'll receive this IRP ONLY when
|
||||
// PnP manager rebalances resources.
|
||||
//
|
||||
Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
case IRP_MN_QUERY_REMOVE_DEVICE:
|
||||
case IRP_MN_QUERY_STOP_DEVICE:
|
||||
{
|
||||
// No action is required from FDO because it have nothing to free.
|
||||
DPRINT("IRP_MN_QUERY_REMOVE_DEVICE\n");
|
||||
|
||||
SET_NEW_PNP_STATE(HubDeviceExtension->Common, RemovePending);
|
||||
|
||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||
break;
|
||||
}
|
||||
case IRP_MN_CANCEL_REMOVE_DEVICE:
|
||||
{
|
||||
DPRINT("IRP_MN_CANCEL_REMOVE_DEVICE\n");
|
||||
|
||||
if (HubDeviceExtension->Common.PnPState == RemovePending)
|
||||
RESTORE_PREVIOUS_PNP_STATE(HubDeviceExtension->Common);
|
||||
|
||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||
break;
|
||||
}
|
||||
case IRP_MN_SURPRISE_REMOVAL:
|
||||
{
|
||||
//
|
||||
// We'll receive this IRP on HUB unexpected removal, or on USB
|
||||
// controller removal from PCI port. Here we should "let know" all
|
||||
// our children that their parent is removed and on next removal
|
||||
// they also can be removed.
|
||||
//
|
||||
SET_NEW_PNP_STATE(HubDeviceExtension->Common, SurpriseRemovePending);
|
||||
|
||||
KeAcquireGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
|
||||
for (i = 0; i < USB_MAXCHILDREN; i++)
|
||||
{
|
||||
ChildDeviceObject = HubDeviceExtension->ChildDeviceObject[i];
|
||||
if (ChildDeviceObject)
|
||||
{
|
||||
ChildDeviceExtension = (PHUB_CHILDDEVICE_EXTENSION)ChildDeviceObject->DeviceObjectExtension;
|
||||
ChildDeviceExtension->ParentDeviceObject = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
|
||||
// This IRP can't be failed
|
||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||
break;
|
||||
return ForwardIrpAndForget(DeviceObject, Irp);
|
||||
}
|
||||
case IRP_MN_REMOVE_DEVICE:
|
||||
{
|
||||
DPRINT("IRP_MN_REMOVE_DEVICE\n");
|
||||
|
||||
SET_NEW_PNP_STATE(HubDeviceExtension->Common, Deleted);
|
||||
|
||||
IoReleaseRemoveLockAndWait(&HubDeviceExtension->Common.RemoveLock, Irp);
|
||||
|
||||
//
|
||||
// Here we should remove all child PDOs. At this point all children
|
||||
// received and returned from IRP_MN_REMOVE so remove synchronization
|
||||
// isn't needed here
|
||||
//
|
||||
|
||||
KeAcquireGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
|
||||
for (i = 0; i < USB_MAXCHILDREN; i++)
|
||||
{
|
||||
ChildDeviceObject = HubDeviceExtension->ChildDeviceObject[i];
|
||||
if (ChildDeviceObject)
|
||||
{
|
||||
PHUB_CHILDDEVICE_EXTENSION UsbChildExtension = (PHUB_CHILDDEVICE_EXTENSION)ChildDeviceObject->DeviceExtension;
|
||||
|
||||
SET_NEW_PNP_STATE(UsbChildExtension->Common, Deleted);
|
||||
|
||||
// Remove the usb device
|
||||
if (UsbChildExtension->UsbDeviceHandle)
|
||||
{
|
||||
Status = HubInterface->RemoveUsbDevice(HubInterface->BusContext, UsbChildExtension->UsbDeviceHandle, 0);
|
||||
ASSERT(Status == STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
// Free full configuration descriptor
|
||||
if (UsbChildExtension->FullConfigDesc)
|
||||
ExFreePool(UsbChildExtension->FullConfigDesc);
|
||||
|
||||
// Free ID buffers
|
||||
if (UsbChildExtension->usCompatibleIds.Buffer)
|
||||
ExFreePool(UsbChildExtension->usCompatibleIds.Buffer);
|
||||
|
||||
if (UsbChildExtension->usDeviceId.Buffer)
|
||||
ExFreePool(UsbChildExtension->usDeviceId.Buffer);
|
||||
|
||||
if (UsbChildExtension->usHardwareIds.Buffer)
|
||||
ExFreePool(UsbChildExtension->usHardwareIds.Buffer);
|
||||
|
||||
if (UsbChildExtension->usInstanceId.Buffer)
|
||||
ExFreePool(UsbChildExtension->usInstanceId.Buffer);
|
||||
|
||||
DPRINT("Deleting child PDO\n");
|
||||
IoDeleteDevice(DeviceObject);
|
||||
ChildDeviceObject = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
|
||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||
Status = ForwardIrpAndForget(DeviceObject, Irp);
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
|
||||
IoDetachDevice(HubDeviceExtension->LowerDeviceObject);
|
||||
DPRINT("Deleting FDO 0x%p\n", DeviceObject);
|
||||
IoDeleteDevice(DeviceObject);
|
||||
|
||||
return Status;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
case IRP_MN_QUERY_BUS_INFORMATION:
|
||||
{
|
||||
// Function drivers and filter drivers do not handle this IRP.
|
||||
DPRINT("IRP_MN_QUERY_BUS_INFORMATION\n");
|
||||
break;
|
||||
}
|
||||
case IRP_MN_QUERY_ID:
|
||||
{
|
||||
DPRINT("IRP_MN_QUERY_ID\n");
|
||||
// Function drivers and filter drivers do not handle this IRP.
|
||||
break;
|
||||
}
|
||||
case IRP_MN_QUERY_CAPABILITIES:
|
||||
{
|
||||
//
|
||||
// If a function or filter driver does not handle this IRP, it
|
||||
// should pass that down.
|
||||
//
|
||||
DPRINT("IRP_MN_QUERY_CAPABILITIES\n");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
DPRINT(" IRP_MJ_PNP / unknown minor function 0x%lx\n", Stack->MinorFunction);
|
||||
break;
|
||||
return ForwardIrpAndForget(DeviceObject, Irp);
|
||||
}
|
||||
}
|
||||
|
||||
Status = ForwardIrpAndForget(DeviceObject, Irp);
|
||||
IoReleaseRemoveLock(&HubDeviceExtension->Common.RemoveLock, Irp);
|
||||
Irp->IoStatus.Information = Information;
|
||||
Irp->IoStatus.Status = Status;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -2297,25 +2086,6 @@ USBHUB_FdoHandleDeviceControl(
|
||||
// get device extension
|
||||
HubDeviceExtension = (PHUB_DEVICE_EXTENSION) DeviceObject->DeviceExtension;
|
||||
|
||||
Status = IoAcquireRemoveLock(&HubDeviceExtension->Common.RemoveLock, Irp);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
Irp->IoStatus.Status = Status;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return Status;
|
||||
}
|
||||
|
||||
// Prevent handling of control requests in remove pending state
|
||||
if (HubDeviceExtension->Common.PnPState == RemovePending)
|
||||
{
|
||||
DPRINT1("[USBHUB] Request for removed device object %p\n", DeviceObject);
|
||||
Irp->IoStatus.Status = STATUS_DEVICE_NOT_CONNECTED;
|
||||
Irp->IoStatus.Information = 0;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
IoReleaseRemoveLock(&HubDeviceExtension->Common.RemoveLock, Irp);
|
||||
return STATUS_DEVICE_NOT_CONNECTED;
|
||||
}
|
||||
|
||||
if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_USB_GET_NODE_INFORMATION)
|
||||
{
|
||||
// is the buffer big enough
|
||||
@@ -2361,7 +2131,6 @@ USBHUB_FdoHandleDeviceControl(
|
||||
// sanity checks
|
||||
ASSERT(NodeConnectionInfo);
|
||||
|
||||
KeAcquireGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
for(Index = 0; Index < USB_MAXCHILDREN; Index++)
|
||||
{
|
||||
if (HubDeviceExtension->ChildDeviceObject[Index] == NULL)
|
||||
@@ -2388,7 +2157,6 @@ USBHUB_FdoHandleDeviceControl(
|
||||
}
|
||||
break;
|
||||
}
|
||||
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
// done
|
||||
Irp->IoStatus.Information = sizeof(USB_NODE_INFORMATION);
|
||||
Status = STATUS_SUCCESS;
|
||||
@@ -2409,7 +2177,6 @@ USBHUB_FdoHandleDeviceControl(
|
||||
// sanity checks
|
||||
ASSERT(NodeKey);
|
||||
|
||||
KeAcquireGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
for(Index = 0; Index < USB_MAXCHILDREN; Index++)
|
||||
{
|
||||
if (HubDeviceExtension->ChildDeviceObject[Index] == NULL)
|
||||
@@ -2449,7 +2216,6 @@ USBHUB_FdoHandleDeviceControl(
|
||||
NodeKey->ActualLength = Length + sizeof(USB_NODE_CONNECTION_DRIVERKEY_NAME);
|
||||
break;
|
||||
}
|
||||
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
}
|
||||
}
|
||||
else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_USB_GET_NODE_CONNECTION_NAME)
|
||||
@@ -2481,7 +2247,6 @@ USBHUB_FdoHandleDeviceControl(
|
||||
Irp->IoStatus.Status = Status;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
|
||||
IoReleaseRemoveLock(&HubDeviceExtension->Common.RemoveLock, Irp);
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
@@ -211,3 +211,84 @@ SubmitRequestToRootHub(
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
FDO_QueryInterfaceCompletionRoutine(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp,
|
||||
IN PVOID Context)
|
||||
{
|
||||
/* Set event */
|
||||
KeSetEvent((PRKEVENT)Context, 0, FALSE);
|
||||
|
||||
/* Completion is done in the HidClassFDO_QueryCapabilities routine */
|
||||
return STATUS_MORE_PROCESSING_REQUIRED;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
FDO_QueryInterface(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN OUT PUSB_BUS_INTERFACE_USBDI_V2 Interface)
|
||||
{
|
||||
PIRP Irp;
|
||||
KEVENT Event;
|
||||
NTSTATUS Status;
|
||||
PIO_STACK_LOCATION IoStack;
|
||||
PHUB_DEVICE_EXTENSION HubDeviceExtension;
|
||||
|
||||
/* Get device extension */
|
||||
HubDeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||
ASSERT(HubDeviceExtension->Common.IsFDO);
|
||||
|
||||
/* Init event */
|
||||
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
||||
|
||||
/* Now allocate the irp */
|
||||
Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE);
|
||||
if (!Irp)
|
||||
{
|
||||
/* No memory */
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
/* Get next stack location */
|
||||
IoStack = IoGetNextIrpStackLocation(Irp);
|
||||
|
||||
/* Init stack location */
|
||||
IoStack->MajorFunction = IRP_MJ_PNP;
|
||||
IoStack->MinorFunction = IRP_MN_QUERY_INTERFACE;
|
||||
IoStack->Parameters.QueryInterface.Interface = (PINTERFACE)Interface;
|
||||
IoStack->Parameters.QueryInterface.InterfaceType = &USB_BUS_INTERFACE_USBDI_GUID;
|
||||
IoStack->Parameters.QueryInterface.Version = USB_BUSIF_USBDI_VERSION_2;
|
||||
IoStack->Parameters.QueryInterface.Size = sizeof(USB_BUS_INTERFACE_USBDI_V2);
|
||||
|
||||
|
||||
/* Set completion routine */
|
||||
IoSetCompletionRoutine(Irp,
|
||||
FDO_QueryInterfaceCompletionRoutine,
|
||||
(PVOID)&Event,
|
||||
TRUE,
|
||||
TRUE,
|
||||
TRUE);
|
||||
|
||||
/* Pnp irps have default completion code */
|
||||
Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
|
||||
|
||||
/* Call lower device */
|
||||
Status = IoCallDriver(HubDeviceExtension->LowerDeviceObject, Irp);
|
||||
if (Status == STATUS_PENDING)
|
||||
{
|
||||
/* Wait for completion */
|
||||
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
|
||||
}
|
||||
|
||||
/* Get status */
|
||||
Status = Irp->IoStatus.Status;
|
||||
|
||||
/* Complete request */
|
||||
IoFreeIrp(Irp);
|
||||
|
||||
/* Done */
|
||||
return Status;
|
||||
}
|
||||
|
@@ -146,25 +146,16 @@ IsValidPDO(
|
||||
|
||||
ChildDeviceExtension = (PHUB_CHILDDEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||
ASSERT(ChildDeviceExtension->Common.IsFDO == FALSE);
|
||||
|
||||
// This can happen when parent device was surprise removed.
|
||||
if (ChildDeviceExtension->ParentDeviceObject == NULL)
|
||||
return FALSE;
|
||||
|
||||
HubDeviceExtension = (PHUB_DEVICE_EXTENSION)ChildDeviceExtension->ParentDeviceObject->DeviceExtension;
|
||||
|
||||
KeAcquireGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
for(Index = 0; Index < USB_MAXCHILDREN; Index++)
|
||||
{
|
||||
if (HubDeviceExtension->ChildDeviceObject[Index] == DeviceObject)
|
||||
{
|
||||
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
|
||||
/* PDO exists */
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
|
||||
/* invalid pdo */
|
||||
return FALSE;
|
||||
@@ -199,31 +190,18 @@ USBHUB_PdoHandleInternalDeviceControl(
|
||||
|
||||
ChildDeviceExtension = (PHUB_CHILDDEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||
ASSERT(ChildDeviceExtension->Common.IsFDO == FALSE);
|
||||
HubDeviceExtension = (PHUB_DEVICE_EXTENSION)ChildDeviceExtension->ParentDeviceObject->DeviceExtension;
|
||||
RootHubDeviceObject = HubDeviceExtension->RootHubPhysicalDeviceObject;
|
||||
|
||||
Status = IoAcquireRemoveLock(&ChildDeviceExtension->Common.RemoveLock, Irp);
|
||||
if (!NT_SUCCESS(Status))
|
||||
if(!IsValidPDO(DeviceObject))
|
||||
{
|
||||
Irp->IoStatus.Status = Status;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return Status;
|
||||
}
|
||||
|
||||
if (ChildDeviceExtension->Common.PnPState == SurpriseRemovePending ||
|
||||
ChildDeviceExtension->Common.PnPState == RemovePending ||
|
||||
ChildDeviceExtension->ParentDeviceObject == NULL)
|
||||
{
|
||||
// Parent or child device was surprise removed.
|
||||
DPRINT1("[USBHUB] Request for removed device object %p\n", DeviceObject);
|
||||
Irp->IoStatus.Status = STATUS_DEVICE_NOT_CONNECTED;
|
||||
Irp->IoStatus.Information = 0;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
IoReleaseRemoveLock(&ChildDeviceExtension->Common.RemoveLock, Irp);
|
||||
return STATUS_DEVICE_NOT_CONNECTED;
|
||||
}
|
||||
|
||||
HubDeviceExtension = (PHUB_DEVICE_EXTENSION)ChildDeviceExtension->ParentDeviceObject->DeviceExtension;
|
||||
RootHubDeviceObject = HubDeviceExtension->RootHubPhysicalDeviceObject;
|
||||
|
||||
switch (Stack->Parameters.DeviceIoControl.IoControlCode)
|
||||
{
|
||||
case IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO:
|
||||
@@ -323,7 +301,6 @@ USBHUB_PdoHandleInternalDeviceControl(
|
||||
// Send the request to RootHub
|
||||
//
|
||||
Status = ForwardUrbToRootHub(RootHubDeviceObject, IOCTL_INTERNAL_USB_SUBMIT_URB, Irp, Urb, NULL);
|
||||
IoReleaseRemoveLock(&ChildDeviceExtension->Common.RemoveLock, Irp);
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
@@ -420,7 +397,6 @@ USBHUB_PdoHandleInternalDeviceControl(
|
||||
Irp->IoStatus.Status = Status;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
}
|
||||
IoReleaseRemoveLock(&ChildDeviceExtension->Common.RemoveLock, Irp);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -445,8 +421,6 @@ USBHUB_PdoStartDevice(
|
||||
IoRegisterDeviceInterface(DeviceObject, &GUID_DEVINTERFACE_USB_DEVICE, NULL, &ChildDeviceExtension->SymbolicLinkName);
|
||||
IoSetDeviceInterfaceState(&ChildDeviceExtension->SymbolicLinkName, TRUE);
|
||||
|
||||
SET_NEW_PNP_STATE(ChildDeviceExtension->Common, Started);
|
||||
|
||||
UNIMPLEMENTED
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
@@ -589,20 +563,15 @@ USBHUB_PdoHandlePnp(
|
||||
PIO_STACK_LOCATION Stack;
|
||||
ULONG_PTR Information = 0;
|
||||
PHUB_CHILDDEVICE_EXTENSION UsbChildExtension;
|
||||
ULONG Index;
|
||||
ULONG bFound;
|
||||
PDEVICE_RELATIONS DeviceRelation;
|
||||
PDEVICE_OBJECT ParentDevice;
|
||||
|
||||
UsbChildExtension = (PHUB_CHILDDEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||
Stack = IoGetCurrentIrpStackLocation(Irp);
|
||||
MinorFunction = Stack->MinorFunction;
|
||||
|
||||
Status = IoAcquireRemoveLock(&UsbChildExtension->Common.RemoveLock, Irp);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
Irp->IoStatus.Status = Status;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return Status;
|
||||
}
|
||||
|
||||
switch (MinorFunction)
|
||||
{
|
||||
case IRP_MN_START_DEVICE:
|
||||
@@ -659,20 +628,17 @@ USBHUB_PdoHandlePnp(
|
||||
}
|
||||
case IRP_MN_QUERY_DEVICE_TEXT:
|
||||
{
|
||||
DPRINT("IRP_MN_QUERY_DEVICE_TEXT\n");
|
||||
Status = USBHUB_PdoQueryDeviceText(DeviceObject, Irp, &Information);
|
||||
break;
|
||||
}
|
||||
case IRP_MN_QUERY_ID:
|
||||
{
|
||||
DPRINT("IRP_MN_QUERY_ID\n");
|
||||
Status = USBHUB_PdoQueryId(DeviceObject, Irp, &Information);
|
||||
break;
|
||||
}
|
||||
case IRP_MN_QUERY_BUS_INFORMATION:
|
||||
{
|
||||
PPNP_BUS_INFORMATION BusInfo;
|
||||
DPRINT("IRP_MN_QUERY_BUS_INFORMATION\n");
|
||||
BusInfo = (PPNP_BUS_INFORMATION)ExAllocatePool(PagedPool, sizeof(PNP_BUS_INFORMATION));
|
||||
RtlCopyMemory(&BusInfo->BusTypeGuid,
|
||||
&GUID_BUS_TYPE_USB,
|
||||
@@ -688,58 +654,42 @@ USBHUB_PdoHandlePnp(
|
||||
{
|
||||
PHUB_DEVICE_EXTENSION HubDeviceExtension = (PHUB_DEVICE_EXTENSION)UsbChildExtension->ParentDeviceObject->DeviceExtension;
|
||||
PUSB_BUS_INTERFACE_HUB_V5 HubInterface = &HubDeviceExtension->HubInterface;
|
||||
ParentDevice = UsbChildExtension->ParentDeviceObject;
|
||||
|
||||
DPRINT("IRP_MJ_PNP / IRP_MN_REMOVE_DEVICE\n");
|
||||
|
||||
ASSERT((UsbChildExtension->Common.PnPState == RemovePending) ||
|
||||
(UsbChildExtension->Common.PnPState == SurpriseRemovePending));
|
||||
|
||||
SET_NEW_PNP_STATE(UsbChildExtension->Common, NotStarted);
|
||||
|
||||
if (!IsValidPDO(DeviceObject))
|
||||
/* remove us from pdo list */
|
||||
bFound = FALSE;
|
||||
for(Index = 0; Index < USB_MAXCHILDREN; Index++)
|
||||
{
|
||||
// Parent or child device was surprise removed, freeing resources allocated for child device.
|
||||
SET_NEW_PNP_STATE(UsbChildExtension->Common, Deleted);
|
||||
|
||||
IoReleaseRemoveLockAndWait(&UsbChildExtension->Common.RemoveLock, Irp);
|
||||
|
||||
// Remove the usb device
|
||||
if (UsbChildExtension->UsbDeviceHandle)
|
||||
if (HubDeviceExtension->ChildDeviceObject[Index] == DeviceObject)
|
||||
{
|
||||
Status = HubInterface->RemoveUsbDevice(HubInterface->BusContext, UsbChildExtension->UsbDeviceHandle, 0);
|
||||
ASSERT(Status == STATUS_SUCCESS);
|
||||
/* Remove the device */
|
||||
Status = HubInterface->RemoveUsbDevice(HubDeviceExtension->UsbDInterface.BusContext, UsbChildExtension->UsbDeviceHandle, 0);
|
||||
|
||||
/* FIXME handle error */
|
||||
ASSERT(Status == STATUS_SUCCESS);
|
||||
|
||||
/* remove us */
|
||||
HubDeviceExtension->ChildDeviceObject[Index] = NULL;
|
||||
bFound = TRUE;
|
||||
break;
|
||||
}
|
||||
// Free full configuration descriptor
|
||||
if (UsbChildExtension->FullConfigDesc)
|
||||
ExFreePool(UsbChildExtension->FullConfigDesc);
|
||||
|
||||
// Free ID buffers
|
||||
if (UsbChildExtension->usCompatibleIds.Buffer)
|
||||
ExFreePool(UsbChildExtension->usCompatibleIds.Buffer);
|
||||
|
||||
if (UsbChildExtension->usDeviceId.Buffer)
|
||||
ExFreePool(UsbChildExtension->usDeviceId.Buffer);
|
||||
|
||||
if (UsbChildExtension->usHardwareIds.Buffer)
|
||||
ExFreePool(UsbChildExtension->usHardwareIds.Buffer);
|
||||
|
||||
if (UsbChildExtension->usInstanceId.Buffer)
|
||||
ExFreePool(UsbChildExtension->usInstanceId.Buffer);
|
||||
|
||||
DPRINT("Deleting child PDO\n");
|
||||
IoDeleteDevice(DeviceObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
IoReleaseRemoveLock(&UsbChildExtension->Common.RemoveLock, Irp);
|
||||
}
|
||||
|
||||
// If device is physically presented, we leave its PDO undeleted.
|
||||
|
||||
/* Complete the IRP */
|
||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
|
||||
/* delete device */
|
||||
IoDeleteDevice(DeviceObject);
|
||||
|
||||
if (bFound)
|
||||
{
|
||||
/* invalidate device relations */
|
||||
IoInvalidateDeviceRelations(ParentDevice, BusRelations);
|
||||
}
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
case IRP_MN_QUERY_DEVICE_RELATIONS:
|
||||
@@ -749,7 +699,6 @@ USBHUB_PdoHandlePnp(
|
||||
{
|
||||
/* not supported */
|
||||
Status = Irp->IoStatus.Status;
|
||||
Information = Irp->IoStatus.Information;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -773,46 +722,13 @@ USBHUB_PdoHandlePnp(
|
||||
break;
|
||||
}
|
||||
case IRP_MN_QUERY_STOP_DEVICE:
|
||||
{
|
||||
//
|
||||
// We should fail this request, because we're not handling IRP_MN_STOP_DEVICE for now.
|
||||
// We'll receive this IRP ONLY when the PnP manager rebalances resources.
|
||||
//
|
||||
Status = STATUS_NOT_SUPPORTED;
|
||||
break;
|
||||
}
|
||||
case IRP_MN_QUERY_REMOVE_DEVICE:
|
||||
{
|
||||
//
|
||||
// Free interface obtained from bottom, according MSDN we should
|
||||
// check interfaces provided to top, but here we are not checking.
|
||||
// All checking will be performed in roothub driver's
|
||||
// IRP_MN_QUERY_REMOVE_DEVICE handler. This will make problems when
|
||||
// buggy driver is loaded on top of us. But we decided to keep source
|
||||
// simpler, because in any case buggy driver will prevent removing of
|
||||
// whole stack.
|
||||
//
|
||||
UsbChildExtension->DeviceInterface.InterfaceDereference(UsbChildExtension->DeviceInterface.BusContext);
|
||||
|
||||
SET_NEW_PNP_STATE(UsbChildExtension->Common, RemovePending);
|
||||
|
||||
/* Sure, no problem */
|
||||
Status = STATUS_SUCCESS;
|
||||
Information = 0;
|
||||
break;
|
||||
}
|
||||
case IRP_MN_CANCEL_REMOVE_DEVICE:
|
||||
{
|
||||
// Check to see have we received query-remove before
|
||||
if (UsbChildExtension->Common.PnPState == RemovePending)
|
||||
{
|
||||
RESTORE_PREVIOUS_PNP_STATE(UsbChildExtension->Common);
|
||||
UsbChildExtension->DeviceInterface.InterfaceReference(UsbChildExtension->DeviceInterface.BusContext);
|
||||
}
|
||||
|
||||
Status = STATUS_SUCCESS;
|
||||
break;
|
||||
}
|
||||
case IRP_MN_QUERY_INTERFACE:
|
||||
{
|
||||
DPRINT1("IRP_MN_QUERY_INTERFACE\n");
|
||||
@@ -820,28 +736,17 @@ USBHUB_PdoHandlePnp(
|
||||
{
|
||||
DPRINT1("USB_BUS_INTERFACE_USBDI_GUID\n");
|
||||
RtlCopyMemory(Stack->Parameters.QueryInterface.Interface, &UsbChildExtension->DeviceInterface, Stack->Parameters.QueryInterface.Size);
|
||||
UsbChildExtension->DeviceInterface.InterfaceReference(UsbChildExtension->DeviceInterface.BusContext);
|
||||
Status = STATUS_SUCCESS;
|
||||
break;
|
||||
}
|
||||
|
||||
// pass irp down
|
||||
IoSkipCurrentIrpStackLocation(Irp);
|
||||
Status = IoCallDriver(UsbChildExtension->ParentDeviceObject, Irp);
|
||||
IoReleaseRemoveLock(&UsbChildExtension->Common.RemoveLock, Irp);
|
||||
return Status;
|
||||
return IoCallDriver(UsbChildExtension->ParentDeviceObject, Irp);
|
||||
}
|
||||
case IRP_MN_SURPRISE_REMOVAL:
|
||||
{
|
||||
DPRINT("[USBHUB] HandlePnp IRP_MN_SURPRISE_REMOVAL\n");
|
||||
|
||||
//
|
||||
// Here we should free all resources and stop all access, lets just set
|
||||
// the flag and do further clean-up in subsequent IRP_MN_REMOVE_DEVICE
|
||||
// We can receive this IRP when device is physically connected (on stop/start fail).
|
||||
//
|
||||
SET_NEW_PNP_STATE(UsbChildExtension->Common, SurpriseRemovePending);
|
||||
|
||||
Status = STATUS_SUCCESS;
|
||||
break;
|
||||
}
|
||||
@@ -853,8 +758,6 @@ USBHUB_PdoHandlePnp(
|
||||
}
|
||||
}
|
||||
|
||||
IoReleaseRemoveLock(&UsbChildExtension->Common.RemoveLock, Irp);
|
||||
|
||||
Irp->IoStatus.Information = Information;
|
||||
Irp->IoStatus.Status = Status;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
|
@@ -62,7 +62,7 @@ USBHUB_AddDevice(
|
||||
PDEVICE_OBJECT DeviceObject;
|
||||
PHUB_DEVICE_EXTENSION HubDeviceExtension;
|
||||
NTSTATUS Status;
|
||||
DPRINT("USBHUB: AddDevice (%p)\n", PhysicalDeviceObject);
|
||||
DPRINT("USBHUB: AddDevice\n");
|
||||
//
|
||||
// Create the Device Object
|
||||
//
|
||||
@@ -86,20 +86,12 @@ USBHUB_AddDevice(
|
||||
HubDeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||
RtlZeroMemory(HubDeviceExtension, sizeof(HUB_DEVICE_EXTENSION));
|
||||
|
||||
INITIALIZE_PNP_STATE(HubDeviceExtension->Common);
|
||||
|
||||
//
|
||||
// Set this to Fdo
|
||||
//
|
||||
HubDeviceExtension->Common.IsFDO = TRUE;
|
||||
DeviceObject->Flags |= DO_POWER_PAGABLE;
|
||||
|
||||
// initialize mutex
|
||||
KeInitializeGuardedMutex(&HubDeviceExtension->HubMutexLock);
|
||||
|
||||
// initialize remove lock
|
||||
IoInitializeRemoveLock(&HubDeviceExtension->Common.RemoveLock, 'buH', 0, 0);
|
||||
|
||||
//
|
||||
// initialize reset complete event
|
||||
//
|
||||
@@ -166,18 +158,6 @@ USBHUB_DispatchDeviceControl(
|
||||
return USBHUB_IrpStub(DeviceObject, Irp);
|
||||
}
|
||||
|
||||
NTSTATUS NTAPI
|
||||
USBHUB_DispatchSystemControl(
|
||||
PDEVICE_OBJECT DeviceObject,
|
||||
PIRP Irp)
|
||||
{
|
||||
DPRINT("Usbhub: DispatchSystemControl\n");
|
||||
if (((PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->Common.IsFDO)
|
||||
return USBHUB_IrpStub(DeviceObject, Irp);
|
||||
else
|
||||
return USBHUB_IrpStub(DeviceObject, Irp);
|
||||
}
|
||||
|
||||
NTSTATUS NTAPI
|
||||
USBHUB_DispatchInternalDeviceControl(
|
||||
PDEVICE_OBJECT DeviceObject,
|
||||
@@ -208,59 +188,37 @@ USBHUB_DispatchPower(
|
||||
PIRP Irp)
|
||||
{
|
||||
PIO_STACK_LOCATION IoStack;
|
||||
PHUB_DEVICE_EXTENSION DeviceExtension;
|
||||
NTSTATUS Status;
|
||||
|
||||
IoStack = IoGetCurrentIrpStackLocation(Irp);
|
||||
DeviceExtension = DeviceObject->DeviceExtension;
|
||||
|
||||
Status = IoAcquireRemoveLock(&DeviceExtension->Common.RemoveLock, Irp);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
Irp->IoStatus.Status = Status;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return Status;
|
||||
}
|
||||
|
||||
DPRINT1("Power Function %x\n", IoStack->MinorFunction);
|
||||
|
||||
if (DeviceExtension->Common.IsFDO)
|
||||
if (IoStack->MinorFunction == IRP_MN_SET_POWER)
|
||||
{
|
||||
PoStartNextPowerIrp(Irp);
|
||||
IoSkipCurrentIrpStackLocation(Irp);
|
||||
Status = PoCallDriver(DeviceExtension->LowerDeviceObject, Irp);
|
||||
IoReleaseRemoveLock(&DeviceExtension->Common.RemoveLock, Irp);
|
||||
return Status;
|
||||
}
|
||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return STATUS_SUCCESS;
|
||||
|
||||
switch (IoStack->MinorFunction)
|
||||
}
|
||||
else if (IoStack->MinorFunction == IRP_MN_QUERY_POWER)
|
||||
{
|
||||
case IRP_MN_SET_POWER:
|
||||
{
|
||||
DPRINT("IRP_MN_SET_POWER\n");
|
||||
break;
|
||||
}
|
||||
case IRP_MN_QUERY_POWER:
|
||||
{
|
||||
DPRINT("IRP_MN_QUERY_POWER\n");
|
||||
break;
|
||||
}
|
||||
case IRP_MN_WAIT_WAKE:
|
||||
{
|
||||
DPRINT("IRP_MN_WAIT_WAKE\n");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
DPRINT1("PDO IRP_MJ_POWER / unknown minor function 0x%lx\n", IoStack->MinorFunction);
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return Irp->IoStatus.Status;
|
||||
}
|
||||
PoStartNextPowerIrp(Irp);
|
||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return STATUS_SUCCESS;
|
||||
|
||||
}
|
||||
else if (IoStack->MinorFunction == IRP_MN_WAIT_WAKE)
|
||||
{
|
||||
PoStartNextPowerIrp(Irp);
|
||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
PoStartNextPowerIrp(Irp);
|
||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
IoReleaseRemoveLock(&DeviceExtension->Common.RemoveLock, Irp);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -287,7 +245,6 @@ DriverEntry(
|
||||
DriverObject->MajorFunction[IRP_MJ_CLOSE] = USBHUB_Close;
|
||||
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = USBHUB_Cleanup;
|
||||
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = USBHUB_DispatchDeviceControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = USBHUB_DispatchSystemControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = USBHUB_DispatchInternalDeviceControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_PNP] = USBHUB_DispatchPnp;
|
||||
DriverObject->MajorFunction[IRP_MJ_POWER] =USBHUB_DispatchPower;
|
||||
|
@@ -39,43 +39,9 @@ typedef struct _WORK_ITEM_DATA
|
||||
PVOID Context;
|
||||
} WORK_ITEM_DATA, *PWORK_ITEM_DATA;
|
||||
|
||||
|
||||
//
|
||||
// Definitions for device's PnP state tracking, all this states are described
|
||||
// in PnP Device States diagram of DDK documentation.
|
||||
//
|
||||
typedef enum _DEVICE_PNP_STATE {
|
||||
|
||||
NotStarted = 0, // Not started
|
||||
Started, // After handling of START_DEVICE IRP
|
||||
StopPending, // After handling of QUERY_STOP IRP
|
||||
Stopped, // After handling of STOP_DEVICE IRP
|
||||
RemovePending, // After handling of QUERY_REMOVE IRP
|
||||
SurpriseRemovePending, // After handling of SURPRISE_REMOVE IRP
|
||||
Deleted, // After handling of REMOVE_DEVICE IRP
|
||||
UnKnown // Unknown state
|
||||
|
||||
} DEVICE_PNP_STATE;
|
||||
|
||||
#define INITIALIZE_PNP_STATE(Data) \
|
||||
(Data).PnPState = NotStarted;\
|
||||
(Data).PreviousPnPState = NotStarted;
|
||||
|
||||
#define SET_NEW_PNP_STATE(Data, state) \
|
||||
(Data).PreviousPnPState = (Data).PnPState;\
|
||||
(Data).PnPState = (state);
|
||||
|
||||
#define RESTORE_PREVIOUS_PNP_STATE(Data) \
|
||||
(Data).PnPState = (Data).PreviousPnPState;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BOOLEAN IsFDO;
|
||||
// We'll track device PnP state via this variables
|
||||
DEVICE_PNP_STATE PnPState;
|
||||
DEVICE_PNP_STATE PreviousPnPState;
|
||||
// Remove lock
|
||||
IO_REMOVE_LOCK RemoveLock;
|
||||
} COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION;
|
||||
|
||||
typedef struct _HUB_CHILDDEVICE_EXTENSION
|
||||
@@ -106,8 +72,6 @@ typedef struct _HUB_DEVICE_EXTENSION
|
||||
PDEVICE_OBJECT RootHubPhysicalDeviceObject;
|
||||
PDEVICE_OBJECT RootHubFunctionalDeviceObject;
|
||||
|
||||
KGUARDED_MUTEX HubMutexLock;
|
||||
|
||||
ULONG NumberOfHubs;
|
||||
KEVENT ResetComplete;
|
||||
|
||||
@@ -130,6 +94,7 @@ typedef struct _HUB_DEVICE_EXTENSION
|
||||
USBD_CONFIGURATION_HANDLE ConfigurationHandle;
|
||||
USBD_PIPE_HANDLE PipeHandle;
|
||||
PVOID RootHubHandle;
|
||||
USB_BUS_INTERFACE_USBDI_V2 DeviceInterface;
|
||||
|
||||
UNICODE_STRING SymbolicLinkName;
|
||||
ULONG InstanceCount;
|
||||
|
@@ -771,6 +771,7 @@ CUSBRequest::BuildIsochronousEndpoint(
|
||||
//
|
||||
// get physical page
|
||||
//
|
||||
*(volatile char *)Buffer; // HACK for CORE-9224
|
||||
Page = MmGetPhysicalAddress(Buffer).LowPart;
|
||||
|
||||
//
|
||||
|
@@ -160,14 +160,9 @@ NTAPI
|
||||
FsRtlIsDbcsInExpression(IN PANSI_STRING Expression,
|
||||
IN PANSI_STRING Name)
|
||||
{
|
||||
USHORT Offset, Position, BackTrackingPosition, OldBackTrackingPosition;
|
||||
USHORT BackTrackingBuffer[16], OldBackTrackingBuffer[16] = {0};
|
||||
PUSHORT BackTrackingSwap, BackTracking = BackTrackingBuffer, OldBackTracking = OldBackTrackingBuffer;
|
||||
USHORT ExpressionPosition, NamePosition = 0, MatchingChars = 1;
|
||||
USHORT NameChar = 0, ExpressionChar;
|
||||
BOOLEAN EndOfName = FALSE;
|
||||
BOOLEAN Result;
|
||||
BOOLEAN DontSkipDot;
|
||||
SHORT StarFound = -1, DosStarFound = -1;
|
||||
PUSHORT BackTracking = NULL, DosBackTracking = NULL;
|
||||
USHORT ExpressionPosition = 0, NamePosition = 0, MatchingChars, LastDot;
|
||||
PAGED_CODE();
|
||||
|
||||
ASSERT(Name->Length);
|
||||
@@ -237,180 +232,170 @@ FsRtlIsDbcsInExpression(IN PANSI_STRING Expression,
|
||||
}
|
||||
}
|
||||
|
||||
/* Name parsing loop */
|
||||
for (; !EndOfName; MatchingChars = BackTrackingPosition)
|
||||
while (NamePosition < Name->Length && ExpressionPosition < Expression->Length)
|
||||
{
|
||||
/* Reset positions */
|
||||
OldBackTrackingPosition = BackTrackingPosition = 0;
|
||||
|
||||
if (NamePosition >= Name->Length)
|
||||
/* Basic check to test if chars are equal */
|
||||
if ((Expression->Buffer[ExpressionPosition] == Name->Buffer[NamePosition]))
|
||||
{
|
||||
EndOfName = TRUE;
|
||||
if (OldBackTracking[MatchingChars - 1] == Expression->Length * 2)
|
||||
break;
|
||||
NamePosition++;
|
||||
ExpressionPosition++;
|
||||
}
|
||||
else
|
||||
/* Check cases that eat one char */
|
||||
else if (Expression->Buffer[ExpressionPosition] == '?')
|
||||
{
|
||||
/* If lead byte present */
|
||||
if (FsRtlIsLeadDbcsCharacter(Name->Buffer[NamePosition]))
|
||||
NamePosition++;
|
||||
ExpressionPosition++;
|
||||
}
|
||||
/* Test star */
|
||||
else if (Expression->Buffer[ExpressionPosition] == '*')
|
||||
{
|
||||
/* Skip contigous stars */
|
||||
while (ExpressionPosition + 1 < Expression->Length && Expression->Buffer[ExpressionPosition + 1] == '*')
|
||||
{
|
||||
NameChar = Name->Buffer[NamePosition] +
|
||||
(0x100 * Name->Buffer[NamePosition + 1]);
|
||||
NamePosition += sizeof(USHORT);
|
||||
ExpressionPosition++;
|
||||
}
|
||||
|
||||
/* Save star position */
|
||||
if (!BackTracking)
|
||||
{
|
||||
BackTracking = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE,
|
||||
Expression->Length * sizeof(USHORT), 'nrSF');
|
||||
}
|
||||
BackTracking[++StarFound] = ExpressionPosition++;
|
||||
|
||||
/* If star is at the end, then eat all rest and leave */
|
||||
if (ExpressionPosition == Expression->Length)
|
||||
{
|
||||
NamePosition = Name->Length;
|
||||
break;
|
||||
}
|
||||
/* Allow null matching */
|
||||
else if (Expression->Buffer[ExpressionPosition] != '?' &&
|
||||
Expression->Buffer[ExpressionPosition] != Name->Buffer[NamePosition])
|
||||
{
|
||||
NamePosition++;
|
||||
}
|
||||
}
|
||||
/* Check DOS_STAR */
|
||||
else if (Expression->Buffer[ExpressionPosition] == ANSI_DOS_STAR)
|
||||
{
|
||||
/* Skip contigous stars */
|
||||
while (ExpressionPosition + 1 < Expression->Length && Expression->Buffer[ExpressionPosition + 1] == ANSI_DOS_STAR)
|
||||
{
|
||||
ExpressionPosition++;
|
||||
}
|
||||
|
||||
/* Look for last dot */
|
||||
MatchingChars = 0;
|
||||
LastDot = (USHORT)-1;
|
||||
while (MatchingChars < Name->Length)
|
||||
{
|
||||
if (Name->Buffer[MatchingChars] == '.')
|
||||
{
|
||||
LastDot = MatchingChars;
|
||||
if (LastDot > NamePosition)
|
||||
break;
|
||||
}
|
||||
|
||||
MatchingChars++;
|
||||
}
|
||||
|
||||
/* If we don't have dots or we didn't find last yet
|
||||
* start eating everything
|
||||
*/
|
||||
if (MatchingChars != Name->Length || LastDot == (USHORT)-1)
|
||||
{
|
||||
if (!DosBackTracking) DosBackTracking = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE,
|
||||
Expression->Length * sizeof(USHORT), 'nrSF');
|
||||
DosBackTracking[++DosStarFound] = ExpressionPosition++;
|
||||
|
||||
/* Not the same char, start exploring */
|
||||
if (Expression->Buffer[ExpressionPosition] != Name->Buffer[NamePosition])
|
||||
NamePosition++;
|
||||
}
|
||||
else
|
||||
{
|
||||
NameChar = Name->Buffer[NamePosition];
|
||||
NamePosition += sizeof(UCHAR);
|
||||
/* Else, if we are at last dot, eat it - otherwise, null match */
|
||||
if (Name->Buffer[NamePosition] == '.')
|
||||
NamePosition++;
|
||||
|
||||
ExpressionPosition++;
|
||||
}
|
||||
}
|
||||
|
||||
while (MatchingChars > OldBackTrackingPosition)
|
||||
/* Check DOS_DOT */
|
||||
else if (Expression->Buffer[ExpressionPosition] == ANSI_DOS_DOT)
|
||||
{
|
||||
ExpressionPosition = (OldBackTracking[OldBackTrackingPosition++] + 1) / 2;
|
||||
|
||||
/* Expression parsing loop */
|
||||
for (Offset = 0; ExpressionPosition < Expression->Length; )
|
||||
/* We only match dots */
|
||||
if (Name->Buffer[NamePosition] == '.')
|
||||
{
|
||||
ExpressionPosition += Offset;
|
||||
NamePosition++;
|
||||
}
|
||||
/* Try to explore later on for null matching */
|
||||
else if (ExpressionPosition + 1 < Expression->Length &&
|
||||
Name->Buffer[NamePosition] == Expression->Buffer[ExpressionPosition + 1])
|
||||
{
|
||||
NamePosition++;
|
||||
}
|
||||
ExpressionPosition++;
|
||||
}
|
||||
/* Check DOS_QM */
|
||||
else if (Expression->Buffer[ExpressionPosition] == ANSI_DOS_QM)
|
||||
{
|
||||
/* We match everything except dots */
|
||||
if (Name->Buffer[NamePosition] != '.')
|
||||
{
|
||||
NamePosition++;
|
||||
}
|
||||
ExpressionPosition++;
|
||||
}
|
||||
/* If nothing match, try to backtrack */
|
||||
else if (StarFound >= 0)
|
||||
{
|
||||
ExpressionPosition = BackTracking[StarFound--];
|
||||
}
|
||||
else if (DosStarFound >= 0)
|
||||
{
|
||||
ExpressionPosition = DosBackTracking[DosStarFound--];
|
||||
}
|
||||
/* Otherwise, fail */
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (ExpressionPosition == Expression->Length)
|
||||
{
|
||||
BackTracking[BackTrackingPosition++] = Expression->Length * 2;
|
||||
break;
|
||||
}
|
||||
|
||||
/* If buffer too small */
|
||||
if (BackTrackingPosition > RTL_NUMBER_OF(BackTrackingBuffer) - 1)
|
||||
{
|
||||
/* Allocate memory for BackTracking */
|
||||
BackTracking = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE,
|
||||
(Expression->Length + 1) * sizeof(USHORT) * 2,
|
||||
'nrSF');
|
||||
/* Copy old buffer content */
|
||||
RtlCopyMemory(BackTracking,
|
||||
BackTrackingBuffer,
|
||||
RTL_NUMBER_OF(BackTrackingBuffer) * sizeof(USHORT));
|
||||
|
||||
/* Allocate memory for OldBackTracking */
|
||||
OldBackTracking = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE,
|
||||
(Expression->Length + 1) * sizeof(USHORT) * 2,
|
||||
'nrSF');
|
||||
/* Copy old buffer content */
|
||||
RtlCopyMemory(OldBackTracking,
|
||||
OldBackTrackingBuffer,
|
||||
RTL_NUMBER_OF(OldBackTrackingBuffer) * sizeof(USHORT));
|
||||
}
|
||||
|
||||
/* If lead byte present */
|
||||
if (FsRtlIsLeadDbcsCharacter(Expression->Buffer[ExpressionPosition]))
|
||||
{
|
||||
ExpressionChar = Expression->Buffer[ExpressionPosition] +
|
||||
(0x100 * Expression->Buffer[ExpressionPosition + 1]);
|
||||
Offset = sizeof(USHORT);
|
||||
}
|
||||
else
|
||||
{
|
||||
ExpressionChar = Expression->Buffer[ExpressionPosition];
|
||||
Offset = sizeof(UCHAR);
|
||||
}
|
||||
|
||||
/* Basic check to test if chars are equal */
|
||||
if (ExpressionChar == NameChar && !EndOfName)
|
||||
{
|
||||
BackTracking[BackTrackingPosition++] = (ExpressionPosition + Offset) * 2;
|
||||
}
|
||||
/* Check cases that eat one char */
|
||||
else if (ExpressionChar == '?' && !EndOfName)
|
||||
{
|
||||
BackTracking[BackTrackingPosition++] = (ExpressionPosition + Offset) * 2;
|
||||
}
|
||||
/* Test star */
|
||||
else if (ExpressionChar == '*')
|
||||
{
|
||||
BackTracking[BackTrackingPosition++] = ExpressionPosition * 2;
|
||||
BackTracking[BackTrackingPosition++] = (ExpressionPosition * 2) + 1;
|
||||
continue;
|
||||
}
|
||||
/* Check DOS_STAR */
|
||||
else if (ExpressionChar == ANSI_DOS_STAR)
|
||||
{
|
||||
/* Look for last dot */
|
||||
DontSkipDot = TRUE;
|
||||
if (!EndOfName && NameChar == '.')
|
||||
{
|
||||
for (Position = NamePosition; Position < Name->Length; )
|
||||
{
|
||||
/* If lead byte not present */
|
||||
if (!FsRtlIsLeadDbcsCharacter(Name->Buffer[Position]))
|
||||
{
|
||||
if (Name->Buffer[Position] == '.')
|
||||
{
|
||||
DontSkipDot = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
Position += sizeof(UCHAR);
|
||||
}
|
||||
else
|
||||
{
|
||||
Position += sizeof(USHORT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (EndOfName || NameChar != '.' || !DontSkipDot)
|
||||
BackTracking[BackTrackingPosition++] = ExpressionPosition * 2;
|
||||
|
||||
BackTracking[BackTrackingPosition++] = (ExpressionPosition * 2) + 1;
|
||||
continue;
|
||||
}
|
||||
/* Check DOS_DOT */
|
||||
else if (ExpressionChar == DOS_DOT)
|
||||
{
|
||||
if (EndOfName) continue;
|
||||
|
||||
if (NameChar == '.')
|
||||
BackTracking[BackTrackingPosition++] = (ExpressionPosition + Offset) * 2;
|
||||
}
|
||||
/* Check DOS_QM */
|
||||
else if (ExpressionChar == ANSI_DOS_QM)
|
||||
{
|
||||
if (EndOfName || NameChar == '.') continue;
|
||||
|
||||
BackTracking[BackTrackingPosition++] = (ExpressionPosition + Offset) * 2;
|
||||
}
|
||||
|
||||
/* Leave from loop */
|
||||
/* Under certain circumstances, expression is over, but name isn't
|
||||
* and we can backtrack, then, backtrack */
|
||||
if (ExpressionPosition == Expression->Length &&
|
||||
NamePosition != Name->Length && StarFound >= 0)
|
||||
{
|
||||
ExpressionPosition = BackTracking[StarFound--];
|
||||
}
|
||||
}
|
||||
/* If we have nullable matching wc at the end of the string, eat them */
|
||||
if (ExpressionPosition != Expression->Length && NamePosition == Name->Length)
|
||||
{
|
||||
while (ExpressionPosition < Expression->Length)
|
||||
{
|
||||
if (Expression->Buffer[ExpressionPosition] != ANSI_DOS_DOT &&
|
||||
Expression->Buffer[ExpressionPosition] != '*' &&
|
||||
Expression->Buffer[ExpressionPosition] != ANSI_DOS_STAR)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
for (Position = 0; MatchingChars > OldBackTrackingPosition && Position < BackTrackingPosition; Position++)
|
||||
{
|
||||
while (MatchingChars > OldBackTrackingPosition &&
|
||||
BackTracking[Position] > OldBackTracking[OldBackTrackingPosition])
|
||||
{
|
||||
++OldBackTrackingPosition;
|
||||
}
|
||||
}
|
||||
ExpressionPosition++;
|
||||
}
|
||||
|
||||
/* Swap pointers */
|
||||
BackTrackingSwap = BackTracking;
|
||||
BackTracking = OldBackTracking;
|
||||
OldBackTracking = BackTrackingSwap;
|
||||
}
|
||||
|
||||
/* Store result value */
|
||||
Result = (OldBackTracking[MatchingChars - 1] == Expression->Length * 2);
|
||||
|
||||
/* Frees the memory if necessary */
|
||||
if (BackTracking != BackTrackingBuffer && BackTracking != OldBackTrackingBuffer)
|
||||
if (BackTracking)
|
||||
{
|
||||
ExFreePoolWithTag(BackTracking, 'nrSF');
|
||||
if (OldBackTracking != BackTrackingBuffer && OldBackTracking != OldBackTrackingBuffer)
|
||||
ExFreePoolWithTag(OldBackTracking, 'nrSF');
|
||||
}
|
||||
if (DosBackTracking)
|
||||
{
|
||||
ExFreePoolWithTag(DosBackTracking, 'nrSF');
|
||||
}
|
||||
|
||||
return Result;
|
||||
return (ExpressionPosition == Expression->Length && NamePosition == Name->Length);
|
||||
}
|
||||
|
||||
/*++
|
||||
|
@@ -23,14 +23,13 @@ FsRtlIsNameInExpressionPrivate(IN PUNICODE_STRING Expression,
|
||||
IN BOOLEAN IgnoreCase,
|
||||
IN PWCHAR UpcaseTable OPTIONAL)
|
||||
{
|
||||
USHORT Offset, Position, BackTrackingPosition, OldBackTrackingPosition;
|
||||
USHORT BackTrackingBuffer[16], OldBackTrackingBuffer[16] = {0};
|
||||
PUSHORT BackTrackingSwap, BackTracking = BackTrackingBuffer, OldBackTracking = OldBackTrackingBuffer;
|
||||
SHORT StarFound = -1, DosStarFound = -1;
|
||||
USHORT BackTrackingBuffer[5], DosBackTrackingBuffer[5];
|
||||
PUSHORT BackTracking = BackTrackingBuffer, DosBackTracking = DosBackTrackingBuffer;
|
||||
SHORT BackTrackingSize = RTL_NUMBER_OF(BackTrackingBuffer);
|
||||
SHORT DosBackTrackingSize = RTL_NUMBER_OF(DosBackTrackingBuffer);
|
||||
UNICODE_STRING IntExpression;
|
||||
USHORT ExpressionPosition, NamePosition = 0, MatchingChars = 1;
|
||||
BOOLEAN EndOfName = FALSE;
|
||||
BOOLEAN Result;
|
||||
BOOLEAN DontSkipDot;
|
||||
USHORT ExpressionPosition = 0, NamePosition = 0, MatchingChars, LastDot;
|
||||
WCHAR CompareChar;
|
||||
PAGED_CODE();
|
||||
|
||||
@@ -38,7 +37,7 @@ FsRtlIsNameInExpressionPrivate(IN PUNICODE_STRING Expression,
|
||||
if (!Name->Length || !Expression->Length)
|
||||
{
|
||||
/* Return TRUE if both strings are empty, otherwise FALSE */
|
||||
if (!Name->Length && !Expression->Length)
|
||||
if (Name->Length == 0 && Expression->Length == 0)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
@@ -104,144 +103,193 @@ FsRtlIsNameInExpressionPrivate(IN PUNICODE_STRING Expression,
|
||||
}
|
||||
}
|
||||
|
||||
/* Name parsing loop */
|
||||
for (; !EndOfName; MatchingChars = BackTrackingPosition, NamePosition++)
|
||||
while ((NamePosition < Name->Length / sizeof(WCHAR)) &&
|
||||
(ExpressionPosition < Expression->Length / sizeof(WCHAR)))
|
||||
{
|
||||
/* Reset positions */
|
||||
OldBackTrackingPosition = BackTrackingPosition = 0;
|
||||
|
||||
if (NamePosition >= Name->Length / sizeof(WCHAR))
|
||||
/* Basic check to test if chars are equal */
|
||||
CompareChar = IgnoreCase ? UpcaseTable[Name->Buffer[NamePosition]] :
|
||||
Name->Buffer[NamePosition];
|
||||
if (Expression->Buffer[ExpressionPosition] == CompareChar)
|
||||
{
|
||||
EndOfName = TRUE;
|
||||
if (OldBackTracking[MatchingChars - 1] == Expression->Length * 2)
|
||||
break;
|
||||
NamePosition++;
|
||||
ExpressionPosition++;
|
||||
}
|
||||
|
||||
while (MatchingChars > OldBackTrackingPosition)
|
||||
/* Check cases that eat one char */
|
||||
else if (Expression->Buffer[ExpressionPosition] == L'?')
|
||||
{
|
||||
ExpressionPosition = (OldBackTracking[OldBackTrackingPosition++] + 1) / 2;
|
||||
|
||||
/* Expression parsing loop */
|
||||
for (Offset = 0; ExpressionPosition < Expression->Length; Offset = sizeof(WCHAR))
|
||||
NamePosition++;
|
||||
ExpressionPosition++;
|
||||
}
|
||||
/* Test star */
|
||||
else if (Expression->Buffer[ExpressionPosition] == L'*')
|
||||
{
|
||||
/* Skip contigous stars */
|
||||
while ((ExpressionPosition + 1 < (USHORT)(Expression->Length / sizeof(WCHAR))) &&
|
||||
(Expression->Buffer[ExpressionPosition + 1] == L'*'))
|
||||
{
|
||||
ExpressionPosition += Offset;
|
||||
ExpressionPosition++;
|
||||
}
|
||||
|
||||
if (ExpressionPosition == Expression->Length)
|
||||
/* Save star position */
|
||||
StarFound++;
|
||||
if (StarFound >= BackTrackingSize)
|
||||
{
|
||||
ASSERT(BackTracking == BackTrackingBuffer);
|
||||
|
||||
BackTrackingSize = Expression->Length / sizeof(WCHAR);
|
||||
BackTracking = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE,
|
||||
BackTrackingSize * sizeof(USHORT),
|
||||
'nrSF');
|
||||
RtlCopyMemory(BackTracking, BackTrackingBuffer, sizeof(BackTrackingBuffer));
|
||||
|
||||
}
|
||||
BackTracking[StarFound] = ExpressionPosition++;
|
||||
|
||||
/* If star is at the end, then eat all rest and leave */
|
||||
if (ExpressionPosition == Expression->Length / sizeof(WCHAR))
|
||||
{
|
||||
NamePosition = Name->Length / sizeof(WCHAR);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Allow null matching */
|
||||
if (Expression->Buffer[ExpressionPosition] != L'?' &&
|
||||
Expression->Buffer[ExpressionPosition] != Name->Buffer[NamePosition])
|
||||
{
|
||||
NamePosition++;
|
||||
}
|
||||
}
|
||||
/* Check DOS_STAR */
|
||||
else if (Expression->Buffer[ExpressionPosition] == DOS_STAR)
|
||||
{
|
||||
/* Skip contigous stars */
|
||||
while ((ExpressionPosition + 1 < (USHORT)(Expression->Length / sizeof(WCHAR))) &&
|
||||
(Expression->Buffer[ExpressionPosition + 1] == DOS_STAR))
|
||||
{
|
||||
ExpressionPosition++;
|
||||
}
|
||||
|
||||
/* Look for last dot */
|
||||
MatchingChars = 0;
|
||||
LastDot = (USHORT)-1;
|
||||
while (MatchingChars < Name->Length / sizeof(WCHAR))
|
||||
{
|
||||
if (Name->Buffer[MatchingChars] == L'.')
|
||||
{
|
||||
BackTracking[BackTrackingPosition++] = Expression->Length * 2;
|
||||
break;
|
||||
LastDot = MatchingChars;
|
||||
if (LastDot > NamePosition)
|
||||
break;
|
||||
}
|
||||
|
||||
/* If buffer too small */
|
||||
if (BackTrackingPosition > RTL_NUMBER_OF(BackTrackingBuffer) - 1)
|
||||
{
|
||||
/* Allocate memory for BackTracking */
|
||||
BackTracking = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE,
|
||||
(Expression->Length + sizeof(WCHAR)) * sizeof(USHORT),
|
||||
'nrSF');
|
||||
/* Copy old buffer content */
|
||||
RtlCopyMemory(BackTracking,
|
||||
BackTrackingBuffer,
|
||||
RTL_NUMBER_OF(BackTrackingBuffer) * sizeof(USHORT));
|
||||
MatchingChars++;
|
||||
}
|
||||
|
||||
/* Allocate memory for OldBackTracking */
|
||||
OldBackTracking = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE,
|
||||
(Expression->Length + sizeof(WCHAR)) * sizeof(USHORT),
|
||||
/* If we don't have dots or we didn't find last yet
|
||||
* start eating everything
|
||||
*/
|
||||
if (MatchingChars != Name->Length || LastDot == (USHORT)-1)
|
||||
{
|
||||
DosStarFound++;
|
||||
if (DosStarFound >= DosBackTrackingSize)
|
||||
{
|
||||
ASSERT(DosBackTracking == DosBackTrackingBuffer);
|
||||
|
||||
DosBackTrackingSize = Expression->Length / sizeof(WCHAR);
|
||||
DosBackTracking = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE,
|
||||
DosBackTrackingSize * sizeof(USHORT),
|
||||
'nrSF');
|
||||
/* Copy old buffer content */
|
||||
RtlCopyMemory(OldBackTracking,
|
||||
OldBackTrackingBuffer,
|
||||
RTL_NUMBER_OF(OldBackTrackingBuffer) * sizeof(USHORT));
|
||||
RtlCopyMemory(DosBackTracking, DosBackTrackingBuffer, sizeof(DosBackTrackingBuffer));
|
||||
}
|
||||
DosBackTracking[DosStarFound] = ExpressionPosition++;
|
||||
|
||||
/* Basic check to test if chars are equal */
|
||||
CompareChar = IgnoreCase ? UpcaseTable[Name->Buffer[NamePosition]] :
|
||||
Name->Buffer[NamePosition];
|
||||
if (Expression->Buffer[ExpressionPosition / sizeof(WCHAR)] == CompareChar && !EndOfName)
|
||||
{
|
||||
BackTracking[BackTrackingPosition++] = (ExpressionPosition + sizeof(WCHAR)) * 2;
|
||||
}
|
||||
/* Check cases that eat one char */
|
||||
else if (Expression->Buffer[ExpressionPosition / sizeof(WCHAR)] == L'?' && !EndOfName)
|
||||
{
|
||||
BackTracking[BackTrackingPosition++] = (ExpressionPosition + sizeof(WCHAR)) * 2;
|
||||
}
|
||||
/* Test star */
|
||||
else if (Expression->Buffer[ExpressionPosition / sizeof(WCHAR)] == L'*')
|
||||
{
|
||||
BackTracking[BackTrackingPosition++] = ExpressionPosition * 2;
|
||||
BackTracking[BackTrackingPosition++] = (ExpressionPosition * 2) + 3;
|
||||
continue;
|
||||
}
|
||||
/* Check DOS_STAR */
|
||||
else if (Expression->Buffer[ExpressionPosition / sizeof(WCHAR)] == DOS_STAR)
|
||||
{
|
||||
/* Look for last dot */
|
||||
DontSkipDot = TRUE;
|
||||
if (!EndOfName && Name->Buffer[NamePosition] == '.')
|
||||
{
|
||||
for (Position = NamePosition - 1; Position < Name->Length; Position++)
|
||||
{
|
||||
if (Name->Buffer[Position] == L'.')
|
||||
{
|
||||
DontSkipDot = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (EndOfName || Name->Buffer[NamePosition] != L'.' || !DontSkipDot)
|
||||
BackTracking[BackTrackingPosition++] = ExpressionPosition * 2;
|
||||
|
||||
BackTracking[BackTrackingPosition++] = (ExpressionPosition * 2) + 3;
|
||||
continue;
|
||||
}
|
||||
/* Check DOS_DOT */
|
||||
else if (Expression->Buffer[ExpressionPosition / sizeof(WCHAR)] == DOS_DOT)
|
||||
{
|
||||
if (EndOfName) continue;
|
||||
|
||||
if (Name->Buffer[NamePosition] == L'.')
|
||||
BackTracking[BackTrackingPosition++] = (ExpressionPosition + sizeof(WCHAR)) * 2;
|
||||
}
|
||||
/* Check DOS_QM */
|
||||
else if (Expression->Buffer[ExpressionPosition / sizeof(WCHAR)] == DOS_QM)
|
||||
{
|
||||
if (EndOfName || Name->Buffer[NamePosition] == L'.') continue;
|
||||
|
||||
BackTracking[BackTrackingPosition++] = (ExpressionPosition + sizeof(WCHAR)) * 2;
|
||||
}
|
||||
|
||||
/* Leave from loop */
|
||||
break;
|
||||
/* Not the same char, start exploring */
|
||||
if (Expression->Buffer[ExpressionPosition] != Name->Buffer[NamePosition])
|
||||
NamePosition++;
|
||||
}
|
||||
|
||||
for (Position = 0; MatchingChars > OldBackTrackingPosition && Position < BackTrackingPosition; Position++)
|
||||
else
|
||||
{
|
||||
while (MatchingChars > OldBackTrackingPosition &&
|
||||
BackTracking[Position] > OldBackTracking[OldBackTrackingPosition])
|
||||
{
|
||||
++OldBackTrackingPosition;
|
||||
}
|
||||
/* Else, if we are at last dot, eat it - otherwise, null match */
|
||||
if (Name->Buffer[NamePosition] == '.')
|
||||
NamePosition++;
|
||||
|
||||
ExpressionPosition++;
|
||||
}
|
||||
}
|
||||
/* Check DOS_DOT */
|
||||
else if (Expression->Buffer[ExpressionPosition] == DOS_DOT)
|
||||
{
|
||||
/* We only match dots */
|
||||
if (Name->Buffer[NamePosition] == L'.')
|
||||
{
|
||||
NamePosition++;
|
||||
}
|
||||
/* Try to explore later on for null matching */
|
||||
else if ((ExpressionPosition + 1 < (USHORT)(Expression->Length / sizeof(WCHAR))) &&
|
||||
(Name->Buffer[NamePosition] == Expression->Buffer[ExpressionPosition + 1]))
|
||||
{
|
||||
NamePosition++;
|
||||
}
|
||||
ExpressionPosition++;
|
||||
}
|
||||
/* Check DOS_QM */
|
||||
else if (Expression->Buffer[ExpressionPosition] == DOS_QM)
|
||||
{
|
||||
/* We match everything except dots */
|
||||
if (Name->Buffer[NamePosition] != L'.')
|
||||
{
|
||||
NamePosition++;
|
||||
}
|
||||
ExpressionPosition++;
|
||||
}
|
||||
/* If nothing match, try to backtrack */
|
||||
else if (StarFound >= 0)
|
||||
{
|
||||
ExpressionPosition = BackTracking[StarFound--];
|
||||
}
|
||||
else if (DosStarFound >= 0)
|
||||
{
|
||||
ExpressionPosition = DosBackTracking[DosStarFound--];
|
||||
}
|
||||
/* Otherwise, fail */
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/* Swap pointers */
|
||||
BackTrackingSwap = BackTracking;
|
||||
BackTracking = OldBackTracking;
|
||||
OldBackTracking = BackTrackingSwap;
|
||||
/* Under certain circumstances, expression is over, but name isn't
|
||||
* and we can backtrack, then, backtrack */
|
||||
if (ExpressionPosition == Expression->Length / sizeof(WCHAR) &&
|
||||
NamePosition != Name->Length / sizeof(WCHAR) &&
|
||||
StarFound >= 0)
|
||||
{
|
||||
ExpressionPosition = BackTracking[StarFound--];
|
||||
}
|
||||
}
|
||||
/* If we have nullable matching wc at the end of the string, eat them */
|
||||
if (ExpressionPosition != Expression->Length / sizeof(WCHAR) && NamePosition == Name->Length / sizeof(WCHAR))
|
||||
{
|
||||
while (ExpressionPosition < Expression->Length / sizeof(WCHAR))
|
||||
{
|
||||
if (Expression->Buffer[ExpressionPosition] != DOS_DOT &&
|
||||
Expression->Buffer[ExpressionPosition] != L'*' &&
|
||||
Expression->Buffer[ExpressionPosition] != DOS_STAR)
|
||||
{
|
||||
break;
|
||||
}
|
||||
ExpressionPosition++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Store result value */
|
||||
Result = (OldBackTracking[MatchingChars - 1] == (Expression->Length * 2));
|
||||
|
||||
/* Frees the memory if necessary */
|
||||
if (BackTracking != BackTrackingBuffer && BackTracking != OldBackTrackingBuffer)
|
||||
if (BackTracking != BackTrackingBuffer)
|
||||
{
|
||||
ExFreePoolWithTag(BackTracking, 'nrSF');
|
||||
if (OldBackTracking != BackTrackingBuffer && OldBackTracking != OldBackTrackingBuffer)
|
||||
ExFreePoolWithTag(OldBackTracking, 'nrSF');
|
||||
}
|
||||
if (DosBackTracking != DosBackTrackingBuffer)
|
||||
{
|
||||
ExFreePoolWithTag(DosBackTracking, 'nrSF');
|
||||
}
|
||||
|
||||
return Result;
|
||||
return (ExpressionPosition == Expression->Length / sizeof(WCHAR) && NamePosition == Name->Length / sizeof(WCHAR));
|
||||
}
|
||||
|
||||
/* PUBLIC FUNCTIONS **********************************************************/
|
||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 730 B After Width: | Height: | Size: 730 B |
Before Width: | Height: | Size: 886 B After Width: | Height: | Size: 886 B |
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 154 B |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 154 B |
@@ -318,7 +318,7 @@ function(add_cd_file)
|
||||
set_property(GLOBAL APPEND PROPERTY BOOTCD_FILE_LIST "${_CD_DESTINATION}/${__file}=${item}")
|
||||
# add it also into the hybridcd if not specified otherwise
|
||||
if(NOT _CD_NOT_IN_HYBRIDCD)
|
||||
set_property(GLOBAL APPEND PROPERTY HYBRIDCD_FILE_LIST "bootcd/${_CD_DESTINATION}/${__file}=${item}")
|
||||
set_property(GLOBAL APPEND PROPERTY HYBRIDCD_FILE_LIST "setup/${_CD_DESTINATION}/${__file}=${item}")
|
||||
endif()
|
||||
endforeach()
|
||||
# manage dependency
|
||||
@@ -357,7 +357,7 @@ function(add_cd_file)
|
||||
set_property(GLOBAL APPEND PROPERTY LIVECD_FILE_LIST "${_CD_DESTINATION}/${__file}=${item}")
|
||||
# add it also into the hybridcd if not specified otherwise
|
||||
if(NOT _CD_NOT_IN_HYBRIDCD)
|
||||
set_property(GLOBAL APPEND PROPERTY HYBRIDCD_FILE_LIST "livecd/${_CD_DESTINATION}/${__file}=${item}")
|
||||
set_property(GLOBAL APPEND PROPERTY HYBRIDCD_FILE_LIST "${_CD_DESTINATION}/${__file}=${item}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif() #end livecd
|
||||
@@ -437,7 +437,7 @@ function(create_iso_lists)
|
||||
|
||||
add_cd_file(
|
||||
FILE ${CMAKE_CURRENT_BINARY_DIR}/livecd.iso
|
||||
DESTINATION livecd
|
||||
DESTINATION root
|
||||
FOR hybridcd)
|
||||
|
||||
get_property(_filelist GLOBAL PROPERTY BOOTCD_FILE_LIST)
|
||||
|
@@ -4,11 +4,11 @@ Copyright (c) Alex Ionescu. All rights reserved.
|
||||
|
||||
Header Name:
|
||||
|
||||
ketypes.h
|
||||
lpctypes.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Type definitions for the Kernel services.
|
||||
Type definitions for the Loader.
|
||||
|
||||
Author:
|
||||
|
||||
|
@@ -8,7 +8,7 @@ Header Name:
|
||||
|
||||
Abstract:
|
||||
|
||||
Function definitions for the Local Procedure Call.
|
||||
Function definitions for the Executive.
|
||||
|
||||
Author:
|
||||
|
||||
@@ -23,7 +23,6 @@ Author:
|
||||
// Dependencies
|
||||
//
|
||||
#include <umtypes.h>
|
||||
#include <lpctypes.h>
|
||||
|
||||
//
|
||||
// LPC Exports
|
||||
|
@@ -8,7 +8,7 @@ Header Name:
|
||||
|
||||
Abstract:
|
||||
|
||||
Type definitions for the Local Procedure Call.
|
||||
Type definitions for the Loader.
|
||||
|
||||
Author:
|
||||
|
||||
|
@@ -4,11 +4,11 @@ Copyright (c) Alex Ionescu. All rights reserved.
|
||||
|
||||
Header Name:
|
||||
|
||||
obfuncs.h
|
||||
obtypes.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Function definitions for the Object Manager
|
||||
Type definitions for the Object Manager
|
||||
|
||||
Author:
|
||||
|
||||
|
@@ -17,15 +17,15 @@ endmacro()
|
||||
string(TIMESTAMP KERNEL_VERSION_BUILD %Y%m%d UTC)
|
||||
|
||||
set(KERNEL_VERSION_MAJOR "0")
|
||||
set(KERNEL_VERSION_MINOR "5")
|
||||
set(KERNEL_VERSION_PATCH_LEVEL "0")
|
||||
set(KERNEL_VERSION_MINOR "4")
|
||||
set(KERNEL_VERSION_PATCH_LEVEL "4")
|
||||
set(COPYRIGHT_YEAR "2017")
|
||||
|
||||
# KERNEL_VERSION_BUILD_TYPE is "SVN" or "" (for the release)
|
||||
set(KERNEL_VERSION_BUILD_TYPE "SVN")
|
||||
set(KERNEL_VERSION_BUILD_TYPE "")
|
||||
|
||||
# KERNEL_VERSION_RELEASE_TYPE is "RC1", "RC2" or "" (for the final one)
|
||||
set(KERNEL_VERSION_RELEASE_TYPE "")
|
||||
set(KERNEL_VERSION_RELEASE_TYPE "FOSDEM2017RC")
|
||||
|
||||
set(KERNEL_VERSION "${KERNEL_VERSION_MAJOR}.${KERNEL_VERSION_MINOR}")
|
||||
if(KERNEL_VERSION_PATCH_LEVEL)
|
||||
|
2
reactos/sdk/lib/3rdparty/libwine/debug.c
vendored
@@ -424,7 +424,7 @@ static int default_dbg_vlog( enum __wine_debug_class cls, struct __wine_debug_ch
|
||||
if (cls < sizeof(debug_classes)/sizeof(debug_classes[0]))
|
||||
ret += wine_dbg_printf( "%s:", debug_classes[cls] );
|
||||
|
||||
if (file && line)
|
||||
if (file && line)
|
||||
ret += wine_dbg_printf ( "(%s:%d) ", file, line );
|
||||
else
|
||||
ret += wine_dbg_printf( "%s:%s: ", channel->name, func );
|
||||
|
@@ -163,7 +163,7 @@ HidParser_StoreCollection(
|
||||
//
|
||||
// store offset
|
||||
//
|
||||
TargetCollection->Offsets[Collection->ReportCount + Index] = CurrentOffset;
|
||||
TargetCollection->Offsets[Collection->NodeCount + Index] = CurrentOffset;
|
||||
|
||||
//
|
||||
// store sub collections
|
||||
@@ -254,7 +254,7 @@ HidParser_SearchReportInCollection(
|
||||
//
|
||||
// get collection
|
||||
//
|
||||
SubCollection = (PHID_COLLECTION)(CollectionContext->RawData + Collection->Offsets[Collection->ReportCount + Index]);
|
||||
SubCollection = (PHID_COLLECTION)(CollectionContext->RawData + Collection->Offsets[Collection->NodeCount + Index]);
|
||||
|
||||
//
|
||||
// recursively search collection
|
||||
@@ -314,7 +314,7 @@ HidParser_GetCollectionCount(
|
||||
//
|
||||
// get offset to sub collection
|
||||
//
|
||||
SubCollection = (PHID_COLLECTION)(CollectionContext->RawData + Collection->Offsets[Collection->ReportCount + Index]);
|
||||
SubCollection = (PHID_COLLECTION)(CollectionContext->RawData + Collection->Offsets[Collection->NodeCount + Index]);
|
||||
|
||||
//
|
||||
// count collection for sub nodes
|
||||
|
@@ -68,7 +68,7 @@ HidParser_GetCollectionDescription(
|
||||
// failed to parse report descriptor
|
||||
//
|
||||
Parser->Debug("[HIDPARSER] Failed to parse report descriptor with %x\n", ParserStatus);
|
||||
return ParserStatus;
|
||||
return TranslateHidParserStatus(ParserStatus);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -126,9 +126,7 @@ HidParser_GetCollectionDescription(
|
||||
//
|
||||
// no memory
|
||||
//
|
||||
Parser->Free(DeviceDescription->CollectionDesc);
|
||||
Parser->Free(DeviceDescription->ReportIDs);
|
||||
return ParserStatus;
|
||||
return TranslateHidParserStatus(ParserStatus);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -155,13 +153,6 @@ HidParser_GetCollectionDescription(
|
||||
// get collection usage page
|
||||
//
|
||||
ParserStatus = HidParser_GetCollectionUsagePage((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, &DeviceDescription->CollectionDesc[Index].Usage, &DeviceDescription->CollectionDesc[Index].UsagePage);
|
||||
if (ParserStatus != HIDPARSER_STATUS_SUCCESS)
|
||||
{
|
||||
// collection not found
|
||||
Parser->Free(DeviceDescription->CollectionDesc);
|
||||
Parser->Free(DeviceDescription->ReportIDs);
|
||||
return ParserStatus;
|
||||
}
|
||||
|
||||
//
|
||||
// windows seems to prepend the report id, regardless if it is required
|
||||
|
@@ -713,6 +713,30 @@ HidParser_AddMainItem(
|
||||
return HIDPARSER_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
HIDPARSER_STATUS
|
||||
AllocateParserContext(
|
||||
IN PHID_PARSER Parser,
|
||||
OUT PHID_PARSER_CONTEXT *OutParserContext)
|
||||
{
|
||||
PHID_PARSER_CONTEXT ParserContext;
|
||||
|
||||
ParserContext = Parser->Alloc(sizeof(HID_PARSER_CONTEXT));
|
||||
if (!ParserContext)
|
||||
{
|
||||
//
|
||||
// failed
|
||||
//
|
||||
return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
//
|
||||
// store result
|
||||
//
|
||||
*OutParserContext = ParserContext;
|
||||
return HIDPARSER_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
HIDPARSER_STATUS
|
||||
HidParser_ParseReportDescriptor(
|
||||
IN PHID_PARSER Parser,
|
||||
@@ -736,18 +760,12 @@ HidParser_ParseReportDescriptor(
|
||||
PMAIN_ITEM_DATA MainItemData;
|
||||
PHID_PARSER_CONTEXT ParserContext;
|
||||
|
||||
CurrentOffset = ReportDescriptor;
|
||||
ReportEnd = ReportDescriptor + ReportLength;
|
||||
|
||||
if (ReportDescriptor >= ReportEnd)
|
||||
return HIDPARSER_STATUS_COLLECTION_NOT_FOUND;
|
||||
|
||||
//
|
||||
// allocate parser
|
||||
//
|
||||
ParserContext = Parser->Alloc(sizeof(HID_PARSER_CONTEXT));;
|
||||
if (!ParserContext)
|
||||
return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES;
|
||||
Status = AllocateParserContext(Parser, &ParserContext);
|
||||
if (Status != HIDPARSER_STATUS_SUCCESS)
|
||||
return Status;
|
||||
|
||||
|
||||
//
|
||||
@@ -760,7 +778,6 @@ HidParser_ParseReportDescriptor(
|
||||
//
|
||||
// no memory
|
||||
//
|
||||
Parser->Free(ParserContext);
|
||||
return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
@@ -775,7 +792,6 @@ HidParser_ParseReportDescriptor(
|
||||
//
|
||||
Parser->Free(ParserContext->LocalItemState.UsageStack);
|
||||
ParserContext->LocalItemState.UsageStack = NULL;
|
||||
Parser->Free(ParserContext);
|
||||
return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
@@ -783,6 +799,8 @@ HidParser_ParseReportDescriptor(
|
||||
// start parsing
|
||||
//
|
||||
CurrentCollection = ParserContext->RootCollection;
|
||||
CurrentOffset = ReportDescriptor;
|
||||
ReportEnd = ReportDescriptor + ReportLength;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -1212,7 +1230,8 @@ HidParser_ParseReportDescriptor(
|
||||
//
|
||||
CurrentOffset += CurrentItemSize + sizeof(ITEM_PREFIX);
|
||||
|
||||
}while (CurrentOffset < ReportEnd);
|
||||
|
||||
}while(CurrentOffset < ReportEnd);
|
||||
|
||||
|
||||
//
|
||||
|
@@ -568,8 +568,7 @@ CHubController::HandlePnp(
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Here we should leave Status as is.
|
||||
Status = Irp->IoStatus.Status;
|
||||
Status = STATUS_SUCCESS;
|
||||
break;
|
||||
}
|
||||
case IRP_MN_QUERY_CAPABILITIES:
|
||||
@@ -612,14 +611,6 @@ CHubController::HandlePnp(
|
||||
// handle device interface requests
|
||||
//
|
||||
Status = HandleQueryInterface(IoStack);
|
||||
|
||||
//
|
||||
// If a bus driver does not export the requested interface, it
|
||||
// should leave Status as is.
|
||||
//
|
||||
if (Status == STATUS_NOT_SUPPORTED)
|
||||
Status = Irp->IoStatus.Status;
|
||||
|
||||
break;
|
||||
}
|
||||
case IRP_MN_REMOVE_DEVICE:
|
||||
@@ -3745,7 +3736,6 @@ CHubController::HandleQueryInterface(
|
||||
InterfaceHub->SetDeviceHandleData = USBHI_SetDeviceHandleData;
|
||||
}
|
||||
|
||||
InterfaceHub->InterfaceReference(InterfaceHub->BusContext);
|
||||
//
|
||||
// request completed
|
||||
//
|
||||
@@ -3800,7 +3790,6 @@ CHubController::HandleQueryInterface(
|
||||
InterfaceDI->EnumLogEntry = USBDI_EnumLogEntry;
|
||||
}
|
||||
|
||||
InterfaceDI->InterfaceReference(InterfaceDI->BusContext);
|
||||
//
|
||||
// request completed
|
||||
//
|
||||
|
@@ -17,7 +17,7 @@
|
||||
#include "asmxtras.inc"
|
||||
#include <isvbop.inc>
|
||||
|
||||
// #define NDEBUG
|
||||
#define NDEBUG
|
||||
|
||||
/* DEFINES ********************************************************************/
|
||||
|
||||
|
@@ -30,6 +30,132 @@ InitDeviceImpl(VOID)
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
EngpPopulateDeviceModeList(
|
||||
_Inout_ PGRAPHICS_DEVICE pGraphicsDevice,
|
||||
_In_ PDEVMODEW pdmDefault)
|
||||
{
|
||||
PWSTR pwsz;
|
||||
PLDEVOBJ pldev;
|
||||
PDEVMODEINFO pdminfo;
|
||||
PDEVMODEW pdm, pdmEnd;
|
||||
ULONG i, cModes = 0;
|
||||
BOOLEAN bModeMatch = FALSE;
|
||||
|
||||
ASSERT(pGraphicsDevice->pdevmodeInfo == NULL);
|
||||
ASSERT(pGraphicsDevice->pDevModeList == NULL);
|
||||
|
||||
pwsz = pGraphicsDevice->pDiplayDrivers;
|
||||
|
||||
/* Loop through the driver names
|
||||
* This is a REG_MULTI_SZ string */
|
||||
for (; *pwsz; pwsz += wcslen(pwsz) + 1)
|
||||
{
|
||||
TRACE("trying driver: %ls\n", pwsz);
|
||||
/* Try to load the display driver */
|
||||
pldev = EngLoadImageEx(pwsz, LDEV_DEVICE_DISPLAY);
|
||||
if (!pldev)
|
||||
{
|
||||
ERR("Could not load driver: '%ls'\n", pwsz);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Get the mode list from the driver */
|
||||
pdminfo = LDEVOBJ_pdmiGetModes(pldev, pGraphicsDevice->DeviceObject);
|
||||
if (!pdminfo)
|
||||
{
|
||||
ERR("Could not get mode list for '%ls'\n", pwsz);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Attach the mode info to the device */
|
||||
pdminfo->pdmiNext = pGraphicsDevice->pdevmodeInfo;
|
||||
pGraphicsDevice->pdevmodeInfo = pdminfo;
|
||||
|
||||
/* Loop all DEVMODEs */
|
||||
pdmEnd = (DEVMODEW*)((PCHAR)pdminfo->adevmode + pdminfo->cbdevmode);
|
||||
for (pdm = pdminfo->adevmode;
|
||||
(pdm + 1 <= pdmEnd) && (pdm->dmSize != 0);
|
||||
pdm = (DEVMODEW*)((PCHAR)pdm + pdm->dmSize + pdm->dmDriverExtra))
|
||||
{
|
||||
/* Count this DEVMODE */
|
||||
cModes++;
|
||||
|
||||
/* Some drivers like the VBox driver don't fill the dmDeviceName
|
||||
with the name of the display driver. So fix that here. */
|
||||
wcsncpy(pdm->dmDeviceName, pwsz, CCHDEVICENAME);
|
||||
pdm->dmDeviceName[CCHDEVICENAME - 1] = 0;
|
||||
}
|
||||
|
||||
// FIXME: release the driver again until it's used?
|
||||
}
|
||||
|
||||
if (!pGraphicsDevice->pdevmodeInfo || cModes == 0)
|
||||
{
|
||||
ERR("No devmodes\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Allocate an index buffer */
|
||||
pGraphicsDevice->cDevModes = cModes;
|
||||
pGraphicsDevice->pDevModeList = ExAllocatePoolWithTag(PagedPool,
|
||||
cModes * sizeof(DEVMODEENTRY),
|
||||
GDITAG_GDEVICE);
|
||||
if (!pGraphicsDevice->pDevModeList)
|
||||
{
|
||||
ERR("No devmode list\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
TRACE("Looking for mode %lux%lux%lu(%lu Hz)\n",
|
||||
pdmDefault->dmPelsWidth,
|
||||
pdmDefault->dmPelsHeight,
|
||||
pdmDefault->dmBitsPerPel,
|
||||
pdmDefault->dmDisplayFrequency);
|
||||
|
||||
/* Loop through all DEVMODEINFOs */
|
||||
for (pdminfo = pGraphicsDevice->pdevmodeInfo, i = 0;
|
||||
pdminfo;
|
||||
pdminfo = pdminfo->pdmiNext)
|
||||
{
|
||||
/* Calculate End of the DEVMODEs */
|
||||
pdmEnd = (DEVMODEW*)((PCHAR)pdminfo->adevmode + pdminfo->cbdevmode);
|
||||
|
||||
/* Loop through the DEVMODEs */
|
||||
for (pdm = pdminfo->adevmode;
|
||||
(pdm + 1 <= pdmEnd) && (pdm->dmSize != 0);
|
||||
pdm = (PDEVMODEW)((PCHAR)pdm + pdm->dmSize + pdm->dmDriverExtra))
|
||||
{
|
||||
TRACE(" %S has mode %lux%lux%lu(%lu Hz)\n",
|
||||
pdm->dmDeviceName,
|
||||
pdm->dmPelsWidth,
|
||||
pdm->dmPelsHeight,
|
||||
pdm->dmBitsPerPel,
|
||||
pdm->dmDisplayFrequency);
|
||||
/* Compare with the default entry */
|
||||
if (!bModeMatch &&
|
||||
pdm->dmBitsPerPel == pdmDefault->dmBitsPerPel &&
|
||||
pdm->dmPelsWidth == pdmDefault->dmPelsWidth &&
|
||||
pdm->dmPelsHeight == pdmDefault->dmPelsHeight)
|
||||
{
|
||||
pGraphicsDevice->iDefaultMode = i;
|
||||
pGraphicsDevice->iCurrentMode = i;
|
||||
TRACE("Found default entry: %lu '%ls'\n", i, pdm->dmDeviceName);
|
||||
if (pdm->dmDisplayFrequency == pdmDefault->dmDisplayFrequency)
|
||||
{
|
||||
/* Uh oh, even the display frequency matches. */
|
||||
bModeMatch = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialize the entry */
|
||||
pGraphicsDevice->pDevModeList[i].dwFlags = 0;
|
||||
pGraphicsDevice->pDevModeList[i].pdm = pdm;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PGRAPHICS_DEVICE
|
||||
NTAPI
|
||||
@@ -44,13 +170,9 @@ EngpRegisterGraphicsDevice(
|
||||
PFILE_OBJECT pFileObject;
|
||||
NTSTATUS Status;
|
||||
PWSTR pwsz;
|
||||
ULONG i, cj, cModes = 0;
|
||||
ULONG cj;
|
||||
SIZE_T cjWritten;
|
||||
BOOL bEnable = TRUE;
|
||||
PDEVMODEINFO pdminfo;
|
||||
PDEVMODEW pdm, pdmEnd;
|
||||
PLDEVOBJ pldev;
|
||||
BOOLEAN bModeMatch = FALSE;
|
||||
|
||||
TRACE("EngpRegisterGraphicsDevice(%wZ)\n", pustrDeviceName);
|
||||
|
||||
@@ -124,116 +246,14 @@ EngpRegisterGraphicsDevice(
|
||||
// FIXME: initialize state flags
|
||||
pGraphicsDevice->StateFlags = 0;
|
||||
|
||||
/* Loop through the driver names
|
||||
* This is a REG_MULTI_SZ string */
|
||||
for (; *pwsz; pwsz += wcslen(pwsz) + 1)
|
||||
/* Create the mode list */
|
||||
pGraphicsDevice->pDevModeList = NULL;
|
||||
if (!EngpPopulateDeviceModeList(pGraphicsDevice, pdmDefault))
|
||||
{
|
||||
TRACE("trying driver: %ls\n", pwsz);
|
||||
/* Try to load the display driver */
|
||||
pldev = EngLoadImageEx(pwsz, LDEV_DEVICE_DISPLAY);
|
||||
if (!pldev)
|
||||
{
|
||||
ERR("Could not load driver: '%ls'\n", pwsz);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Get the mode list from the driver */
|
||||
pdminfo = LDEVOBJ_pdmiGetModes(pldev, pDeviceObject);
|
||||
if (!pdminfo)
|
||||
{
|
||||
ERR("Could not get mode list for '%ls'\n", pwsz);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Attach the mode info to the device */
|
||||
pdminfo->pdmiNext = pGraphicsDevice->pdevmodeInfo;
|
||||
pGraphicsDevice->pdevmodeInfo = pdminfo;
|
||||
|
||||
/* Loop all DEVMODEs */
|
||||
pdmEnd = (DEVMODEW*)((PCHAR)pdminfo->adevmode + pdminfo->cbdevmode);
|
||||
for (pdm = pdminfo->adevmode;
|
||||
(pdm + 1 <= pdmEnd) && (pdm->dmSize != 0);
|
||||
pdm = (DEVMODEW*)((PCHAR)pdm + pdm->dmSize + pdm->dmDriverExtra))
|
||||
{
|
||||
/* Count this DEVMODE */
|
||||
cModes++;
|
||||
|
||||
/* Some drivers like the VBox driver don't fill the dmDeviceName
|
||||
with the name of the display driver. So fix that here. */
|
||||
wcsncpy(pdm->dmDeviceName, pwsz, CCHDEVICENAME);
|
||||
pdm->dmDeviceName[CCHDEVICENAME - 1] = 0;
|
||||
}
|
||||
|
||||
// FIXME: release the driver again until it's used?
|
||||
}
|
||||
|
||||
if (!pGraphicsDevice->pdevmodeInfo || cModes == 0)
|
||||
{
|
||||
ERR("No devmodes\n");
|
||||
ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Allocate an index buffer */
|
||||
pGraphicsDevice->cDevModes = cModes;
|
||||
pGraphicsDevice->pDevModeList = ExAllocatePoolWithTag(PagedPool,
|
||||
cModes * sizeof(DEVMODEENTRY),
|
||||
GDITAG_GDEVICE);
|
||||
if (!pGraphicsDevice->pDevModeList)
|
||||
{
|
||||
ERR("No devmode list\n");
|
||||
ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TRACE("Looking for mode %lux%lux%lu(%lu Hz)\n",
|
||||
pdmDefault->dmPelsWidth,
|
||||
pdmDefault->dmPelsHeight,
|
||||
pdmDefault->dmBitsPerPel,
|
||||
pdmDefault->dmDisplayFrequency);
|
||||
|
||||
/* Loop through all DEVMODEINFOs */
|
||||
for (pdminfo = pGraphicsDevice->pdevmodeInfo, i = 0;
|
||||
pdminfo;
|
||||
pdminfo = pdminfo->pdmiNext)
|
||||
{
|
||||
/* Calculate End of the DEVMODEs */
|
||||
pdmEnd = (DEVMODEW*)((PCHAR)pdminfo->adevmode + pdminfo->cbdevmode);
|
||||
|
||||
/* Loop through the DEVMODEs */
|
||||
for (pdm = pdminfo->adevmode;
|
||||
(pdm + 1 <= pdmEnd) && (pdm->dmSize != 0);
|
||||
pdm = (PDEVMODEW)((PCHAR)pdm + pdm->dmSize + pdm->dmDriverExtra))
|
||||
{
|
||||
TRACE(" %S has mode %lux%lux%lu(%lu Hz)\n",
|
||||
pdm->dmDeviceName,
|
||||
pdm->dmPelsWidth,
|
||||
pdm->dmPelsHeight,
|
||||
pdm->dmBitsPerPel,
|
||||
pdm->dmDisplayFrequency);
|
||||
/* Compare with the default entry */
|
||||
if (!bModeMatch &&
|
||||
pdm->dmBitsPerPel == pdmDefault->dmBitsPerPel &&
|
||||
pdm->dmPelsWidth == pdmDefault->dmPelsWidth &&
|
||||
pdm->dmPelsHeight == pdmDefault->dmPelsHeight)
|
||||
{
|
||||
pGraphicsDevice->iDefaultMode = i;
|
||||
pGraphicsDevice->iCurrentMode = i;
|
||||
TRACE("Found default entry: %lu '%ls'\n", i, pdm->dmDeviceName);
|
||||
if (pdm->dmDisplayFrequency == pdmDefault->dmDisplayFrequency)
|
||||
{
|
||||
/* Uh oh, even the display frequency matches. */
|
||||
bModeMatch = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialize the entry */
|
||||
pGraphicsDevice->pDevModeList[i].dwFlags = 0;
|
||||
pGraphicsDevice->pDevModeList[i].pdm = pdm;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Lock loader */
|
||||
EngAcquireSemaphore(ghsemGraphicsDeviceList);
|
||||
|
||||
@@ -250,7 +270,7 @@ EngpRegisterGraphicsDevice(
|
||||
|
||||
/* Unlock loader */
|
||||
EngReleaseSemaphore(ghsemGraphicsDeviceList);
|
||||
TRACE("Prepared %lu modes for %ls\n", cModes, pGraphicsDevice->pwszDescription);
|
||||
TRACE("Prepared %lu modes for %ls\n", pGraphicsDevice->cDevModes, pGraphicsDevice->pwszDescription);
|
||||
|
||||
return pGraphicsDevice;
|
||||
}
|
||||
|
@@ -3,6 +3,11 @@
|
||||
|
||||
#define TAG_GDEV 'gdev'
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
PDEVOBJ_vRefreshModeList(
|
||||
PPDEVOBJ ppdev);
|
||||
|
||||
extern PGRAPHICS_DEVICE gpPrimaryGraphicsDevice;
|
||||
extern PGRAPHICS_DEVICE gpVgaGraphicsDevice;
|
||||
|
||||
@@ -29,6 +34,11 @@ EngpRegisterGraphicsDevice(
|
||||
_In_ PUNICODE_STRING pustrDescription,
|
||||
_In_ PDEVMODEW pdmDefault);
|
||||
|
||||
BOOLEAN
|
||||
EngpPopulateDeviceModeList(
|
||||
_Inout_ PGRAPHICS_DEVICE pGraphicsDevice,
|
||||
_In_ PDEVMODEW pdmDefault);
|
||||
|
||||
INIT_FUNCTION
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
|
@@ -251,6 +251,45 @@ PDEVOBJ_pSurface(
|
||||
return ppdev->pSurface;
|
||||
}
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
PDEVOBJ_vRefreshModeList(
|
||||
PPDEVOBJ ppdev)
|
||||
{
|
||||
PGRAPHICS_DEVICE pGraphicsDevice;
|
||||
PDEVMODEINFO pdminfo, pdmiNext;
|
||||
DEVMODEW dmDefault;
|
||||
|
||||
/* Lock the PDEV */
|
||||
EngAcquireSemaphore(ppdev->hsemDevLock);
|
||||
|
||||
pGraphicsDevice = ppdev->pGraphicsDevice;
|
||||
|
||||
/* Remember our default mode */
|
||||
dmDefault = *pGraphicsDevice->pDevModeList[pGraphicsDevice->iDefaultMode].pdm;
|
||||
|
||||
/* Clear out the modes */
|
||||
for (pdminfo = pGraphicsDevice->pdevmodeInfo;
|
||||
pdminfo;
|
||||
pdminfo = pdmiNext)
|
||||
{
|
||||
pdmiNext = pdminfo->pdmiNext;
|
||||
ExFreePoolWithTag(pdminfo, GDITAG_DEVMODE);
|
||||
}
|
||||
pGraphicsDevice->pdevmodeInfo = NULL;
|
||||
ExFreePoolWithTag(pGraphicsDevice->pDevModeList, GDITAG_GDEVICE);
|
||||
pGraphicsDevice->pDevModeList = NULL;
|
||||
|
||||
/* Now re-populate the list */
|
||||
if (!EngpPopulateDeviceModeList(pGraphicsDevice, &dmDefault))
|
||||
{
|
||||
DPRINT1("FIXME: EngpPopulateDeviceModeList failed, we just destroyed a perfectly good mode list\n");
|
||||
}
|
||||
|
||||
/* Unlock PDEV */
|
||||
EngReleaseSemaphore(ppdev->hsemDevLock);
|
||||
}
|
||||
|
||||
PDEVMODEW
|
||||
NTAPI
|
||||
PDEVOBJ_pdmMatchDevMode(
|
||||
|
@@ -463,20 +463,28 @@ UserEnumDisplaySettings(
|
||||
PGRAPHICS_DEVICE pGraphicsDevice;
|
||||
PDEVMODEENTRY pdmentry;
|
||||
ULONG i, iFoundMode;
|
||||
PPDEVOBJ ppdev;
|
||||
|
||||
TRACE("Enter UserEnumDisplaySettings('%wZ', %lu)\n",
|
||||
pustrDevice, iModeNum);
|
||||
|
||||
/* Ask GDI for the GRAPHICS_DEVICE */
|
||||
pGraphicsDevice = EngpFindGraphicsDevice(pustrDevice, 0, 0);
|
||||
ppdev = EngpGetPDEV(pustrDevice);
|
||||
|
||||
if (!pGraphicsDevice)
|
||||
if (!pGraphicsDevice || !ppdev)
|
||||
{
|
||||
/* No device found */
|
||||
ERR("No device found!\n");
|
||||
return STATUS_INVALID_PARAMETER_1;
|
||||
}
|
||||
|
||||
/* let's politely ask the driver for an updated mode list,
|
||||
just in case there's something new in there (vbox) */
|
||||
|
||||
PDEVOBJ_vRefreshModeList(ppdev);
|
||||
PDEVOBJ_vRelease(ppdev);
|
||||
|
||||
iFoundMode = 0;
|
||||
for (i = 0; i < pGraphicsDevice->cDevModes; i++)
|
||||
{
|
||||
|
@@ -1464,20 +1464,15 @@ IntCallWindowProcW(BOOL IsAnsiProc,
|
||||
|
||||
if (PreResult) goto Exit;
|
||||
|
||||
if (!Dialog)
|
||||
Result = CALL_EXTERN_WNDPROC(WndProc, AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam);
|
||||
else
|
||||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
Result = CALL_EXTERN_WNDPROC(WndProc, AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam);
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
ERR("Exception Dialog Ansi %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti);
|
||||
ERR("Exception when calling Ansi WndProc %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti);
|
||||
}
|
||||
_SEH2_END;
|
||||
}
|
||||
|
||||
if (Hook && MsgOverride)
|
||||
{
|
||||
@@ -1518,20 +1513,15 @@ IntCallWindowProcW(BOOL IsAnsiProc,
|
||||
|
||||
if (PreResult) goto Exit;
|
||||
|
||||
if (!Dialog)
|
||||
Result = CALL_EXTERN_WNDPROC(WndProc, hWnd, Msg, wParam, lParam);
|
||||
else
|
||||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
Result = CALL_EXTERN_WNDPROC(WndProc, hWnd, Msg, wParam, lParam);
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
ERR("Exception Dialog unicode %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti);
|
||||
ERR("Exception when calling unicode WndProc %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti);
|
||||
}
|
||||
_SEH2_END;
|
||||
}
|
||||
|
||||
if (Hook && MsgOverride)
|
||||
{
|
||||
@@ -1611,20 +1601,15 @@ IntCallWindowProcA(BOOL IsAnsiProc,
|
||||
|
||||
if (PreResult) goto Exit;
|
||||
|
||||
if (!Dialog)
|
||||
Result = CALL_EXTERN_WNDPROC(WndProc, hWnd, Msg, wParam, lParam);
|
||||
else
|
||||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
Result = CALL_EXTERN_WNDPROC(WndProc, hWnd, Msg, wParam, lParam);
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
ERR("Exception Dialog Ansi %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti);
|
||||
ERR("Exception when calling Ansi WndProc %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti);
|
||||
}
|
||||
_SEH2_END;
|
||||
}
|
||||
|
||||
if (Hook && MsgOverride)
|
||||
{
|
||||
@@ -1672,20 +1657,15 @@ IntCallWindowProcA(BOOL IsAnsiProc,
|
||||
|
||||
if (PreResult) goto Exit;
|
||||
|
||||
if (!Dialog)
|
||||
Result = CALL_EXTERN_WNDPROC(WndProc, UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam);
|
||||
else
|
||||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
Result = CALL_EXTERN_WNDPROC(WndProc, UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam);
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
ERR("Exception Dialog unicode %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti);
|
||||
ERR("Exception when calling unicode WndProc %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti);
|
||||
}
|
||||
_SEH2_END;
|
||||
}
|
||||
|
||||
if (Hook && MsgOverride)
|
||||
{
|
||||
|
@@ -21,7 +21,7 @@ add_subdirectory(winetests)
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/testdata/)
|
||||
file(GLOB_RECURSE TESTDATA_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/testdata/ ${CMAKE_CURRENT_SOURCE_DIR}/testdata/*)
|
||||
foreach(item ${TESTDATA_FILES})
|
||||
add_rostests_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/testdata/${item} SUBDIR testdata)
|
||||
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/testdata/${item} DESTINATION reactos/bin/testdata NAME_ON_CD ${item} FOR all)
|
||||
endforeach(item)
|
||||
endif()
|
||||
|
||||
|
@@ -26,7 +26,6 @@ add_subdirectory(powrprof)
|
||||
add_subdirectory(sdk)
|
||||
add_subdirectory(setupapi)
|
||||
add_subdirectory(shell32)
|
||||
add_subdirectory(shlwapi)
|
||||
add_subdirectory(spoolss)
|
||||
add_subdirectory(psapi)
|
||||
add_subdirectory(user32)
|
||||
|
@@ -22,4 +22,4 @@ add_executable(advapi32_apitest ${SOURCE})
|
||||
target_link_libraries(advapi32_apitest wine ${PSEH_LIB})
|
||||
set_module_type(advapi32_apitest win32cui)
|
||||
add_importlibs(advapi32_apitest advapi32 msvcrt kernel32 ntdll)
|
||||
add_rostests_file(TARGET advapi32_apitest)
|
||||
add_cd_file(TARGET advapi32_apitest DESTINATION reactos/bin FOR all)
|
||||
|
@@ -11,4 +11,4 @@ list(APPEND SOURCE
|
||||
add_executable(apphelp_apitest ${SOURCE})
|
||||
set_module_type(apphelp_apitest win32cui)
|
||||
add_importlibs(apphelp_apitest advapi32 userenv version shlwapi msvcrt kernel32 ntdll)
|
||||
add_rostests_file(TARGET apphelp_apitest)
|
||||
add_cd_file(TARGET apphelp_apitest DESTINATION reactos/bin FOR all)
|
||||
|
@@ -9,4 +9,4 @@ list(APPEND SOURCE
|
||||
add_executable(appshim_apitest ${SOURCE})
|
||||
set_module_type(appshim_apitest win32cui)
|
||||
add_importlibs(appshim_apitest version msvcrt kernel32 ntdll)
|
||||
add_rostests_file(TARGET appshim_apitest)
|
||||
add_cd_file(TARGET appshim_apitest DESTINATION reactos/bin FOR all)
|
||||
|
@@ -20,4 +20,4 @@ add_executable(atl_apitest
|
||||
target_link_libraries(atl_apitest wine uuid)
|
||||
set_module_type(atl_apitest win32cui)
|
||||
add_importlibs(atl_apitest rpcrt4 ole32 oleaut32 msimg32 gdi32 advapi32 user32 msvcrt kernel32 ntdll)
|
||||
add_rostests_file(TARGET atl_apitest)
|
||||
add_cd_file(TARGET atl_apitest DESTINATION reactos/bin FOR all)
|
||||
|
@@ -18,4 +18,4 @@ add_executable(browseui_apitest ${SOURCE})
|
||||
target_link_libraries(browseui_apitest uuid wine)
|
||||
set_module_type(browseui_apitest win32cui)
|
||||
add_importlibs(browseui_apitest shell32 ole32 shlwapi msvcrt kernel32 ntdll)
|
||||
add_rostests_file(TARGET browseui_apitest)
|
||||
add_cd_file(TARGET browseui_apitest DESTINATION reactos/bin FOR all)
|
||||
|
@@ -16,4 +16,4 @@ add_executable(com_apitest ${SOURCE})
|
||||
target_link_libraries(com_apitest wine uuid)
|
||||
set_module_type(com_apitest win32cui)
|
||||
add_importlibs(com_apitest advapi32 ole32 shlwapi shell32 msvcrt kernel32 ntdll)
|
||||
add_rostests_file(TARGET com_apitest)
|
||||
add_cd_file(TARGET com_apitest DESTINATION reactos/bin FOR all)
|
||||
|
@@ -557,4 +557,4 @@ add_target_compile_definitions(crtdll_crt_apitest TEST_CRTDLL)
|
||||
target_link_libraries(crtdll_crt_apitest wine ${PSEH_LIB})
|
||||
set_module_type(crtdll_crt_apitest win32cui)
|
||||
add_importlibs(crtdll_crt_apitest crtdll msvcrt kernel32 ntdll)
|
||||
add_rostests_file(TARGET crtdll_crt_apitest)
|
||||
add_cd_file(TARGET crtdll_crt_apitest DESTINATION reactos/bin FOR all)
|
||||
|
@@ -1378,7 +1378,7 @@ endif()
|
||||
#target_link_libraries(static_crt_apitest ${PSEH_LIB} crt wine)
|
||||
#set_module_type(static_crt_apitest win32cui)
|
||||
#add_importlibs(static_crt_apitest kernel32 ntdll)
|
||||
#add_rostests_file(TARGET static_crt_apitest)
|
||||
#add_cd_file(TARGET static_crt_apitest DESTINATION reactos/bin FOR all)
|
||||
|
||||
#spec2def(static_crt_dll_startup.dll dll_startup.spec)
|
||||
#add_library(static_crt_dll_startup SHARED
|
||||
@@ -1387,14 +1387,14 @@ endif()
|
||||
#target_link_libraries(static_crt_dll_startup crt)
|
||||
#set_module_type(static_crt_dll_startup win32dll)
|
||||
#add_importlibs(static_crt_dll_startup kernel32 ntdll)
|
||||
#add_rostests_file(TARGET static_crt_dll_startup)
|
||||
#add_cd_file(TARGET static_crt_dll_startup DESTINATION reactos/bin FOR all)
|
||||
|
||||
add_executable(msvcrt_crt_apitest testlist.c ${SOURCE_MSVCRT})
|
||||
add_target_compile_definitions(msvcrt_crt_apitest TEST_MSVCRT)
|
||||
target_link_libraries(msvcrt_crt_apitest wine ${PSEH_LIB})
|
||||
set_module_type(msvcrt_crt_apitest win32cui)
|
||||
add_importlibs(msvcrt_crt_apitest msvcrt kernel32 ntdll)
|
||||
add_rostests_file(TARGET msvcrt_crt_apitest)
|
||||
add_cd_file(TARGET msvcrt_crt_apitest DESTINATION reactos/bin FOR all)
|
||||
|
||||
spec2def(msvcrt_crt_dll_startup.dll dll_startup.spec)
|
||||
add_library(msvcrt_crt_dll_startup SHARED
|
||||
@@ -1402,4 +1402,4 @@ add_library(msvcrt_crt_dll_startup SHARED
|
||||
${CMAKE_CURRENT_BINARY_DIR}/msvcrt_crt_dll_startup.def)
|
||||
set_module_type(msvcrt_crt_dll_startup win32dll)
|
||||
add_importlibs(msvcrt_crt_dll_startup msvcrt kernel32 ntdll)
|
||||
add_rostests_file(TARGET msvcrt_crt_dll_startup)
|
||||
add_cd_file(TARGET msvcrt_crt_dll_startup DESTINATION reactos/bin FOR all)
|
||||
|
@@ -156,4 +156,4 @@ add_target_compile_definitions(ntdll_crt_apitest TEST_NTDLL)
|
||||
target_link_libraries(ntdll_crt_apitest wine ${PSEH_LIB})
|
||||
set_module_type(ntdll_crt_apitest win32cui)
|
||||
add_importlibs(ntdll_crt_apitest ntdll msvcrt kernel32)
|
||||
add_rostests_file(TARGET ntdll_crt_apitest)
|
||||
add_cd_file(TARGET ntdll_crt_apitest DESTINATION reactos/bin FOR all)
|
||||
|
@@ -4,4 +4,4 @@ add_executable(dciman32_apitest DCICreatePrimary.c testlist.c)
|
||||
target_link_libraries(dciman32_apitest wine)
|
||||
set_module_type(dciman32_apitest win32cui)
|
||||
add_importlibs(dciman32_apitest msvcrt kernel32 ntdll)
|
||||
add_rostests_file(TARGET dciman32_apitest)
|
||||
add_cd_file(TARGET dciman32_apitest DESTINATION reactos/bin FOR all)
|
||||
|
@@ -7,4 +7,4 @@ add_executable(dnsapi_apitest ${SOURCE})
|
||||
target_link_libraries(dnsapi_apitest wine)
|
||||
set_module_type(dnsapi_apitest win32cui)
|
||||
add_importlibs(dnsapi_apitest ws2_32 dnsapi iphlpapi msvcrt kernel32 ntdll)
|
||||
add_rostests_file(TARGET dnsapi_apitest)
|
||||
add_cd_file(TARGET dnsapi_apitest DESTINATION reactos/bin FOR all)
|
||||
|
@@ -13,4 +13,4 @@ list(APPEND SOURCE
|
||||
add_executable(fltlib_apitest ${SOURCE})
|
||||
set_module_type(fltlib_apitest win32cui)
|
||||
add_importlibs(fltlib_apitest user32 msvcrt kernel32)
|
||||
add_rostests_file(TARGET fltlib_apitest)
|
||||
add_cd_file(TARGET fltlib_apitest DESTINATION reactos/bin FOR all)
|
||||
|
@@ -77,4 +77,4 @@ add_executable(gdi32_apitest ${SOURCE} resource.rc)
|
||||
target_link_libraries(gdi32_apitest ${PSEH_LIB} win32ksys)
|
||||
set_module_type(gdi32_apitest win32cui)
|
||||
add_importlibs(gdi32_apitest gdi32 user32 msvcrt kernel32 ntdll)
|
||||
add_rostests_file(TARGET gdi32_apitest)
|
||||
add_cd_file(TARGET gdi32_apitest DESTINATION reactos/bin FOR all)
|
||||
|
@@ -9,4 +9,4 @@ add_executable(iphlpapi_apitest ${SOURCE})
|
||||
target_link_libraries(iphlpapi_apitest wine ${PSEH_LIB})
|
||||
set_module_type(iphlpapi_apitest win32cui)
|
||||
add_importlibs(iphlpapi_apitest iphlpapi advapi32 msvcrt kernel32 ntdll)
|
||||
add_rostests_file(TARGET iphlpapi_apitest)
|
||||
add_cd_file(TARGET iphlpapi_apitest DESTINATION reactos/bin FOR all)
|
||||
|
@@ -1,8 +1,5 @@
|
||||
|
||||
add_subdirectory(redirptest)
|
||||
|
||||
list(APPEND SOURCE
|
||||
DefaultActCtx.c
|
||||
dosdev.c
|
||||
FindActCtxSectionStringW.c
|
||||
FindFiles.c
|
||||
@@ -11,7 +8,6 @@ list(APPEND SOURCE
|
||||
GetDriveType.c
|
||||
GetModuleFileName.c
|
||||
interlck.c
|
||||
LoadLibraryExW.c
|
||||
lstrcpynW.c
|
||||
MultiByteToWideChar.c
|
||||
PrivMoveFileIdentityW.c
|
||||
@@ -29,7 +25,7 @@ target_link_libraries(kernel32_apitest wine ${PSEH_LIB})
|
||||
set_module_type(kernel32_apitest win32cui)
|
||||
add_delay_importlibs(kernel32_apitest advapi32 shlwapi)
|
||||
add_importlibs(kernel32_apitest msvcrt kernel32 ntdll)
|
||||
add_rostests_file(TARGET kernel32_apitest)
|
||||
add_cd_file(TARGET kernel32_apitest DESTINATION reactos/bin FOR all)
|
||||
|
||||
list(APPEND MANIFEST_FILES
|
||||
classtest.manifest
|
||||
@@ -38,5 +34,5 @@ list(APPEND MANIFEST_FILES
|
||||
deptest.manifest)
|
||||
|
||||
foreach(item ${MANIFEST_FILES})
|
||||
add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/${item}")
|
||||
add_cd_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/${item}" DESTINATION reactos/bin FOR all)
|
||||
endforeach(item)
|
||||
|
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
* Test for the default activation context that is active in every process.
|
||||
*
|
||||
* Copyright 2017 Giannis Adamopoulos
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "wine/test.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winerror.h"
|
||||
|
||||
START_TEST(DefaultActCtx)
|
||||
{
|
||||
DWORD buffer[256];
|
||||
BOOL res;
|
||||
PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION details = (PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION)buffer;
|
||||
PACTIVATION_CONTEXT_DETAILED_INFORMATION info = (PACTIVATION_CONTEXT_DETAILED_INFORMATION)buffer;
|
||||
HANDLE h;
|
||||
DWORD i;
|
||||
ACTCTX_SECTION_KEYED_DATA KeyedData = { 0 };
|
||||
|
||||
res = QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX,
|
||||
NULL,
|
||||
NULL,
|
||||
ActivationContextDetailedInformation,
|
||||
&buffer,
|
||||
sizeof(buffer),
|
||||
NULL);
|
||||
ok(res == TRUE, "Expected success\n");
|
||||
if(res)
|
||||
{
|
||||
ok(info->lpRootManifestPath == NULL, "Expected null lpRootManifestPath, got %S\n", info->lpRootManifestPath);
|
||||
ok(info->lpRootConfigurationPath == NULL, "Expected null lpRootConfigurationPath, got %S\n", info->lpRootConfigurationPath);
|
||||
ok(info->lpAppDirPath == NULL, "Expected null lpAppDirPath, got %S\n", info->lpAppDirPath);
|
||||
ok(info->ulAssemblyCount == 0, "Expected 0 assemblies\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
skip("ActivationContextDetailedInformation failed\n");
|
||||
}
|
||||
|
||||
|
||||
i = 0;
|
||||
res = QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX,
|
||||
NULL,
|
||||
&i,
|
||||
AssemblyDetailedInformationInActivationContext,
|
||||
&buffer,
|
||||
sizeof(buffer),
|
||||
NULL);
|
||||
ok(res == TRUE, "Expected success\n");
|
||||
if (res)
|
||||
{
|
||||
ok(details->lpAssemblyEncodedAssemblyIdentity == NULL, "Expected null lpAssemblyEncodedAssemblyIdentity, got %S\n", details->lpAssemblyEncodedAssemblyIdentity);
|
||||
ok(details->lpAssemblyManifestPath == NULL, "Expected null lpAssemblyManifestPath, got %S\n", details->lpAssemblyManifestPath);
|
||||
ok(details->lpAssemblyPolicyPath == NULL, "Expected null lpAssemblyPolicyPath, got %S\n", details->lpAssemblyPolicyPath);
|
||||
ok(details->lpAssemblyDirectoryName == NULL, "Expected null lpAssemblyDirectoryName, got %S\n", details->lpAssemblyDirectoryName);
|
||||
}
|
||||
else
|
||||
{
|
||||
skip("AssemblyDetailedInformationInActivationContext failed\n");
|
||||
}
|
||||
|
||||
i = 1;
|
||||
res = QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX,
|
||||
NULL,
|
||||
&i,
|
||||
AssemblyDetailedInformationInActivationContext,
|
||||
&buffer,
|
||||
sizeof(buffer),
|
||||
NULL);
|
||||
ok(res == TRUE, "Expected success\n"); /* This is FALSE in win10 */
|
||||
if (res)
|
||||
{
|
||||
ok(details->lpAssemblyEncodedAssemblyIdentity == NULL, "Expected null lpAssemblyEncodedAssemblyIdentity, got %S\n", details->lpAssemblyEncodedAssemblyIdentity);
|
||||
ok(details->lpAssemblyManifestPath == NULL, "Expected null lpAssemblyManifestPath, got %S\n", details->lpAssemblyManifestPath);
|
||||
ok(details->lpAssemblyPolicyPath == NULL, "Expected null lpAssemblyPolicyPath, got %S\n", details->lpAssemblyPolicyPath);
|
||||
ok(details->lpAssemblyDirectoryName == NULL, "Expected null lpAssemblyDirectoryName, got %S\n", details->lpAssemblyDirectoryName);
|
||||
}
|
||||
else
|
||||
{
|
||||
skip("AssemblyDetailedInformationInActivationContext failed\n");
|
||||
}
|
||||
|
||||
res = GetCurrentActCtx (&h);
|
||||
ok(res == TRUE, "Expected success\n");
|
||||
ok(h == NULL, "Expected null current context\n");
|
||||
|
||||
KeyedData.cbSize = sizeof(KeyedData);
|
||||
res = FindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX,
|
||||
NULL,
|
||||
ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION,
|
||||
L"Microsoft.Windows.SysyemCompatible",
|
||||
&KeyedData);
|
||||
ok(res == FALSE, "Expected failure\n");
|
||||
|
||||
KeyedData.cbSize = sizeof(KeyedData);
|
||||
res = FindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX,
|
||||
NULL,
|
||||
ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION,
|
||||
L"System Default Context",
|
||||
&KeyedData);
|
||||
ok(res == FALSE, "Expected failure\n");
|
||||
|
||||
KeyedData.cbSize = sizeof(KeyedData);
|
||||
res = FindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX,
|
||||
NULL,
|
||||
ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION,
|
||||
L"Microsoft.Windows.Common-Controls",
|
||||
&KeyedData);
|
||||
ok(res == TRUE, "Expected success\n");
|
||||
if (res)
|
||||
{
|
||||
ok(KeyedData.hActCtx == NULL, "Expected null handle for common control context\n");
|
||||
ok(KeyedData.ulAssemblyRosterIndex != 0, "%lu\n", KeyedData.ulAssemblyRosterIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
skip("ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION failed\n");
|
||||
}
|
||||
|
||||
}
|
@@ -92,9 +92,9 @@ HANDLE _CreateActCtxFromFile(LPCWSTR FileName, int line)
|
||||
|
||||
SetLastError(0xdeaddead);
|
||||
h = CreateActCtxW(&ActCtx);
|
||||
ok_(__FILE__, line)(h != INVALID_HANDLE_VALUE, "CreateActCtx failed for %S\n", FileName);
|
||||
ok_(__FILE__, line)(h != INVALID_HANDLE_VALUE, "CreateActCtx failed\n");
|
||||
// In win10 last error is unchanged and in win2k3 it is ERROR_BAD_EXE_FORMAT
|
||||
ok_(__FILE__, line)(GetLastError() == ERROR_BAD_EXE_FORMAT || GetLastError() == 0xdeaddead, "Wrong last error %lu\n", GetLastError());
|
||||
ok_(__FILE__, line)(GetLastError() == ERROR_BAD_EXE_FORMAT, "Wrong last error. Expected %d, got %lu\n", ERROR_BAD_EXE_FORMAT, GetLastError());
|
||||
|
||||
return h;
|
||||
}
|
||||
@@ -119,7 +119,7 @@ VOID _DeactivateCtx(ULONG_PTR cookie, int line)
|
||||
ok_(__FILE__, line)(GetLastError() == 0xdeaddead, "Wrong last error. Expected %lu, got %lu\n", (DWORD)(0xdeaddead), GetLastError());
|
||||
}
|
||||
|
||||
void TestClassRedirection(HANDLE h, LPCWSTR ClassToTest, LPCWSTR ExpectedClassPart, LPCWSTR ExpectedModule, ULONG ExpectedClassCount)
|
||||
void TestClassRedirection(HANDLE h, LPCWSTR ClassToTest, LPCWSTR ExpectedClassName, LPCWSTR ExpectedModule, ULONG ExpectedClassCount)
|
||||
{
|
||||
ACTCTX_SECTION_KEYED_DATA KeyedData = { 0 };
|
||||
BOOL res;
|
||||
@@ -161,10 +161,10 @@ void TestClassRedirection(HANDLE h, LPCWSTR ClassToTest, LPCWSTR ExpectedClassPa
|
||||
ok(KeyedData.ulLength == data_lenght, "Got lenght %lu instead of %d\n", KeyedData.ulLength, data_lenght);
|
||||
ok(classData->size == sizeof(*classData), "Got %lu instead of %d\n", classData->size, sizeof(*classData));
|
||||
ok(classData->res == 0, "Got res %lu\n", classData->res);
|
||||
ok(classData->name_len == wcslen(ExpectedClassName) * 2, "Got name len %lu, expected %d\n", classData->name_len, wcslen(ExpectedClassName) *2);
|
||||
ok(classData->module_len == wcslen(ExpectedModule) * 2, "Got name len %lu, expected %d\n", classData->module_len, wcslen(ExpectedModule) *2);
|
||||
ok(wcscmp(VersionedClass, ExpectedClassName) == 0, "Got %S, expected %S\n", VersionedClass, ExpectedClassName);
|
||||
ok(wcscmp(ClassLib, ExpectedModule) == 0, "Got %S, expected %S\n", ClassLib, ExpectedModule);
|
||||
/* compare only if VersionedClass starts with ExpectedClassPart */
|
||||
ok(memcmp(VersionedClass, ExpectedClassPart, sizeof(WCHAR) * wcslen(ExpectedClassPart)) == 0, "Expected %S to start with %S\n", VersionedClass, ExpectedClassPart);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ START_TEST(FindActCtxSectionStringW)
|
||||
if (h != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
_ActivateCtx(h, &cookie, __LINE__);
|
||||
TestClassRedirection(h, L"Button", L"6.0.", L"comctl32.dll", 29);
|
||||
TestClassRedirection(h, L"Button", L"6.0.3790.1830!Button", L"comctl32.dll", 29);
|
||||
ok( GetModuleHandleW(L"comctl32.dll") == NULL, "Expected comctl32 not to be loaded\n");
|
||||
ok( GetModuleHandleW(L"user32.dll") == NULL, "Expected user32 not to be loaded\n");
|
||||
_DeactivateCtx(cookie, __LINE__);
|
||||
|
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
* Copyright 2017 Giannis Adamopoulos
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "wine/test.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winerror.h"
|
||||
|
||||
HANDLE _CreateActCtxFromFile(LPCWSTR FileName, int line);
|
||||
VOID _ActivateCtx(HANDLE h, ULONG_PTR *cookie, int line);
|
||||
VOID _DeactivateCtx(ULONG_PTR cookie, int line);
|
||||
|
||||
typedef DWORD (WINAPI *LPGETVERSION)();
|
||||
|
||||
VOID _TestVesion(HANDLE dll, DWORD ExpectedVersion, int line)
|
||||
{
|
||||
LPGETVERSION proc = (LPGETVERSION)GetProcAddress(dll, "GetVersion");
|
||||
DWORD version = proc();
|
||||
ok_(__FILE__, line)(version == ExpectedVersion, "Got version %lu, expected %lu\n", version, ExpectedVersion);
|
||||
}
|
||||
|
||||
VOID TestDllRedirection()
|
||||
{
|
||||
HANDLE dll1, dll2, h;
|
||||
ULONG_PTR cookie;
|
||||
|
||||
/* Try to load the libraries without sxs */
|
||||
dll1 = LoadLibraryExW(L"kernel32test_versioned.dll",0 , 0);
|
||||
ok (dll1 != NULL, "LoadLibraryExW failed\n");
|
||||
dll2 = LoadLibraryExW(L"testdata\\kernel32test_versioned.dll",0 , 0);
|
||||
ok (dll2 != NULL, "LoadLibraryExW failed\n");
|
||||
|
||||
ok (dll1 != dll2, "\n");
|
||||
_TestVesion(dll1, 1, __LINE__);
|
||||
_TestVesion(dll2, 2, __LINE__);
|
||||
|
||||
FreeLibrary(dll1);
|
||||
FreeLibrary(dll2);
|
||||
|
||||
dll1 = LoadLibraryExW(L"kernel32test_versioned.dll",0 , 0);
|
||||
ok (dll1 != NULL, "LoadLibraryExW failed\n");
|
||||
|
||||
/* redir2dep.manifest defines an assembly with nothing but a dependency on redirtest2 assembly */
|
||||
/* redirtest2.manifest defines an assembly that contains kernel32test_versioned.dll */
|
||||
/* In win10 it is enought to load and activate redirtest2 */
|
||||
/* In win2k3 however the only way to trigger the redirection is to load and activate redir2dep */
|
||||
h = _CreateActCtxFromFile(L"testdata\\redir2dep.manifest", __LINE__);
|
||||
_ActivateCtx(h, &cookie, __LINE__);
|
||||
dll2 = LoadLibraryExW(L"kernel32test_versioned.dll",0 , 0);
|
||||
_DeactivateCtx(cookie, __LINE__);
|
||||
ok (dll2 != NULL, "LoadLibraryExW failed\n");
|
||||
|
||||
ok (dll1 != dll2, "\n");
|
||||
_TestVesion(dll1, 1, __LINE__);
|
||||
_TestVesion(dll2, 2, __LINE__);
|
||||
|
||||
FreeLibrary(dll1);
|
||||
FreeLibrary(dll2);
|
||||
|
||||
dll1 = LoadLibraryExW(L"comctl32.dll",0 ,0);
|
||||
ok (dll1 != NULL, "LoadLibraryExW failed\n");
|
||||
|
||||
h = _CreateActCtxFromFile(L"comctl32dep.manifest", __LINE__);
|
||||
_ActivateCtx(h, &cookie, __LINE__);
|
||||
dll2 = LoadLibraryExW(L"comctl32.dll",0 , 0);
|
||||
_DeactivateCtx(cookie, __LINE__);
|
||||
ok (dll2 != NULL, "LoadLibraryExW failed\n");
|
||||
|
||||
ok (dll1 != dll2, "\n");
|
||||
|
||||
}
|
||||
|
||||
START_TEST(LoadLibraryExW)
|
||||
{
|
||||
TestDllRedirection();
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
|
||||
spec2def(redirtest.dll redirtest.spec ADD_IMPORTLIB)
|
||||
|
||||
list(APPEND SOURCE1
|
||||
redirtest1.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/redirtest_stubs.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/redirtest.def)
|
||||
|
||||
list(APPEND SOURCE2
|
||||
redirtest2.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/redirtest_stubs.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/redirtest.def)
|
||||
|
||||
add_library(redirtest1 SHARED ${SOURCE1})
|
||||
set_module_type(redirtest1 win32dll)
|
||||
add_importlibs(redirtest1 msvcrt kernel32 ntdll)
|
||||
add_rostests_file(TARGET redirtest1 RENAME kernel32test_versioned.dll)
|
||||
|
||||
add_library(redirtest2 SHARED ${SOURCE2})
|
||||
set_module_type(redirtest2 win32dll)
|
||||
add_importlibs(redirtest2 msvcrt kernel32 ntdll)
|
||||
add_rostests_file(TARGET redirtest2 SUBDIR testdata RENAME kernel32test_versioned.dll)
|
||||
add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/redirtest2.manifest" SUBDIR testdata)
|
||||
add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/redir2dep.manifest" SUBDIR testdata)
|
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="redirtest2"
|
||||
version="0.2.2.2"
|
||||
processorArchitecture="x86"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
</assembly>
|
@@ -1,27 +0,0 @@
|
||||
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
|
||||
DWORD WINAPI GetVersion()
|
||||
{
|
||||
return TESTVER;
|
||||
}
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
DllMain(HINSTANCE hinstDll,
|
||||
DWORD dwReason,
|
||||
LPVOID reserved)
|
||||
{
|
||||
switch (dwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
DisableThreadLibraryCalls(hinstDll);
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
@@ -1 +0,0 @@
|
||||
@ stdcall GetVersion()
|
@@ -1,27 +0,0 @@
|
||||
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
|
||||
DWORD WINAPI GetVersion()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
DllMain(HINSTANCE hinstDll,
|
||||
DWORD dwReason,
|
||||
LPVOID reserved)
|
||||
{
|
||||
switch (dwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
DisableThreadLibraryCalls(hinstDll);
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
@@ -1,27 +0,0 @@
|
||||
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
|
||||
DWORD WINAPI GetVersion()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
DllMain(HINSTANCE hinstDll,
|
||||
DWORD dwReason,
|
||||
LPVOID reserved)
|
||||
{
|
||||
switch (dwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
DisableThreadLibraryCalls(hinstDll);
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity type="win32" name="redirtest2" version="0.2.2.2" processorArchitecture="x86" />
|
||||
<file name="kernel32test_versioned.dll"/>
|
||||
</assembly>
|
||||
|
@@ -3,7 +3,6 @@
|
||||
#define STANDALONE
|
||||
#include <apitest.h>
|
||||
|
||||
extern void func_DefaultActCtx(void);
|
||||
extern void func_dosdev(void);
|
||||
extern void func_FindActCtxSectionStringW(void);
|
||||
extern void func_FindFiles(void);
|
||||
@@ -12,7 +11,6 @@ extern void func_GetCurrentDirectory(void);
|
||||
extern void func_GetDriveType(void);
|
||||
extern void func_GetModuleFileName(void);
|
||||
extern void func_interlck(void);
|
||||
extern void func_LoadLibraryExW(void);
|
||||
extern void func_lstrcpynW(void);
|
||||
extern void func_Mailslot(void);
|
||||
extern void func_MultiByteToWideChar(void);
|
||||
@@ -26,7 +24,6 @@ extern void func_WideCharToMultiByte(void);
|
||||
|
||||
const struct test winetest_testlist[] =
|
||||
{
|
||||
{ "DefaultActCtx", func_DefaultActCtx },
|
||||
{ "dosdev", func_dosdev },
|
||||
{ "FindActCtxSectionStringW", func_FindActCtxSectionStringW },
|
||||
{ "FindFiles", func_FindFiles },
|
||||
@@ -35,7 +32,6 @@ const struct test winetest_testlist[] =
|
||||
{ "GetDriveType", func_GetDriveType },
|
||||
{ "GetModuleFileName", func_GetModuleFileName },
|
||||
{ "interlck", func_interlck },
|
||||
{ "LoadLibraryExW", func_LoadLibraryExW },
|
||||
{ "lstrcpynW", func_lstrcpynW },
|
||||
{ "MailslotRead", func_Mailslot },
|
||||
{ "MultiByteToWideChar", func_MultiByteToWideChar },
|
||||
|