From: Eric Kohl Date: Mon, 8 Jun 2015 19:54:46 +0000 (+0000) Subject: [UDFS] X-Git-Tag: backups/colins-printing-for-freedom@73041~15^2~144 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=5e2fe69e38a090ce2625395a220e1765dddb3946 [UDFS] Remove license, evaluation and demo features. They makes no sense in an open source driver. svn path=/trunk/; revision=68081 --- diff --git a/reactos/drivers/filesystems/udfs/Include/key_lib.cpp b/reactos/drivers/filesystems/udfs/Include/key_lib.cpp deleted file mode 100644 index c59d91027c1..00000000000 --- a/reactos/drivers/filesystems/udfs/Include/key_lib.cpp +++ /dev/null @@ -1,102 +0,0 @@ -//////////////////////////////////////////////////////////////////// -// Copyright (C) Alexander Telyatnikov, Ivan Keliukh, Yegor Anchishkin, SKIF Software, 1999-2013. Kiev, Ukraine -// All rights reserved -// This file was released under the GPLv2 on June 2015. -//////////////////////////////////////////////////////////////////// - -static const char XPEHb[] = "zfvbgt^&*()aq,lpwdenjsxnygv!@yhuhb#$%chimuokbr"; - -UDF_FibonachiNum( - int n, - int* f - ) -{ - int a=0xff557788; - int i; - // do something - n <<= 8; - for(i=0; i= n) { - n >>= 4; - (*f) = (*f) ^ (a+n); - n >>= 1; - a = n & a; - } - } - n >>= 3; - // if(n < 2) - if(!(n & ~1)) - return 1; - n--; - if(!(n+1)) - return 1; - a = UDF_FibonachiNum(n, f); - return UDF_FibonachiNum(n-1, f) + a; -} - -void -UDF_build_long_key( - char* buffer, - int blen, - char* key_str, - int klen - ) -{ - int i, k, j; - int r[32]; - int* tmp = (int*)buffer; - int f, fn; - - memcpy(buffer, key_str, klen); - for(i=0; i=blen/4) - break; - r[j%(klen/4)] = (int32)( ((int64)r[j%(klen/4)] * 0x8088405 + 1) >> 3 ); - tmp[i] = r[j%(klen/4)] ^ f; - j++; - fn--; - } -} // end UDF_build_long_key() - - -void -UDF_build_hash_by_key( - char* longkey_buffer, - int longkey_len, - char* key_hash, - char* key_str - ) -{ - UDF_MD5_CTX context; - char key1[16]; - int m; - - UDF_build_long_key(longkey_buffer, longkey_len, key_str, 16); - UDF_MD5Init(&context); - UDF_MD5Update(&context, (PUCHAR)longkey_buffer, longkey_len); - UDF_MD5Pad (&context); - UDF_MD5Final((PUCHAR)key_hash, &context); - memcpy(key1, key_hash, 16); - for(m = 0; m<113; m++) { - UDF_build_long_key(longkey_buffer, longkey_len, key_hash, 16); - UDF_MD5Init(&context); - UDF_MD5Update(&context, (PUCHAR)longkey_buffer, longkey_len); - UDF_MD5Pad (&context); - UDF_MD5Final((PUCHAR)key_hash, &context); - } - for(m=0; m<16; m++) { - key_hash[m] = key_hash[m] ^ key1[m]; - } -} // end UDF_build_hash_by_key() - diff --git a/reactos/drivers/filesystems/udfs/Include/key_lib.h b/reactos/drivers/filesystems/udfs/Include/key_lib.h deleted file mode 100644 index 096f9160734..00000000000 --- a/reactos/drivers/filesystems/udfs/Include/key_lib.h +++ /dev/null @@ -1,26 +0,0 @@ -//////////////////////////////////////////////////////////////////// -// Copyright (C) Alexander Telyatnikov, Ivan Keliukh, Yegor Anchishkin, SKIF Software, 1999-2013. Kiev, Ukraine -// All rights reserved -// This file was released under the GPLv2 on June 2015. -//////////////////////////////////////////////////////////////////// - -#include "platform.h" -#include "md5.h" - -#define UDF_LONG_KEY_SIZE 1024 - -extern void -UDF_build_long_key( - char* buffer, - int blen, - char* key_str, - int klen - ); - -extern void -UDF_build_hash_by_key( - char* longkey_buffer, - int longkey_len, - char* key_hash, - char* key_str - ); diff --git a/reactos/drivers/filesystems/udfs/Include/md5.h b/reactos/drivers/filesystems/udfs/Include/md5.h deleted file mode 100644 index 9638ae93798..00000000000 --- a/reactos/drivers/filesystems/udfs/Include/md5.h +++ /dev/null @@ -1,65 +0,0 @@ -/* MD5.H - header file for MD5C.C - * $FreeBSD: src/sys/sys/md5.h,v 1.16 2002/06/24 14:18:39 mux Exp $ - */ - -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All -rights reserved. - -License to copy and use this software is granted provided that it -is identified as the "RSA Data Security, Inc. MD5 Message-Digest -Algorithm" in all material mentioning or referencing this software -or this function. - -License is also granted to make and use derivative works provided -that such works are identified as "derived from the RSA Data -Security, Inc. MD5 Message-Digest Algorithm" in all material -mentioning or referencing the derived work. - -RSA Data Security, Inc. makes no representations concerning either -the merchantability of this software or the suitability of this -software for any particular purpose. It is provided "as is" -without express or implied warranty of any kind. - -These notices must be retained in any copies of any part of this -documentation and/or software. - */ - -#ifndef _SYS_MD5_H_ -#define _SYS_MD5_H_ -/* MD5 context. */ -typedef struct UDF_MD5Context { - uint32 state[4]; /* state (ABCD) */ - uint32 count[2]; /* number of bits, modulo 2^64 (lsb first) */ - unsigned char buffer[64]; /* input buffer */ -} UDF_MD5_CTX; - -#ifdef __cplusplus -#define MD5_DECL extern "C" -#else -#define MD5_DECL extern -#endif - -MD5_DECL -void UDF_MD5Init (UDF_MD5_CTX *); - -MD5_DECL -void UDF_MD5Update (UDF_MD5_CTX *, const unsigned char *, unsigned int); - -MD5_DECL -void UDF_MD5Pad (UDF_MD5_CTX *); - -MD5_DECL -void UDF_MD5Final (unsigned char [16], UDF_MD5_CTX *); - -MD5_DECL -char * UDF_MD5End(UDF_MD5_CTX *, char *); - -typedef struct _UDF_MD5_DIGEST { - uint8 d[16]; -} UDF_MD5_DIGEST , *PUDF_MD5_DIGEST; - -/*char * MD5File(const char *, char *); -char * MD5FileChunk(const char *, char *, off_t, off_t); -char * MD5Data(const unsigned char *, unsigned int, char *);*/ - -#endif /* _SYS_MD5_H_ */ diff --git a/reactos/drivers/filesystems/udfs/Include/md5c.c b/reactos/drivers/filesystems/udfs/Include/md5c.c deleted file mode 100644 index 93b5d13a1dd..00000000000 --- a/reactos/drivers/filesystems/udfs/Include/md5c.c +++ /dev/null @@ -1,567 +0,0 @@ -/* - * MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm - * - * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All - * rights reserved. - * - * License to copy and use this software is granted provided that it - * is identified as the "RSA Data Security, Inc. MD5 Message-Digest - * Algorithm" in all material mentioning or referencing this software - * or this function. - * - * License is also granted to make and use derivative works provided - * that such works are identified as "derived from the RSA Data - * Security, Inc. MD5 Message-Digest Algorithm" in all material - * mentioning or referencing the derived work. - * - * RSA Data Security, Inc. makes no representations concerning either - * the merchantability of this software or the suitability of this - * software for any particular purpose. It is provided "as is" - * without express or implied warranty of any kind. - * - * These notices must be retained in any copies of any part of this - * documentation and/or software. - * - * This code is the same as the code published by RSA Inc. It has been - * edited for clarity and style only. - */ - -/* - * This file should be kept in sync with src/lib/libmd/md5c.c - */ -//#include "md5.h" - -void UDF_MD5Transform(uint32 [4], const unsigned char [64]); - -/* - * Encodes input (uint32) into output (unsigned char). Assumes len is - * a multiple of 4. - */ - -#define htole32(a) (a) -#define le32dec(a) (*(a)) - -void -UDF_Encode (unsigned char *output, uint32 *input, unsigned int len) -{ - unsigned int i; - unsigned int *op = (unsigned int *)output; - - for (i = 0; i < len / 4; i++) - op[i] = htole32(input[i]); -} - -/* - * Decodes input (unsigned char) into output (uint32). Assumes len is - * a multiple of 4. - */ - -void -UDF_Decode (uint32 *output, const unsigned char *input, unsigned int len) -{ - unsigned int i; - const unsigned int *ip = (const unsigned int *)input; - - for (i = 0; i < len / 4; i++) - output[i] = le32dec(&ip[i]); -} - -static const unsigned char PADDING[64] = { - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -/* F, G, H and I are basic MD5 functions. */ -#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) -#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) -#define I(x, y, z) ((y) ^ ((x) | (~z))) - -/* ROTATE_LEFT rotates x left n bits. */ -#ifdef _X86_ -__declspec (naked) -uint32 -__fastcall -ROTATE_LEFT( - uint32 x, // ECX - uint32 n // EDX - ) -{ - _asm { - push ecx - mov eax,ecx - mov ecx,edx - rol eax,cl - pop ecx - ret - } -} -#else // NO X86 optimization , use generic C/C++ -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) -#endif // _X86_ - -/* - * FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. - * Rotation is separate from addition to prevent recomputation. - */ - -void -FF( -/* uint32 &a, - uint32 b, - uint32 c, - uint32 d,*/ - uint32 a[4], - uint32 x, - uint32 s, - uint32 ac - ) -{ - a[0] += F (a[1], a[2], a[3]) + (x) + (uint32)(ac); - a[0] = ROTATE_LEFT (a[0], (s)); - a[0] += (a[1]); -} - -void -GG( -/* uint32 &a, - uint32 b, - uint32 c, - uint32 d,*/ - uint32 a[4], - uint32 x, - uint32 s, - uint32 ac - ) -{ -/* a += G ((b), (c), (d)) + (x) + (uint32)(ac); - a = ROTATE_LEFT ((a), (s)); - a += (b);*/ - a[0] += G (a[1], a[2], a[3]) + (x) + (uint32)(ac); - a[0] = ROTATE_LEFT (a[0], (s)); - a[0] += (a[1]); -} - -void -HH( -/* uint32 &a, - uint32 b, - uint32 c, - uint32 d,*/ - uint32 a[4], - uint32 x, - uint32 s, - uint32 ac - ) -{ -/* a += H ((b), (c), (d)) + (x) + (uint32)(ac); - a = ROTATE_LEFT ((a), (s)); - a += (b);*/ - a[0] += H (a[1], a[2], a[3]) + (x) + (uint32)(ac); - a[0] = ROTATE_LEFT (a[0], (s)); - a[0] += (a[1]); -} - -void -II( -/* uint32 &a, - uint32 b, - uint32 c, - uint32 d,*/ - uint32 a[4], - uint32 x, - uint32 s, - uint32 ac - ) -{ -/* a += I ((b), (c), (d)) + (x) + (uint32)(ac); - a = ROTATE_LEFT ((a), (s)); - a += (b);*/ - a[0] += I (a[1], a[2], a[3]) + (x) + (uint32)(ac); - a[0] = ROTATE_LEFT (a[0], (s)); - a[0] += (a[1]); -} - -#if 0 // NO X86 optimization , use generic C/C++ - -#define FF(a, b, c, d, x, s, ac) { \ - (a) += F ((b), (c), (d)) + (x) + (uint32)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define GG(a, b, c, d, x, s, ac) { \ - (a) += G ((b), (c), (d)) + (x) + (uint32)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define HH(a, b, c, d, x, s, ac) { \ - (a) += H ((b), (c), (d)) + (x) + (uint32)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define II(a, b, c, d, x, s, ac) { \ - (a) += I ((b), (c), (d)) + (x) + (uint32)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#endif // _X86_ - -/* MD5 initialization. Begins an MD5 operation, writing a new context. */ - -static const uint32 UDF_MD5Init_state[4] = { - 0x67452301, - 0xefcdab89, - 0x98badcfe, - 0x10325476 - }; - -void -UDF_MD5Init ( - UDF_MD5_CTX *context - ) -{ - - context->count[0] = context->count[1] = 0; - - /* Load magic initialization constants. */ -#if 0 - context->state[0] = 0x67452301; - context->state[1] = 0xefcdab89; - context->state[2] = 0x98badcfe; - context->state[3] = 0x10325476; -#endif - memcpy(context->state, UDF_MD5Init_state, sizeof(UDF_MD5Init_state)); -} - -/* - * MD5 block update operation. Continues an MD5 message-digest - * operation, processing another message block, and updating the - * context. - */ - -void -UDF_MD5Update ( - UDF_MD5_CTX *context, - const unsigned char *input, - unsigned int inputLen - ) -{ - unsigned int i, index, partLen; - - /* Compute number of bytes mod 64 */ - index = (unsigned int)((context->count[0] >> 3) & 0x3F); - - /* Update number of bits */ - if ((context->count[0] += ((uint32)inputLen << 3)) - < ((uint32)inputLen << 3)) - context->count[1]++; - context->count[1] += ((uint32)inputLen >> 29); - - partLen = 64 - index; - - /* Transform as many times as possible. */ - if (inputLen >= partLen) { - memcpy((void *)&context->buffer[index], (const void *)input, - partLen); - UDF_MD5Transform (context->state, context->buffer); - - for (i = partLen; i + 63 < inputLen; i += 64) - UDF_MD5Transform (context->state, &input[i]); - - index = 0; - } - else - i = 0; - - /* Buffer remaining input */ - memcpy ((void *)&context->buffer[index], (const void *)&input[i], - inputLen-i); -} - -/* - * MD5 padding. Adds padding followed by original length. - */ - -void -UDF_MD5Pad ( - UDF_MD5_CTX *context - ) -{ - unsigned char bits[8]; - unsigned int index, padLen; - - /* Save number of bits */ - UDF_Encode (bits, context->count, 8); - - /* Pad out to 56 mod 64. */ - index = (unsigned int)((context->count[0] >> 3) & 0x3f); - padLen = (index < 56) ? (56 - index) : (120 - index); - UDF_MD5Update (context, PADDING, padLen); - - /* Append length (before padding) */ - UDF_MD5Update (context, bits, 8); -} - -/* - * MD5 finalization. Ends an MD5 message-digest operation, writing the - * the message digest and zeroizing the context. - */ - -void -UDF_MD5Final ( - unsigned char digest[16], - UDF_MD5_CTX *context - ) -{ - /* Do padding. */ - UDF_MD5Pad (context); - - /* Store state in digest */ - UDF_Encode (digest, context->state, 16); - - /* Zeroize sensitive information. */ - memset ((void *)context, 0, sizeof (*context)); -} - -/* MD5 basic transformation. Transforms state based on block. */ - -static const uint32 UDF_MD5Transform_dwords[4][16] = { - { - 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, - 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, - 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be, - 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821 - }, - { - 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, - 0xd62f105d, 0x2441453, 0xd8a1e681, 0xe7d3fbc8, - 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, - 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a - }, - { - 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, - 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70, - 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x4881d05, - 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665 - }, - { - 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, - 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1, - 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, - 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 - } -}; - -static const uint32 UDF_MD5Transform_idx[4][16] = { - { - 0, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15 - }, - { - 1, 6, 11, 0, 5, 10, 15, 4, - 9, 14, 3, 8, 13, 2, 7, 12 - }, - { - 5, 8, 11, 14, 1, 4, 7, 10, - 13, 0, 3, 6, 9, 12, 15, 2 - }, - { - 0, 7, 14, 5, 12, 3, 10, 1, - 8, 15, 6, 13, 4, 11, 2, 9 - } -}; - -static const uint32 UDF_MD5Transform_Sxx[4][4] = { - { 7 , 12, 17, 22 }, - { 5 , 9 , 14, 20 }, - { 4 , 11, 16, 23 }, - { 6 , 10, 15, 21 } -}; - -void -UDF_MD5Rotate ( - uint32 state[4] - ) -{ - uint32 a = state[3]; - /* Load magic initialization constants. */ -#if 0 - state[3] = state[0]; - state[2] = state[3]; - state[1] = state[4]; -#endif - memmove(&state[1], &state[0], sizeof(state[0])*3); - state[0] = a; -} - -typedef void (*P_MD5_XX) - ( -/* uint32 &a, - uint32 b, - uint32 c, - uint32 d,*/ - uint32 a[4], - uint32 x, - uint32 s, - uint32 ac - ); - -void -UDF_MD5Transform ( - uint32 state[4], - const unsigned char block[64] - ) -{ -// uint32 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; - uint32 x[16]; - uint32 state1[4]; - uint32 i, j, k; - - P_MD5_XX MD5_func[] = {FF, GG, HH, II}; - - memcpy(state1, state, sizeof(state1)); - - UDF_Decode (x, block, 64); - - for(j=0; j<4; j++) { - for(i=0; i<16;) { - for(k=0; k<4; k++, i++) { - MD5_func[j] (state1, x[UDF_MD5Transform_idx[j][i]], UDF_MD5Transform_Sxx[j][k], UDF_MD5Transform_dwords[j][i]); /* 1 */ - UDF_MD5Rotate(state1); - } - } - } -#if 0 - for(i=0; i<16;) { - #define j 0 - for(k=0; k<4; k++, i++) { - FF (state1, x[UDF_MD5Transform_idx[j][i]], UDF_MD5Transform_Sxx[j][k], UDF_MD5Transform_dwords[j][i]); /* 1 */ - UDF_MD5Rotate(state1); - } - #undef j - } - for(i=0; i<16;) { - #define j 1 - for(k=0; k<4; k++, i++) { - GG (state1, x[UDF_MD5Transform_idx[j][i]], UDF_MD5Transform_Sxx[j][k], UDF_MD5Transform_dwords[j][i]); /* 1 */ - UDF_MD5Rotate(state1); - } - #undef j - } - for(i=0; i<16;) { - #define j 2 - for(k=0; k<4; k++, i++) { - HH (state1, x[UDF_MD5Transform_idx[j][i]], UDF_MD5Transform_Sxx[j][k], UDF_MD5Transform_dwords[j][i]); /* 1 */ - UDF_MD5Rotate(state1); - } - #undef j - } - for(i=0; i<16;) { - #define j 3 - for(k=0; k<4; k++, i++) { - II (state1, x[UDF_MD5Transform_idx[j][i]], UDF_MD5Transform_Sxx[j][k], UDF_MD5Transform_dwords[j][i]); /* 1 */ - UDF_MD5Rotate(state1); - } - #undef j - } -#endif //0 - -#if 0 - /* Round 1 */ -#define S11 7 -#define S12 12 -#define S13 17 -#define S14 22 - FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ - FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ - FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ - FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ - FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ - FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ - FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ - FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ - FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ - FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ - FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ - FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ - FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ - FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ - FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ - FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ - - /* Round 2 */ -#define S21 5 -#define S22 9 -#define S23 14 -#define S24 20 - GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ - GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ - GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ - GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ - GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ - GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */ - GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ - GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ - GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ - GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ - GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ - GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ - GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ - GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ - GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ - GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ - - /* Round 3 */ -#define S31 4 -#define S32 11 -#define S33 16 -#define S34 23 - HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ - HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ - HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ - HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ - HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ - HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ - HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ - HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ - HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ - HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ - HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ - HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ - HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ - HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ - HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ - HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ - - /* Round 4 */ -#define S41 6 -#define S42 10 -#define S43 15 -#define S44 21 - II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ - II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ - II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ - II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ - II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ - II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ - II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ - II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ - II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ - II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ - II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ - II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ - II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ - II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ - II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ - II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ -#endif //0 - - state[0] += state1[0]; - state[1] += state1[1]; - state[2] += state1[2]; - state[3] += state1[3]; - - /* Zeroize sensitive information. */ - memset ((void *)x, 0, sizeof (x)); -} diff --git a/reactos/drivers/filesystems/udfs/Include/protect.h b/reactos/drivers/filesystems/udfs/Include/protect.h deleted file mode 100644 index a588b5b299e..00000000000 --- a/reactos/drivers/filesystems/udfs/Include/protect.h +++ /dev/null @@ -1,120 +0,0 @@ -//////////////////////////////////////////////////////////////////// -// Copyright (C) Alexander Telyatnikov, Ivan Keliukh, Yegor Anchishkin, SKIF Software, 1999-2013. Kiev, Ukraine -// All rights reserved -// This file was released under the GPLv2 on June 2015. -//////////////////////////////////////////////////////////////////// - -#ifndef __UDF_PROTECT__H__ -#define __UDF_PROTECT__H__ - -//#include "udf_eval_time.h" -//#include "product.h" - -//#define EVALUATION_TIME_LIMIT !!! // this must be defined in compiler options - -#define TIME_JAN_1_2003 0x23d8b -#define EVALUATION_TERM 30 -#define EVALUATION_TERM_XOR 0x75fd63c8 -#define EVALUATION_TERM_DIE ((-1) ^ EVALUATION_TERM_XOR) - -//#define UDF_CURRENT_VERSION 0x00015002 -// xx.1.50.02 -//#define UDF_CURRENT_BUILD 110 - -#define REG_TRIAL_DATE1_KEY_NAME L"\\REGISTRY\\MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer" -#define REG_TRIAL_DATE1_VAL_NAME L"AlwaysOnTop" - -#define REG_TRIAL_DATE2_KEY_NAME L"\\REGISTRY\\MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer" -#define REG_TRIAL_DATE2_VAL_NAME L"AlwaysOnTop" - -#define REG_TRIAL_DATE3_KEY_NAME_A "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Compatibility32" -#define REG_TRIAL_DATE3_KEY_NAME_W L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Compatibility32" -#define REG_TRIAL_DATE3_VAL_NAME_A "DWGUIFMTUDF32" -#define REG_TRIAL_DATE3_VAL_NAME_W L"DWGUIFMTUDF32" - -// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Compatibility, RUN.EXE Date -// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ModuleCompatibility, EXPLORER.EXE Date -// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WOW\Compatibility, CMD32.EXE Version -// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion, InstallTime Version -// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer, SmallIcons TrialEnd -// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Nls\LocaleMapIDs, CurrentLocaleID TrialEnd -// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved, 62ad7960-e634-11d8-b031-00024451f90c not used now - -/* -#define XOR_STR_DECL(n, val) \ - ULONG UdfXorStr##n = val; -*/ - -#define UDF_INSTALL_INFO_LOCATIONS 2 - -#define XOR_VAR(suff, n) UdfXorVal##suff##n -#define XOR_VAR_DECL(suff, n, val) \ - ULONG XOR_VAR(suff, n) = val; -#define XOR_VAR_DECLH(suff, n) \ - extern ULONG XOR_VAR(suff, n); - -extern ULONG PresentDateMask; -extern BOOLEAN TrialEndOnStart; - -XOR_VAR_DECLH(Date, 0); -XOR_VAR_DECLH(Date, 1); -XOR_VAR_DECLH(Version, 0); -XOR_VAR_DECLH(Version, 1); -XOR_VAR_DECLH(TrialEnd, 0); -XOR_VAR_DECLH(TrialEnd, 1); -//XOR_VAR_DECL(Date, 0, 0xff7765cc); -//XOR_VAR_DECL(Date, 1, 0xf76caa82); - -//#include "protect_reg.h" - - -#define GET_XXX_REG_VAL_TYPE(str, n) (REG_##str##_TYPE_##n) -#define GET_XXX_REG_XOR(xxx, n) (REG_##xxx##_XOR_##n) - -//#define GET_DATE_REG_XOR(n) (UdfXorVal##Date##n) - -// str pointer to the buffer to extract name to -#define GET_XXX_REG_YYY_NAME(xxx, yyy, _str, n) /* Kernel */ \ -{ \ - ULONG i; \ - PCHAR str = (PCHAR)(_str); \ - PCHAR tmp = REG_##xxx##_##yyy##_NAME_##n; \ - for(i=0; i< sizeof(REG_##xxx##_##yyy##_NAME_##n); i++) { \ - str[i] = tmp[i] ^ (UCHAR)GET_##xxx##_REG_XOR(n) ; \ - } \ -} - -#define GET_DATE_REG_XOR(n) GET_XXX_REG_XOR(DATE, n) -// str pointer to the buffer to extract name to -#define GET_DATE_REG_KEY_NAME(_str, n) GET_XXX_REG_YYY_NAME(DATE, KEY, _str, n) -#define GET_DATE_REG_VAL_NAME(_str, n) GET_XXX_REG_YYY_NAME(DATE, VAL, _str, n) - - -#define GET_VERSION_REG_XOR(n) GET_XXX_REG_XOR(VERSION, n) -//#define GET_VERSION_REG_XOR(n) (UdfXorVal##Version##n) -#define GET_VERSION_REG_KEY_NAME(_str, n) GET_XXX_REG_YYY_NAME(VERSION, KEY, _str, n) -#define GET_VERSION_REG_VAL_NAME(_str, n) GET_XXX_REG_YYY_NAME(VERSION, VAL, _str, n) - -#define GET_TRIAL_REG_XOR(n) GET_XXX_REG_XOR(TRIAL, n) -//#define GET_TRIAL_REG_XOR(n) (UdfXorVal##Trial##n) -#define GET_TRIAL_REG_KEY_NAME(_str, n) GET_XXX_REG_YYY_NAME(TRIAL, KEY, _str, n) -#define GET_TRIAL_REG_VAL_NAME(_str, n) GET_XXX_REG_YYY_NAME(TRIAL, VAL, _str, n) - -////////////// - -#define UDF_LICENSE_KEY L"LicenseKey" -#define UDF_LICENSE_KEY_USER "LicenseKey" - -#define UDF_USER_KEY L"UserName" -#define UDF_USER_KEY_USER "UserName" - -#endif // __UDF_PROTECT__H__ - -#ifdef INCLUDE_XOR_DECL_ONLY - XOR_VAR_DECL(Date, 0, 0xf826fab2); - XOR_VAR_DECL(Date, 1, 0x12fcb245); - XOR_VAR_DECL(Version, 0, 0x8c36acf3); - XOR_VAR_DECL(Version, 1, 0x9437cfa4); - XOR_VAR_DECL(TrialEnd, 0, 0xfc9387a6); - XOR_VAR_DECL(TrialEnd, 1, 0x287cfbde); -#endif // INCLUDE_XOR_DECL_ONLY diff --git a/reactos/drivers/filesystems/udfs/Include/protect_user_mode.cpp b/reactos/drivers/filesystems/udfs/Include/protect_user_mode.cpp deleted file mode 100644 index 694b0b5ea4d..00000000000 --- a/reactos/drivers/filesystems/udfs/Include/protect_user_mode.cpp +++ /dev/null @@ -1,185 +0,0 @@ -//////////////////////////////////////////////////////////////////// -// Copyright (C) Alexander Telyatnikov, Ivan Keliukh, Yegor Anchishkin, SKIF Software, 1999-2013. Kiev, Ukraine -// All rights reserved -// This file was released under the GPLv2 on June 2015. -//////////////////////////////////////////////////////////////////// - -//#define EVALUATION_TIME_LIMIT - -#ifdef EVALUATION_TIME_LIMIT - -#define VAR_SAVED(preff, n) Var##preff##n##Saved - -#define KEY(preff, n) preff##n##Key -#define VAL(preff, n) preff##n##Val - -#define CheckAndSave(preff, n, val, type) \ - if (!VAR_SAVED(##preff, ##n)) { \ - if (##type==1) \ - RegisterDword(KEY(##preff,##n),VAL(##preff,##n),##val ^ XOR_VAR(##preff, ##n) ); \ - else { \ - szTemp[16]; \ - sprintf(szTemp,"0x%08x", ##val ^ XOR_VAR(##preff, ##n)); \ - RegisterString(KEY(##preff,##n),VAL(##preff,##n), &szTemp[0], FALSE, 0); \ - }\ - VAR_SAVED(##preff, ##n) = TRUE; \ - } - -#define RegisterTrialEnd() \ - CheckAndSave(TrialEnd, 0, 1, 1); \ - CheckAndSave(TrialEnd, 1, 1, 1); - -#define ClearTrialEnd() \ - CheckAndSave(TrialEnd, 0, 0, 1); \ - CheckAndSave(TrialEnd, 1, 0, 1); - -#define RegisterDate() \ - CheckAndSave(Date, 0, dwDaysSince2003, 0); \ - CheckAndSave(Date, 1, dwDaysSince2003, 0); - -#define RegisterVersion() \ - CheckAndSave(Version, 0, UDF_CURRENT_BUILD, 0); \ - CheckAndSave(Version, 1, UDF_CURRENT_BUILD, 1); - -#define PATH_VAR_DECL(preff, n) \ -CHAR KEY(preff, n)[256], VAL(preff, n)[64]; \ -BOOL VAR_SAVED(preff, n) = FALSE; - - -#define GET_KEY_DATE(n) GET_DATE_REG_KEY_NAME(Date##n##Key, ##n) -#define GET_VAL_DATE(n) GET_DATE_REG_VAL_NAME(Date##n##Val, ##n) - -#define GET_KEY_VERSION(n) GET_VERSION_REG_KEY_NAME(Version##n##Key, ##n) -#define GET_VAL_VERSION(n) GET_VERSION_REG_VAL_NAME(Version##n##Val, ##n) - -#define GET_KEY_TRIAL(n) GET_TRIAL_REG_KEY_NAME(TrialEnd##n##Key, ##n) -#define GET_VAL_TRIAL(n) GET_TRIAL_REG_VAL_NAME(TrialEnd##n##Val, ##n) - - CHAR szTemp[16]; - ULONG dwDaysSince2003, dwDaysSince2003fromReg0 = 0, dwDaysSince2003fromReg1 = 0; - ULONG TrialEnd0, TrialEnd1; - ULONG Version0 = 0, Version1 = 0; - SYSTEMTIME SystemTime, SystemTime2003; - FILETIME FileTime, FileTime2003; - ULARGE_INTEGER Time, Time2003; - - -#define INCLUDE_XOR_DECL_ONLY -#include "protect.h" -#undef INCLUDE_XOR_DECL_ONLY - - PATH_VAR_DECL(Date, 0); - PATH_VAR_DECL(Date, 1); - PATH_VAR_DECL(Version, 0); - PATH_VAR_DECL(Version, 1); - PATH_VAR_DECL(TrialEnd, 0); - PATH_VAR_DECL(TrialEnd, 1); - - GET_KEY_TRIAL(0); - GET_VAL_TRIAL(1); - -#ifndef NO_KEY_PRESENCE_CHECK - CHAR Key[17]; - if (GetRegString(UDF_SERVICE_PATH,UDF_LICENSE_KEY_USER,Key, sizeof(Key))) { - goto LicenseKeyPresent; - } -#endif // NO_KEY_PRESENCE_CHECK - - GetSystemTime(&SystemTime); - SystemTimeToFileTime(&SystemTime, &FileTime); - memset(&SystemTime2003, 0, sizeof(SystemTime2003)); - SystemTime2003.wYear = 2003; - - GET_KEY_DATE(0); - GET_VAL_DATE(0); - GET_KEY_VERSION(0); - - SystemTime2003.wMonth = 1; - SystemTime2003.wDay = 1; - - GET_VAL_VERSION(1); - - SystemTimeToFileTime(&SystemTime2003, &FileTime2003); - - memcpy(&Time , &FileTime, sizeof(ULARGE_INTEGER)); - memcpy(&Time2003, &FileTime2003, sizeof(ULARGE_INTEGER)); - Time.QuadPart -= Time2003.QuadPart; - - GET_KEY_TRIAL(1); - GET_VAL_TRIAL(0); - - dwDaysSince2003 = (ULONG)(Time.QuadPart/10000000I64/3600/24); - - GET_KEY_DATE(1); - GET_VAL_VERSION(0); - GET_KEY_VERSION(1); - - if (GetRegString(KEY(Version, 0), VAL(Version, 0),&szTemp[0], sizeof(szTemp))) { - sscanf(szTemp,"0x%08x", &Version0); - Version0 ^= XOR_VAR(Version,0); - } - - GET_VAL_DATE(1); - - if (GetRegUlong(KEY(Version, 1), VAL(Version, 1),&Version1)) { - Version1 ^= XOR_VAR(Version,1); - } - - if (Version0 < UDF_CURRENT_BUILD && Version1 < UDF_CURRENT_BUILD) { - RegisterVersion(); - ClearTrialEnd(); - RegisterDate(); - return 1; - } - - if ((LONGLONG)(Time.QuadPart) < 0 || - GetRegUlong(KEY(TrialEnd, 0), VAL(TrialEnd, 0),&TrialEnd0) && (TrialEnd0 ^ XOR_VAR(TrialEnd, 0)) != 0 || - GetRegUlong(KEY(TrialEnd, 1), VAL(TrialEnd, 1),&TrialEnd1) && (TrialEnd1 ^ XOR_VAR(TrialEnd, 1)) != 0) { - RegisterTrialEnd(); -#ifndef NO_MESSAGE_BOXES - if (MyMessageBox(hInst, - GetDesktopWindow(), - MAKEINTRESOURCE(IDS_EXPIRED_TEXT), - MAKEINTRESOURCE(IDS_EXPIRED), MB_YESNO | MB_ICONQUESTION) == IDYES) goto EnterRegistration; - -#endif // NO_MESSAGE_BOXES - return 0; - } - - if (GetRegString(KEY(Date, 0), VAL(Date, 0),&szTemp[0], sizeof(szTemp))) { - sscanf(szTemp,"0x%08x", &dwDaysSince2003fromReg0); - dwDaysSince2003fromReg0 ^= XOR_VAR(Date,0); - } - - if (GetRegString(KEY(Date, 1), VAL(Date, 1),&szTemp[0], sizeof(szTemp))) { - sscanf(szTemp,"0x%08x", &dwDaysSince2003fromReg1); - dwDaysSince2003fromReg1 ^= XOR_VAR(Date,1); - } - - if (dwDaysSince2003fromReg1 > dwDaysSince2003fromReg0) dwDaysSince2003fromReg0 = dwDaysSince2003fromReg1; - - if (!dwDaysSince2003fromReg0 && !dwDaysSince2003fromReg1) { - RegisterDate(); - dwDaysSince2003fromReg0 = dwDaysSince2003; - } else if (!dwDaysSince2003fromReg0) { - CheckAndSave(Date, 0, dwDaysSince2003fromReg1, 0); - dwDaysSince2003fromReg0 = dwDaysSince2003fromReg1; - } else if (!dwDaysSince2003fromReg1) { - CheckAndSave(Date, 1, dwDaysSince2003fromReg0, 0); - } - - if(dwDaysSince2003 - dwDaysSince2003fromReg0 > EVALUATION_TERM || dwDaysSince2003 < dwDaysSince2003fromReg0 || - dwDaysSince2003 > UDF_MAX_DATE || - dwDaysSince2003 < UDF_MIN_DATE) { - RegisterTrialEnd(); -#ifndef NO_MESSAGE_BOXES - if (MyMessageBox(hInst, - GetDesktopWindow(), - MAKEINTRESOURCE(IDS_EXPIRED_TEXT), - MAKEINTRESOURCE(IDS_EXPIRED), MB_YESNO | MB_ICONQUESTION) == IDYES) goto EnterRegistration; - -#endif // NO_MESSAGE_BOXES - return 0; - } - -#endif EVALUATION_TIME_LIMIT diff --git a/reactos/drivers/filesystems/udfs/Include/udf_common.h b/reactos/drivers/filesystems/udfs/Include/udf_common.h index 94817e1c673..d8f26ffdf08 100644 --- a/reactos/drivers/filesystems/udfs/Include/udf_common.h +++ b/reactos/drivers/filesystems/udfs/Include/udf_common.h @@ -577,9 +577,6 @@ typedef struct _UDFData { // type of zone (e.g. a default size for the FCB zone might be // different from the default size for the ByteLock zone). -#ifdef EVALUATION_TIME_LIMIT - UDF_KEY_LIST CurrentKeyHash; -#endif //EVALUATION_TIME_LIMIT // Of course, you will need to use different values (min/max) // for lookaside lists (if you decide to use them instead) uint32 DefaultZoneSizeInNumStructs; @@ -589,9 +586,6 @@ typedef struct _UDFData { // ERESOURCE IsSyncResource; // Is operation synchronous flag // BOOLEAN IsSync; -#ifdef EVALUATION_TIME_LIMIT - ULONG Saved_j; -#endif //EVALUATION_TIME_LIMIT // delayed close support ERESOURCE DelayedCloseResource; @@ -610,20 +604,12 @@ typedef struct _UDFData { BOOLEAN ReduceDelayedClose; BOOLEAN ReduceDirDelayedClose; -#ifdef EVALUATION_TIME_LIMIT - LARGE_INTEGER UDFCurrentTime; -#endif //EVALUATION_TIME_LIMIT ULONG CPU_Count; LARGE_INTEGER UDFLargeZero; // mount event (for udf gui app) PKEVENT MountEvent; -#ifdef EVALUATION_TIME_LIMIT - WCHAR LicenseKeyW[16+1]; - WCHAR LKPadding[1]; -#endif //EVALUATION_TIME_LIMIT - #endif //_UDF_STRUCTURES_H_ //HKEY hUdfRootKey; UNICODE_STRING SavedRegPath; @@ -631,21 +617,12 @@ typedef struct _UDFData { UNICODE_STRING UnicodeStrSDir; UNICODE_STRING AclName; // WCHAR UnicodeStrRootBuffer[2]; -#ifdef EVALUATION_TIME_LIMIT - ULONG iTime; - ULONG iVer; - ULONG iTrial; -#endif //EVALUATION_TIME_LIMIT ULONG WCacheMaxFrames; ULONG WCacheMaxBlocks; ULONG WCacheBlocksPerFrameSh; ULONG WCacheFramesToKeepFree; -#ifdef EVALUATION_TIME_LIMIT - UCHAR Page2Padding[PAGE_SIZE]; -#endif //EVALUATION_TIME_LIMIT - // some state information is maintained in the flags field uint32 UDFFlags; @@ -657,7 +634,6 @@ typedef struct _UDFData { #define UDF_DATA_FLAGS_RESOURCE_INITIALIZED (0x00000001) #define UDF_DATA_FLAGS_ZONES_INITIALIZED (0x00000002) #define UDF_DATA_FLAGS_BEING_UNLOADED (0x00000004) -#define UDF_DATA_FLAGS_UNREGISTERED (0x00000008) /**/ diff --git a/reactos/drivers/filesystems/udfs/cleanup.cpp b/reactos/drivers/filesystems/udfs/cleanup.cpp index 2d1d28233fa..ae8859672fb 100644 --- a/reactos/drivers/filesystems/udfs/cleanup.cpp +++ b/reactos/drivers/filesystems/udfs/cleanup.cpp @@ -155,9 +155,6 @@ UDFCommonCleanup( PDIR_INDEX_HDR DirNdx; #endif // UDF_DBG // PUDF_DATALOC_INFO Dloc; -#ifdef EVALUATION_TIME_LIMIT - ULONG t; -#endif //EVALUATION_TIME_LIMIT TmPrint(("UDFCommonCleanup\n")); @@ -580,17 +577,6 @@ DiscardDelete: ChangeTime = TRUE; } } -#ifdef EVALUATION_TIME_LIMIT - KeQuerySystemTime(&UDFGlobalData.UDFCurrentTime); - t = (ULONG)(UDFGlobalData.UDFCurrentTime.QuadPart / (10*1000*1000)); - t /= (60*60*24); - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - if(t-TIME_JAN_1_2003 > UDF_MAX_DATE || - t-TIME_JAN_1_2003 < UDF_MIN_DATE) { - Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; - } - } -#endif //EVALUATION_TIME_LIMIT if(!(Fcb->FCBFlags & UDF_FCB_DIRECTORY)) { // Update sizes in DirIndex if(!Fcb->OpenHandleCount) { diff --git a/reactos/drivers/filesystems/udfs/devcntrl.cpp b/reactos/drivers/filesystems/udfs/devcntrl.cpp index 8cbcae7e9e6..c7beb58d161 100644 --- a/reactos/drivers/filesystems/udfs/devcntrl.cpp +++ b/reactos/drivers/filesystems/udfs/devcntrl.cpp @@ -18,10 +18,6 @@ #include "CDRW/scsi_port.h" -#ifdef EVALUATION_TIME_LIMIT -#include "Include/protect.h" -#endif //EVALUATION_TIME_LIMIT - #define UDF_CURRENT_BUILD 123456789 // define the file specific bug-check id @@ -219,18 +215,8 @@ UDFCommonDeviceControl( if (Fcb->NodeIdentifier.NodeType == UDF_NODE_TYPE_VCB) { // Everything is acceptable for Volume Vcb = (PVCB)(Fcb); -#ifdef EVALUATION_TIME_LIMIT - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; - } -#endif //EVALUATION_TIME_LIMIT } else { Vcb = Fcb->Vcb; -#ifdef EVALUATION_TIME_LIMIT - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; - } -#endif //EVALUATION_TIME_LIMIT CompleteIrp = TRUE; // For files/disrs only the following are acceptable switch (IoControlCode) { @@ -327,23 +313,6 @@ UDFCommonDeviceControl( UnsafeIoctl = FALSE; break; -#ifdef EVALUATION_TIME_LIMIT - case IOCTL_CDRW_RESERVE_TRACK: - case IOCTL_CDRW_SET_STREAMING: - case IOCTL_CDRW_SYNC_CACHE: - case IOCTL_CDRW_BLANK: - case IOCTL_CDRW_LL_WRITE: - case IOCTL_CDRW_FORMAT_UNIT: - case IOCTL_CDRW_SET_WRITE_MODE: - case IOCTL_CDRW_CLOSE_TRK_SES: - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - KdPrint(("Unregistered version. IOCTL blocked\n")); - Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; - CompleteIrp = TRUE; - try_return(RC = STATUS_INVALID_PARAMETER); - } - break; -#endif //EVALUATION_TIME_LIMIT } if(IoControlCode != IOCTL_CDROM_DISK_TYPE) { @@ -670,14 +639,10 @@ notify_media_change: break; #ifndef UDF_READ_ONLY_BUILD case IOCTL_UDF_SEND_LICENSE_KEY: -#ifdef EVALUATION_TIME_LIMIT - RC = UDFProcessLicenseKey( PtrIrpContext, Irp ); -#else //EVALUATION_TIME_LIMIT RC = STATUS_SUCCESS; Irp->IoStatus.Information = 0; Irp->IoStatus.Status = STATUS_SUCCESS; -#endif //EVALUATION_TIME_LIMIT CompleteIrp = TRUE; break; #endif //UDF_READ_ONLY_BUILD @@ -843,16 +808,6 @@ notify_media_change: Vcb->VCBFlags &= ~UDF_VCB_FLAGS_MEDIA_LOCKED; goto ioctl_do_default; -#ifdef EVALUATION_TIME_LIMIT - case IOCTL_CDRW_GET_SIGNATURE: - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; -// CompleteIrp = TRUE; -// try_return(RC = STATUS_INVALID_PARAMETER); - } - goto ioctl_do_default; -#endif //EVALUATION_TIME_LIMIT - case FSCTL_ALLOW_EXTENDED_DASD_IO: KdPrint(("UDFUserFsCtrlRequest: FSCTL_ALLOW_EXTENDED_DASD_IO\n")); @@ -1262,326 +1217,3 @@ UDFSetFileAllocModeFromICB( return STATUS_SUCCESS; } // end UDFSetFileAllocModeFromICB() #endif //UDF_READ_ONLY_BUILD - -#ifdef EVALUATION_TIME_LIMIT - -#define UDF_MD5Init UDF_MD5Init3 -#define UDF_MD5Update UDF_MD5Update3 -#define UDF_MD5Pad UDF_MD5Pad3 -#define UDF_MD5Final UDF_MD5Final3 -#define UDF_MD5End UDF_MD5End3 -#define UDF_MD5Transform UDF_MD5Transform3 -#define UDF_Encode UDF_Encode3 -#define UDF_Decode UDF_Decode3 -#define PADDING PADDING3 - -#define ROTATE_LEFT ROTATE_LEFT3 -#define FF FF3 -#define GG GG3 -#define HH HH3 -#define II II3 - -#define UDF_MD5Transform_dwords UDF_MD5Transform_dwords3 -#define UDF_MD5Transform_idx UDF_MD5Transform_idx3 -#define UDF_MD5Transform_Sxx UDF_MD5Transform_Sxx3 -#define UDF_MD5Rotate UDF_MD5Rotate3 - -#include "..\Include\md5.h" -#include "..\Include\md5c.c" - -#define UDF_FibonachiNum UDF_FibonachiNum3 -#define XPEHb XPEHb3 -#define UDF_build_long_key UDF_build_long_key3 -#define UDF_build_hash_by_key UDF_build_hash_by_key3 - -#include "..\Include\key_lib.h" -#include "..\Include\key_lib.cpp" - -extern ULONG UDFNumberOfKeys; -extern PCHAR pUDFLongKey; -extern PUDF_KEY_LIST pUDFKeyList; -extern PUCHAR pRegKeyName0; - -NTSTATUS -UDFProcessLicenseKey( - PtrUDFIrpContext IrpContext, - PIRP Irp - ) -{ - WCHAR RegPath[128]; - WCHAR RegKeyName[64]; - CHAR LicenseKey[16+1]; - WCHAR LicenseKeyW[16+1]; - HKEY hUdfRootKey; - NTSTATUS RC = STATUS_INVALID_USER_BUFFER; - - ULONG i, j; - int checksum[4] = {0,0,0,0}; - - PEXTENDED_IO_STACK_LOCATION IrpSp = - (PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation( Irp ); -/* - PVCB Vcb; - PtrUDFFCB Fcb; - PtrUDFCCB Ccb; -*/ - PUDF_KEY_LIST OutputBuffer; - - // Decode the file object, the only type of opens we accept are - // user volume opens. -/* - Ccb = (PtrUDFCCB)(IrpSp->FileObject->FsContext2); - Fcb = Ccb->Fcb; - Vcb = Fcb->Vcb; -*/ - Irp->IoStatus.Information = 0; - if(IrpSp->Parameters.FileSystemControl.InputBufferLength < 16) - return STATUS_BUFFER_TOO_SMALL; - if(IrpSp->Parameters.FileSystemControl.OutputBufferLength < 16) - return STATUS_BUFFER_TOO_SMALL; - - OutputBuffer = (PUDF_KEY_LIST)UDFGetCallersBuffer(Irp->AssociatedIrp.SystemBuffer); - if(!OutputBuffer) - return STATUS_INVALID_USER_BUFFER; - - // Build Registry Value name for License Key - for(i=0; i> 16)); - } - RegKeyName[i] = 0; - - RegTGetKeyHandle(NULL, UDFGlobalData.SavedRegPath.Buffer, &hUdfRootKey); - if(hUdfRootKey) { - if(!RegTGetStringValue(hUdfRootKey, NULL, - RegKeyName, LicenseKeyW, (16+1)*sizeof(WCHAR)) ) { - UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_UNREGISTERED; - } - RegTCloseKeyHandle(hUdfRootKey); - } - LicenseKeyW[16] = 0; - // convert WCHAR Key to CHAR key - for(i=0; i<16; i++) { - LicenseKey[i] = (UCHAR)(LicenseKeyW[i]); - } - - // build hash - UDF_build_hash_by_key(pUDFLongKey, UDF_LONG_KEY_SIZE, (PCHAR)&(UDFGlobalData.CurrentKeyHash), LicenseKey); - // check if it is correct - for(i=0; i (UDF_MAX_DATE+TIME_JAN_1_2003) || - t2 < (UDF_MIN_DATE+TIME_JAN_1_2003)) { - KdPrint(("Eval time expired: %x <= %x <= %x\n", - UDF_MIN_DATE+TIME_JAN_1_2003, t2, UDF_MAX_DATE+TIME_JAN_1_2003)); - } else { - ULONG iTime; - ULONG iVer; - if(!UDFGetInstallVersion((PULONG)&iVer) || - !UDFGetInstallTime(&iTime)) { - KdPrint(("UDFGetInstallTime() or UDFGetInstallVersion() failed\n")); - } else - if(iVer > UDF_CURRENT_BUILD) { - KdPrint(("Init: Detected newer build\n")); - } else - if(UDFGetTrialEnd((PULONG)&iVer)) { - KdPrint(("UDFGetTrialEnd() read TRUE from Registry !!!\n")); - } else { - iTime += TIME_JAN_1_2003; - KdPrint(("cTime = %x, iTime = %x\n", t2, iTime)); - if((ULONG)t2 < (ULONG)iTime) { - KdPrint(("Eval time expired: System (%x) < Install (%x)\n", - t2, iTime)); - } else - if((ULONG)t2 > (ULONG)iTime + EVALUATION_TERM) { - KdPrint(("Eval time expired above EVALUATION_TERM: System (%x) > Install+Eval (%x)\n", - t2, iTime+EVALUATION_TERM)); - } else - if((iTime >> 2) & (0x80000000 >> 2)) { - KdPrint(("Eval time expired (negative install time)\n")); - } else { - j = 4; - } - } - KdPrint(("Eval time %s\n", j == 4 ? "ok" : "failed")); - //RC = STATUS_SUCCESS; - } - } - - UDFGlobalData.Saved_j = j; - - { - PIO_STACK_LOCATION IrpSp = NULL; - PVCB Vcb; - PLIST_ENTRY Link; - PPREVENT_MEDIA_REMOVAL_USER_IN Buf = NULL; - - // Acquire GlobalDataResource - UDFAcquireResourceExclusive(&(UDFGlobalData.GlobalDataResource), TRUE); - // Walk through all of the Vcb's attached to the global data. - Link = UDFGlobalData.VCBQueue.Flink; - - while (Link != &(UDFGlobalData.VCBQueue)) { - // Get 'next' Vcb - Vcb = CONTAINING_RECORD( Link, VCB, NextVCB ); - // Move to the next link now - Link = Link->Flink; - ASSERT(Link != Link->Flink); - - if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_SHUTDOWN)) { - - UDFAcquireResourceExclusive(&(Vcb->VCBResource), TRUE); - if(j!=4) { - KdPrint(("DevCtl: unregistered\n")); - if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_READ_ONLY)) { - Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; - } - UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_UNREGISTERED; - } else { - KdPrint(("DevCtl: registered :)\n")); - if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_READ_ONLY)) { - Vcb->VCBFlags &= ~UDF_VCB_FLAGS_VOLUME_READ_ONLY; - } - UDFGlobalData.UDFFlags &= ~UDF_DATA_FLAGS_UNREGISTERED; - } - UDFReleaseResource(&(Vcb->VCBResource)); - } - } - if(j == 4) { - KdPrint(("DevCtl: registered (2)\n")); - UDFGlobalData.UDFFlags &= ~UDF_DATA_FLAGS_UNREGISTERED; - } else { - KdPrint(("DevCtl: unregistered (2)\n")); - UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_UNREGISTERED; - } - // Once we have processed all the mounted logical volumes, we can release - // all acquired global resources and leave (in peace :-) - UDFReleaseResource( &(UDFGlobalData.GlobalDataResource) ); - } - - if(j == 4) { - KdPrint(("DevCtl: registered (3)\n")); - RtlCopyMemory(UDFGlobalData.LicenseKeyW, LicenseKeyW, 16*sizeof(WCHAR)); - UDFGlobalData.UDFFlags &= ~UDF_DATA_FLAGS_UNREGISTERED; - } else { - WCHAR s[16]; - ULONG type, sz; - ULONG d; - PVOID pdata; - NTSTATUS RC; - - KdPrint(("DevCtl: unregistered (3): Write BIAKAs to Registry\n")); - UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_UNREGISTERED; - - // End of trial - d = 1 ^ XOR_VAR(TrialEnd, 0); - swprintf(s, L"0x%8.8x\0", d); - GET_TRIAL_REG_KEY_NAME(RegPath, 0); - GET_TRIAL_REG_VAL_NAME(RegKeyName, 0); - type = GET_XXX_REG_VAL_TYPE(TRIAL, 0) ? REG_SZ : REG_DWORD; - pdata = GET_XXX_REG_VAL_TYPE(TRIAL, 0) ? (PVOID)s : (PVOID)&d; - sz = GET_XXX_REG_VAL_TYPE(TRIAL, 0) ? (10+1+1)*sizeof(WCHAR) : sizeof(d); - KdPrint(("%ws\n %ws\n", RegPath, RegKeyName)); - RC = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE /*| RTL_REGISTRY_OPTIONAL*/, - RegPath, RegKeyName, - type, pdata, sz ); - KdPrint(("status %#x\n", RC)); - d = 1 ^ XOR_VAR(TrialEnd, 1); - swprintf(s, L"0x%8.8x\0", d); - GET_TRIAL_REG_KEY_NAME(RegPath, 1); - GET_TRIAL_REG_VAL_NAME(RegKeyName, 1); - type = GET_XXX_REG_VAL_TYPE(TRIAL, 1) ? REG_SZ : REG_DWORD; - pdata = GET_XXX_REG_VAL_TYPE(TRIAL, 1) ? (PVOID)s : (PVOID)&d; - sz = GET_XXX_REG_VAL_TYPE(TRIAL, 1) ? (10+1+1)*sizeof(WCHAR) : sizeof(d); - KdPrint(("%ws\n %ws\n", RegPath, RegKeyName)); - RC = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE /*| RTL_REGISTRY_OPTIONAL*/, - RegPath, RegKeyName, - type, pdata, sz ); - KdPrint(("status %#x\n", RC)); - // Install Date - if(!TrialEndOnStart) { - d = UDFGlobalData.iTime ^ XOR_VAR(Date, 0); - swprintf(s, L"0x%8.8x\0", d); - GET_DATE_REG_KEY_NAME(RegPath, 0); - GET_DATE_REG_VAL_NAME(RegKeyName, 0); - type = GET_XXX_REG_VAL_TYPE(DATE, 0) ? REG_SZ : REG_DWORD; - pdata = GET_XXX_REG_VAL_TYPE(DATE, 0) ? (PVOID)s : (PVOID)&d; - sz = GET_XXX_REG_VAL_TYPE(DATE, 0) ? (10+1+1)*sizeof(WCHAR) : sizeof(d); - if(PresentDateMask & (1 << 0)) { - KdPrint(("%ws\n %ws\n", RegPath, RegKeyName)); - RC = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE /*| RTL_REGISTRY_OPTIONAL*/, - RegPath, RegKeyName, - type, pdata, sz ); - KdPrint(("status %#x\n", RC)); - } - d = UDFGlobalData.iTime ^ XOR_VAR(Date, 1); - swprintf(s, L"0x%8.8x\0", d); - GET_DATE_REG_KEY_NAME(RegPath, 1); - GET_DATE_REG_VAL_NAME(RegKeyName, 1); - type = GET_XXX_REG_VAL_TYPE(DATE, 1) ? REG_SZ : REG_DWORD; - pdata = GET_XXX_REG_VAL_TYPE(DATE, 1) ? (PVOID)s : (PVOID)&d; - sz = GET_XXX_REG_VAL_TYPE(DATE, 1) ? (10+1+1)*sizeof(WCHAR) : sizeof(d); - if(PresentDateMask & (1 << 1)) { - KdPrint(("%ws\n %ws\n", RegPath, RegKeyName)); - RC = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE /*| RTL_REGISTRY_OPTIONAL*/, - RegPath, RegKeyName, - type, pdata, sz ); - KdPrint(("status %#x\n", RC)); - } - } - // Highest version - d = UDFGlobalData.iVer ^ XOR_VAR(Version, 0); - swprintf(s, L"0x%8.8x\0", d); - GET_VERSION_REG_KEY_NAME(RegPath, 0); - GET_VERSION_REG_VAL_NAME(RegKeyName, 0); - type = GET_XXX_REG_VAL_TYPE(VERSION, 0) ? REG_SZ : REG_DWORD; - pdata = GET_XXX_REG_VAL_TYPE(VERSION, 0) ? (PVOID)s : (PVOID)&d; - sz = GET_XXX_REG_VAL_TYPE(VERSION, 0) ? (10+1+1)*sizeof(WCHAR) : sizeof(d); - KdPrint(("%ws\n %ws\n", RegPath, RegKeyName)); - RC = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE /*| RTL_REGISTRY_OPTIONAL*/, - RegPath, RegKeyName, - type, pdata, sz ); - KdPrint(("status %#x\n", RC)); - d = UDFGlobalData.iVer ^ XOR_VAR(Version, 1); - swprintf(s, L"0x%8.8x\0", d); - GET_VERSION_REG_KEY_NAME(RegPath, 1); - GET_VERSION_REG_VAL_NAME(RegKeyName, 1); - type = GET_XXX_REG_VAL_TYPE(VERSION, 1) ? REG_SZ : REG_DWORD; - pdata = GET_XXX_REG_VAL_TYPE(VERSION, 1) ? (PVOID)s : (PVOID)&d; - sz = GET_XXX_REG_VAL_TYPE(VERSION, 1) ? (10+1+1)*sizeof(WCHAR) : sizeof(d); - KdPrint(("%ws\n %ws\n", RegPath, RegKeyName)); - RC = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE /*| RTL_REGISTRY_OPTIONAL*/, - RegPath, RegKeyName, - type, pdata, sz ); - KdPrint(("status %#x\n", RC)); - } - return RC; -} // end UDFProcessLicenseKey() - -#endif //EVALUATION_TIME_LIMIT diff --git a/reactos/drivers/filesystems/udfs/fileinfo.cpp b/reactos/drivers/filesystems/udfs/fileinfo.cpp index c5efc3746d5..ca8d7e239ce 100644 --- a/reactos/drivers/filesystems/udfs/fileinfo.cpp +++ b/reactos/drivers/filesystems/udfs/fileinfo.cpp @@ -200,12 +200,6 @@ UDFCommonFileInfo( ASSERT(Fcb->NodeIdentifier.NodeType == UDF_NODE_TYPE_FCB); //Vcb->VCBFlags |= UDF_VCB_SKIP_EJECT_CHECK; -#ifdef EVALUATION_TIME_LIMIT - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; - } -#endif //EVALUATION_TIME_LIMIT - // The NT I/O Manager always allocates and supplies a system // buffer for query and set file information calls. // Copying information to/from the user buffer and the system @@ -648,11 +642,7 @@ UDFGetStandardInformation( Vcb = Fcb->Vcb; PtrBuffer->NumberOfLinks = UDFGetFileLinkCount(FileInfo); PtrBuffer->DeletePending = (Fcb->FCBFlags & UDF_FCB_DELETE_ON_CLOSE) ? TRUE : FALSE; -#ifdef EVALUATION_TIME_LIMIT - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; - } -#endif //EVALUATION_TIME_LIMIT + // Case on whether this is a file or a directory, and extract // the information and fill in the fcb/dcb specific parts // of the output buffer diff --git a/reactos/drivers/filesystems/udfs/flush.cpp b/reactos/drivers/filesystems/udfs/flush.cpp index bf8d7edb94a..75d5d2f444d 100644 --- a/reactos/drivers/filesystems/udfs/flush.cpp +++ b/reactos/drivers/filesystems/udfs/flush.cpp @@ -520,8 +520,7 @@ UDFFlushLogicalVolume( if(Vcb->VCBFlags & (UDF_VCB_FLAGS_RAW_DISK/* | UDF_VCB_FLAGS_MEDIA_READ_ONLY*/)) return 0; - if((Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_READ_ONLY) && - !(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED)) + if(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_READ_ONLY) return 0; if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED)) return 0; diff --git a/reactos/drivers/filesystems/udfs/fscntrl.cpp b/reactos/drivers/filesystems/udfs/fscntrl.cpp index fa94596a33b..6ebb2a6825c 100644 --- a/reactos/drivers/filesystems/udfs/fscntrl.cpp +++ b/reactos/drivers/filesystems/udfs/fscntrl.cpp @@ -550,12 +550,6 @@ UDFMountVolume( try_return(RC); } -#ifdef EVALUATION_TIME_LIMIT - if(UDFGlobalData.Saved_j != 4) { - UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_UNREGISTERED; - } -#endif //EVALUATION_TIME_LIMIT - VolDo = NULL; Vpb = NULL; @@ -626,11 +620,6 @@ UDFMountVolume( Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; Vcb->VCBFlags |= UDF_VCB_FLAGS_MEDIA_READ_ONLY; #endif //UDF_READ_ONLY_BUILD -#ifdef EVALUATION_TIME_LIMIT - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; - } -#endif //EVALUATION_TIME_LIMIT if(!NT_SUCCESS(RC)) { KdPrint(("UDFMountVolume: try raw mount\n")); @@ -866,12 +855,6 @@ UDFStartEjectWaiter( PREVENT_MEDIA_REMOVAL_USER_IN Buff; KdPrint(("UDFStartEjectWaiter:\n")); -#ifdef EVALUATION_TIME_LIMIT - if(UDFGlobalData.Saved_j != 4) { - UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_UNREGISTERED; - } -#endif //EVALUATION_TIME_LIMIT - if(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_READ_ONLY) { KdPrint((" UDF_VCB_FLAGS_MEDIA_READ_ONLY\n")); } @@ -920,13 +903,6 @@ UDFStartEjectWaiter( ExInitializeWorkItem(&(Vcb->EjectWaiter->EjectReqWorkQueueItem), (PWORKER_THREAD_ROUTINE)UDFEjectReqWaiter, Vcb->EjectWaiter); KdPrint(("UDFStartEjectWaiter: create thread\n")); ExQueueWorkItem(&(Vcb->EjectWaiter->EjectReqWorkQueueItem), DelayedWorkQueue); - -#ifdef EVALUATION_TIME_LIMIT - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; - } -#endif //EVALUATION_TIME_LIMIT - } else { KdPrint((" ignore\n")); } diff --git a/reactos/drivers/filesystems/udfs/misc.cpp b/reactos/drivers/filesystems/udfs/misc.cpp index 7d01759cc0e..7a0a7e91321 100644 --- a/reactos/drivers/filesystems/udfs/misc.cpp +++ b/reactos/drivers/filesystems/udfs/misc.cpp @@ -55,7 +55,6 @@ UDFInitializeZones(VOID) // determine memory requirements switch (MmQuerySystemSize()) { -#ifndef DEMO case MmMediumSystem: SizeOfObjectNameZone = (4 * SizeOfZone * UDFQuadAlign(sizeof(UDFObjectName))) + sizeof(ZONE_SEGMENT_HEADER); SizeOfCCBZone = (4 * SizeOfZone * UDFQuadAlign(sizeof(UDFCCB))) + sizeof(ZONE_SEGMENT_HEADER); @@ -82,7 +81,6 @@ UDFInitializeZones(VOID) UDFGlobalData.WCacheBlocksPerFrameSh = 8; UDFGlobalData.WCacheFramesToKeepFree = 8; break; -#endif //DEMO case MmSmallSystem: default: SizeOfObjectNameZone = (2 * SizeOfZone * UDFQuadAlign(sizeof(UDFObjectName))) + sizeof(ZONE_SEGMENT_HEADER); @@ -1303,12 +1301,10 @@ UDFCommonDispatch( RC = UDFCommonQueryVolInfo(PtrIrpContext, Irp); break; #ifndef UDF_READ_ONLY_BUILD -#ifndef DEMO // release case IRP_MJ_SET_VOLUME_INFORMATION: // Invoke the common query volume routine RC = UDFCommonSetVolInfo(PtrIrpContext, Irp); break; -#endif // DEMO #endif //UDF_READ_ONLY_BUILD #ifdef UDF_HANDLE_EAS /* case IRP_MJ_QUERY_EA: @@ -1326,12 +1322,10 @@ UDFCommonDispatch( RC = UDFCommonGetSecurity(PtrIrpContext, Irp); break; #ifndef UDF_READ_ONLY_BUILD -#ifndef DEMO // release case IRP_MJ_SET_SECURITY: // Invoke the common set Security routine RC = UDFCommonSetSecurity(PtrIrpContext, Irp); break; -#endif // DEMO #endif //UDF_READ_ONLY_BUILD #endif // UDF_ENABLE_SECURITY // Continue with the remaining possible dispatch routines below ... diff --git a/reactos/drivers/filesystems/udfs/read.cpp b/reactos/drivers/filesystems/udfs/read.cpp index 03ecd17f3c2..903a4ebe45a 100644 --- a/reactos/drivers/filesystems/udfs/read.cpp +++ b/reactos/drivers/filesystems/udfs/read.cpp @@ -420,11 +420,6 @@ UDFCommonRead( } #endif -#ifdef EVALUATION_TIME_LIMIT - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; - } -#endif //EVALUATION_TIME_LIMIT // Forward the request to the lower level driver // Lock the callers buffer if (!NT_SUCCESS(RC = UDFLockCallersBuffer(PtrIrpContext, Irp, TRUE, ReadLength))) { @@ -470,11 +465,6 @@ UDFCommonRead( try_return(RC); } -#ifdef EVALUATION_TIME_LIMIT - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; - } -#endif //EVALUATION_TIME_LIMIT NtReqFcb = Fcb->NTRequiredFCB; Res1Acq = UDFIsResourceAcquired(&(NtReqFcb->MainResource)); diff --git a/reactos/drivers/filesystems/udfs/secursup.cpp b/reactos/drivers/filesystems/udfs/secursup.cpp index 6038b31ce69..238b6abdf9c 100644 --- a/reactos/drivers/filesystems/udfs/secursup.cpp +++ b/reactos/drivers/filesystems/udfs/secursup.cpp @@ -219,7 +219,6 @@ try_exit: NOTHING; } #ifndef UDF_READ_ONLY_BUILD -#ifndef DEMO /************************************************************************* * * Function: UDFSetSecurity() @@ -414,7 +413,6 @@ try_exit: NOTHING; return(RC); } // ens UDFCommonSetSecurity() -#endif //DEMO #endif //UDF_READ_ONLY_BUILD #endif //UDF_ENABLE_SECURITY @@ -806,24 +804,22 @@ UDFWriteSecurity( PUDF_FILE_INFO SDirInfo = NULL; PUDF_FILE_INFO AclInfo = NULL; PERESOURCE Res1 = NULL; -#ifndef DEMO NTSTATUS RC; ULONG NumberBytesRead; -#endif //DEMO // KdPrint(("UDFWriteSecurity\n")); -#if !defined(DEMO) && !defined(UDF_READ_ONLY_BUILD) +#if !defined(UDF_READ_ONLY_BUILD) if(!Vcb->WriteSecurity || (Vcb->VCBFlags & (UDF_VCB_FLAGS_VOLUME_READ_ONLY | UDF_VCB_FLAGS_MEDIA_READ_ONLY))) -#endif //!defined(DEMO) && !defined(UDF_READ_ONLY_BUILD) +#endif //!defined(UDF_READ_ONLY_BUILD) return STATUS_SUCCESS; -#if !defined(DEMO) && !defined(UDF_READ_ONLY_BUILD) +#if !defined(UDF_READ_ONLY_BUILD) _SEH2_TRY { @@ -908,7 +904,7 @@ try_exit: NOTHING; return RC; -#endif //!defined(DEMO) && !defined(UDF_READ_ONLY_BUILD) +#endif //!defined(UDF_READ_ONLY_BUILD) #endif //UDF_ENABLE_SECURITY return STATUS_SUCCESS; @@ -953,12 +949,6 @@ UDFCheckAccessRights( goto treat_as_ro; #endif //UDF_READ_ONLY_BUILD -#ifdef EVALUATION_TIME_LIMIT - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - Fcb->Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; - goto treat_as_ro; - } -#endif //EVALUATION_TIME_LIMIT if(Fcb->FCBFlags & UDF_FCB_READ_ONLY) { ROCheck = TRUE; } else @@ -969,9 +959,9 @@ UDFCheckAccessRights( ROCheck = TRUE; } if(ROCheck) { -#if defined(EVALUATION_TIME_LIMIT) || defined(UDF_READ_ONLY_BUILD) +#ifdef UDF_READ_ONLY_BUILD treat_as_ro: -#endif //EVALUATION_TIME_LIMIT +#endif //UDF_READ_ONLY_BUILD ACCESS_MASK DesiredAccessMask = 0; if(Fcb->Vcb->CompatFlags & UDF_VCB_IC_WRITE_IN_RO_DIR) { @@ -1029,11 +1019,6 @@ treat_as_ro: #ifdef UDF_ENABLE_SECURITY } #endif //UDF_ENABLE_SECURITY -#ifdef EVALUATION_TIME_LIMIT - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - Fcb->Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; - } -#endif //EVALUATION_TIME_LIMIT if(FileObject) { if (Fcb->OpenHandleCount) { // The FCB is currently in use by some thread. @@ -1058,11 +1043,6 @@ treat_as_ro: // we get here if given file was opened for internal purposes RC = STATUS_SUCCESS; } -#ifdef EVALUATION_TIME_LIMIT - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - Fcb->Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; - } -#endif //EVALUATION_TIME_LIMIT return RC; } // end UDFCheckAccessRights() diff --git a/reactos/drivers/filesystems/udfs/udf_info/mount.cpp b/reactos/drivers/filesystems/udfs/udf_info/mount.cpp index ddfce7c212a..3eb1e106aba 100644 --- a/reactos/drivers/filesystems/udfs/udf_info/mount.cpp +++ b/reactos/drivers/filesystems/udfs/udf_info/mount.cpp @@ -921,8 +921,7 @@ UDFUmount__( #ifndef UDF_READ_ONLY_BUILD uint32 flags = 0; - if(((Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_READ_ONLY) && - !(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED)) + if((Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_READ_ONLY) || !Vcb->Modified) return STATUS_SUCCESS; // prevent discarding metadata diff --git a/reactos/drivers/filesystems/udfs/udf_info/phys_eject.cpp b/reactos/drivers/filesystems/udfs/udf_info/phys_eject.cpp index 6323b6300dc..47802fbe0b5 100644 --- a/reactos/drivers/filesystems/udfs/udf_info/phys_eject.cpp +++ b/reactos/drivers/filesystems/udfs/udf_info/phys_eject.cpp @@ -84,9 +84,6 @@ UDFEjectReqWaiter( ((PGET_EVENT_USER_IN)(&(WC->EjectReqBuffer)))->Immed = TRUE; ((PGET_EVENT_USER_IN)(&(WC->EjectReqBuffer)))->EventClass = evt_type; -#ifdef EVALUATION_TIME_LIMIT - KeQuerySystemTime(&UDFGlobalData.UDFCurrentTime); -#endif //EVALUATION_TIME_LIMIT RC = UDFPhSendIOCTL( IOCTL_CDRW_GET_EVENT, TargetDevObj, &(WC->EjectReqBuffer),sizeof(GET_EVENT_USER_IN), @@ -103,10 +100,6 @@ UDFEjectReqWaiter( supported_evt_classes = WC->EjectReqBuffer.MediaChange.Header.SupportedClasses; } } - } else { -#ifdef EVALUATION_TIME_LIMIT - KeQuerySystemTime(&UDFGlobalData.UDFCurrentTime); -#endif //EVALUATION_TIME_LIMIT } if(!UseEvent) break; @@ -142,15 +135,6 @@ stop_waiter: BM_FlushPriod = Vcb->BM_FlushPriod; Tree_FlushPriod = Vcb->Tree_FlushPriod; -#ifdef EVALUATION_TIME_LIMIT - if(!UDFGlobalData.LicenseKeyItemStarted) { - UDFGlobalData.LicenseKeyItemStarted = TRUE; - ExInitializeWorkItem(&(UDFGlobalData.LicenseKeyItem), UDFKeyWaiter, NULL); - // KdPrint(("UDFLicenseWaiter: create thread\n")); - ExQueueWorkItem(&(UDFGlobalData.LicenseKeyItem), DelayedWorkQueue); - } -#endif //EVALUATION_TIME_LIMIT - // check if we approaching end of disk if(space_check_counter > 2) { // update FreeAllocUnits if it is necessary @@ -169,10 +153,6 @@ stop_waiter: } space_check_counter++; -#ifdef EVALUATION_TIME_LIMIT - KeQuerySystemTime(&UDFGlobalData.UDFCurrentTime); -#endif //EVALUATION_TIME_LIMIT - if(Vcb->VCBFlags & UDF_VCB_SKIP_EJECT_CHECK) { SkipCount++; SkipEjectCount++; @@ -310,9 +290,7 @@ wait_eject: Vcb->Tree_FlushTime)); // do not touch unchanged volume - if(((Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_READ_ONLY) && - !(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED)) - || + if((Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_READ_ONLY) || !Vcb->Modified) goto skip_BM_flush; @@ -328,11 +306,6 @@ wait_eject: } VcbAcquired = TRUE; } - // License Key check - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; - goto skip_BM_flush; - } KdPrint(("UDF: Flushing Directory Tree....\n")); if( BM_FlushPriod && @@ -360,8 +333,7 @@ skip_BM_flush: // do not touch unchanged volume - if((Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_READ_ONLY) && - !(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED)) + if(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_READ_ONLY) goto skip_BM_flush2; if(!Vcb->Modified) goto skip_BM_flush2; diff --git a/reactos/drivers/filesystems/udfs/udffs.h b/reactos/drivers/filesystems/udfs/udffs.h index 6e26a67b1ac..66ef1f9bad8 100644 --- a/reactos/drivers/filesystems/udfs/udffs.h +++ b/reactos/drivers/filesystems/udfs/udffs.h @@ -21,8 +21,6 @@ //#define UDF_TRACK_UNICODE_STR -//#define DEMO - //#define UDF_LIMIT_NAME_LEN //#define UDF_LIMIT_DIR_SIZE @@ -54,10 +52,6 @@ #define UDF_DEFAULT_DIR_PACK_THRESHOLD (16) #endif // UDF_LIMIT_DIR_SIZE -#ifdef DEMO - #define UDF_DEMO_VOLUME_LABEL L"UDF Demo" -#endif //DEMO - #define UDF_DEFAULT_READAHEAD_GRAN 0x10000 #define UDF_DEFAULT_SPARSE_THRESHOLD (256*PACKETSIZE_UDF) @@ -181,11 +175,9 @@ extern UDFData UDFGlobalData; #include "Include/phys_lib.h" #include "errmsg.h" //#include "Include/tools.h" -#include "Include/protect.h" #include "udfpubl.h" //#include "ntifs.h" #include "mem.h" -#include "Include/key_lib.h" extern CCHAR DefLetter[]; diff --git a/reactos/drivers/filesystems/udfs/udfinit.cpp b/reactos/drivers/filesystems/udfs/udfinit.cpp index a40fa606681..adcc7ac4880 100644 --- a/reactos/drivers/filesystems/udfs/udfinit.cpp +++ b/reactos/drivers/filesystems/udfs/udfinit.cpp @@ -24,55 +24,6 @@ // global variables are declared here UDFData UDFGlobalData; -#ifdef EVALUATION_TIME_LIMIT - -ULONG PresentDateMask = 0; -BOOLEAN TrialEndOnStart = FALSE; - -#define UDF_MD5Init UDF_MD5Init2 -#define UDF_MD5Update UDF_MD5Update2 -#define UDF_MD5Pad UDF_MD5Pad2 -#define UDF_MD5Final UDF_MD5Final2 -#define UDF_MD5End UDF_MD5End2 -#define UDF_MD5Transform UDF_MD5Transform2 -#define UDF_Encode UDF_Encode2 -#define UDF_Decode UDF_Decode2 -#define PADDING PADDING2 - -#define ROTATE_LEFT ROTATE_LEFT2 -#define FF FF2 -#define GG GG2 -#define HH HH2 -#define II II2 - -#define UDF_MD5Transform_dwords UDF_MD5Transform_dwords2 -#define UDF_MD5Transform_idx UDF_MD5Transform_idx2 -#define UDF_MD5Transform_Sxx UDF_MD5Transform_Sxx2 -#define UDF_MD5Rotate UDF_MD5Rotate2 - -#include "..\Include\md5.h" -#include "..\Include\md5c.c" - -#define UDF_FibonachiNum UDF_FibonachiNum2 -#define XPEHb XPEHb2 -#define UDF_build_long_key UDF_build_long_key2 -#define UDF_build_hash_by_key UDF_build_hash_by_key2 - -#include "..\Include\key_lib.h" -#include "..\Include\key_lib.cpp" - -extern ULONG UDFNumberOfKeys; -extern PCHAR pUDFLongKey; -extern PUDF_KEY_LIST pUDFKeyList; -extern PUCHAR pRegKeyName0; - -#include "..\Include\protect.h" -#define INCLUDE_XOR_DECL_ONLY -#include "..\Include\protect.h" -#undef INCLUDE_XOR_DECL_ONLY - -#endif //EVALUATION_TIME_LIMIT - #define KD_PREFIX struct UDF_MEDIA_CLASS_NAMES UDFMediaClassName[] = { @@ -150,32 +101,14 @@ DriverEntry( // UNICODE_STRING unicodeCdRomDeviceName; PUDFFS_DEV_EXTENSION FSDevExt; HKEY hUdfRootKey; -#ifdef EVALUATION_TIME_LIMIT - WCHAR RegPath[128]; - WCHAR RegKeyName[64]; - CHAR LicenseKey[16+1]; - ULONG iVer; - - ULONG i, j; - int checksum[4] = {0,0,0,0}; -#else LARGE_INTEGER delay; -#endif //EVALUATION_TIME_LIMIT // KdPrint(("UDF: Entered " VER_STR_PRODUCT_NAME " UDF DriverEntry \n")); // KdPrint((KD_PREFIX "Build " VER_STR_PRODUCT "\n")); -#ifdef EVALUATION_TIME_LIMIT - BrutePoint(); -#endif //EVALUATION_TIME_LIMIT - _SEH2_TRY { _SEH2_TRY { -#ifdef EVALUATION_TIME_LIMIT - LARGE_INTEGER cTime; -#endif //EVALUATION_TIME_LIMIT - /* CrNtInit(DriverObject, RegistryPath); @@ -194,159 +127,6 @@ DriverEntry( UDFGlobalData.NodeIdentifier.NodeType = UDF_NODE_TYPE_GLOBAL_DATA; UDFGlobalData.NodeIdentifier.NodeSize = sizeof(UDFGlobalData); -#ifdef EVALUATION_TIME_LIMIT - - KeQuerySystemTime((PLARGE_INTEGER)&cTime); - - { - uint64 t, t2; - t = cTime.QuadPart / 100; - t /= 60; - t /= 200*120*24; - t /= 250; - t2 = (int32)t; - KdPrint((KD_PREFIX "t2 = %x\n", t2)); - if(t2-TIME_JAN_1_2003 > UDF_MAX_DATE || - t2-TIME_JAN_1_2003 < UDF_MIN_DATE) { - KdPrint((KD_PREFIX "Ssytem time is out of range: %x <= %x <= %x\n", - UDF_MIN_DATE, (uint32)t2-TIME_JAN_1_2003, UDF_MAX_DATE)); - UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_UNREGISTERED; - } - } - - if(UDFGetTrialEnd(&iVer)) { - TrialEndOnStart = TRUE; - KdPrint((KD_PREFIX "Eval time expired some time ago\n")); - UDFGlobalData.UDFFlags = (UDFGlobalData.UDFFlags & ~UDF_DATA_FLAGS_UNREGISTERED) + UDF_DATA_FLAGS_UNREGISTERED; - } - cTime.QuadPart /= (10*1000*1000); - cTime.QuadPart /= (60*60*24); - - KdPrint((KD_PREFIX "cTime = %x, jTime = %x\n", cTime.LowPart, TIME_JAN_1_2003)); - if(cTime.QuadPart < TIME_JAN_1_2003) { - KdPrint((KD_PREFIX "System time %x < TIME_JAN_1_2003\n", cTime.LowPart)); - UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_UNREGISTERED; - } - cTime.LowPart -= TIME_JAN_1_2003; - KdPrint(("cTime = %x\n", cTime.LowPart)); - - if(!UDFGetInstallVersion((PULONG)&iVer) || - !UDFGetInstallTime((PULONG)&cTime.HighPart)) { - KdPrint((KD_PREFIX "UDFGetInstallTime() or UDFGetInstallVersion() failed\n")); - UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_UNREGISTERED; - } else { - KdPrint((KD_PREFIX "cTime = %x, iTime = %x\n", cTime.LowPart, cTime.HighPart)); - if(iVer > UDF_CURRENT_BUILD) { - KdPrint(("Init: Detected newer build (0)\n")); - UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_UNREGISTERED; - } - if((ULONG)cTime.LowPart < (ULONG)cTime.HighPart) { - KdPrint(("Eval time expired: current (%x) < install (%x)\n", - cTime.LowPart, cTime.HighPart)); - UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_UNREGISTERED; - } - if((ULONG)cTime.LowPart > (ULONG)cTime.HighPart + EVALUATION_TERM) { - KdPrint(("Eval time expired above EVALUATION_TERM\n")); - UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_UNREGISTERED; - } - if((cTime.HighPart >> 16) & 0x8000) { - KdPrint(("Eval time expired (negative install time)\n")); - UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_UNREGISTERED; - } - } - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - WCHAR s[16]; - ULONG type, sz; - ULONG d; - PVOID pdata; - - KdPrint(("Init: unregistered (3). Write BIAKAs to Registry\n")); - UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_UNREGISTERED; - - // End of trial - d = 1 ^ XOR_VAR(TrialEnd, 0); - swprintf(s, L"0x%8.8x\0", d); - GET_TRIAL_REG_KEY_NAME(RegPath, 0); - GET_TRIAL_REG_VAL_NAME(RegKeyName, 0); - type = GET_XXX_REG_VAL_TYPE(TRIAL, 0) ? REG_SZ : REG_DWORD; - pdata = GET_XXX_REG_VAL_TYPE(TRIAL, 0) ? (PVOID)s : (PVOID)&d; - sz = GET_XXX_REG_VAL_TYPE(TRIAL, 0) ? (10+1+1)*sizeof(WCHAR) : sizeof(d); - KdPrint(("%ws\n %ws\n", RegPath, RegKeyName)); - RC = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE /*| RTL_REGISTRY_OPTIONAL*/, - RegPath, RegKeyName, - type, pdata, sz ); - KdPrint(("status %#x\n", RC)); - d = 1 ^ XOR_VAR(TrialEnd, 1); - swprintf(s, L"0x%8.8x\0", d); - GET_TRIAL_REG_KEY_NAME(RegPath, 1); - GET_TRIAL_REG_VAL_NAME(RegKeyName, 1); - type = GET_XXX_REG_VAL_TYPE(TRIAL, 1) ? REG_SZ : REG_DWORD; - pdata = GET_XXX_REG_VAL_TYPE(TRIAL, 1) ? (PVOID)s : (PVOID)&d; - sz = GET_XXX_REG_VAL_TYPE(TRIAL, 1) ? (10+1+1)*sizeof(WCHAR) : sizeof(d); - KdPrint(("%ws\n %ws\n", RegPath, RegKeyName)); - RC = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE /*| RTL_REGISTRY_OPTIONAL*/, - RegPath, RegKeyName, - type, pdata, sz ); - KdPrint(("status %#x\n", RC)); - // Install Date - if(!TrialEndOnStart) { - d = UDFGlobalData.iTime ^ XOR_VAR(Date, 0); - swprintf(s, L"0x%8.8x\0", d); - GET_DATE_REG_KEY_NAME(RegPath, 0); - GET_DATE_REG_VAL_NAME(RegKeyName, 0); - type = GET_XXX_REG_VAL_TYPE(DATE, 0) ? REG_SZ : REG_DWORD; - pdata = GET_XXX_REG_VAL_TYPE(DATE, 0) ? (PVOID)s : (PVOID)&d; - sz = GET_XXX_REG_VAL_TYPE(DATE, 0) ? (10+1+1)*sizeof(WCHAR) : sizeof(d); - if(!(PresentDateMask & (1 << 0))) { - KdPrint(("%ws\n %ws\n", RegPath, RegKeyName)); - RC = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE /*| RTL_REGISTRY_OPTIONAL*/, - RegPath, RegKeyName, - type, pdata, sz ); - KdPrint(("status %#x\n", RC)); - } - d = UDFGlobalData.iTime ^ XOR_VAR(Date, 1); - swprintf(s, L"0x%8.8x\0", d); - GET_DATE_REG_KEY_NAME(RegPath, 1); - GET_DATE_REG_VAL_NAME(RegKeyName, 1); - type = GET_XXX_REG_VAL_TYPE(DATE, 1) ? REG_SZ : REG_DWORD; - pdata = GET_XXX_REG_VAL_TYPE(DATE, 1) ? (PVOID)s : (PVOID)&d; - sz = GET_XXX_REG_VAL_TYPE(DATE, 1) ? (10+1+1)*sizeof(WCHAR) : sizeof(d); - if(!(PresentDateMask & (1 << 1))) { - KdPrint(("%ws\n %ws\n", RegPath, RegKeyName)); - RC = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE /*| RTL_REGISTRY_OPTIONAL*/, - RegPath, RegKeyName, - type, pdata, sz ); - KdPrint(("status %#x\n", RC)); - } - } - // Highest version - d = UDFGlobalData.iVer ^ XOR_VAR(Version, 0); - swprintf(s, L"0x%8.8x\0", d); - GET_VERSION_REG_KEY_NAME(RegPath, 0); - GET_VERSION_REG_VAL_NAME(RegKeyName, 0); - type = GET_XXX_REG_VAL_TYPE(VERSION, 0) ? REG_SZ : REG_DWORD; - pdata = GET_XXX_REG_VAL_TYPE(VERSION, 0) ? (PVOID)s : (PVOID)&d; - sz = GET_XXX_REG_VAL_TYPE(VERSION, 0) ? (10+1+1)*sizeof(WCHAR) : sizeof(d); - KdPrint(("%ws\n %ws\n", RegPath, RegKeyName)); - RC = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE /*| RTL_REGISTRY_OPTIONAL*/, - RegPath, RegKeyName, - type, pdata, sz ); - KdPrint(("status %#x\n", RC)); - d = UDFGlobalData.iVer ^ XOR_VAR(Version, 1); - swprintf(s, L"0x%8.8x\0", d); - GET_VERSION_REG_KEY_NAME(RegPath, 1); - GET_VERSION_REG_VAL_NAME(RegKeyName, 1); - type = GET_XXX_REG_VAL_TYPE(VERSION, 1) ? REG_SZ : REG_DWORD; - pdata = GET_XXX_REG_VAL_TYPE(VERSION, 1) ? (PVOID)s : (PVOID)&d; - sz = GET_XXX_REG_VAL_TYPE(VERSION, 1) ? (10+1+1)*sizeof(WCHAR) : sizeof(d); - KdPrint(("%ws\n %ws\n", RegPath, RegKeyName)); - RC = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE /*| RTL_REGISTRY_OPTIONAL*/, - RegPath, RegKeyName, - type, pdata, sz ); - KdPrint(("status %#x\n", RC)); - } -#endif //EVALUATION_TIME_LIMIT - // initialize the global data resource and remember the fact that // the resource has been initialized RC = UDFInitializeResourceLite(&(UDFGlobalData.GlobalDataResource)); @@ -430,9 +210,6 @@ DriverEntry( UDFInitializeFunctionPointers(DriverObject); UDFGlobalData.CPU_Count = KeNumberProcessors; -#ifdef EVALUATION_TIME_LIMIT - UDFGlobalData.Saved_j = 4; -#endif //EVALUATION_TIME_LIMIT // create a device object representing the driver itself // so that requests can be targeted to the driver ... @@ -548,56 +325,8 @@ DriverEntry( // delay.QuadPart = -10000000; // KeDelayExecutionThread(KernelMode, FALSE, &delay); //10 microseconds -#ifdef EVALUATION_TIME_LIMIT - // Build Registry Value name for License Key - for(i=0; i> 16)); - } - RegKeyName[i] = 0; - -// RtlZeroMemory(UDFGlobalData.LicenseKeyW, sizeof(UDFGlobalData.LicenseKeyW)); - RegTGetStringValue(hUdfRootKey, NULL, - RegKeyName, UDFGlobalData.LicenseKeyW, (16+1)*sizeof(WCHAR)); -// UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_UNREGISTERED; -// } - RegTCloseKeyHandle(hUdfRootKey); - - UDFGlobalData.LicenseKeyW[16] = 0; - // convert WCHAR Key to CHAR key - for(i=0; i<16; i++) { - LicenseKey[i] = (UCHAR)(UDFGlobalData.LicenseKeyW[i]); - } - - // build hash - UDF_build_hash_by_key(pUDFLongKey, UDF_LONG_KEY_SIZE, (PCHAR)&(UDFGlobalData.CurrentKeyHash), LicenseKey); - // check if it is correct - for(i=0; iMajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] = UDFQueryVolInfo; #ifndef UDF_READ_ONLY_BUILD -#ifndef DEMO DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION] = UDFSetVolInfo; -#endif //DEMO #endif //UDF_READ_ONLY_BUILD DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] = UDFDirControl; // To implement support for file system IOCTL calls, enable initialization @@ -790,9 +517,7 @@ UDFInitializeFunctionPointers( #ifdef UDF_ENABLE_SECURITY DriverObject->MajorFunction[IRP_MJ_QUERY_SECURITY] = UDFGetSecurity; #ifndef UDF_READ_ONLY_BUILD -#ifndef DEMO DriverObject->MajorFunction[IRP_MJ_SET_SECURITY] = UDFSetSecurity; -#endif //DEMO #endif //UDF_READ_ONLY_BUILD #endif //UDF_ENABLE_SECURITY @@ -1169,254 +894,3 @@ UDFRemountAll( if (!NT_SUCCESS(RC)) break; } }*/ - - -#ifdef EVALUATION_TIME_LIMIT - -BOOLEAN -UDFGetInstallVersion( - PULONG iVer - ) -{ - WCHAR RegPath[128]; - WCHAR RegVal[64]; - WCHAR Str[32]; - ULONG i, j; - ULONG a, v; - ULONG type; - ULONG sz; - - KdPrint((KD_PREFIX "UDFGetInstallVersion:\n")); - - (*iVer) = UDF_CURRENT_BUILD; - for(j=0; j= 'a' && Str[i] <= 'f') { - a = 10 + Str[i] - 'a'; - } else { - a = Str[i] - '0'; - } - KdPrint((KD_PREFIX "val: %x\n", a)); - v *= 16; - v += a; - } -de_xor: - switch(j) { - case 0: v ^= XOR_VAR(Version, 0); break; - case 1: v ^= XOR_VAR(Version, 1); break; - } - if(v & 0x80000000) - continue; - if((*iVer) == -1 || (*iVer) < v) { - (*iVer) = v; - } - UDFGlobalData.iVer = (*iVer); - } - } - UDFGlobalData.iVer = (*iVer); -/* if(UDFGlobalData.iVer == -1) - return FALSE;*/ - KdPrint((KD_PREFIX "ret val: %x\n", *iVer)); - if((*iVer) > UDF_CURRENT_BUILD) { - return FALSE; - } - return TRUE; -} // end UDFGetInstallVersion() - -BOOLEAN -UDFGetInstallTime( - PULONG iTime - ) -{ - WCHAR RegPath[128]; - WCHAR RegVal[64]; - WCHAR Str[32]; - ULONG i, j; - ULONG a, v; - ULONG type; - ULONG sz; - - KdPrint((KD_PREFIX "UDFGetInstallTime:\n")); - - (*iTime) = -1; - for(j=0; j= 'a' && Str[i] <= 'f') { - a = 10 + Str[i] - 'a'; - } else { - a = Str[i] - '0'; - } - KdPrint((KD_PREFIX "val: %x\n", a)); - v *= 16; - v += a; - } -de_xor: - switch(j) { - case 0: v ^= XOR_VAR(Date, 0); break; - case 1: v ^= XOR_VAR(Date, 1); break; - } - PresentDateMask |= 0x00000001 << j; - if(v & 0x80000000) - continue; - if((*iTime) == -1 || (*iTime) < v) { - (*iTime) = v; - } - UDFGlobalData.iTime = (*iTime); - } - } - UDFGlobalData.iTime = (*iTime); - if(UDFGlobalData.iTime == -1) { - - LARGE_INTEGER cTime; - KeQuerySystemTime((PLARGE_INTEGER)&cTime); - - cTime.QuadPart /= (10*1000*1000); - cTime.QuadPart /= (60*60*24); - - KdPrint((KD_PREFIX "cTime = %x, jTime = %x\n", cTime.LowPart, TIME_JAN_1_2003)); - if(cTime.QuadPart < TIME_JAN_1_2003) { - KdPrint((KD_PREFIX "Eval time expired (1)\n")); - UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_UNREGISTERED; - } - cTime.LowPart -= TIME_JAN_1_2003; - KdPrint(("cTime = %x\n", cTime.LowPart)); - - UDFGlobalData.iTime = (*iTime) = cTime.LowPart; - return FALSE; - } - UDFGlobalData.iTime = (*iTime); - KdPrint((KD_PREFIX "ret val: %x\n", *iTime)); - return TRUE; -} // end UDFGetInstallTime() - -BOOLEAN -UDFGetTrialEnd( - PULONG iTrial - ) -{ - WCHAR RegPath[128]; - WCHAR RegVal[64]; - WCHAR Str[32]; - ULONG i, j; - ULONG a, v; - ULONG type; - ULONG sz; - - KdPrint((KD_PREFIX "UDFGetTrialEnd:\n")); - - (*iTrial) = 0; - for(j=0; j= 'a' && Str[i] <= 'f') { - a = 10 + Str[i] - 'a'; - } else { - a = Str[i] - '0'; - } - KdPrint((KD_PREFIX "val: %x\n", a)); - v *= 16; - v += a; - } -de_xor: - switch(j) { - case 0: v ^= XOR_VAR(TrialEnd, 0); break; - case 1: v ^= XOR_VAR(TrialEnd, 1); break; - } - if((*iTrial) < v) { - (*iTrial) = v; - } - if(UDFGlobalData.iTrial = (*iTrial)) { - return TRUE; - } - } - } - return FALSE; -} // end UDFGetTrialEnd() - -#endif //EVALUATION_TRIAL_LIMIT - - - diff --git a/reactos/drivers/filesystems/udfs/volinfo.cpp b/reactos/drivers/filesystems/udfs/volinfo.cpp index 2e7b45e04c8..5ff1cc727df 100644 --- a/reactos/drivers/filesystems/udfs/volinfo.cpp +++ b/reactos/drivers/filesystems/udfs/volinfo.cpp @@ -21,10 +21,6 @@ Abstract: // define the file specific bug-check id #define UDF_BUG_CHECK_ID UDF_FILE_VOL_INFORMATION -#ifdef DEMO -PWCHAR DemoVolIdent = UDF_DEMO_VOLUME_LABEL; -#endif // DEMO - // Local support routines NTSTATUS UDFQueryFsVolumeInfo ( @@ -313,11 +309,7 @@ UDFQueryFsVolumeInfo( KdPrint((" UDFQueryFsVolumeInfo: \n")); // Fill in the data from the Vcb. Buffer->VolumeCreationTime.QuadPart = Vcb->VolCreationTime; -#ifndef DEMO // release Buffer->VolumeSerialNumber = Vcb->PhSerialNumber; -#else // DEMO - Buffer->VolumeSerialNumber = 0xDE1770; -#endif // DEMO KdPrint((" SN %x\n", Vcb->PhSerialNumber)); Buffer->SupportsObjects = FALSE; @@ -326,11 +318,7 @@ UDFQueryFsVolumeInfo( // Check if the buffer we're given is long enough if (*Length >= (ULONG) Vcb->VolIdent.Length) { -#ifndef DEMO // release BytesToCopy = Vcb->VolIdent.Length; -#else // DEMO - BytesToCopy = sizeof(UDF_DEMO_VOLUME_LABEL) - sizeof(WCHAR); -#endif // DEMO Status = STATUS_SUCCESS; } else { BytesToCopy = *Length; @@ -340,11 +328,7 @@ UDFQueryFsVolumeInfo( Buffer->VolumeLabelLength = BytesToCopy; if (BytesToCopy) -#ifndef DEMO // release RtlCopyMemory( &(Buffer->VolumeLabel[0]), Vcb->VolIdent.Buffer, BytesToCopy ); -#else // DEMO - RtlCopyMemory( &(Buffer->VolumeLabel[0]), DemoVolIdent, BytesToCopy ); -#endif // DEMO *Length -= BytesToCopy; return Status; @@ -618,7 +602,6 @@ UDFQueryFsAttributeInfo( #ifndef UDF_READ_ONLY_BUILD -#ifndef DEMO // release NTSTATUS NTAPI @@ -827,5 +810,4 @@ UDFSetLabelInfo ( return STATUS_SUCCESS; } // end UDFSetLabelInfo () -#endif // DEMO #endif //UDF_READ_ONLY_BUILD diff --git a/reactos/drivers/filesystems/udfs/write.cpp b/reactos/drivers/filesystems/udfs/write.cpp index 32955b3ddb7..dd22e911926 100644 --- a/reactos/drivers/filesystems/udfs/write.cpp +++ b/reactos/drivers/filesystems/udfs/write.cpp @@ -229,14 +229,6 @@ UDFCommonWrite( } Vcb->VCBFlags |= UDF_VCB_SKIP_EJECT_CHECK; -#ifdef EVALUATION_TIME_LIMIT - // License Key check - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; - try_return(RC = STATUS_ACCESS_DENIED); - } -#endif //EVALUATION_TIME_LIMIT - // Disk based file systems might decide to verify the logical volume // (if required and only if removable media are supported) at this time // As soon as Tray is locked, we needn't call UDFVerifyVcb() @@ -436,14 +428,6 @@ UDFCommonWrite( try_return(RC = STATUS_TOO_LATE); } -#ifdef EVALUATION_TIME_LIMIT - // License Key check - if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_UNREGISTERED) { - Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY; - try_return(RC = STATUS_ACCESS_DENIED); - } -#endif //EVALUATION_TIME_LIMIT - // Paging I/O write operations are special. If paging i/o write // requests begin beyond end-of-file, the request should be no-oped // If paging i/o