ReactOS 0.4.16-dev-1408-gbc64f3a
version.c
Go to the documentation of this file.
1/*
2 * Implementation of VERSION.DLL
3 *
4 * Copyright 1996,1997 Marcus Meissner
5 * Copyright 1997 David Cuthbert
6 * Copyright 1999 Ulrich Weigand
7 * Copyright 2005 Paul Vriens
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 *
23 */
24
25#include <stdarg.h>
26#include <stdlib.h>
27#include <string.h>
28#include <stdio.h>
29#include <sys/types.h>
30
31#include "ntstatus.h"
32#define WIN32_NO_STATUS
33#include "windef.h"
34#include "winbase.h"
35#include "winver.h"
36#include "winuser.h"
37#include "winnls.h"
38#include "winternl.h"
39#include "winerror.h"
40#include "appmodel.h"
41
42#include "kernelbase.h"
43#include "wine/debug.h"
44
46
47typedef struct
48{
56
57typedef struct
58{
63
65{
69};
70
71/***********************************************************************
72 * Version Info Structure
73 */
74
75typedef struct
76{
79 CHAR szKey[1];
80#if 0 /* variable length structure */
81 /* DWORD aligned */
82 BYTE Value[];
83 /* DWORD aligned */
84 VS_VERSION_INFO_STRUCT16 Children[];
85#endif
87
88typedef struct
89{
92 WORD wType; /* 1:Text, 0:Binary */
93 WCHAR szKey[1];
94#if 0 /* variable length structure */
95 /* DWORD aligned */
96 BYTE Value[];
97 /* DWORD aligned */
98 VS_VERSION_INFO_STRUCT32 Children[];
99#endif
101
102#define VersionInfoIs16( ver ) \
103 ( ((const VS_VERSION_INFO_STRUCT16 *)ver)->szKey[0] >= ' ' )
104
105#define DWORD_ALIGN( base, ptr ) \
106 ( (LPBYTE)(base) + ((((LPBYTE)(ptr) - (LPBYTE)(base)) + 3) & ~3) )
107
108#define VersionInfo16_Value( ver ) \
109 DWORD_ALIGN( (ver), (ver)->szKey + strlen((ver)->szKey) + 1 )
110#define VersionInfo32_Value( ver ) \
111 DWORD_ALIGN( (ver), (ver)->szKey + lstrlenW((ver)->szKey) + 1 )
112
113#define VersionInfo16_Children( ver ) \
114 (const VS_VERSION_INFO_STRUCT16 *)( VersionInfo16_Value( ver ) + \
115 ( ( (ver)->wValueLength + 3 ) & ~3 ) )
116#define VersionInfo32_Children( ver ) \
117 (const VS_VERSION_INFO_STRUCT32 *)( VersionInfo32_Value( ver ) + \
118 ( ( (ver)->wValueLength * \
119 ((ver)->wType? 2 : 1) + 3 ) & ~3 ) )
120
121#define VersionInfo16_Next( ver ) \
122 (VS_VERSION_INFO_STRUCT16 *)( (LPBYTE)ver + (((ver)->wLength + 3) & ~3) )
123#define VersionInfo32_Next( ver ) \
124 (VS_VERSION_INFO_STRUCT32 *)( (LPBYTE)ver + (((ver)->wLength + 3) & ~3) )
125
126
127/***********************************************************************
128 * Win8 info, reported if the app doesn't provide compat GUID in the manifest and
129 * doesn't have higher OS version in PE header.
130 */
131static const struct version_info windows8_version_info = { 6, 2, 9200 };
132
133/***********************************************************************
134 * Win8.1 info, reported if the app doesn't provide compat GUID in the manifest and
135 * OS version in PE header is 8.1 or higher but below 10.
136 */
137static const struct version_info windows8_1_version_info = { 6, 3, 9600 };
138
139
140/***********************************************************************
141 * Windows versions that need compatibility GUID specified in manifest
142 * in order to be reported by the APIs.
143 */
144static const struct
145{
148} version_data[] =
149{
150 /* Windows 8.1 */
151 {
152 { 6, 3, 9600 },
153 {0x1f676c76,0x80e1,0x4239,{0x95,0xbb,0x83,0xd0,0xf6,0xd0,0xda,0x78}}
154 },
155 /* Windows 10 */
156 {
157 { 10, 0, 19043 },
158 {0x8e0f7a12,0xbfb3,0x4fe8,{0xb9,0xa5,0x48,0xfd,0x50,0xa1,0x5a,0x9a}}
159 }
161
162
163/******************************************************************************
164 * init_current_version
165 *
166 * Initialize the current_version variable.
167 *
168 * For compatibility, Windows 8.1 and later report Win8 version unless the app
169 * has a manifest or higher OS version in the PE optional header
170 * that confirms its compatibility with newer versions of Windows.
171 *
172 */
174
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}
262
263
264/**********************************************************************
265 * find_entry_by_id
266 *
267 * Find an entry by id in a resource directory
268 * Copied from loader/pe_resource.c
269 */
271 WORD id, const void *root,
272 DWORD root_size )
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}
298
299
300/**********************************************************************
301 * find_entry_default
302 *
303 * Find a default entry in a resource directory
304 * Copied from loader/pe_resource.c
305 */
307 const void *root )
308{
310
312 return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry->OffsetToDirectory);
313}
314
315
316/**********************************************************************
317 * push_language
318 *
319 * push a language onto the list of languages to try
320 */
321static inline int push_language( WORD *list, int pos, WORD lang )
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}
328
329
330/**********************************************************************
331 * find_entry_language
332 */
334 const void *root, DWORD root_size,
335 DWORD flags )
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}
363
364
366{
367 DWORD res;
368
370 if (!ReadFile( handle, data, len, &res, NULL )) res = 0;
371 return res;
372}
373
374/***********************************************************************
375 * find_ne_resource [internal]
376 */
377static BOOL find_ne_resource( HANDLE handle, DWORD *resLen, DWORD *resOff )
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}
439
440/***********************************************************************
441 * find_pe_resource [internal]
442 */
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}
573
574
575/***********************************************************************
576 * find_version_resource [internal]
577 */
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}
601
602/******************************************************************************
603 * This function will print via standard TRACE, debug info regarding
604 * the file info structure vffi.
605 */
606static void print_vffi_debug(const VS_FIXEDFILEINFO *vffi)
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}
734
735/***********************************************************************
736 * GetFileVersionInfoSizeW (kernelbase.@)
737 */
739{
741}
742
743/***********************************************************************
744 * GetFileVersionInfoSizeA (kernelbase.@)
745 */
747{
749}
750
751/******************************************************************************
752 * GetFileVersionInfoSizeExW (kernelbase.@)
753 */
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}
837
838/******************************************************************************
839 * GetFileVersionInfoSizeExA (kernelbase.@)
840 */
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}
859
860/***********************************************************************
861 * GetFileVersionInfoExW (kernelbase.@)
862 */
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}
940
941/***********************************************************************
942 * GetFileVersionInfoExA (kernelbase.@)
943 */
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}
963
964/***********************************************************************
965 * GetFileVersionInfoW (kernelbase.@)
966 */
968{
970}
971
972/***********************************************************************
973 * GetFileVersionInfoA (kernelbase.@)
974 */
976{
978}
979
980/***********************************************************************
981 * VersionInfo16_FindChild [internal]
982 */
984 LPCSTR key, UINT len )
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}
999
1000/***********************************************************************
1001 * VersionInfo32_FindChild [internal]
1002 */
1004 LPCWSTR key, UINT len )
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}
1019
1020/***********************************************************************
1021 * VersionInfo16_QueryValue [internal]
1022 *
1023 * Gets a value from a 16-bit NE resource
1024 */
1026 LPVOID *lplpBuffer, UINT *puLen )
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}
1063
1064/***********************************************************************
1065 * VersionInfo32_QueryValue [internal]
1066 *
1067 * Gets a value from a 32-bit PE resource
1068 */
1070 LPVOID *lplpBuffer, UINT *puLen, BOOL *pbText )
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}
1111
1112/***********************************************************************
1113 * VerQueryValueA (kernelbase.@)
1114 */
1116 LPVOID *lplpBuffer, PUINT puLen )
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}
1167
1168/***********************************************************************
1169 * VerQueryValueW (kernelbase.@)
1170 */
1172 LPVOID *lplpBuffer, PUINT puLen )
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}
1222
1223
1224/******************************************************************************
1225 * file_existsA
1226 */
1227static BOOL file_existsA( char const * path, char const * file, BOOL excl )
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}
1248
1249/******************************************************************************
1250 * file_existsW
1251 */
1252static BOOL file_existsW( const WCHAR *path, const WCHAR *file, BOOL excl )
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}
1273
1274/*****************************************************************************
1275 * VerFindFileA (kernelbase.@)
1276 *
1277 * Determines where to install a file based on whether it locates another
1278 * version of the file in the system. The values VerFindFile returns are
1279 * used in a subsequent call to the VerInstallFile function.
1280 */
1282 LPSTR cur_dir, PUINT curdir_len, LPSTR dest, PUINT dest_len )
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}
1365
1366/*****************************************************************************
1367 * VerFindFileW (kernelbase.@)
1368 */
1370 LPWSTR cur_dir, PUINT curdir_len, LPWSTR dest, PUINT dest_len )
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}
1443
1444
1445/***********************************************************************
1446 * GetProductInfo (kernelbase.@)
1447 */
1449 DWORD sp_major, DWORD sp_minor, DWORD *type )
1450{
1451 return RtlGetProductInfo( os_major, os_minor, sp_major, sp_minor, type );
1452}
1453
1454
1455/***********************************************************************
1456 * GetVersion (kernelbase.@)
1457 */
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}
1473
1474
1475/***********************************************************************
1476 * GetVersionExA (kernelbase.@)
1477 */
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}
1510
1511
1512/***********************************************************************
1513 * GetVersionExW (kernelbase.@)
1514 */
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}
1544
1545
1546/***********************************************************************
1547 * GetCurrentPackageFamilyName (kernelbase.@)
1548 */
1550{
1551 FIXME( "(%p %p): stub\n", length, name );
1553}
1554
1555
1556/***********************************************************************
1557 * GetCurrentPackageFullName (kernelbase.@)
1558 */
1560{
1561 FIXME( "(%p %p): stub\n", length, name );
1563}
1564
1565
1566/***********************************************************************
1567 * GetCurrentPackageId (kernelbase.@)
1568 */
1569LONG WINAPI /* DECLSPEC_HOTPATCH */ GetCurrentPackageId( UINT32 *len, BYTE *buffer )
1570{
1571 FIXME( "(%p %p): stub\n", len, buffer );
1573}
1574
1575/***********************************************************************
1576 * GetCurrentPackageInfo (kernelbase.@)
1577 */
1579{
1580 FIXME( "(%#x %p %p %p): stub\n", flags, buffer_size, buffer, count );
1582}
1583
1584/***********************************************************************
1585 * GetCurrentPackagePath (kernelbase.@)
1586 */
1588{
1589 FIXME( "(%p %p): stub\n", length, path );
1591}
1592
1593
1594/***********************************************************************
1595 * GetPackageFullName (kernelbase.@)
1596 */
1598{
1599 FIXME( "(%p %p %p): stub\n", process, length, name );
1601}
1602
1603
1604/***********************************************************************
1605 * GetPackageFamilyName (kernelbase.@)
1606 */
1608{
1609 FIXME( "(%p %p %p): stub\n", process, length, name );
1611}
1612
1613/***********************************************************************
1614 * GetPackagesByPackageFamily (kernelbase.@)
1615 */
1617 WCHAR *full_names, UINT32 *buffer_len, WCHAR *buffer)
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}
1628
1629/***********************************************************************
1630 * GetPackagePathByFullName (kernelbase.@)
1631 */
1633{
1634 if (!len || !name)
1636
1637 FIXME( "(%s %p %p): stub\n", debugstr_w(name), len, path );
1638
1640}
1641
1642static const struct
1643{
1645 const WCHAR *name;
1646}
1647arch_names[] =
1648{
1652 {PROCESSOR_ARCHITECTURE_NEUTRAL, L"neutral"},
1653 {PROCESSOR_ARCHITECTURE_ARM64, L"arm64"},
1656
1657static UINT32 processor_arch_from_string(const WCHAR *str, unsigned int len)
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}
1666
1667/***********************************************************************
1668 * PackageIdFromFullName (kernelbase.@)
1669 */
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}
DWORD Id
unsigned int UINT32
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
unsigned int dir
Definition: maze.c:112
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
Definition: list.h:37
wcscpy
static SIZE_T datasize
Definition: asm.c:30
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
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
HMODULE hModule
Definition: animate.c:44
#define CloseHandle
Definition: compat.h:739
#define wcschr
Definition: compat.h:17
#define GetProcessHeap()
Definition: compat.h:736
struct tagVS_FIXEDFILEINFO VS_FIXEDFILEINFO
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define FILE_BEGIN
Definition: compat.h:761
#define wcsnicmp
Definition: compat.h:14
#define CP_ACP
Definition: compat.h:109
#define OPEN_EXISTING
Definition: compat.h:775
#define ReadFile(a, b, c, d, e)
Definition: compat.h:742
#define SetFilePointer
Definition: compat.h:743
#define lstrcpynA
Definition: compat.h:751
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define FreeLibrary(x)
Definition: compat.h:748
#define GENERIC_READ
Definition: compat.h:135
#define TRACE_ON(x)
Definition: compat.h:75
#define RtlImageNtHeader
Definition: compat.h:806
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define CALLBACK
Definition: compat.h:35
#define lstrcpyW
Definition: compat.h:749
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
#define FILE_SHARE_READ
Definition: compat.h:136
#define wcsicmp
Definition: compat.h:15
#define lstrcpynW
Definition: compat.h:738
#define lstrlenW
Definition: compat.h:750
PPEB Peb
Definition: dllmain.c:27
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
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
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2337
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
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2283
BOOL WINAPI GetVersionExW(IN LPOSVERSIONINFOW lpVersionInformation)
Definition: version.c:37
BOOL WINAPI GetVersionExA(IN LPOSVERSIONINFOA lpVersionInformation)
Definition: version.c:69
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
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
LANGID WINAPI GetSystemDefaultLangID(void)
Definition: locale.c:1199
LANGID WINAPI GetUserDefaultLangID(void)
Definition: locale.c:1182
const WCHAR system_dir[]
Definition: file.c:68
const WCHAR windows_dir[]
Definition: file.c:67
BOOL WINAPI GetFileVersionInfoExA(DWORD flags, LPCSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:944
static const IMAGE_RESOURCE_DIRECTORY * find_entry_default(const IMAGE_RESOURCE_DIRECTORY *dir, const void *root)
Definition: version.c:306
#define VersionInfo32_Next(ver)
Definition: version.c:123
DWORD WINAPI GetFileVersionInfoSizeA(LPCSTR filename, LPDWORD handle)
Definition: version.c:746
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: version.c:1281
static BOOL CALLBACK init_current_version(PINIT_ONCE init_once, PVOID parameter, PVOID *context)
Definition: version.c:175
UINT32 code
Definition: version.c:1644
BOOL WINAPI DECLSPEC_HOTPATCH GetProductInfo(DWORD os_major, DWORD os_minor, DWORD sp_major, DWORD sp_minor, DWORD *type)
Definition: version.c:1448
static DWORD find_version_resource(HANDLE handle, DWORD *reslen, DWORD *offset, DWORD flags)
Definition: version.c:578
GUID guid
Definition: version.c:147
static BOOL file_existsW(const WCHAR *path, const WCHAR *file, BOOL excl)
Definition: version.c:1252
LONG WINAPI GetPackageFullName(HANDLE process, UINT32 *length, WCHAR *name)
Definition: version.c:1597
static BOOL VersionInfo16_QueryValue(const VS_VERSION_INFO_STRUCT16 *info, LPCSTR lpSubBlock, LPVOID *lplpBuffer, UINT *puLen)
Definition: version.c:1025
static void print_vffi_debug(const VS_FIXEDFILEINFO *vffi)
Definition: version.c:606
LONG WINAPI GetCurrentPackagePath(UINT32 *length, WCHAR *path)
Definition: version.c:1587
static BOOL find_pe_resource(HANDLE handle, DWORD *resLen, DWORD *resOff, DWORD flags)
Definition: version.c:443
static BOOL VersionInfo32_QueryValue(const VS_VERSION_INFO_STRUCT32 *info, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, UINT *puLen, BOOL *pbText)
Definition: version.c:1069
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
BOOL WINAPI VerQueryValueA(LPCVOID pBlock, LPCSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1115
LONG WINAPI GetCurrentPackageId(UINT32 *len, BYTE *buffer)
Definition: version.c:1569
#define VersionInfo16_Value(ver)
Definition: version.c:108
#define VersionInfo16_Next(ver)
Definition: version.c:121
static UINT32 processor_arch_from_string(const WCHAR *str, unsigned int len)
Definition: version.c:1657
struct version_info info
Definition: version.c:146
DWORD WINAPI GetVersion(void)
Definition: version.c:1458
#define VersionInfo32_Value(ver)
Definition: version.c:110
static BOOL file_existsA(char const *path, char const *file, BOOL excl)
Definition: version.c:1227
static const struct @527 version_data[]
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:967
static RTL_OSVERSIONINFOEXW current_version
Definition: version.c:173
static BOOL find_ne_resource(HANDLE handle, DWORD *resLen, DWORD *resOff)
Definition: version.c:377
const WCHAR * name
Definition: version.c:1645
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
LONG WINAPI GetPackageFamilyName(HANDLE process, UINT32 *length, WCHAR *name)
Definition: version.c:1607
static int push_language(WORD *list, int pos, WORD lang)
Definition: version.c:321
DWORD WINAPI GetFileVersionInfoSizeExA(DWORD flags, LPCSTR filename, LPDWORD handle)
Definition: version.c:841
#define VersionInfoIs16(ver)
Definition: version.c:102
BOOL WINAPI GetFileVersionInfoA(LPCSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:975
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1171
static const struct version_info windows8_1_version_info
Definition: version.c:137
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: version.c:1369
#define VersionInfo32_Children(ver)
Definition: version.c:116
LONG WINAPI GetCurrentPackageFullName(UINT32 *length, WCHAR *name)
Definition: version.c:1559
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:738
static const VS_VERSION_INFO_STRUCT32 * VersionInfo32_FindChild(const VS_VERSION_INFO_STRUCT32 *info, LPCWSTR key, UINT len)
Definition: version.c:1003
BOOL WINAPI GetFileVersionInfoExW(DWORD flags, LPCWSTR filename, DWORD ignored, DWORD datasize, LPVOID data)
Definition: version.c:863
static const struct @528 arch_names[]
LONG WINAPI GetPackagePathByFullName(const WCHAR *name, UINT32 *len, WCHAR *path)
Definition: version.c:1632
static const VS_VERSION_INFO_STRUCT16 * VersionInfo16_FindChild(const VS_VERSION_INFO_STRUCT16 *info, LPCSTR key, UINT len)
Definition: version.c:983
#define VersionInfo16_Children(ver)
Definition: version.c:113
LONG WINAPI GetCurrentPackageFamilyName(UINT32 *length, WCHAR *name)
Definition: version.c:1549
LONG WINAPI PackageIdFromFullName(const WCHAR *full_name, UINT32 flags, UINT32 *buffer_length, BYTE *buffer)
Definition: version.c:1670
DWORD WINAPI GetFileVersionInfoSizeExW(DWORD flags, LPCWSTR filename, LPDWORD ret_handle)
Definition: version.c:754
LONG WINAPI DECLSPEC_HOTPATCH GetPackagesByPackageFamily(const WCHAR *family_name, UINT32 *count, WCHAR *full_names, UINT32 *buffer_len, WCHAR *buffer)
Definition: version.c:1616
LONG WINAPI GetCurrentPackageInfo(const UINT32 flags, UINT32 *buffer_size, BYTE *buffer, UINT32 *count)
Definition: version.c:1578
static const struct version_info windows8_version_info
Definition: version.c:131
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
uint8_t ignored[3]
Definition: fsck.fat.h:0
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint res
Definition: glext.h:9613
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
GLenum mode
Definition: glext.h:6217
GLbitfield flags
Definition: glext.h:7161
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLuint64EXT * result
Definition: glext.h:11304
GLenum GLsizei len
Definition: glext.h:6722
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 const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
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
NTSYSAPI NTSTATUS WINAPI RtlQueryInformationActivationContext(ULONG, HANDLE, PVOID, ULONG, PVOID, SIZE_T, SIZE_T *)
Definition: actctx.c:5572
const char * filename
Definition: ioapi.h:137
#define NtCurrentTeb
uint32_t entry
Definition: isohybrid.c:63
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
static const SecPkgInfoW infoW
Definition: kerberos.c:293
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
USHORT LANGID
Definition: mui.h:9
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static const WCHAR filenameW[]
Definition: amstream.c:41
static WCHAR app_dir[MAX_PATH]
Definition: actctx.c:469
IMAGE_NT_HEADERS nt
Definition: module.c:50
static DWORD LPDWORD reslen
Definition: directory.c:51
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG sharing
Definition: pipe.c:70
static char * dest
Definition: rtl.c:135
struct section sections[2]
Definition: diskspace.c:792
static HWND child
Definition: cursoricon.c:298
#define min(a, b)
Definition: monoChain.cc:55
unsigned int * PUINT
Definition: ndis.h:50
unsigned int UINT
Definition: ndis.h:50
#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
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
#define VER_PLATFORM_WIN32_NT
Definition: rtltypes.h:238
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define IMAGE_NT_OPTIONAL_HDR32_MAGIC
Definition: ntimage.h:376
#define IMAGE_NT_OPTIONAL_HDR64_MAGIC
Definition: ntimage.h:377
#define VS_FILE_INFO
Definition: ntverrsrc.c:28
#define VS_VERSION_INFO
Definition: ntverrsrc.c:27
#define LOWORD(l)
Definition: pedump.c:82
#define IMAGE_NT_SIGNATURE
Definition: pedump.c:93
long LONG
Definition: pedump.c:60
#define IMAGE_OS2_SIGNATURE
Definition: pedump.c:90
#define IMAGE_DOS_SIGNATURE
Definition: pedump.c:89
#define IMAGE_DIRECTORY_ENTRY_RESOURCE
Definition: pedump.c:261
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
const WCHAR * str
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#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 DECLSPEC_HOTPATCH
Definition: config.h:9
strcat
Definition: string.h:92
strcpy
Definition: string.h:131
#define memset(x, y, z)
Definition: compat.h:39
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define TRACE(s)
Definition: solgame.cpp:4
wchar_t const *const size_t const buffer_size
Definition: stat.cpp:95
WORD handle
Definition: version.c:53
WORD offset
Definition: version.c:49
WORD length
Definition: version.c:50
WORD id
Definition: version.c:52
WORD flags
Definition: version.c:51
WORD usage
Definition: version.c:54
WORD type_id
Definition: version.c:59
WORD count
Definition: version.c:60
DWORD resloader
Definition: version.c:61
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
WORD MinorOperatingSystemVersion
Definition: ntddk_ex.h:161
WORD MajorOperatingSystemVersion
Definition: ntddk_ex.h:160
Definition: pedump.c:458
DWORD OffsetToData
Definition: pedump.c:459
DWORD Size
Definition: pedump.c:460
Definition: pedump.c:414
USHORT wServicePackMajor
Definition: rtltypes.h:261
USHORT wSuiteMask
Definition: rtltypes.h:263
UCHAR wProductType
Definition: rtltypes.h:264
USHORT wServicePackMinor
Definition: rtltypes.h:262
WCHAR szCSDVersion[128]
Definition: rtltypes.h:274
ULONG dwMajorVersion
Definition: rtltypes.h:270
ULONG dwMinorVersion
Definition: rtltypes.h:271
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:269
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
PVOID ImageBaseAddress
Definition: ntddk_ex.h:245
PVOID ActivationContextData
Definition: winternl.h:354
Definition: inflate.c:139
Definition: http.c:7252
Definition: fci.c:127
Definition: copy.c:22
Definition: name.c:39
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
DWORD major
Definition: version.c:66
DWORD build
Definition: version.c:68
DWORD minor
Definition: version.c:67
#define max(a, b)
Definition: svc.c:63
T1_FIELD_DICT_FONTDICT family_name
Definition: t1tokens.h:30
int32_t INT_PTR
Definition: typedefs.h:64
#define MAKEWORD(a, b)
Definition: typedefs.h:248
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
unsigned char * LPBYTE
Definition: typedefs.h:53
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
#define MAKELONG(a, b)
Definition: typedefs.h:249
#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 FILE_VER_GET_LOCALISED
Definition: verrsrc.h:147
#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 VFF_FILEINUSE
Definition: verrsrc.h:109
#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 VFF_BUFFTOOSMALL
Definition: verrsrc.h:110
#define VFF_CURNEDEST
Definition: verrsrc.h:108
#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
#define VFFF_ISSHAREDFILE
Definition: verrsrc.h:105
static const WCHAR lang[]
Definition: wbemdisp.c:287
static const LCID english
Definition: wbemdisp.c:32
int retval
Definition: wcstombs.cpp:91
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
PRTL_RUN_ONCE PINIT_ONCE
Definition: winbase.h:3973
#define LOAD_LIBRARY_AS_IMAGE_RESOURCE
Definition: winbase.h:380
RTL_RUN_ONCE INIT_ONCE
Definition: winbase.h:3972
#define INIT_ONCE_STATIC_INIT
Definition: winbase.h:647
CONST void * LPCVOID
Definition: windef.h:191
#define WINAPI
Definition: msvc.h:6
#define APPMODEL_ERROR_NO_PACKAGE
Definition: winerror.h:2337
#define ERROR_BAD_PATHNAME
Definition: winerror.h:233
#define ERROR_RESOURCE_TYPE_NOT_FOUND
Definition: winerror.h:1120
#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
NTSYSAPI BOOLEAN NTAPI RtlGetProductInfo(_In_ ULONG OSMajorVersion, _In_ ULONG OSMinorVersion, _In_ ULONG SpMajorVersion, _In_ ULONG SpMinorVersion, _Out_ PULONG ReturnedProductType)
#define strnicmp
Definition: xmlstorage.h:206
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char CHAR
Definition: xmlstorage.h:175
unsigned char BYTE
Definition: xxhash.c:193