ReactOS 0.4.16-dev-1470-gfbd70c8
version.c File Reference
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include "ntstatus.h"
#include "windef.h"
#include "winbase.h"
#include "winver.h"
#include "winuser.h"
#include "winnls.h"
#include "winternl.h"
#include "winerror.h"
#include "appmodel.h"
#include "kernelbase.h"
#include "wine/debug.h"
Include dependency graph for version.c:

Go to the source code of this file.

Classes

struct  NE_NAMEINFO
 
struct  NE_TYPEINFO
 
struct  version_info
 
struct  VS_VERSION_INFO_STRUCT16
 
struct  VS_VERSION_INFO_STRUCT32
 

Macros

#define WIN32_NO_STATUS
 
#define VersionInfoIs16(ver)    ( ((const VS_VERSION_INFO_STRUCT16 *)ver)->szKey[0] >= ' ' )
 
#define DWORD_ALIGN(base, ptr)    ( (LPBYTE)(base) + ((((LPBYTE)(ptr) - (LPBYTE)(base)) + 3) & ~3) )
 
#define VersionInfo16_Value(ver)    DWORD_ALIGN( (ver), (ver)->szKey + strlen((ver)->szKey) + 1 )
 
#define VersionInfo32_Value(ver)    DWORD_ALIGN( (ver), (ver)->szKey + lstrlenW((ver)->szKey) + 1 )
 
#define VersionInfo16_Children(ver)
 
#define VersionInfo32_Children(ver)
 
#define VersionInfo16_Next(ver)    (VS_VERSION_INFO_STRUCT16 *)( (LPBYTE)ver + (((ver)->wLength + 3) & ~3) )
 
#define VersionInfo32_Next(ver)    (VS_VERSION_INFO_STRUCT32 *)( (LPBYTE)ver + (((ver)->wLength + 3) & ~3) )
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ver)
 
static BOOL CALLBACK init_current_version (PINIT_ONCE init_once, PVOID parameter, PVOID *context)
 
static const IMAGE_RESOURCE_DIRECTORYfind_entry_by_id (const IMAGE_RESOURCE_DIRECTORY *dir, WORD id, const void *root, DWORD root_size)
 
static const IMAGE_RESOURCE_DIRECTORYfind_entry_default (const IMAGE_RESOURCE_DIRECTORY *dir, const void *root)
 
static int push_language (WORD *list, int pos, WORD lang)
 
static const IMAGE_RESOURCE_DIRECTORYfind_entry_language (const IMAGE_RESOURCE_DIRECTORY *dir, const void *root, DWORD root_size, DWORD flags)
 
static DWORD read_data (HANDLE handle, DWORD offset, void *data, DWORD len)
 
static BOOL find_ne_resource (HANDLE handle, DWORD *resLen, DWORD *resOff)
 
static BOOL find_pe_resource (HANDLE handle, DWORD *resLen, DWORD *resOff, DWORD flags)
 
static DWORD find_version_resource (HANDLE handle, DWORD *reslen, DWORD *offset, DWORD flags)
 
static void print_vffi_debug (const VS_FIXEDFILEINFO *vffi)
 
DWORD WINAPI GetFileVersionInfoSizeW (LPCWSTR filename, LPDWORD handle)
 
DWORD WINAPI GetFileVersionInfoSizeA (LPCSTR filename, LPDWORD handle)
 
DWORD WINAPI GetFileVersionInfoSizeExW (DWORD flags, LPCWSTR filename, LPDWORD ret_handle)
 
DWORD WINAPI GetFileVersionInfoSizeExA (DWORD flags, LPCSTR filename, LPDWORD handle)
 
BOOL WINAPI GetFileVersionInfoExW (DWORD flags, LPCWSTR filename, DWORD ignored, DWORD datasize, LPVOID data)
 
BOOL WINAPI GetFileVersionInfoExA (DWORD flags, LPCSTR filename, DWORD handle, DWORD datasize, LPVOID data)
 
BOOL WINAPI GetFileVersionInfoW (LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
 
BOOL WINAPI GetFileVersionInfoA (LPCSTR filename, DWORD handle, DWORD datasize, LPVOID data)
 
static const VS_VERSION_INFO_STRUCT16VersionInfo16_FindChild (const VS_VERSION_INFO_STRUCT16 *info, LPCSTR key, UINT len)
 
static const VS_VERSION_INFO_STRUCT32VersionInfo32_FindChild (const VS_VERSION_INFO_STRUCT32 *info, LPCWSTR key, UINT len)
 
static BOOL VersionInfo16_QueryValue (const VS_VERSION_INFO_STRUCT16 *info, LPCSTR lpSubBlock, LPVOID *lplpBuffer, UINT *puLen)
 
static BOOL VersionInfo32_QueryValue (const VS_VERSION_INFO_STRUCT32 *info, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, UINT *puLen, BOOL *pbText)
 
BOOL WINAPI VerQueryValueA (LPCVOID pBlock, LPCSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
 
BOOL WINAPI VerQueryValueW (LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
 
static BOOL file_existsA (char const *path, char const *file, BOOL excl)
 
static BOOL file_existsW (const WCHAR *path, const WCHAR *file, BOOL excl)
 
DWORD WINAPI VerFindFileA (DWORD flags, LPCSTR filename, LPCSTR win_dir, LPCSTR app_dir, LPSTR cur_dir, PUINT curdir_len, LPSTR dest, PUINT dest_len)
 
DWORD WINAPI VerFindFileW (DWORD flags, LPCWSTR filename, LPCWSTR win_dir, LPCWSTR app_dir, LPWSTR cur_dir, PUINT curdir_len, LPWSTR dest, PUINT dest_len)
 
BOOL WINAPI DECLSPEC_HOTPATCH GetProductInfo (DWORD os_major, DWORD os_minor, DWORD sp_major, DWORD sp_minor, DWORD *type)
 
DWORD WINAPI GetVersion (void)
 
BOOL WINAPI GetVersionExA (OSVERSIONINFOA *info)
 
BOOL WINAPI GetVersionExW (OSVERSIONINFOW *info)
 
LONG WINAPI GetCurrentPackageFamilyName (UINT32 *length, WCHAR *name)
 
LONG WINAPI GetCurrentPackageFullName (UINT32 *length, WCHAR *name)
 
LONG WINAPI GetCurrentPackageId (UINT32 *len, BYTE *buffer)
 
LONG WINAPI GetCurrentPackageInfo (const UINT32 flags, UINT32 *buffer_size, BYTE *buffer, UINT32 *count)
 
LONG WINAPI GetCurrentPackagePath (UINT32 *length, WCHAR *path)
 
LONG WINAPI GetPackageFullName (HANDLE process, UINT32 *length, WCHAR *name)
 
LONG WINAPI GetPackageFamilyName (HANDLE process, UINT32 *length, WCHAR *name)
 
LONG WINAPI DECLSPEC_HOTPATCH GetPackagesByPackageFamily (const WCHAR *family_name, UINT32 *count, WCHAR *full_names, UINT32 *buffer_len, WCHAR *buffer)
 
LONG WINAPI GetPackagePathByFullName (const WCHAR *name, UINT32 *len, WCHAR *path)
 
static UINT32 processor_arch_from_string (const WCHAR *str, unsigned int len)
 
LONG WINAPI PackageIdFromFullName (const WCHAR *full_name, UINT32 flags, UINT32 *buffer_length, BYTE *buffer)
 

Variables

static const struct version_info windows8_version_info = { 6, 2, 9200 }
 
static const struct version_info windows8_1_version_info = { 6, 3, 9600 }
 
struct {
   struct version_info   info
 
   GUID   guid
 
version_data []
 
static RTL_OSVERSIONINFOEXW current_version
 
struct {
   UINT32   code
 
   const WCHAR *   name
 
arch_names []
 

Macro Definition Documentation

◆ DWORD_ALIGN

#define DWORD_ALIGN (   base,
  ptr 
)     ( (LPBYTE)(base) + ((((LPBYTE)(ptr) - (LPBYTE)(base)) + 3) & ~3) )

Definition at line 105 of file version.c.

◆ VersionInfo16_Children

#define VersionInfo16_Children (   ver)
Value:
( ( (ver)->wValueLength + 3 ) & ~3 ) )
#define VersionInfo16_Value(ver)
Definition: version.c:108

Definition at line 113 of file version.c.

◆ VersionInfo16_Next

#define VersionInfo16_Next (   ver)     (VS_VERSION_INFO_STRUCT16 *)( (LPBYTE)ver + (((ver)->wLength + 3) & ~3) )

Definition at line 121 of file version.c.

◆ VersionInfo16_Value

#define VersionInfo16_Value (   ver)     DWORD_ALIGN( (ver), (ver)->szKey + strlen((ver)->szKey) + 1 )

Definition at line 108 of file version.c.

◆ VersionInfo32_Children

#define VersionInfo32_Children (   ver)
Value:
( ( (ver)->wValueLength * \
((ver)->wType? 2 : 1) + 3 ) & ~3 ) )
#define VersionInfo32_Value(ver)
Definition: version.c:110

Definition at line 116 of file version.c.

◆ VersionInfo32_Next

#define VersionInfo32_Next (   ver)     (VS_VERSION_INFO_STRUCT32 *)( (LPBYTE)ver + (((ver)->wLength + 3) & ~3) )

Definition at line 123 of file version.c.

◆ VersionInfo32_Value

#define VersionInfo32_Value (   ver)     DWORD_ALIGN( (ver), (ver)->szKey + lstrlenW((ver)->szKey) + 1 )

Definition at line 110 of file version.c.

◆ VersionInfoIs16

#define VersionInfoIs16 (   ver)     ( ((const VS_VERSION_INFO_STRUCT16 *)ver)->szKey[0] >= ' ' )

Definition at line 102 of file version.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 32 of file version.c.

Function Documentation

◆ file_existsA()

static BOOL file_existsA ( char const path,
char const file,
BOOL  excl 
)
static

Definition at line 1227 of file version.c.

1228{
1230 char filename[MAX_PATH];
1231 int len;
1232 HANDLE handle;
1233
1234 if (path)
1235 {
1236 strcpy( filename, path );
1237 len = strlen(filename);
1238 if (len && filename[len - 1] != '\\') strcat( filename, "\\" );
1239 strcat( filename, file );
1240 }
1241 else if (!SearchPathA( NULL, file, NULL, MAX_PATH, filename, NULL )) return FALSE;
1242
1244 if (handle == INVALID_HANDLE_VALUE) return FALSE;
1246 return TRUE;
1247}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define MAX_PATH
Definition: compat.h:34
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define FILE_SHARE_READ
Definition: compat.h:136
DWORD WINAPI SearchPathA(IN LPCSTR lpPath OPTIONAL, IN LPCSTR lpFileName, IN LPCSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPSTR lpBuffer, OUT LPSTR *lpFilePart OPTIONAL)
Definition: path.c:1123
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
const char * filename
Definition: ioapi.h:137
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG sharing
Definition: pipe.c:70
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
strcat
Definition: string.h:92
strcpy
Definition: string.h:131
Definition: fci.c:127

Referenced by VerFindFileA().

◆ file_existsW()

static BOOL file_existsW ( const WCHAR path,
const WCHAR file,
BOOL  excl 
)
static

Definition at line 1252 of file version.c.

1253{
1256 int len;
1257 HANDLE handle;
1258
1259 if (path)
1260 {
1263 if (len && filename[len - 1] != '\\') lstrcatW( filename, L"\\" );
1265 }
1266 else if (!SearchPathW( NULL, file, NULL, MAX_PATH, filename, NULL )) return FALSE;
1267
1269 if (handle == INVALID_HANDLE_VALUE) return FALSE;
1271 return TRUE;
1272}
#define CreateFileW
Definition: compat.h:741
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
DWORD WINAPI SearchPathW(IN LPCWSTR lpPath OPTIONAL, IN LPCWSTR lpFileName, IN LPCWSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart OPTIONAL)
Definition: path.c:1298
#define L(x)
Definition: resources.c:13
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by VerFindFileW().

◆ find_entry_by_id()

static const IMAGE_RESOURCE_DIRECTORY * find_entry_by_id ( const IMAGE_RESOURCE_DIRECTORY dir,
WORD  id,
const void root,
DWORD  root_size 
)
static

Definition at line 270 of file version.c.

273{
275 int min, max, pos;
276
278 min = dir->NumberOfNamedEntries;
279 max = min + dir->NumberOfIdEntries - 1;
280
281 if (max >= (root_size - ((INT_PTR)dir - (INT_PTR)root) - sizeof(*dir)) / sizeof(*entry))
282 return NULL;
283
284 while (min <= max)
285 {
286 pos = (min + max) / 2;
287 if (entry[pos].Id == id)
288 {
289 DWORD offset = entry[pos].OffsetToDirectory;
290 if (offset > root_size - sizeof(*dir)) return NULL;
291 return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + offset);
292 }
293 if (entry[pos].Id > id) max = pos - 1;
294 else min = pos + 1;
295 }
296 return NULL;
297}
DWORD Id
unsigned int dir
Definition: maze.c:112
GLintptr offset
Definition: glext.h:5920
uint32_t entry
Definition: isohybrid.c:63
#define min(a, b)
Definition: monoChain.cc:55
Definition: pedump.c:414
#define max(a, b)
Definition: svc.c:63
int32_t INT_PTR
Definition: typedefs.h:64

Referenced by find_entry_language(), and find_pe_resource().

◆ find_entry_default()

static const IMAGE_RESOURCE_DIRECTORY * find_entry_default ( const IMAGE_RESOURCE_DIRECTORY dir,
const void root 
)
static

Definition at line 306 of file version.c.

308{
310
312 return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry->OffsetToDirectory);
313}

