crypt32: Constify some variables (1 of 2)

Andrew Talbot Andrew.Talbot at talbotville.com
Sat Apr 14 12:12:05 CDT 2007


Changelog:
    crypt32: Constify some variables.

diff -urN a/dlls/crypt32/protectdata.c b/dlls/crypt32/protectdata.c
--- a/dlls/crypt32/protectdata.c	2006-10-06 19:37:56.000000000 +0100
+++ b/dlls/crypt32/protectdata.c	2007-04-14 16:29:30.000000000 +0100
@@ -111,7 +111,7 @@
 
 /* debugging tool to print strings of hex chars */
 static const char *
-hex_str(unsigned char *p, int n)
+hex_str(const unsigned char *p, int n)
 {
     const char * ptr;
     char report[80];
@@ -146,7 +146,7 @@
 }
 
 static
-void serialize_string(BYTE * str,BYTE ** ptr,DWORD len, DWORD width,
+void serialize_string(const BYTE *str, BYTE **ptr, DWORD len, DWORD width,
                       BOOL prepend_len)
 {
     /*TRACE("called %ux%u\n",(unsigned int)len,(unsigned int)width);*/
@@ -160,7 +160,7 @@
 }
 
 static
-BOOL unserialize_dword(BYTE * ptr, DWORD *index, DWORD size, DWORD * value)
+BOOL unserialize_dword(const BYTE *ptr, DWORD *index, DWORD size, DWORD *value)
 {
     /*TRACE("called\n");*/
 
@@ -178,7 +178,7 @@
 }
 
 static
-BOOL unserialize_string(BYTE * ptr, DWORD *index, DWORD size,
+BOOL unserialize_string(const BYTE *ptr, DWORD *index, DWORD size,
                         DWORD len, DWORD width, BOOL inline_len,
                         BYTE ** data, DWORD * stored)
 {
@@ -212,7 +212,7 @@
 }
 
 static
-BOOL serialize(struct protect_data_t * pInfo, DATA_BLOB * pSerial)
+BOOL serialize(const struct protect_data_t *pInfo, DATA_BLOB *pSerial)
 {
     BYTE * ptr;
     DWORD dwStrLen;
@@ -340,7 +340,7 @@
 }
 
 static
-BOOL unserialize(DATA_BLOB * pSerial, struct protect_data_t * pInfo)
+BOOL unserialize(const DATA_BLOB *pSerial, struct protect_data_t *pInfo)
 {
     BYTE * ptr;
     DWORD index;
@@ -484,7 +484,7 @@
 
 /* perform sanity checks */
 static
-BOOL valid_protect_data(struct protect_data_t * pInfo)
+BOOL valid_protect_data(const struct protect_data_t *pInfo)
 {
     BOOL status=TRUE;
 
@@ -681,7 +681,7 @@
 
 /* test that a given hash matches an exported-to-blob hash value */
 static
-BOOL hash_matches_blob(HCRYPTHASH hHash, DATA_BLOB * two)
+BOOL hash_matches_blob(HCRYPTHASH hHash, const DATA_BLOB *two)
 {
     BOOL rc = FALSE;
     DATA_BLOB one;
@@ -704,8 +704,8 @@
 
 /* create an encryption key from a given salt and optional entropy */
 static
-BOOL load_encryption_key(HCRYPTPROV hProv, DATA_BLOB * salt,
-                         DATA_BLOB * pOptionalEntropy, HCRYPTKEY * phKey)
+BOOL load_encryption_key(HCRYPTPROV hProv, const DATA_BLOB *salt,
+                         const DATA_BLOB *pOptionalEntropy, HCRYPTKEY *phKey)
 {
     BOOL rc = TRUE;
     HCRYPTHASH hSaltHash;
@@ -768,7 +768,7 @@
 
 /* debugging tool to print the structures of a ProtectData call */
 static void
-report(DATA_BLOB* pDataIn, DATA_BLOB* pOptionalEntropy,
+report(const DATA_BLOB* pDataIn, const DATA_BLOB* pOptionalEntropy,
        CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags)
 {
     TRACE("pPromptStruct: %p\n", pPromptStruct);



More information about the wine-patches mailing list