[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/image meta_header.c,1.2,1.3 writer.c,1.
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/image meta_header.c,1.2,1.3 writer.c,1.10,1.11 |
Date: |
Thu, 24 Apr 2003 21:22:02 -0400 |
Update of /cvsroot/dotgnu-pnet/pnet/image
In directory subversions:/tmp/cvs-serv4423/image
Modified Files:
meta_header.c writer.c
Log Message:
Add the "Assembly.GetImageRuntimeVersion" internalcall.
Index: meta_header.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/meta_header.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** meta_header.c 20 Aug 2001 00:58:46 -0000 1.2
--- meta_header.c 25 Apr 2003 01:22:00 -0000 1.3
***************
*** 2,6 ****
* meta_header.c - Routines for walking the header of the metadata section.
*
! * Copyright (C) 2001 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
--- 2,6 ----
* meta_header.c - Routines for walking the header of the metadata section.
*
! * Copyright (C) 2001, 2003 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
***************
*** 301,304 ****
--- 301,341 ----
/* The offset is the header's size */
return offset;
+ }
+
+ const char *ILImageMetaRuntimeVersion(ILImage *image, int *length)
+ {
+ unsigned char *addr;
+ unsigned long len;
+ unsigned long headerLen;
+ unsigned long numEntries;
+ unsigned long versionLen;
+ const char *version;
+
+ /* Find the metadata section and validate it */
+ numEntries = GetMetadata(image, &addr, &len, &headerLen);
+ if(numEntries == (unsigned long)0xFFFFFFFF)
+ {
+ return 0;
+ }
+
+ /* Determine the size of the version string */
+ versionLen = headerLen - 20;
+
+ /* The version is at offset 16 within the metadata header */
+ version = (const char *)(addr + 16);
+
+ /* Trim trailing zeros from the version string */
+ while(versionLen > 0 && version[versionLen - 1] == '\0')
+ {
+ --versionLen;
+ }
+ if(!versionLen)
+ {
+ return 0;
+ }
+
+ /* Return the version information to the caller */
+ *length = (int)versionLen;
+ return version;
}
Index: writer.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/writer.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** writer.c 8 Feb 2003 04:24:29 -0000 1.10
--- writer.c 25 Apr 2003 01:22:00 -0000 1.11
***************
*** 317,321 ****
* Must be padded to a multiple of 4 in size.
*/
! #define VERSION_STRING "v1.0.2914\0\0\0"
#define VERSION_STRING_LEN 12
--- 317,321 ----
* Must be padded to a multiple of 4 in size.
*/
! #define VERSION_STRING "v1.1.4322\0\0\0"
#define VERSION_STRING_LEN 12
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/image meta_header.c,1.2,1.3 writer.c,1.10,1.11,
Rhys Weatherley <address@hidden> <=