Referenced by find_entry_language().

◆ find_entry_language()

static const IMAGE_RESOURCE_DIRECTORY * find_entry_language ( const IMAGE_RESOURCE_DIRECTORY dir,
const void root,
DWORD  root_size,
DWORD  flags 
)
static

Definition at line 333 of file version.c.

336{
338 WORD list[9];
339 int i, pos = 0;
340
342 {
343 /* cf. LdrFindResource_U */
345 pos = push_language( list, pos, LANGIDFROMLCID( NtCurrentTeb()->CurrentLocale ) );
353 }
354 else
355 {
356 /* FIXME: resolve LN file here */
358 }
359
360 for (i = 0; i < pos; i++) if ((ret = find_entry_by_id( dir, list[i], root, root_size ))) return ret;
361 return find_entry_default( dir, root );
362}
Definition: list.h:37
LANGID WINAPI GetSystemDefaultLangID(void)
Definition: locale.c:1199
LANGID WINAPI GetUserDefaultLangID(void)
Definition: locale.c:1182
static const IMAGE_RESOURCE_DIRECTORY * find_entry_default(const IMAGE_RESOURCE_DIRECTORY *dir, const void *root)
Definition: version.c:306
static const IMAGE_RESOURCE_DIRECTORY * find_entry_by_id(const IMAGE_RESOURCE_DIRECTORY *dir, WORD id, const void *root, DWORD root_size)
Definition: version.c:270
static int push_language(WORD *list, int pos, WORD lang)
Definition: version.c:321
return ret
Definition: mutex.c:146
unsigned short WORD
Definition: ntddk_ex.h:93
GLbitfield flags
Definition: glext.h:7161
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define NtCurrentTeb
#define LANG_NEUTRAL
Definition: nls.h:22
#define MAKELANGID(p, s)
Definition: nls.h:15
#define LANG_ENGLISH
Definition: nls.h:52
#define LANGIDFROMLCID(l)
Definition: nls.h:18
#define SUBLANG_NEUTRAL
Definition: nls.h:167
#define SUBLANG_DEFAULT
Definition: nls.h:168
#define PRIMARYLANGID(l)
Definition: nls.h:16
#define FILE_VER_GET_LOCALISED
Definition: verrsrc.h:147

Referenced by find_pe_resource().

◆ find_ne_resource()

static BOOL find_ne_resource ( HANDLE  handle,
DWORD resLen,
DWORD resOff 
)
static

Definition at line 377 of file version.c.

378{
379 const WORD typeid = VS_FILE_INFO | 0x8000;
380 const WORD resid = VS_VERSION_INFO | 0x8000;
381 IMAGE_OS2_HEADER nehd;
382 NE_TYPEINFO *typeInfo;
383 NE_NAMEINFO *nameInfo;
384 DWORD nehdoffset = *resOff;
385 LPBYTE resTab;
386 DWORD resTabSize;
387 int count;
388
389 /* Read in NE header */
390 if (read_data( handle, nehdoffset, &nehd, sizeof(nehd) ) != sizeof(nehd)) return FALSE;
391
392 resTabSize = nehd.ne_restab - nehd.ne_rsrctab;
393 if ( !resTabSize )
394 {
395 TRACE("No resources in NE dll\n" );
396 return FALSE;
397 }
398
399 /* Read in resource table */
400 resTab = HeapAlloc( GetProcessHeap(), 0, resTabSize );
401 if ( !resTab ) return FALSE;
402
403 if (read_data( handle, nehd.ne_rsrctab + nehdoffset, resTab, resTabSize ) != resTabSize)
404 {
405 HeapFree( GetProcessHeap(), 0, resTab );
406 return FALSE;
407 }
408
409 /* Find resource */
410 typeInfo = (NE_TYPEINFO *)(resTab + 2);
411 while (typeInfo->type_id)
412 {
413 if (typeInfo->type_id == typeid) goto found_type;
414 typeInfo = (NE_TYPEINFO *)((char *)(typeInfo + 1) +
415 typeInfo->count * sizeof(NE_NAMEINFO));
416 }
417 TRACE("No typeid entry found\n" );
418 HeapFree( GetProcessHeap(), 0, resTab );
419 return FALSE;
420
421 found_type:
422 nameInfo = (NE_NAMEINFO *)(typeInfo + 1);
423
424 for (count = typeInfo->count; count > 0; count--, nameInfo++)
425 if (nameInfo->id == resid) goto found_name;
426
427 TRACE("No resid entry found\n" );
428 HeapFree( GetProcessHeap(), 0, resTab );
429 return FALSE;
430
431 found_name:
432 /* Return resource data */
433 *resLen = nameInfo->length << *(WORD *)resTab;
434 *resOff = nameInfo->offset << *(WORD *)resTab;
435
436 HeapFree( GetProcessHeap(), 0, resTab );
437 return TRUE;
438}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define VS_FILE_INFO
Definition: ntverrsrc.c:28
#define VS_VERSION_INFO
Definition: ntverrsrc.c:27
#define TRACE(s)
Definition: solgame.cpp:4
WORD offset
Definition: version.c:49
WORD length
Definition: version.c:50
WORD id
Definition: version.c:52
WORD type_id
Definition: version.c:59
WORD count
Definition: version.c:60
unsigned char * LPBYTE
Definition: typedefs.h:53

Referenced by find_version_resource().

◆ find_pe_resource()

static BOOL find_pe_resource ( HANDLE  handle,
DWORD resLen,
DWORD resOff,
DWORD  flags 
)
static

Definition at line 443 of file version.c.

444{
445 union
446 {
449 } pehd;
450 DWORD pehdoffset = *resOff;
451 PIMAGE_DATA_DIRECTORY resDataDir;
453 LPBYTE resSection;
454 DWORD len, section_size, data_size, resDirSize;
455 const void *resDir;
456 const IMAGE_RESOURCE_DIRECTORY *resPtr;
457 const IMAGE_RESOURCE_DATA_ENTRY *resData;
458 int i, nSections;
459 BOOL ret = FALSE;
460
461 /* Read in PE header */
462 len = read_data( handle, pehdoffset, &pehd, sizeof(pehd) );
463 if (len < sizeof(pehd.nt32.FileHeader)) return FALSE;
464 if (len < sizeof(pehd)) memset( (char *)&pehd + len, 0, sizeof(pehd) - len );
465
466 switch (pehd.nt32.OptionalHeader.Magic)
467 {
469 resDataDir = pehd.nt32.OptionalHeader.DataDirectory + IMAGE_DIRECTORY_ENTRY_RESOURCE;
470 break;
472 resDataDir = pehd.nt64.OptionalHeader.DataDirectory + IMAGE_DIRECTORY_ENTRY_RESOURCE;
473 break;
474 default:
475 return FALSE;
476 }
477
478 if ( !resDataDir->Size )
479 {
480 TRACE("No resources in PE dll\n" );
481 return FALSE;
482 }
483
484 /* Read in section table */
485 nSections = pehd.nt32.FileHeader.NumberOfSections;
487 nSections * sizeof(IMAGE_SECTION_HEADER) );
488 if ( !sections ) return FALSE;
489
490 len = FIELD_OFFSET( IMAGE_NT_HEADERS32, OptionalHeader ) + pehd.nt32.FileHeader.SizeOfOptionalHeader;
491 if (read_data( handle, pehdoffset + len, sections, nSections * sizeof(IMAGE_SECTION_HEADER) ) !=
492 nSections * sizeof(IMAGE_SECTION_HEADER))
493 {
495 return FALSE;
496 }
497
498 /* Find resource section */
499 for ( i = 0; i < nSections; i++ )
500 if ( resDataDir->VirtualAddress >= sections[i].VirtualAddress
501 && resDataDir->VirtualAddress < sections[i].VirtualAddress +
502 sections[i].SizeOfRawData )
503 break;
504
505 if ( i == nSections )
506 {
508 TRACE("Couldn't find resource section\n" );
509 return FALSE;
510 }
511
512 /* Read in resource section */
513 data_size = sections[i].SizeOfRawData;
514 section_size = max( data_size, sections[i].Misc.VirtualSize );
515 resSection = HeapAlloc( GetProcessHeap(), 0, section_size );
516 if ( !resSection )
517 {
519 return FALSE;
520 }
521
522 if (read_data( handle, sections[i].PointerToRawData, resSection, data_size ) != data_size) goto done;
523 if (data_size < section_size) memset( (char *)resSection + data_size, 0, section_size - data_size );
524
525 /* Find resource */
526 resDir = resSection + (resDataDir->VirtualAddress - sections[i].VirtualAddress);
527 resDirSize = section_size - (resDataDir->VirtualAddress - sections[i].VirtualAddress);
528
529 resPtr = resDir;
530 resPtr = find_entry_by_id( resPtr, VS_FILE_INFO, resDir, resDirSize );
531 if ( !resPtr )
532 {
533 TRACE("No typeid entry found\n" );
534 goto done;
535 }
536 resPtr = find_entry_by_id( resPtr, VS_VERSION_INFO, resDir, resDirSize );
537 if ( !resPtr )
538 {
539 TRACE("No resid entry found\n" );
540 goto done;
541 }
542 resPtr = find_entry_language( resPtr, resDir, resDirSize, flags );
543 if ( !resPtr )
544 {
545 TRACE("No default language entry found\n" );
546 goto done;
547 }
548
549 /* Find resource data section */
550 resData = (const IMAGE_RESOURCE_DATA_ENTRY*)resPtr;
551 for ( i = 0; i < nSections; i++ )
552 if ( resData->OffsetToData >= sections[i].VirtualAddress
553 && resData->OffsetToData < sections[i].VirtualAddress +
554 sections[i].SizeOfRawData )
555 break;
556
557 if ( i == nSections )
558 {
559 TRACE("Couldn't find resource data section\n" );
560 goto done;
561 }
562
563 /* Return resource data */
564 *resLen = resData->Size;
565 *resOff = resData->OffsetToData - sections[i].VirtualAddress + sections[i].PointerToRawData;
566 ret = TRUE;
567
568 done:
569 HeapFree( GetProcessHeap(), 0, resSection );
571 return ret;
572}
static const IMAGE_RESOURCE_DIRECTORY * find_entry_language(const IMAGE_RESOURCE_DIRECTORY *dir, const void *root, DWORD root_size, DWORD flags)
Definition: version.c:333
unsigned int BOOL
Definition: ntddk_ex.h:94
struct section sections[2]
Definition: diskspace.c:792
#define IMAGE_NT_OPTIONAL_HDR32_MAGIC
Definition: ntimage.h:376
#define IMAGE_NT_OPTIONAL_HDR64_MAGIC
Definition: ntimage.h:377
#define IMAGE_DIRECTORY_ENTRY_RESOURCE
Definition: pedump.c:261
#define memset(x, y, z)
Definition: compat.h:39
Definition: pedump.c:458
DWORD OffsetToData
Definition: pedump.c:459
DWORD Size
Definition: pedump.c:460
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by find_version_resource().

◆ find_version_resource()

static DWORD find_version_resource ( HANDLE  handle,
DWORD reslen,
DWORD offset,
DWORD  flags 
)
static

Definition at line 578 of file version.c.

579{
581 WORD magic;
582
583 if (read_data( handle, 0, &mzh, sizeof(mzh) ) != sizeof(mzh)) return 0;
584 if (mzh.e_magic != IMAGE_DOS_SIGNATURE) return 0;
585
586 if (read_data( handle, mzh.e_lfanew, &magic, sizeof(magic) ) != sizeof(magic)) return 0;
587 *offset = mzh.e_lfanew;
588
589 switch (magic)
590 {
592 if (!find_ne_resource( handle, reslen, offset )) magic = 0;
593 break;
595 if (!find_pe_resource( handle, reslen, offset, flags )) magic = 0;
596 break;
597 }
598 WARN( "Can't handle %04x files.\n", magic );
599 return magic;
600}
#define WARN(fmt,...)
Definition: precomp.h:61
static BOOL find_pe_resource(HANDLE handle, DWORD *resLen, DWORD *resOff, DWORD flags)
Definition: version.c:443
static BOOL find_ne_resource(HANDLE handle, DWORD *resLen, DWORD *resOff)
Definition: version.c:377
static DWORD LPDWORD reslen
Definition: directory.c:51
#define IMAGE_NT_SIGNATURE
Definition: pedump.c:93
#define IMAGE_OS2_SIGNATURE
Definition: pedump.c:90
#define IMAGE_DOS_SIGNATURE
Definition: pedump.c:89

Referenced by GetFileVersionInfoExW(), and GetFileVersionInfoSizeExW().

◆ GetCurrentPackageFamilyName()

LONG WINAPI GetCurrentPackageFamilyName ( UINT32 length,
WCHAR name 
)

Definition at line 1549 of file version.c.

1550{
1551 FIXME( "(%p %p): stub\n", length, name );
1553}
#define FIXME(fmt,...)
Definition: precomp.h:53
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
Definition: name.c:39
#define APPMODEL_ERROR_NO_PACKAGE
Definition: winerror.h:2337

◆ GetCurrentPackageFullName()

LONG WINAPI GetCurrentPackageFullName ( UINT32 length,
WCHAR name 
)

Definition at line 1559 of file version.c.

1560{
1561 FIXME( "(%p %p): stub\n", length, name );
1563}

◆ GetCurrentPackageId()

LONG WINAPI GetCurrentPackageId ( UINT32 len,
BYTE buffer 
)

Definition at line 1569 of file version.c.

1570{
1571 FIXME( "(%p %p): stub\n", len, buffer );
1573}
GLuint buffer
Definition: glext.h:5915

◆ GetCurrentPackageInfo()

LONG WINAPI GetCurrentPackageInfo ( const UINT32  flags,
UINT32 buffer_size,
BYTE buffer,
UINT32 count 
)

Definition at line 1578 of file version.c.

1579{
1580 FIXME( "(%#x %p %p %p): stub\n", flags, buffer_size, buffer, count );
1582}
wchar_t const *const size_t const buffer_size
Definition: stat.cpp:95

◆ GetCurrentPackagePath()

LONG WINAPI GetCurrentPackagePath ( UINT32 length,
WCHAR path 
)

Definition at line 1587 of file version.c.

1588{
1589 FIXME( "(%p %p): stub\n", length, path );
1591}

◆ GetFileVersionInfoA()

BOOL WINAPI GetFileVersionInfoA ( LPCSTR  filename,
DWORD  handle,
DWORD  datasize,
LPVOID  data 
)

Definition at line 975 of file version.c.

976{
978}
static SIZE_T datasize
Definition: asm.c:30
BOOL WINAPI GetFileVersionInfoExA(DWORD flags, LPCSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:944
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

Referenced by _fetch_versioninfo(), create_file_with_version(), debugsymbols_GetModuleVersionInformation(), get_file_version(), get_version_info(), GetDriverVersion(), is_stub_dll(), SHLWAPI_GetModuleVersion(), START_TEST(), test_32bit_win(), test_extra_block(), test_info(), Test_VerQueryValueA(), and test_VerQueryValueA().

◆ GetFileVersionInfoExA()

BOOL WINAPI GetFileVersionInfoExA ( DWORD  flags,
LPCSTR  filename,
DWORD  handle,
DWORD  datasize,
LPVOID  data 
)

Definition at line 944 of file version.c.

945{
947 BOOL retval;
948
949 TRACE("(0x%lx,%s,%ld,size=%ld,data=%p)\n",
951
952 if(filename)
954 else
955 filenameW.Buffer = NULL;
956
958
960
961 return retval;
962}
BOOL WINAPI GetFileVersionInfoExW(DWORD flags, LPCWSTR filename, DWORD ignored, DWORD datasize, LPVOID data)
Definition: version.c:863
#define debugstr_a
Definition: kernel32.h:31
static const WCHAR filenameW[]
Definition: amstream.c:41
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
int retval
Definition: wcstombs.cpp:91

Referenced by GetFileVersionInfoA().

◆ GetFileVersionInfoExW()

BOOL WINAPI GetFileVersionInfoExW ( DWORD  flags,
LPCWSTR  filename,
DWORD  ignored,
DWORD  datasize,
LPVOID  data 
)

Definition at line 863 of file version.c.

864{
865 static const char signature[4] = "FE2X";
866 DWORD len, offset, magic = 1;
869
870 TRACE("(0x%lx,%s,%ld,size=%ld,data=%p)\n",
872
873 if (!data)
874 {
876 return FALSE;
877 }
879 FIXME("flags 0x%lx ignored\n", flags & ~FILE_VER_GET_LOCALISED);
880
882 {
883 HRSRC hRsrc = NULL;
885 {
889 }
890 if (!hRsrc)
893 if (hRsrc)
894 {
895 HGLOBAL hMem = LoadResource( hModule, hRsrc );
896 magic = IMAGE_NT_SIGNATURE;
897 len = min( SizeofResource(hModule, hRsrc), datasize );
898 memcpy( data, LockResource( hMem ), len );
899 FreeResource( hMem );
900 }
902 }
903 else
904 {
906 NULL, OPEN_EXISTING, 0, 0 );
907 if (handle == INVALID_HANDLE_VALUE) return 0;
908 if ((magic = find_version_resource( handle, &len, &offset, flags )))
911 }
912
913 switch (magic)
914 {
916 /* We have a 16bit resource. */
917 if (TRACE_ON(ver))
919 SetLastError(0);
920 return TRUE;
921
923 /* We have a 32bit resource.
924 *
925 * XP/W2K/W2K3 uses a buffer which is 2 times the actual needed space + 4 bytes "FE2X"
926 * This extra buffer is used for Unicode to ANSI conversions in A-Calls
927 */
928 len = vvis->wLength + sizeof(signature);
929 if (datasize >= len) memcpy( (char*)data + vvis->wLength, signature, sizeof(signature) );
930 if (TRACE_ON(ver))
932 SetLastError(0);
933 return TRUE;
934
935 default:
937 return FALSE;
938 }
939}
HMODULE hModule
Definition: animate.c:44
#define SetLastError(x)
Definition: compat.h:752
#define FreeLibrary(x)
Definition: compat.h:748
#define GENERIC_READ
Definition: compat.h:135
#define TRACE_ON(x)
Definition: compat.h:75
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
BOOL WINAPI FreeResource(HGLOBAL handle)
Definition: res.c:559
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HRSRC WINAPI FindResourceExW(HMODULE hModule, LPCWSTR type, LPCWSTR name, WORD lang)
Definition: res.c:164
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
static DWORD find_version_resource(HANDLE handle, DWORD *reslen, DWORD *offset, DWORD flags)
Definition: version.c:578
static void print_vffi_debug(const VS_FIXEDFILEINFO *vffi)
Definition: version.c:606
uint8_t ignored[3]
Definition: fsck.fat.h:0
#define debugstr_w
Definition: kernel32.h:32
USHORT LANGID
Definition: mui.h:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static const LCID english
Definition: wbemdisp.c:32
#define LOAD_LIBRARY_AS_IMAGE_RESOURCE
Definition: winbase.h:380
#define ERROR_RESOURCE_DATA_NOT_FOUND
Definition: winerror.h:1119
#define ERROR_INVALID_DATA
Definition: winerror.h:116
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by GetFileVersionInfoExA(), and GetFileVersionInfoW().

◆ GetFileVersionInfoSizeA()

◆ GetFileVersionInfoSizeExA()

DWORD WINAPI GetFileVersionInfoSizeExA ( DWORD  flags,
LPCSTR  filename,
LPDWORD  handle 
)

Definition at line 841 of file version.c.

842{
845
846 TRACE("(0x%lx,%s,%p)\n", flags, debugstr_a(filename), handle );
847
848 if(filename)
850 else
851 filenameW.Buffer = NULL;
852
854
856
857 return retval;
858}
DWORD WINAPI GetFileVersionInfoSizeExW(DWORD flags, LPCWSTR filename, LPDWORD ret_handle)
Definition: version.c:754

Referenced by GetFileVersionInfoSizeA().

◆ GetFileVersionInfoSizeExW()

DWORD WINAPI GetFileVersionInfoSizeExW ( DWORD  flags,
LPCWSTR  filename,
LPDWORD  ret_handle 
)

Definition at line 754 of file version.c.

755{
756 DWORD len, offset, magic = 1;
758
759 TRACE("(0x%lx,%s,%p)\n", flags, debugstr_w(filename), ret_handle );
760
761 if (ret_handle) *ret_handle = 0;
762
763 if (!filename)
764 {
766 return 0;
767 }
768 if (!*filename)
769 {
771 return 0;
772 }
774 FIXME("flags 0x%lx ignored\n", flags & ~FILE_VER_GET_LOCALISED);
775
777 {
778 HRSRC hRsrc = NULL;
780 {
784 }
785 if (!hRsrc)
788 if (hRsrc)
789 {
790 magic = IMAGE_NT_SIGNATURE;
791 len = SizeofResource( hModule, hRsrc );
792 }
794 }
795 else
796 {
798 NULL, OPEN_EXISTING, 0, 0 );
799 if (handle == INVALID_HANDLE_VALUE) return 0;
802 }
803
804 switch (magic)
805 {
807 /* We have a 16bit resource.
808 *
809 * XP/W2K/W2K3 uses a buffer which is more than the actual needed space:
810 *
811 * (info->wLength - sizeof(VS_FIXEDFILEINFO)) * 4
812 *
813 * This extra buffer is used for ANSI to Unicode conversions in W-Calls.
814 * info->wLength should be the same as len. Currently it isn't but that
815 * doesn't seem to be a problem (len is bigger than info->wLength).
816 */
817 SetLastError(0);
818 return (len - sizeof(VS_FIXEDFILEINFO)) * 4;
819
821 /* We have a 32bit resource.
822 *
823 * XP/W2K/W2K3 uses a buffer which is 2 times the actual needed space + 4 bytes "FE2X"
824 * This extra buffer is used for Unicode to ANSI conversions in A-Calls
825 */
826 SetLastError(0);
827 return (len * 2) + 4;
828
829 default:
830 if (GetVersion() & 0x80000000) /* Windows 95/98 */
832 else
834 return 0;
835 }
836}
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
DWORD WINAPI GetVersion(void)
Definition: version.c:1458
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define ERROR_BAD_PATHNAME
Definition: winerror.h:233

Referenced by GetFileVersionInfoSizeExA(), and GetFileVersionInfoSizeW().

◆ GetFileVersionInfoSizeW()

◆ GetFileVersionInfoW()

◆ GetPackageFamilyName()

LONG WINAPI GetPackageFamilyName ( HANDLE  process,
UINT32 length,
WCHAR name 
)

Definition at line 1607 of file version.c.

1608{
1609 FIXME( "(%p %p %p): stub\n", process, length, name );
1611}

◆ GetPackageFullName()

LONG WINAPI GetPackageFullName ( HANDLE  process,
UINT32 length,
WCHAR name 
)

Definition at line 1597 of file version.c.

1598{
1599 FIXME( "(%p %p %p): stub\n", process, length, name );
1601}

◆ GetPackagePathByFullName()

LONG WINAPI GetPackagePathByFullName ( const WCHAR name,
UINT32 len,
WCHAR path 
)

Definition at line 1632 of file version.c.

1633{
1634 if (!len || !name)
1636
1637 FIXME( "(%s %p %p): stub\n", debugstr_w(name), len, path );
1638
1640}

◆ GetPackagesByPackageFamily()

LONG WINAPI DECLSPEC_HOTPATCH GetPackagesByPackageFamily ( const WCHAR family_name,
UINT32 count,
WCHAR full_names,
UINT32 buffer_len,
WCHAR buffer 
)

Definition at line 1616 of file version.c.

1618{
1619 FIXME( "(%s %p %p %p %p): stub\n", debugstr_w(family_name), count, full_names, buffer_len, buffer );
1620
1621 if (!count || !buffer_len)
1623
1624 *count = 0;
1625 *buffer_len = 0;
1626 return ERROR_SUCCESS;
1627}
#define ERROR_SUCCESS
Definition: deptool.c:10
T1_FIELD_DICT_FONTDICT family_name
Definition: t1tokens.h:30

◆ GetProductInfo()

BOOL WINAPI DECLSPEC_HOTPATCH GetProductInfo ( DWORD  os_major,
DWORD  os_minor,
DWORD  sp_major,
DWORD  sp_minor,
DWORD type 
)

Definition at line 1448 of file version.c.

1450{
1451 return RtlGetProductInfo( os_major, os_minor, sp_major, sp_minor, type );
1452}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
NTSYSAPI BOOLEAN NTAPI RtlGetProductInfo(_In_ ULONG OSMajorVersion, _In_ ULONG OSMinorVersion, _In_ ULONG SpMajorVersion, _In_ ULONG SpMinorVersion, _Out_ PULONG ReturnedProductType)

Referenced by get_operatingsystemsku(), and init_function_pointers().

◆ GetVersion()

DWORD WINAPI GetVersion ( void  )

Definition at line 1458 of file version.c.

1459{
1461 DWORD result;
1462
1463 info.dwOSVersionInfoSize = sizeof(info);
1464 if (!GetVersionExW( (OSVERSIONINFOW *)&info )) return 0;
1465
1466 result = MAKELONG( MAKEWORD( info.dwMajorVersion, info.dwMinorVersion ),
1467 (info.dwPlatformId ^ 2) << 14 );
1468
1469 if (info.dwPlatformId == VER_PLATFORM_WIN32_NT)
1470 result |= LOWORD(info.dwBuildNumber) << 16;
1471 return result;
1472}
BOOL WINAPI GetVersionExW(IN LPOSVERSIONINFOW lpVersionInformation)
Definition: version.c:37
struct version_info info
Definition: version.c:146
GLuint64EXT * result
Definition: glext.h:11304
#define VER_PLATFORM_WIN32_NT
Definition: rtltypes.h:238
#define LOWORD(l)
Definition: pedump.c:82
#define MAKEWORD(a, b)
Definition: typedefs.h:248
#define MAKELONG(a, b)
Definition: typedefs.h:249

Referenced by _LocalGetPrinterLevel0(), AfdCreateSocket(), CDefaultContextMenu::BrowserFlagsFromVerb(), CheckCdrwFilter(), ConvertStringSecurityDescriptorToSecurityDescriptorW(), ConvertStringSidToSidA(), ConvertStringSidToSidW(), CreateAllAccessSecurityAttributes(), CreateFileA(), CreateFileW(), dde_connect(), DECLARE_INTERFACE_(), DllMain(), get_host_os_flag(), get_window_region(), GetDiskFreeSpaceW(), GetFileVersionInfoSizeExW(), GetProgramFilesPath(), GetVersionMajorMinor(), GetWinVersion(), InitTreeViewItems(), IPropertyStorage_fnWriteMultiple(), is_version_nt(), load_library(), LoadCardBitmaps(), main(), MDIMainFrame::MDIMainFrame(), MsiGetMode(), OaBuildVersion(), CShellBrowser::OnBackspace(), OpenProcess(), path_to_pidl(), register_classes(), RichEditWndProcW(), CShellLink::Save(), SHCreateWorkerWindowW(), SHELL32_FileOperation(), SHELL_OsIsUnicode(), START_TEST(), test_button_messages(), test_CopyImage_Bitmap(), test_CopyImage_Check(), test_enum_value(), test_enumdisplaydevices_adapter(), test_GetDiskFreeSpaceA(), test_GetRandomRgn(), test_GetTempPathW(), test_installprops(), test_NhGetInterfaceNameFromDeviceGuid(), test_NhGetInterfaceNameFromGuid(), test_reg_create_key(), test_SHSimpleIDListFromPath(), test_tiff_color_formats(), testCtrlHandler(), TryShellExecuteHooks(), UnmapViewOfFile(), validate_envW(), VerifyPassword(), VfdIsValidPlatform(), and VirtualProtectEx().

◆ GetVersionExA()

BOOL WINAPI GetVersionExA ( OSVERSIONINFOA info)

Definition at line 1478 of file version.c.

1479{
1481
1482 if (info->dwOSVersionInfoSize != sizeof(OSVERSIONINFOA) &&
1483 info->dwOSVersionInfoSize != sizeof(OSVERSIONINFOEXA))
1484 {
1485 WARN( "wrong OSVERSIONINFO size from app (got: %ld)\n", info->dwOSVersionInfoSize );
1487 return FALSE;
1488 }
1489
1490 infoW.dwOSVersionInfoSize = sizeof(infoW);
1491 if (!GetVersionExW( (OSVERSIONINFOW *)&infoW )) return FALSE;
1492
1493 info->dwMajorVersion = infoW.dwMajorVersion;
1494 info->dwMinorVersion = infoW.dwMinorVersion;
1495 info->dwBuildNumber = infoW.dwBuildNumber;
1496 info->dwPlatformId = infoW.dwPlatformId;
1497 WideCharToMultiByte( CP_ACP, 0, infoW.szCSDVersion, -1,
1498 info->szCSDVersion, sizeof(info->szCSDVersion), NULL, NULL );
1499
1500 if (info->dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXA))
1501 {
1503 vex->wServicePackMajor = infoW.wServicePackMajor;
1504 vex->wServicePackMinor = infoW.wServicePackMinor;
1505 vex->wSuiteMask = infoW.wSuiteMask;
1506 vex->wProductType = infoW.wProductType;
1507 }
1508 return TRUE;
1509}
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
static const SecPkgInfoW infoW
Definition: kerberos.c:293
USHORT wServicePackMajor
Definition: rtltypes.h:261
USHORT wSuiteMask
Definition: rtltypes.h:263
UCHAR wProductType
Definition: rtltypes.h:264
USHORT wServicePackMinor
Definition: rtltypes.h:262

◆ GetVersionExW()

BOOL WINAPI GetVersionExW ( OSVERSIONINFOW info)

Definition at line 1515 of file version.c.

1516{
1517 static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT;
1518
1519 if (info->dwOSVersionInfoSize != sizeof(OSVERSIONINFOW) &&
1520 info->dwOSVersionInfoSize != sizeof(OSVERSIONINFOEXW))
1521 {
1522 WARN( "wrong OSVERSIONINFO size from app (got: %ld)\n", info->dwOSVersionInfoSize );
1523 return FALSE;
1524 }
1525
1526 if (!InitOnceExecuteOnce(&init_once, init_current_version, NULL, NULL)) return FALSE;
1527
1528 info->dwMajorVersion = current_version.dwMajorVersion;
1529 info->dwMinorVersion = current_version.dwMinorVersion;
1530 info->dwBuildNumber = current_version.dwBuildNumber;
1531 info->dwPlatformId = current_version.dwPlatformId;
1532 wcscpy( info->szCSDVersion, current_version.szCSDVersion );
1533
1534 if (info->dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXW))
1535 {
1541 }
1542 return TRUE;
1543}
wcscpy
BOOL WINAPI InitOnceExecuteOnce(_Inout_ PINIT_ONCE InitOnce, _In_ __callback PINIT_ONCE_FN InitFn, _Inout_opt_ PVOID Parameter, _Outptr_opt_result_maybenull_ LPVOID *Context)
Definition: InitOnce.c:12
static BOOL CALLBACK init_current_version(PINIT_ONCE init_once, PVOID parameter, PVOID *context)
Definition: version.c:175
static RTL_OSVERSIONINFOEXW current_version
Definition: version.c:173
WCHAR szCSDVersion[128]
Definition: rtltypes.h:274
ULONG dwMajorVersion
Definition: rtltypes.h:270
ULONG dwMinorVersion
Definition: rtltypes.h:271
USHORT wServicePackMinor
Definition: rtltypes.h:276
ULONG dwPlatformId
Definition: rtltypes.h:273
UCHAR wProductType
Definition: rtltypes.h:278
USHORT wSuiteMask
Definition: rtltypes.h:277
ULONG dwBuildNumber
Definition: rtltypes.h:272
USHORT wServicePackMajor
Definition: rtltypes.h:275
RTL_RUN_ONCE INIT_ONCE
Definition: winbase.h:3972
#define INIT_ONCE_STATIC_INIT
Definition: winbase.h:647

◆ init_current_version()

static BOOL CALLBACK init_current_version ( PINIT_ONCE  init_once,
PVOID  parameter,
PVOID context 
)
static

Definition at line 175 of file version.c.

176{
177 struct acci
178 {
179 DWORD ElementCount;
180 COMPATIBILITY_CONTEXT_ELEMENT Elements[1];
181 } *acci;
182 BOOL have_os_compat_elements = FALSE;
183 const struct version_info *ver;
185 SIZE_T req;
186 int idx;
187
190
191 for (idx = ARRAY_SIZE(version_data); idx--;)
192 if ( current_version.dwMajorVersion > version_data[idx].info.major ||
195 break;
196
197 if (idx < 0) return TRUE;
199
201 CompatibilityInformationInActivationContext, NULL, 0, &req) != STATUS_BUFFER_TOO_SMALL
202 || !req)
203 goto done;
204
205 if (!(acci = HeapAlloc(GetProcessHeap(), 0, req)))
206 {
208 return FALSE;
209 }
210
212 CompatibilityInformationInActivationContext, acci, req, &req) == STATUS_SUCCESS)
213 {
214 do
215 {
216 DWORD i;
217
218 for (i = 0; i < acci->ElementCount; i++)
219 {
220 if (acci->Elements[i].Type != ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS)
221 continue;
222
223 have_os_compat_elements = TRUE;
224
225 if (IsEqualGUID(&acci->Elements[i].Id, &version_data[idx].guid))
226 {
227 ver = &version_data[idx].info;
228
231 ver = NULL;
232
233 idx = 0; /* break from outer loop */
234 break;
235 }
236 }
237 } while (idx--);
238 }
239 HeapFree(GetProcessHeap(), 0, acci);
240
241done:
242 if (!have_os_compat_elements && current_version.dwMajorVersion >= 10
247 {
249 FIXME("Unsupported current_version.dwMajorVersion %lu.\n", current_version.dwMajorVersion);
250
252 }
253
254 if (ver)
255 {
259 }
260 return TRUE;
261}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
unsigned int idx
Definition: utils.c:41
NTSTATUS NTAPI RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
Definition: version.c:182
static __inline BOOL set_ntstatus(NTSTATUS status)
Definition: security.c:227
#define RtlImageNtHeader
Definition: compat.h:806
PPEB Peb
Definition: dllmain.c:27
static const struct @527 version_data[]
static const struct version_info windows8_1_version_info
Definition: version.c:137
static const struct version_info windows8_version_info
Definition: version.c:131
NTSYSAPI NTSTATUS WINAPI RtlQueryInformationActivationContext(ULONG, HANDLE, PVOID, ULONG, PVOID, SIZE_T, SIZE_T *)
Definition: actctx.c:5572
IMAGE_NT_HEADERS nt
Definition: module.c:50
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
WORD MinorOperatingSystemVersion
Definition: ntddk_ex.h:161
WORD MajorOperatingSystemVersion
Definition: ntddk_ex.h:160
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:269
PVOID ImageBaseAddress
Definition: ntddk_ex.h:245
PVOID ActivationContextData
Definition: winternl.h:354
DWORD major
Definition: version.c:66
DWORD build
Definition: version.c:68
DWORD minor
Definition: version.c:67
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by GetVersionExW().

◆ PackageIdFromFullName()

LONG WINAPI PackageIdFromFullName ( const WCHAR full_name,
UINT32  flags,
UINT32 buffer_length,
BYTE buffer 
)

Definition at line 1670 of file version.c.

1671{
1672 const WCHAR *name, *version_str, *arch_str, *resource_id, *publisher_id, *s;
1673 PACKAGE_ID *id = (PACKAGE_ID *)buffer;
1675
1676 TRACE("full_name %s, flags %#x, buffer_length %p, buffer %p.\n",
1677 debugstr_w(full_name), flags, buffer_length, buffer);
1678
1679 if (flags)
1680 FIXME("Flags %#x are not supported.\n", flags);
1681
1682 if (!full_name || !buffer_length)
1684
1685 if (!buffer && *buffer_length)
1687
1688 name = full_name;
1689 if (!(version_str = wcschr(name, L'_')))
1691 ++version_str;
1692
1693 if (!(arch_str = wcschr(version_str, L'_')))
1695 ++arch_str;
1696
1697 if (!(resource_id = wcschr(arch_str, L'_')))
1699 ++resource_id;
1700
1701 if (!(publisher_id = wcschr(resource_id, L'_')))
1703 ++publisher_id;
1704
1705 /* Publisher id length should be 13. */
1706 size = sizeof(*id) + sizeof(WCHAR) * ((version_str - name) + (publisher_id - resource_id) + 13 + 1);
1707 buffer_size = *buffer_length;
1708 *buffer_length = size;
1709 if (buffer_size < size)
1711
1712 memset(id, 0, sizeof(*id));
1713 if ((id->processorArchitecture = processor_arch_from_string(arch_str, resource_id - arch_str - 1)) == ~0u)
1714 {
1715 FIXME("Unrecognized arch %s.\n", debugstr_w(arch_str));
1717 }
1718 buffer += sizeof(*id);
1719
1720 id->version.Major = wcstol(version_str, NULL, 10);
1721 if (!(s = wcschr(version_str, L'.')))
1723 ++s;
1724 id->version.Minor = wcstol(s, NULL, 10);
1725 if (!(s = wcschr(s, L'.')))
1727 ++s;
1728 id->version.Build = wcstol(s, NULL, 10);
1729 if (!(s = wcschr(s, L'.')))
1731 ++s;
1732 id->version.Revision = wcstol(s, NULL, 10);
1733
1734 id->name = (WCHAR *)buffer;
1735 len = version_str - name - 1;
1736 memcpy(id->name, name, sizeof(*id->name) * len);
1737 id->name[len] = 0;
1738 buffer += sizeof(*id->name) * (len + 1);
1739
1740 id->resourceId = (WCHAR *)buffer;
1741 len = publisher_id - resource_id - 1;
1742 memcpy(id->resourceId, resource_id, sizeof(*id->resourceId) * len);
1743 id->resourceId[len] = 0;
1744 buffer += sizeof(*id->resourceId) * (len + 1);
1745
1746 id->publisherId = (WCHAR *)buffer;
1747 len = lstrlenW(publisher_id);
1748 if (len != 13)
1750 memcpy(id->publisherId, publisher_id, sizeof(*id->publisherId) * len);
1751 id->publisherId[len] = 0;
1752
1753 return ERROR_SUCCESS;
1754}
unsigned int UINT32
#define wcschr
Definition: compat.h:17
static UINT32 processor_arch_from_string(const WCHAR *str, unsigned int len)
Definition: version.c:1657
const WCHAR * name
Definition: version.c:1645
GLdouble s
Definition: gl.h:2039
GLsizeiptr size
Definition: glext.h:5919
GLuint id
Definition: glext.h:5910
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)

◆ print_vffi_debug()

static void print_vffi_debug ( const VS_FIXEDFILEINFO vffi)
static

Definition at line 606 of file version.c.

607{
608 BOOL versioned_printer = FALSE;
609
610 if((vffi->dwFileType == VFT_DLL) || (vffi->dwFileType == VFT_DRV))
611 {
613 /* this is documented for newer w2k Drivers and up */
614 versioned_printer = TRUE;
615 else if( (vffi->dwFileSubtype == VFT2_DRV_PRINTER) &&
616 (vffi->dwFileVersionMS != vffi->dwProductVersionMS) &&
617 (vffi->dwFileVersionMS > 0) &&
618 (vffi->dwFileVersionMS <= 3) )
619 /* found this on NT 3.51, NT4.0 and old w2k Drivers */
620 versioned_printer = TRUE;
621 }
622
623 TRACE("structversion=%u.%u, ",
625 if(versioned_printer)
626 {
628 WORD ver_rev = HIWORD(vffi->dwFileVersionLS);
629 TRACE("fileversion=%lu.%u.%u.%u (%s.major.minor.release), ",
630 (vffi->dwFileVersionMS),
631 HIBYTE(ver_rev), LOBYTE(ver_rev), LOWORD(vffi->dwFileVersionLS),
632 (mode == 3) ? "Usermode" : ((mode <= 2) ? "Kernelmode" : "?") );
633 }
634 else
635 {
636 TRACE("fileversion=%u.%u.%u.%u, ",
639 }
640 TRACE("productversion=%u.%u.%u.%u\n",
643
644 TRACE("flagmask=0x%lx, flags=0x%lx %s%s%s%s%s%s\n",
645 vffi->dwFileFlagsMask, vffi->dwFileFlags,
646 (vffi->dwFileFlags & VS_FF_DEBUG) ? "DEBUG," : "",
647 (vffi->dwFileFlags & VS_FF_PRERELEASE) ? "PRERELEASE," : "",
648 (vffi->dwFileFlags & VS_FF_PATCHED) ? "PATCHED," : "",
649 (vffi->dwFileFlags & VS_FF_PRIVATEBUILD) ? "PRIVATEBUILD," : "",
650 (vffi->dwFileFlags & VS_FF_INFOINFERRED) ? "INFOINFERRED," : "",
651 (vffi->dwFileFlags & VS_FF_SPECIALBUILD) ? "SPECIALBUILD," : "");
652
653 TRACE("(");
654
655 TRACE("OS=0x%x.0x%x ", HIWORD(vffi->dwFileOS), LOWORD(vffi->dwFileOS));
656
657 switch (vffi->dwFileOS&0xFFFF0000)
658 {
659 case VOS_DOS:TRACE("DOS,");break;
660 case VOS_OS216:TRACE("OS/2-16,");break;
661 case VOS_OS232:TRACE("OS/2-32,");break;
662 case VOS_NT:TRACE("NT,");break;
663 case VOS_UNKNOWN:
664 default:
665 TRACE("UNKNOWN(0x%lx),",vffi->dwFileOS&0xFFFF0000);break;
666 }
667
668 switch (LOWORD(vffi->dwFileOS))
669 {
670 case VOS__BASE:TRACE("BASE");break;
671 case VOS__WINDOWS16:TRACE("WIN16");break;
672 case VOS__WINDOWS32:TRACE("WIN32");break;
673 case VOS__PM16:TRACE("PM16");break;
674 case VOS__PM32:TRACE("PM32");break;
675 default:
676 TRACE("UNKNOWN(0x%x)",LOWORD(vffi->dwFileOS));break;
677 }
678
679 TRACE(")\n");
680
681 switch (vffi->dwFileType)
682 {
683 case VFT_APP:TRACE("filetype=APP");break;
684 case VFT_DLL:
685 TRACE("filetype=DLL");
686 if(vffi->dwFileSubtype != 0)
687 {
688 if(versioned_printer) /* NT3.x/NT4.0 or old w2k Driver */
689 TRACE(",PRINTER");
690 TRACE(" (subtype=0x%lx)", vffi->dwFileSubtype);
691 }
692 break;
693 case VFT_DRV:
694 TRACE("filetype=DRV,");
695 switch(vffi->dwFileSubtype)
696 {
697 case VFT2_DRV_PRINTER:TRACE("PRINTER");break;
698 case VFT2_DRV_KEYBOARD:TRACE("KEYBOARD");break;
699 case VFT2_DRV_LANGUAGE:TRACE("LANGUAGE");break;
700 case VFT2_DRV_DISPLAY:TRACE("DISPLAY");break;
701 case VFT2_DRV_MOUSE:TRACE("MOUSE");break;
702 case VFT2_DRV_NETWORK:TRACE("NETWORK");break;
703 case VFT2_DRV_SYSTEM:TRACE("SYSTEM");break;
704 case VFT2_DRV_INSTALLABLE:TRACE("INSTALLABLE");break;
705 case VFT2_DRV_SOUND:TRACE("SOUND");break;
706 case VFT2_DRV_COMM:TRACE("COMM");break;
707 case VFT2_DRV_INPUTMETHOD:TRACE("INPUTMETHOD");break;
708 case VFT2_DRV_VERSIONED_PRINTER:TRACE("VERSIONED_PRINTER");break;
709 case VFT2_UNKNOWN:
710 default:
711 TRACE("UNKNOWN(0x%lx)",vffi->dwFileSubtype);break;
712 }
713 break;
714 case VFT_FONT:
715 TRACE("filetype=FONT,");
716 switch (vffi->dwFileSubtype)
717 {
718 case VFT2_FONT_RASTER:TRACE("RASTER");break;
719 case VFT2_FONT_VECTOR:TRACE("VECTOR");break;
720 case VFT2_FONT_TRUETYPE:TRACE("TRUETYPE");break;
721 default:TRACE("UNKNOWN(0x%lx)",vffi->dwFileSubtype);break;
722 }
723 break;
724 case VFT_VXD:TRACE("filetype=VXD");break;
725 case VFT_STATIC_LIB:TRACE("filetype=STATIC_LIB");break;
726 case VFT_UNKNOWN:
727 default:
728 TRACE("filetype=Unknown(0x%lx)",vffi->dwFileType);break;
729 }
730
731 TRACE("\n");
732 TRACE("filedate=0x%lx.0x%lx\n",vffi->dwFileDateMS,vffi->dwFileDateLS);
733}
GLenum mode
Definition: glext.h:6217
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
DWORD dwFileVersionLS
Definition: compat.h:903
DWORD dwFileVersionMS
Definition: compat.h:902
DWORD dwFileDateLS
Definition: compat.h:912
DWORD dwStrucVersion
Definition: compat.h:901
DWORD dwProductVersionLS
Definition: compat.h:905
DWORD dwProductVersionMS
Definition: compat.h:904
DWORD dwFileFlagsMask
Definition: compat.h:906
DWORD dwFileSubtype
Definition: compat.h:910
DWORD dwFileDateMS
Definition: compat.h:911
#define HIWORD(l)
Definition: typedefs.h:247
#define VFT_DLL
Definition: verrsrc.h:76
#define VOS_NT
Definition: verrsrc.h:56
#define VFT_FONT
Definition: verrsrc.h:78
#define VFT2_UNKNOWN
Definition: verrsrc.h:84
#define VS_FF_INFOINFERRED
Definition: verrsrc.h:46
#define VFT2_FONT_VECTOR
Definition: verrsrc.h:100
#define VFT2_DRV_SOUND
Definition: verrsrc.h:93
#define VFT_UNKNOWN
Definition: verrsrc.h:74
#define VFT2_DRV_COMM
Definition: verrsrc.h:94
#define VOS__WINDOWS16
Definition: verrsrc.h:61
#define VFT2_DRV_DISPLAY
Definition: verrsrc.h:88
#define VOS_UNKNOWN
Definition: verrsrc.h:52
#define VS_FF_PATCHED
Definition: verrsrc.h:44
#define VOS__BASE
Definition: verrsrc.h:60
#define VFT2_DRV_NETWORK
Definition: verrsrc.h:90
#define VOS__PM16
Definition: verrsrc.h:62
#define VS_FF_SPECIALBUILD
Definition: verrsrc.h:47
#define VOS__WINDOWS32
Definition: verrsrc.h:64
#define VFT2_FONT_TRUETYPE
Definition: verrsrc.h:101
#define VFT2_DRV_SYSTEM
Definition: verrsrc.h:91
#define VFT_VXD
Definition: verrsrc.h:79
#define VFT2_DRV_LANGUAGE
Definition: verrsrc.h:87
#define VS_FF_PRERELEASE
Definition: verrsrc.h:43
#define VFT2_DRV_PRINTER
Definition: verrsrc.h:85
#define VFT2_DRV_VERSIONED_PRINTER
Definition: verrsrc.h:96
#define VOS_OS232
Definition: verrsrc.h:55
#define VFT2_FONT_RASTER
Definition: verrsrc.h:99
#define VFT_DRV
Definition: verrsrc.h:77
#define VFT2_DRV_INSTALLABLE
Definition: verrsrc.h:92
#define VFT2_DRV_MOUSE
Definition: verrsrc.h:89
#define VS_FF_DEBUG
Definition: verrsrc.h:42
#define VFT_STATIC_LIB
Definition: verrsrc.h:81
#define VFT2_DRV_INPUTMETHOD
Definition: verrsrc.h:95
#define VFT2_DRV_KEYBOARD
Definition: verrsrc.h:86
#define VFT_APP
Definition: verrsrc.h:75
#define VOS_DOS
Definition: verrsrc.h:53
#define VOS__PM32
Definition: verrsrc.h:63
#define VOS_OS216
Definition: verrsrc.h:54
#define VS_FF_PRIVATEBUILD
Definition: verrsrc.h:45

Referenced by GetFileVersionInfoExW().

◆ processor_arch_from_string()

static UINT32 processor_arch_from_string ( const WCHAR str,
unsigned int  len 
)
static

Definition at line 1657 of file version.c.

1658{
1659 unsigned int i;
1660
1661 for (i = 0; i < ARRAY_SIZE(arch_names); ++i)
1663 return arch_names[i].code;
1664 return ~0u;
1665}
#define wcsnicmp
Definition: compat.h:14
static const struct @528 arch_names[]
const WCHAR * str
Definition: inflate.c:139

Referenced by PackageIdFromFullName().

◆ push_language()

static int push_language ( WORD list,
int  pos,
WORD  lang 
)
inlinestatic

Definition at line 321 of file version.c.

322{
323 int i;
324 for (i = 0; i < pos; i++) if (list[i] == lang) return pos;
325 list[pos++] = lang;
326 return pos;
327}
static const WCHAR lang[]
Definition: wbemdisp.c:287

Referenced by find_entry_language().

◆ read_data()

static DWORD read_data ( HANDLE  handle,
DWORD  offset,
void data,
DWORD  len 
)
static

Definition at line 365 of file version.c.

366{
367 DWORD res;
368
370 if (!ReadFile( handle, data, len, &res, NULL )) res = 0;
371 return res;
372}
#define FILE_BEGIN
Definition: compat.h:761
#define ReadFile(a, b, c, d, e)
Definition: compat.h:742
#define SetFilePointer
Definition: compat.h:743
GLuint res
Definition: glext.h:9613

◆ VerFindFileA()

DWORD WINAPI VerFindFileA ( DWORD  flags,
LPCSTR  filename,
LPCSTR  win_dir,
LPCSTR  app_dir,
LPSTR  cur_dir,
PUINT  curdir_len,
LPSTR  dest,
PUINT  dest_len 
)

Definition at line 1281 of file version.c.

1283{
1284 DWORD retval = 0;
1285 const char *curDir;
1286 const char *destDir;
1287 char winDir[MAX_PATH], systemDir[MAX_PATH];
1288
1289 TRACE("flags = %lx filename=%s windir=%s appdir=%s curdirlen=%p(%u) destdirlen=%p(%u)\n",
1291 curdir_len, curdir_len ? *curdir_len : 0, dest_len, dest_len ? *dest_len : 0 );
1292
1293 /* Figure out where the file should go; shared files default to the
1294 system directory */
1295
1296 GetSystemDirectoryA(systemDir, sizeof(systemDir));
1297 curDir = "";
1298
1300 {
1301 destDir = systemDir;
1302 /* Were we given a filename? If so, try to find the file. */
1303 if(filename)
1304 {
1305 if(file_existsA(destDir, filename, FALSE)) curDir = destDir;
1307 curDir = app_dir;
1308
1309 if(!file_existsA(systemDir, filename, FALSE))
1311 }
1312 }
1313 else /* not a shared file */
1314 {
1315 destDir = app_dir ? app_dir : "";
1316 if(filename)
1317 {
1318 GetWindowsDirectoryA( winDir, MAX_PATH );
1319 if(file_existsA(destDir, filename, FALSE)) curDir = destDir;
1320 else if(file_existsA(winDir, filename, FALSE))
1321 curDir = winDir;
1322 else if(file_existsA(systemDir, filename, FALSE))
1323 curDir = systemDir;
1324
1325 if (app_dir && app_dir[0])
1326 {
1329 }
1330 else if(file_existsA(NULL, filename, FALSE))
1332 }
1333 }
1334
1335 /* Check to see if the file exists and is in use by another application */
1336 if (filename && file_existsA(curDir, filename, FALSE))
1337 {
1338 if (filename && !file_existsA(curDir, filename, TRUE))
1340 }
1341
1342 if (dest_len && dest)
1343 {
1344 UINT len = strlen(destDir) + 1;
1345 if (*dest_len < len) retval |= VFF_BUFFTOOSMALL;
1346 lstrcpynA(dest, destDir, *dest_len);
1347 *dest_len = len;
1348 }
1349 if (curdir_len && cur_dir)
1350 {
1351 UINT len = strlen(curDir) + 1;
1352 if (*curdir_len < len) retval |= VFF_BUFFTOOSMALL;
1353 lstrcpynA(cur_dir, curDir, *curdir_len);
1354 *curdir_len = len;
1355 }
1356
1357 TRACE("ret = %lu (%s%s%s) curdir=%s destdir=%s\n", retval,
1358 (retval & VFF_CURNEDEST) ? "VFF_CURNEDEST " : "",
1359 (retval & VFF_FILEINUSE) ? "VFF_FILEINUSE " : "",
1360 (retval & VFF_BUFFTOOSMALL) ? "VFF_BUFFTOOSMALL " : "",
1361 debugstr_a(cur_dir), debugstr_a(dest));
1362
1363 return retval;
1364}
#define lstrcpynA
Definition: compat.h:751
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2337
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2283
static BOOL file_existsA(char const *path, char const *file, BOOL excl)
Definition: version.c:1227
static WCHAR app_dir[MAX_PATH]
Definition: actctx.c:469
static char * dest
Definition: rtl.c:135
unsigned int UINT
Definition: ndis.h:50
#define VFF_FILEINUSE
Definition: verrsrc.h:109
#define VFF_BUFFTOOSMALL
Definition: verrsrc.h:110
#define VFF_CURNEDEST
Definition: verrsrc.h:108
#define VFFF_ISSHAREDFILE
Definition: verrsrc.h:105

Referenced by test_find_file().

◆ VerFindFileW()

DWORD WINAPI VerFindFileW ( DWORD  flags,
LPCWSTR  filename,
LPCWSTR  win_dir,
LPCWSTR  app_dir,
LPWSTR  cur_dir,
PUINT  curdir_len,
LPWSTR  dest,
PUINT  dest_len 
)

Definition at line 1369 of file version.c.

1371{
1372 DWORD retval = 0;
1373 const WCHAR *curDir;
1374 const WCHAR *destDir;
1375
1376 TRACE("flags = %lx filename=%s windir=%s appdir=%s curdirlen=%p(%u) destdirlen=%p(%u)\n",
1378 curdir_len, curdir_len ? *curdir_len : 0, dest_len, dest_len ? *dest_len : 0 );
1379
1380 /* Figure out where the file should go; shared files default to the
1381 system directory */
1382
1383 curDir = L"";
1384
1386 {
1387 destDir = system_dir;
1388 /* Were we given a filename? If so, try to find the file. */
1389 if(filename)
1390 {
1391 if(file_existsW(destDir, filename, FALSE)) curDir = destDir;
1393 {
1394 curDir = app_dir;
1396 }
1397 }
1398 }
1399 else /* not a shared file */
1400 {
1401 destDir = app_dir ? app_dir : L"";
1402 if(filename)
1403 {
1404 if(file_existsW(destDir, filename, FALSE)) curDir = destDir;
1406 {
1407 curDir = windows_dir;
1409 }
1411 {
1412 curDir = system_dir;
1414 }
1415 }
1416 }
1417
1418 if (filename && !file_existsW(curDir, filename, TRUE))
1420
1421 if (dest_len && dest)
1422 {
1423 UINT len = lstrlenW(destDir) + 1;
1424 if (*dest_len < len) retval |= VFF_BUFFTOOSMALL;
1425 lstrcpynW(dest, destDir, *dest_len);
1426 *dest_len = len;
1427 }
1428 if (curdir_len && cur_dir)
1429 {
1430 UINT len = lstrlenW(curDir) + 1;
1431 if (*curdir_len < len) retval |= VFF_BUFFTOOSMALL;
1432 lstrcpynW(cur_dir, curDir, *curdir_len);
1433 *curdir_len = len;
1434 }
1435
1436 TRACE("ret = %lu (%s%s%s) curdir=%s destdir=%s\n", retval,
1437 (retval & VFF_CURNEDEST) ? "VFF_CURNEDEST " : "",
1438 (retval & VFF_FILEINUSE) ? "VFF_FILEINUSE " : "",
1439 (retval & VFF_BUFFTOOSMALL) ? "VFF_BUFFTOOSMALL " : "",
1440 debugstr_w(cur_dir), debugstr_w(dest));
1441 return retval;
1442}
#define lstrcpynW
Definition: compat.h:738
const WCHAR system_dir[]
Definition: file.c:68
const WCHAR windows_dir[]
Definition: file.c:67
static BOOL file_existsW(const WCHAR *path, const WCHAR *file, BOOL excl)
Definition: version.c:1252

◆ VerQueryValueA()

BOOL WINAPI VerQueryValueA ( LPCVOID  pBlock,
LPCSTR  lpSubBlock,
LPVOID lplpBuffer,
PUINT  puLen 
)

Definition at line 1115 of file version.c.

1117{
1118 static const char rootA[] = "\\";
1119 const VS_VERSION_INFO_STRUCT16 *info = pBlock;
1120
1121 TRACE("(%p,%s,%p,%p)\n",
1122 pBlock, debugstr_a(lpSubBlock), lplpBuffer, puLen );
1123
1124 if (!pBlock)
1125 return FALSE;
1126
1127 if (lpSubBlock == NULL || lpSubBlock[0] == '\0')
1128 lpSubBlock = rootA;
1129
1130 if ( !VersionInfoIs16( info ) )
1131 {
1132 BOOL ret, isText;
1133 INT len;
1134 LPWSTR lpSubBlockW;
1135 UINT value_len;
1136
1137 len = MultiByteToWideChar(CP_ACP, 0, lpSubBlock, -1, NULL, 0);
1138 lpSubBlockW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
1139
1140 if (!lpSubBlockW)
1141 return FALSE;
1142
1143 MultiByteToWideChar(CP_ACP, 0, lpSubBlock, -1, lpSubBlockW, len);
1144
1145 ret = VersionInfo32_QueryValue(pBlock, lpSubBlockW, lplpBuffer, &value_len, &isText);
1146 if (puLen) *puLen = value_len;
1147
1148 HeapFree(GetProcessHeap(), 0, lpSubBlockW);
1149
1150 if (ret && isText)
1151 {
1152 /* Set lpBuffer so it points to the 'empty' area where we store
1153 * the converted strings
1154 */
1155 LPSTR lpBufferA = (LPSTR)pBlock + info->wLength + 4;
1156 DWORD pos = (LPCSTR)*lplpBuffer - (LPCSTR)pBlock;
1157 len = WideCharToMultiByte(CP_ACP, 0, *lplpBuffer, value_len,
1158 lpBufferA + pos, info->wLength - pos, NULL, NULL);
1159 *lplpBuffer = lpBufferA + pos;
1160 if (puLen) *puLen = len;
1161 }
1162 return ret;
1163 }
1164
1165 return VersionInfo16_QueryValue(info, lpSubBlock, lplpBuffer, puLen);
1166}
#define MultiByteToWideChar
Definition: compat.h:110
static BOOL VersionInfo16_QueryValue(const VS_VERSION_INFO_STRUCT16 *info, LPCSTR lpSubBlock, LPVOID *lplpBuffer, UINT *puLen)
Definition: version.c:1025
static BOOL VersionInfo32_QueryValue(const VS_VERSION_INFO_STRUCT32 *info, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, UINT *puLen, BOOL *pbText)
Definition: version.c:1069
#define VersionInfoIs16(ver)
Definition: version.c:102
int32_t INT
Definition: typedefs.h:58
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182

Referenced by debugsymbols_GetModuleVersionInformation(), get_file_version(), get_version_info(), GetDriverVersion(), is_stub_dll(), SHLWAPI_GetModuleVersion(), test_32bit_win(), test_extra_block(), test_GetFileVersionInfoEx(), test_info(), test_VerQueryValue_InvalidLength(), Test_VerQueryValueA(), test_VerQueryValueA(), and VerInstallFileA().

◆ VerQueryValueW()

BOOL WINAPI VerQueryValueW ( LPCVOID  pBlock,
LPCWSTR  lpSubBlock,
LPVOID lplpBuffer,
PUINT  puLen 
)

Definition at line 1171 of file version.c.

1173{
1174 const VS_VERSION_INFO_STRUCT32 *info = pBlock;
1175
1176 TRACE("(%p,%s,%p,%p)\n",
1177 pBlock, debugstr_w(lpSubBlock), lplpBuffer, puLen );
1178
1179 if (!pBlock)
1180 return FALSE;
1181
1182 if (!lpSubBlock || !lpSubBlock[0])
1183 lpSubBlock = L"\\";
1184
1185 if ( VersionInfoIs16( info ) )
1186 {
1187 BOOL ret;
1188 int len;
1189 LPSTR lpSubBlockA;
1190
1191 len = WideCharToMultiByte(CP_ACP, 0, lpSubBlock, -1, NULL, 0, NULL, NULL);
1192 lpSubBlockA = HeapAlloc(GetProcessHeap(), 0, len * sizeof(char));
1193
1194 if (!lpSubBlockA)
1195 return FALSE;
1196
1197 WideCharToMultiByte(CP_ACP, 0, lpSubBlock, -1, lpSubBlockA, len, NULL, NULL);
1198
1199 ret = VersionInfo16_QueryValue(pBlock, lpSubBlockA, lplpBuffer, puLen);
1200
1201 HeapFree(GetProcessHeap(), 0, lpSubBlockA);
1202
1203 if (ret && wcscmp( lpSubBlock, L"\\" ) && wcsicmp( lpSubBlock, L"\\VarFileInfo\\Translation" ))
1204 {
1205 /* Set lpBuffer so it points to the 'empty' area where we store
1206 * the converted strings
1207 */
1208 LPWSTR lpBufferW = (LPWSTR)((LPSTR)pBlock + info->wLength);
1209 DWORD pos = (LPCSTR)*lplpBuffer - (LPCSTR)pBlock;
1210 DWORD max = (info->wLength - sizeof(VS_FIXEDFILEINFO)) * 4 - info->wLength;
1211
1212 len = MultiByteToWideChar(CP_ACP, 0, *lplpBuffer, -1,
1213 lpBufferW + pos, max/sizeof(WCHAR) - pos );
1214 *lplpBuffer = lpBufferW + pos;
1215 if (puLen) *puLen = len;
1216 }
1217 return ret;
1218 }
1219
1220 return VersionInfo32_QueryValue(info, lpSubBlock, lplpBuffer, puLen, NULL);
1221}
struct tagVS_FIXEDFILEINFO VS_FIXEDFILEINFO
#define wcsicmp
Definition: compat.h:15
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

Referenced by capGetDriverDescriptionW(), check_native_ie(), do_file_copyW(), fetch_module_versioninfo(), file_version_matches(), filesys_GetFileVersion(), fill_file_description(), get_file_version(), get_module_version(), GetExecutableVendor(), GetFileVersion(), CFileVersionInfo::GetFixedInfo(), GetProcessDefaultLayout(), CQueryAssociations::GetString(), CFileVersionInfo::GetString(), GetVersionFromFileExW(), GetVersionInfoString(), Imm32LoadImeVerInfo(), CFileVersionInfo::Load(), COpenWithList::LoadInfo(), LPK_ApplyMirroring(), match_languages(), msi_get_disk_file_version(), pSetupGetVersionInfoFromImage(), SdbGetFileAttributes(), SdbpGetStringAttr(), SdbpReadFileVersion(), search_file(), set_msi_assembly_prop(), test_32bit_win(), Test_StaticVersionInfo(), test_VerQueryValue_InvalidLength(), Test_VerQueryValueW(), and VerQueryValueWrapW().

◆ VersionInfo16_FindChild()

static const VS_VERSION_INFO_STRUCT16 * VersionInfo16_FindChild ( const VS_VERSION_INFO_STRUCT16 info,
LPCSTR  key,
UINT  len 
)
static

Definition at line 983 of file version.c.

985{
987
988 while ((char *)child < (char *)info + info->wLength )
989 {
990 if (!strnicmp( child->szKey, key, len ) && !child->szKey[len])
991 return child;
992
993 if (!(child->wLength)) return NULL;
995 }
996
997 return NULL;
998}
#define VersionInfo16_Next(ver)
Definition: version.c:121
#define VersionInfo16_Children(ver)
Definition: version.c:113
static HWND child
Definition: cursoricon.c:298
Definition: copy.c:22
#define strnicmp
Definition: xmlstorage.h:206

Referenced by VersionInfo16_QueryValue().

◆ VersionInfo16_QueryValue()

static BOOL VersionInfo16_QueryValue ( const VS_VERSION_INFO_STRUCT16 info,
LPCSTR  lpSubBlock,
LPVOID lplpBuffer,
UINT puLen 
)
static

Definition at line 1025 of file version.c.

1027{
1028 while ( *lpSubBlock )
1029 {
1030 /* Find next path component */
1031 LPCSTR lpNextSlash;
1032 for ( lpNextSlash = lpSubBlock; *lpNextSlash; lpNextSlash++ )
1033 if ( *lpNextSlash == '\\' )
1034 break;
1035
1036 /* Skip empty components */
1037 if ( lpNextSlash == lpSubBlock )
1038 {
1039 lpSubBlock++;
1040 continue;
1041 }
1042
1043 /* We have a non-empty component: search info for key */
1044 info = VersionInfo16_FindChild( info, lpSubBlock, lpNextSlash-lpSubBlock );
1045 if ( !info )
1046 {
1047 if (puLen) *puLen = 0 ;
1049 return FALSE;
1050 }
1051
1052 /* Skip path component */
1053 lpSubBlock = lpNextSlash;
1054 }
1055
1056 /* Return value */
1057 *lplpBuffer = VersionInfo16_Value( info );
1058 if (puLen)
1059 *puLen = info->wValueLength;
1060
1061 return TRUE;
1062}
static const VS_VERSION_INFO_STRUCT16 * VersionInfo16_FindChild(const VS_VERSION_INFO_STRUCT16 *info, LPCSTR key, UINT len)
Definition: version.c:983
#define ERROR_RESOURCE_TYPE_NOT_FOUND
Definition: winerror.h:1120

Referenced by VerQueryValueA(), and VerQueryValueW().

◆ VersionInfo32_FindChild()

static const VS_VERSION_INFO_STRUCT32 * VersionInfo32_FindChild ( const VS_VERSION_INFO_STRUCT32 info,
LPCWSTR  key,
UINT  len 
)
static

Definition at line 1003 of file version.c.

1005{
1007
1008 while ((char *)child < (char *)info + info->wLength )
1009 {
1010 if (!wcsnicmp( child->szKey, key, len ) && !child->szKey[len])
1011 return child;
1012
1013 if (!(child->wLength)) return NULL;
1015 }
1016
1017 return NULL;
1018}
#define VersionInfo32_Next(ver)
Definition: version.c:123
#define VersionInfo32_Children(ver)
Definition: version.c:116

Referenced by VersionInfo32_QueryValue().

◆ VersionInfo32_QueryValue()

static BOOL VersionInfo32_QueryValue ( const VS_VERSION_INFO_STRUCT32 info,
LPCWSTR  lpSubBlock,
LPVOID lplpBuffer,
UINT puLen,
BOOL pbText 
)
static

Definition at line 1069 of file version.c.

1071{
1072 TRACE("lpSubBlock : (%s)\n", debugstr_w(lpSubBlock));
1073
1074 while ( *lpSubBlock )
1075 {
1076 /* Find next path component */
1077 LPCWSTR lpNextSlash;
1078 for ( lpNextSlash = lpSubBlock; *lpNextSlash; lpNextSlash++ )
1079 if ( *lpNextSlash == '\\' )
1080 break;
1081
1082 /* Skip empty components */
1083 if ( lpNextSlash == lpSubBlock )
1084 {
1085 lpSubBlock++;
1086 continue;
1087 }
1088
1089 /* We have a non-empty component: search info for key */
1090 info = VersionInfo32_FindChild( info, lpSubBlock, lpNextSlash-lpSubBlock );
1091 if ( !info )
1092 {
1093 if (puLen) *puLen = 0 ;
1095 return FALSE;
1096 }
1097
1098 /* Skip path component */
1099 lpSubBlock = lpNextSlash;
1100 }
1101
1102 /* Return value */
1103 *lplpBuffer = VersionInfo32_Value( info );
1104 if (puLen)
1105 *puLen = info->wValueLength;
1106 if (pbText)
1107 *pbText = info->wType;
1108
1109 return TRUE;
1110}
static const VS_VERSION_INFO_STRUCT32 * VersionInfo32_FindChild(const VS_VERSION_INFO_STRUCT32 *info, LPCWSTR key, UINT len)
Definition: version.c:1003
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by VerQueryValueA(), and VerQueryValueW().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ver  )

Variable Documentation

◆ 

const struct { ... } arch_names[]
Initial value:
=
{
{PROCESSOR_ARCHITECTURE_NEUTRAL, L"neutral"},
{PROCESSOR_ARCHITECTURE_ARM64, L"arm64"},
}
#define PROCESSOR_ARCHITECTURE_ARM
Definition: ketypes.h:110
#define PROCESSOR_ARCHITECTURE_UNKNOWN
Definition: ketypes.h:115
#define PROCESSOR_ARCHITECTURE_AMD64
Definition: ketypes.h:114
#define PROCESSOR_ARCHITECTURE_INTEL
Definition: ketypes.h:105

Referenced by processor_arch_from_string().

◆ code

Definition at line 1644 of file version.c.

◆ current_version

RTL_OSVERSIONINFOEXW current_version
static

Definition at line 173 of file version.c.

Referenced by GetVersionExW(), and init_current_version().

◆ guid

GUID guid

Definition at line 147 of file version.c.

Referenced by __wine_msi_call_dll_function(), _dump_dinput_GUID(), _GetDocumentsPidl(), _ILCreateGuid(), _test_provideclassinfo(), a_to_w_callback(), ACTION_CallScript(), ACTION_MsiPublishAssemblies(), ACTION_PublishProduct(), add_tbs_to_menu(), add_typeinfo_block(), alloc_importinfo(), Anime_SetFrameIndex(), BmpFrameEncode_SetPixelFormat(), callback_providersA(), callback_providersW(), ATL::CComBSTR::CComBSTR(), check_db_properties(), check_safearray(), client(), CoGetActivationState(), component_GetGUID(), compose_base85_guid(), CModeBias::ConvertModeBias(), CoRegisterSurrogateEx(), create_activex_object(), create_event_sink(), create_metadata_reader_from_container_iterator(), create_metadata_reader_iterator(), create_msft_typeinfo(), create_object(), create_script_host(), create_test_guid(), CRYPT_guid2wstr(), CRYPT_OpenSIPFunctionKey(), CRYPT_SIPDeleteFunction(), CRYPT_SIPWriteFunction(), CryptCATEnumerateMember(), ctl2_alloc_guid(), ctl2_find_guid(), ctl2_hash_guid(), custom_action_server(), custom_action_thread(), d3d8_indexbuffer_FreePrivateData(), d3d8_indexbuffer_GetPrivateData(), d3d8_indexbuffer_SetPrivateData(), d3d8_resource_free_private_data(), d3d8_resource_get_private_data(), d3d8_resource_set_private_data(), d3d8_surface_FreePrivateData(), d3d8_surface_GetPrivateData(), d3d8_surface_SetPrivateData(), d3d8_texture_2d_FreePrivateData(), d3d8_texture_2d_GetPrivateData(), d3d8_texture_2d_SetPrivateData(), d3d8_texture_3d_FreePrivateData(), d3d8_texture_3d_GetPrivateData(), d3d8_texture_3d_SetPrivateData(), d3d8_texture_cube_FreePrivateData(), d3d8_texture_cube_GetPrivateData(), d3d8_texture_cube_SetPrivateData(), d3d8_vertexbuffer_FreePrivateData(), d3d8_vertexbuffer_GetPrivateData(), d3d8_vertexbuffer_SetPrivateData(), d3d8_volume_FreePrivateData(), d3d8_volume_GetPrivateData(), d3d8_volume_SetPrivateData(), d3d9_indexbuffer_FreePrivateData(), d3d9_indexbuffer_GetPrivateData(), d3d9_indexbuffer_SetPrivateData(), d3d9_resource_free_private_data(), d3d9_resource_get_private_data(), d3d9_resource_set_private_data(), d3d9_surface_FreePrivateData(), d3d9_surface_GetPrivateData(), d3d9_surface_SetPrivateData(), d3d9_texture_2d_FreePrivateData(), d3d9_texture_2d_GetPrivateData(), d3d9_texture_2d_SetPrivateData(), d3d9_texture_3d_FreePrivateData(), d3d9_texture_3d_GetPrivateData(), d3d9_texture_3d_SetPrivateData(), d3d9_texture_cube_FreePrivateData(), d3d9_texture_cube_GetPrivateData(), d3d9_texture_cube_SetPrivateData(), d3d9_vertexbuffer_FreePrivateData(), d3d9_vertexbuffer_GetPrivateData(), d3d9_vertexbuffer_SetPrivateData(), d3d9_volume_FreePrivateData(), d3d9_volume_GetPrivateData(), d3d9_volume_SetPrivateData(), d3d_device1_Initialize(), d3d_device_create(), d3drm1_CreateDeviceFromClipper(), d3drm1_CreateDeviceFromSurface(), d3drm2_CreateDeviceFromClipper(), d3drm2_CreateDeviceFromSurface(), d3drm3_CreateDeviceFromClipper(), d3drm3_CreateDeviceFromSurface(), d3drm3_RegisterClient(), d3drm3_UnregisterClient(), d3drm_device1_InitFromClipper(), d3drm_device2_InitFromClipper(), d3drm_device2_InitFromSurface(), d3drm_device3_InitFromClipper(), d3drm_device3_InitFromSurface(), d3drm_mesh_builder3_Load(), d3dx9_file_data_GetId(), d3dx9_file_data_GetType(), d3dx9_file_enum_object_GetDataObjectById(), D3DXLoadMeshFromXInMemory(), D3DXLoadMeshHierarchyFromXInMemory(), ddraw1_Initialize(), ddraw2_Initialize(), ddraw4_Initialize(), ddraw7_Initialize(), DDRAW_Create(), debugstr_dmguid(), debugstr_guid(), DECLARE_INTERFACE_(), DECLARE_INTERFACE_IID_(), decode_base85_guid(), del_mapping_key(), delete_component_path(), DirectSoundCaptureEnumerateW(), DirectSoundDevice_Initialize(), DirectSoundEnumerateW(), DllRegisterServer(), DllUnregisterServer(), dsound_enum(), Dump(), dump_DIEFFECT(), effect_from_guid(), encode_base85_guid(), enum_callback(), enum_components(), EnumJoysticks(), EtwEnableTrace(), exec_script(), fetch_machine_component(), fetch_user_component(), find_action_by_guid(), find_clr_surrogate(), find_cominterface_redirection(), find_comserver_redirection(), find_devices(), find_guid(), find_guid_index(), find_sortguid(), find_tlib_redirection(), find_typelib_key(), FindActCtxSectionGuid(), CUserAssist::FireEvent(), GdipCreateEffect(), generate_uuid(), get_bool_property(), get_device_pnp_name(), get_device_pnp_name_guid(), get_elem_script_host(), get_formatinfo(), get_guid_from_language(), get_guid_from_type(), get_iface_guid(), get_IID_string(), get_interface_key(), get_language_sort(), get_mapping_key(), get_mesh_data(), get_metadata_container(), get_property(), get_script_guid(), get_script_host(), get_settingid(), get_typeinfo_of_guid(), get_typelib_key(), getCurrentChannelConfig(), CDisplayAttributeMgr::GetDisplayAttributeInfo(), CFunctionProvider::GetFunction(), GetGlobalCompartment(), GetRecordInfoFromTypeInfo(), GetSdbGuid(), CQueryAssociations::GetString(), CFunctionProviderBase::GetType(), GifDecoder_Block_GetContainerFormat(), GifFrameDecode_Block_GetContainerFormat(), Guid2str(), GUIDFromStringA(), GUIDFromStringW(), hash_guid(), Host_CreateObject(), ICreateTypeInfo2_fnSetCustData(), ICreateTypeInfo2_fnSetFuncCustData(), ICreateTypeInfo2_fnSetGuid(), ICreateTypeInfo2_fnSetImplTypeCustData(), ICreateTypeInfo2_fnSetParamCustData(), ICreateTypeInfo2_fnSetVarCustData(), ICreateTypeLib2_fnSetCustData(), ICreateTypeLib2_fnSetGuid(), IDirectPlay2AImpl_Initialize(), IDirectPlay2Impl_Initialize(), IDirectPlay3AImpl_Initialize(), IDirectPlay3Impl_Initialize(), IDirectPlay4AImpl_Initialize(), IDirectPlay4Impl_Initialize(), IDirectPlayImpl_Initialize(), IDirectXFileDataImpl_GetType(), IEnumDMO_fnNext(), IFileDialog2_fnSetClientGuid(), IFileOpenDialog_fnSetClientGuid(), IFileSaveDialog_fnSetClientGuid(), CIMEUIWindowHandler::ImeUIMsImeModeBiasHandler(), init_classinfo(), InitDisplayAttrbuteLib(), CCleanupHandler::Initialize(), InitPropVariantFromGUIDAsString(), InitVariantFromGUIDAsString(), intDdGetDriverInfo(), is_prefixed_volume(), IsCatalogFile(), IsEqual(), ITERATE_RegisterTypeLibraries(), ITERATE_UnregisterTypeLibraries(), ITypeInfo2_fnGetCustData(), ITypeInfo2_fnGetFuncCustData(), ITypeInfo2_fnGetImplTypeCustData(), ITypeInfo2_fnGetParamCustData(), ITypeInfo2_fnGetVarCustData(), ITypeInfo_fnInvoke(), ITypeLib2_fnGetCustData(), ITypeLib2_fnGetTypeInfoOfGuid(), JoyConfig8Impl_AddNewHardware(), jpeg_encoder_create_frame(), jpeg_encoder_get_supported_format(), load_data(), load_devices_from_reg(), load_mesh_data(), load_stream(), CCleanupHandlerList::LoadHandlers(), LocalServer_QueryService(), LPSAFEARRAY_UserMarshal(), LPSAFEARRAY_UserSize(), LPSAFEARRAY_UserUnmarshal(), MakeGuidString(), match_guid_attr_imp(), matchGUID(), metadatahandler_stream_provider_GetPreferredVendorGUID(), MMDevPropStore_OpenPropKey(), msft_read_guid(), MSFT_ReadAllGuids(), MSI_ProvideQualifiedComponentEx(), MsiEnumComponentsExA(), MsiEnumComponentsExW(), path_find_symbol_file(), per_user_install_callback(), PerfCreateInstance(), PerfStartProvider(), PerfStartProviderEx(), png_encoder_create_frame(), png_encoder_get_supported_format(), probe_volume(), profile3_GetProfileID(), PROPVAR_WCHARToGUID(), PropVariantToGUID(), query_feature_state(), query_typelib_path(), CUserAssist::QueryEvent(), QueryPathOfRegTypeLib(), ReadGuidNode(), register_dsound_devices(), register_key_guid(), RegisterPowerSettingNotification(), RtlFindActivationContextSectionGuid(), RtlFindActivationContextSectionString(), RtlGUIDFromString(), s_remote_GetActionInfo(), SAFEARRAY_CopyData(), SafeArraySetIID(), script_parse_event(), ScriptThread(), search_components(), server(), set_component_path(), set_custdata(), set_guid(), CShellLink::SetAdvertiseInfo(), setCurrentChannelConfig(), CUserAssist::SetEvent(), SetGlobalCompartmentDWORD(), setperusersecvalues_test(), SetPerUserSecValuesW(), SETUPDI_GuidToString(), SHELL32_GUIDToStringA(), SHELL32_GUIDToStringW(), shellex_load_object_and_run(), ShellExecute_FromContextMenuHandlers(), SHGlobalCounterCreate(), should_enumerate_device(), SHPropertyBag_OnRegKey(), SHPropertyBag_ReadTest(), SHPropertyBag_WriteTest(), SHRegGetCLSIDKeyA(), SHRegGetCLSIDKeyW(), SHStringFromGUIDA(), SHStringFromGUIDW(), squash_guid(), START_TEST(), string_to_guid(), StringToGuid(), test_Activate(), test_ClassIDs(), test_createeffect(), test_device_iface(), test_device_iface_detail(), test_device_info(), test_device_interface_key(), test_device_key(), test_devnode(), test_dsound(), test_dump_typelib(), test_find_progid_redirection(), test_fromguid(), test_GdipGetAllPropertyItems(), test_get_device_instance_id(), test_get_inf_class(), test_GetDefaultSearchGUID(), test_gif_properties(), TEST_GUIDFromStringA(), TEST_GUIDFromStringW(), test_GuidFunctions(), test_InitPropVariantFromGUIDAsString(), test_interface_identifier_conversion(), test_is_testdb(), test_MsiEnumComponents(), test_MsiEnumComponentsEx(), test_MsiEnumProducts(), test_MsiEnumProductsEx(), test_multi_encoder_impl(), test_open_class_key(), test_ordinal_imports(), test_Persist(), test_pixelformat_info(), Test_PrivateData(), test_PropVariantToGUID(), test_register_device_iface(), test_register_device_info(), test_registry_property_a(), test_registry_property_w(), test_RtlGUIDFromString(), test_safearray_layout(), test_SafeArrayCreateEx(), test_server_listening(), test_sip(), test_tiff_properties(), test_UuidCreate(), test_WICMapShortNameToGuid(), TF_ClearLangBarAddIns(), ThreadMgr_ActivateEx(), tiff_encoder_create_frame(), tiff_encoder_get_supported_format(), Timeline_IAMTimeline_GetDefaultEffect(), Timeline_IAMTimeline_GetDefaultTransition(), Timeline_IAMTimeline_SetDefaultEffect(), Timeline_IAMTimeline_SetDefaultTransition(), TimelineObj_GetSubObjectGUID(), TimelineObj_SetSubObjectGUID(), TLB_append_guid(), TLB_get_custdata_by_guid(), TLB_get_guid_null(), TLB_get_guidref(), TLB_GUIDFromString(), TLB_unregister_interface(), typeFromGUID(), uniquecontainer(), UserInstStubWrapperW(), VariantToGUID(), wic_guid_to_d3dformat(), wined3d_private_store_set_private_data(), WMProfileManager_LoadProfileByID(), WMSFT_compile_guids(), write_pointer_tfs(), and Database::WriteBinary().

◆ info

Definition at line 146 of file version.c.

Referenced by GetVersion(), and test_VerifyVersionInfo().

◆ name

Definition at line 1645 of file version.c.

Referenced by PackageIdFromFullName().

◆ 

const struct { ... } version_data[]
Initial value:
=
{
{
{ 6, 3, 9600 },
{0x1f676c76,0x80e1,0x4239,{0x95,0xbb,0x83,0xd0,0xf6,0xd0,0xda,0x78}}
},
{
{ 10, 0, 19043 },
{0x8e0f7a12,0xbfb3,0x4fe8,{0xb9,0xa5,0x48,0xfd,0x50,0xa1,0x5a,0x9a}}
}
}

Referenced by init_current_version().

◆ windows8_1_version_info

const struct version_info windows8_1_version_info = { 6, 3, 9600 }
static

Definition at line 137 of file version.c.

Referenced by init_current_version().

◆ windows8_version_info

const struct version_info windows8_version_info = { 6, 2, 9200 }
static

Definition at line 131 of file version.c.

Referenced by init_current_version().