winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2007
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
1085 discussions
Start a n
N
ew thread
Mikolaj Zalewski : msvcrt: Don't test codepage 20932.
by Alexandre Julliard
23 Aug '07
23 Aug '07
Module: wine Branch: master Commit: cf8cf1d7f9a7c3ee8d695ff00f9ce55a81da1aab URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cf8cf1d7f9a7c3ee8d695ff00…
Author: Mikolaj Zalewski <mikolajz(a)google.com> Date: Wed Aug 22 18:41:32 2007 -0700 msvcrt: Don't test codepage 20932. --- dlls/msvcrt/mbcs.c | 2 +- dlls/msvcrt/tests/string.c | 4 ---- 2 files changed, 1 insertions(+), 5 deletions(-) diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index e2148e8..9c6d34c 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -50,7 +50,7 @@ static struct cp_extra_info_t g_cpextrainfo[] = {936, {0x40, 0xfe, 0, 0}}, {949, {0x41, 0xfe, 0, 0}}, {950, {0x40, 0x7e, 0xa1, 0xfe, 0, 0}}, - {20932, {1, 255, 0, 0}}, + {20932, {1, 255, 0, 0}}, /* seems to give different results on different systems */ {0, {1, 255, 0, 0}} /* match all with FIXME */ }; diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c index d400823..698a3af 100644 --- a/dlls/msvcrt/tests/string.c +++ b/dlls/msvcrt/tests/string.c @@ -143,12 +143,9 @@ static int result_cp_949_mbctype[] = { 0x0,66, 0x18,26, 0x8,6, 0x28,26, 0x8,6, 0 0,1 }; static int result_cp_950_mbctype[] = { 0x0,65, 0x8,1, 0x18,26, 0x8,6, 0x28,26, 0x8,4, 0x0,2, 0x4,32, 0xc,94, 0,1 }; -static int result_cp_20932_mbctype[] = { 0x0,2, 0x8,64, 0x18,26, 0x8,6, 0x28,26, 0x8,19, - 0xc,1, 0x8,18, 0xc,94, 0,1 }; static int todo_none[] = { -2 }; static int todo_cp_932[] = { 254, -2 }; -static int todo_cp_20932[] = { 143, -2 }; void test_cp_table(int cp, int *result, int *todo) { @@ -197,7 +194,6 @@ static void test_mbcp(void) test_codepage(936); test_codepage(949); test_codepage(950); - test_codepage_todo(20932, todo_cp_20932); _setmbcp(936); ok(__mb_cur_max == mb_orig_max, "__mb_cur_max shouldn't be updated (is %d != %d)\n", __mb_cur_max, mb_orig_max);
1
0
0
0
Mikolaj Zalewski : msvcrt: Test and fix _mbccpy, _mbsncpy and _mbsnbcpy.
by Alexandre Julliard
23 Aug '07
23 Aug '07
Module: wine Branch: master Commit: c5268a20abd734b8591138fedaa4c9f1cc4b007e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c5268a20abd734b8591138fed…
Author: Mikolaj Zalewski <mikolajz(a)google.com> Date: Wed Aug 22 10:47:01 2007 -0700 msvcrt: Test and fix _mbccpy, _mbsncpy and _mbsnbcpy. --- dlls/msvcrt/mbcs.c | 56 +++++++++++++++++++++++++++---------------- dlls/msvcrt/tests/string.c | 57 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 90 insertions(+), 23 deletions(-) diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index 38c249b..e2148e8 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -31,6 +31,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); unsigned char MSVCRT_mbctype[257]; +static int g_mbcp_is_multibyte = 0; + int MSVCRT___mb_cur_max = 1; extern int MSVCRT___lc_collate_cp; @@ -207,6 +209,8 @@ int CDECL _setmbcp(int cp) { /* trail bytes not available through kernel32 but stored in a structure in msvcrt */ struct cp_extra_info_t *cpextra = g_cpextrainfo; + + g_mbcp_is_multibyte = 1; while (TRUE) { if (cpextra->cp == 0 || cpextra->cp == newcp) @@ -226,6 +230,8 @@ int CDECL _setmbcp(int cp) cpextra++; } } + else + g_mbcp_is_multibyte = 0; /* we can't use GetStringTypeA directly because we don't have a locale - only a code page */ @@ -385,26 +391,39 @@ MSVCRT_size_t CDECL _mbslen(const unsigned char* str) void CDECL _mbccpy(unsigned char* dest, const unsigned char* src) { *dest = *src; - if(MSVCRT___mb_cur_max > 1 && MSVCRT_isleadbyte(*src)) + if(_ismbblead(*src)) *++dest = *++src; /* MB char */ } /********************************************************************* * _mbsncpy(MSVCRT.@) + * REMARKS + * The parameter n is the number or characters to copy, not the size of + * the buffer. Use _mbsnbcpy for a function analogical to strncpy */ unsigned char* CDECL _mbsncpy(unsigned char* dst, const unsigned char* src, MSVCRT_size_t n) { unsigned char* ret = dst; if(!n) return dst; - if(MSVCRT___mb_cur_max > 1) + if (g_mbcp_is_multibyte) { while (*src && n) { n--; - *dst++ = *src; - if (MSVCRT_isleadbyte(*src++)) - *dst++ = *src++; + if (_ismbblead(*src)) + { + if (!*(src+1)) + { + *dst++ = 0; + *dst++ = 0; + break; + } + + *dst++ = *src++; + } + + *dst++ = *src++; } } else @@ -421,32 +440,27 @@ unsigned char* CDECL _mbsncpy(unsigned char* dst, const unsigned char* src, MSVC /********************************************************************* * _mbsnbcpy(MSVCRT.@) + * REMARKS + * Like strncpy this function doesn't enforce the string to be + * NUL-terminated */ unsigned char* CDECL _mbsnbcpy(unsigned char* dst, const unsigned char* src, MSVCRT_size_t n) { unsigned char* ret = dst; if(!n) return dst; - if(MSVCRT___mb_cur_max > 1) + if(g_mbcp_is_multibyte) { - while (*src && (n > 1)) - { - n--; - *dst++ = *src; - if (MSVCRT_isleadbyte(*src++)) - { - *dst++ = *src++; - n--; - } - } - if (*src && n && !MSVCRT_isleadbyte(*src)) + int is_lead = 0; + while (*src && n) { - /* If the last character is a multi-byte character then - * we cannot copy it since we have only one byte left - */ - *dst++ = *src; + is_lead = (!is_lead && _ismbblead(*src)); n--; + *dst++ = *src++; } + + if (is_lead) /* if string ends with a lead, remove it */ + *(dst - 1) = 0; } else { diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c index 4f82652..d400823 100644 --- a/dlls/msvcrt/tests/string.c +++ b/dlls/msvcrt/tests/string.c @@ -23,9 +23,26 @@ #include <string.h> #include <mbstring.h> #include <stdlib.h> +#include <stdio.h> #include <mbctype.h> +#include <locale.h> + +static char *buf_to_string(const unsigned char *bin, int len, int nr) +{ + static char buf[2][1024]; + char *w = buf[nr]; + int i; + + for (i = 0; i < len; i++) + { + sprintf(w, "%02x ", (unsigned char)bin[i]); + w += strlen(w); + } + return buf[nr]; +} #define expect_eq(expr, value, type, format) { type ret = (expr); ok((value) == ret, #expr " expected " format " got " format "\n", value, ret); } +#define expect_bin(buf, value, len) { ok(memcmp((buf), value, len) == 0, "Binary buffer mismatch - expected %s, got %s\n", buf_to_string((unsigned char *)value, len, 1), buf_to_string((buf), len, 0)); } static void* (*pmemcpy)(void *, const void *, size_t n); static int* (*pmemcmp)(void *, const void *, size_t n); @@ -33,6 +50,8 @@ static int* (*pmemcmp)(void *, const void *, size_t n); #define SETNOFAIL(x,y) x = (void*)GetProcAddress(hMsvcrt,y) #define SET(x,y) SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y) +HMODULE hMsvcrt; + static void test_swab( void ) { char original[] = "BADCFEHGJILKNMPORQTSVUXWZY@#"; char expected1[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ@#"; @@ -167,7 +186,8 @@ static void test_mbcp(void) int curr_mbcp = _getmbcp(); unsigned char *mbstring = (unsigned char *)"\xb0\xb1\xb2 \xb3\xb4 \xb5"; /* incorrect string */ unsigned char *mbstring2 = (unsigned char *)"\xb0\xb1\xb2\xb3Q\xb4\xb5"; /* correct string */ - unsigned char *mbsonlylead = (unsigned char *)"\xb0"; + unsigned char *mbsonlylead = (unsigned char *)"\xb0\0\xb1\xb2"; + unsigned char buf[16]; /* some two single-byte code pages*/ test_codepage(1252); @@ -201,6 +221,40 @@ static void test_mbcp(void) expect_eq(_mbslen(mbsonlylead), 0, int, "%d"); /* lead + NUL not counted as character */ expect_eq(_mbslen(mbstring), 4, int, "%d"); /* lead + invalid trail counted */ + /* _mbccpy/_mbsncpy */ + memset(buf, 0xff, sizeof(buf)); + _mbccpy(buf, mbstring); + expect_bin(buf, "\xb0\xb1\xff", 3); + + memset(buf, 0xff, sizeof(buf)); + _mbsncpy(buf, mbstring, 1); + expect_bin(buf, "\xb0\xb1\xff", 3); + memset(buf, 0xff, sizeof(buf)); + _mbsncpy(buf, mbstring, 2); + expect_bin(buf, "\xb0\xb1\xb2 \xff", 5); + memset(buf, 0xff, sizeof(buf)); + _mbsncpy(buf, mbstring, 3); + expect_bin(buf, "\xb0\xb1\xb2 \xb3\xb4\xff", 7); + memset(buf, 0xff, sizeof(buf)); + _mbsncpy(buf, mbstring, 4); + expect_bin(buf, "\xb0\xb1\xb2 \xb3\xb4 \xff", 8); + memset(buf, 0xff, sizeof(buf)); + _mbsncpy(buf, mbstring, 5); + expect_bin(buf, "\xb0\xb1\xb2 \xb3\xb4 \0\0\xff", 10); + memset(buf, 0xff, sizeof(buf)); + _mbsncpy(buf, mbsonlylead, 6); + expect_bin(buf, "\0\0\0\0\0\0\0\xff", 8); + + memset(buf, 0xff, sizeof(buf)); + _mbsnbcpy(buf, mbstring2, 2); + expect_bin(buf, "\xb0\xb1\xff", 3); + _mbsnbcpy(buf, mbstring2, 3); + expect_bin(buf, "\xb0\xb1\0\xff", 4); + _mbsnbcpy(buf, mbstring2, 4); + expect_bin(buf, "\xb0\xb1\xb2\xb3\xff", 5); + memset(buf, 0xff, sizeof(buf)); + _mbsnbcpy(buf, mbsonlylead, 5); + expect_bin(buf, "\0\0\0\0\0\xff", 6); /* functions that depend on locale codepage, not mbcp. * we hope the current locale to be SBCS because setlocale(LC_ALL, ".1252") seems not to work yet @@ -263,7 +317,6 @@ START_TEST(string) void *mem; static const char xilstring[]="c:/xilinx"; int nLen; - HMODULE hMsvcrt; hMsvcrt = GetModuleHandleA("msvcrt.dll"); if (!hMsvcrt)
1
0
0
0
James Hawkins : advpack: Formalize the SESSION struct.
by Alexandre Julliard
23 Aug '07
23 Aug '07
Module: wine Branch: master Commit: 5b62c8461c85985df69316168f9235ee540676b2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5b62c8461c85985df69316168…
Author: James Hawkins <truiken(a)gmail.com> Date: Wed Aug 22 17:41:04 2007 -0700 advpack: Formalize the SESSION struct. --- dlls/advpack/files.c | 82 +++++++++++++++++++++++++------------------------ 1 files changed, 42 insertions(+), 40 deletions(-) diff --git a/dlls/advpack/files.c b/dlls/advpack/files.c index 163f994..d0f948c 100644 --- a/dlls/advpack/files.c +++ b/dlls/advpack/files.c @@ -29,6 +29,7 @@ #include "winternl.h" #include "setupapi.h" #include "advpub.h" +#include "fdi.h" #include "wine/debug.h" #include "wine/unicode.h" #include "advpack_private.h" @@ -515,28 +516,29 @@ HRESULT WINAPI DelNodeRunDLL32W(HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, INT /* The following defintions were copied from dlls/cabinet/cabinet.h */ -/* EXTRACTdest flags */ +/* SESSION Operation */ #define EXTRACT_FILLFILELIST 0x00000001 #define EXTRACT_EXTRACTFILES 0x00000002 -struct ExtractFileList { - LPSTR filename; - struct ExtractFileList *next; - BOOL unknown; /* always 1L */ -} ; +struct FILELIST{ + LPSTR FileName; + struct FILELIST *next; + BOOL Extracted; +}; -/* the first parameter of the function Extract */ typedef struct { - long result1; /* 0x000 */ - long unknown1[3]; /* 0x004 */ - struct ExtractFileList *filelist; /* 0x010 */ - long filecount; /* 0x014 */ - DWORD flags; /* 0x018 */ - char directory[0x104]; /* 0x01c */ - char lastfile[0x20c]; /* 0x120 */ -} EXTRACTdest; - -static HRESULT (WINAPI *pExtract)(EXTRACTdest*, LPCSTR); + INT FileSize; + ERF Error; + struct FILELIST *FileList; + INT FileCount; + INT Operation; + CHAR Destination[MAX_PATH]; + CHAR CurrentFile[MAX_PATH]; + CHAR Reserved[MAX_PATH]; + struct FILELIST *FilterList; +} SESSION; + +static HRESULT (WINAPI *pExtract)(SESSION*, LPCSTR); /* removes legal characters before and after file list, and * converts the file list to a NULL-separated list @@ -591,9 +593,9 @@ static LPSTR convert_file_list(LPCSTR FileList, DWORD *dwNumFiles) return szConvertedList; } -static void free_file_node(struct ExtractFileList *pNode) +static void free_file_node(struct FILELIST *pNode) { - HeapFree(GetProcessHeap(), 0, pNode->filename); + HeapFree(GetProcessHeap(), 0, pNode->FileName); HeapFree(GetProcessHeap(), 0, pNode); } @@ -622,23 +624,23 @@ static BOOL file_in_list(LPCSTR szFile, LPCSTR szFileList) /* removes nodes from the linked list that aren't specified in szFileList * returns the number of files that are in both the linked list and szFileList */ -static DWORD fill_file_list(EXTRACTdest *extractDest, LPCSTR szCabName, LPCSTR szFileList) +static DWORD fill_file_list(SESSION *session, LPCSTR szCabName, LPCSTR szFileList) { DWORD dwNumFound = 0; - struct ExtractFileList *pNode; - struct ExtractFileList *prev = NULL; + struct FILELIST *pNode; + struct FILELIST *prev = NULL; - extractDest->flags |= EXTRACT_FILLFILELIST; - if (pExtract(extractDest, szCabName)) + session->Operation |= EXTRACT_FILLFILELIST; + if (pExtract(session, szCabName)) { - extractDest->flags &= ~EXTRACT_FILLFILELIST; + session->Operation &= ~EXTRACT_FILLFILELIST; return -1; } - pNode = extractDest->filelist; + pNode = session->FileList; while (pNode) { - if (file_in_list(pNode->filename, szFileList)) + if (file_in_list(pNode->FileName, szFileList)) { prev = pNode; pNode = pNode->next; @@ -652,13 +654,13 @@ static DWORD fill_file_list(EXTRACTdest *extractDest, LPCSTR szCabName, LPCSTR s } else { - extractDest->filelist = pNode->next; + session->FileList = pNode->next; free_file_node(pNode); - pNode = extractDest->filelist; + pNode = session->FileList; } } - extractDest->flags &= ~EXTRACT_FILLFILELIST; + session->Operation &= ~EXTRACT_FILLFILELIST; return dwNumFound; } @@ -690,7 +692,7 @@ static DWORD fill_file_list(EXTRACTdest *extractDest, LPCSTR szCabName, LPCSTR s HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags, LPCSTR FileList, LPVOID LReserved, DWORD Reserved) { - EXTRACTdest extractDest; + SESSION session; HMODULE hCabinet; HRESULT res = S_OK; DWORD dwFileCount = 0; @@ -717,8 +719,8 @@ HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags, goto done; } - ZeroMemory(&extractDest, sizeof(EXTRACTdest)); - lstrcpyA(extractDest.directory, ExpandDir); + ZeroMemory(&session, sizeof(SESSION)); + lstrcpyA(session.Destination, ExpandDir); if (FileList) { @@ -729,7 +731,7 @@ HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags, goto done; } - dwFilesFound = fill_file_list(&extractDest, CabName, szConvertedList); + dwFilesFound = fill_file_list(&session, CabName, szConvertedList); if (dwFilesFound != dwFileCount) { res = E_FAIL; @@ -737,15 +739,15 @@ HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags, } } else - extractDest.flags |= EXTRACT_FILLFILELIST; + session.Operation |= EXTRACT_FILLFILELIST; - extractDest.flags |= EXTRACT_EXTRACTFILES; - res = pExtract(&extractDest, CabName); + session.Operation |= EXTRACT_EXTRACTFILES; + res = pExtract(&session, CabName); - if (extractDest.filelist) + if (session.FileList) { - struct ExtractFileList* curr = extractDest.filelist; - struct ExtractFileList* next; + struct FILELIST *curr = session.FileList; + struct FILELIST *next; while (curr) {
1
0
0
0
James Hawkins : cabinet: Formalize the SESSION struct.
by Alexandre Julliard
23 Aug '07
23 Aug '07
Module: wine Branch: master Commit: 832e30694d02c8a34dedc8ccbbf9bf5a3590e6ce URL:
http://source.winehq.org/git/wine.git/?a=commit;h=832e30694d02c8a34dedc8ccb…
Author: James Hawkins <truiken(a)gmail.com> Date: Wed Aug 22 17:35:53 2007 -0700 cabinet: Formalize the SESSION struct. --- dlls/cabinet/cabinet.h | 34 ++++++++++----------- dlls/cabinet/cabinet_main.c | 67 ++++++++++++++++++++++-------------------- 2 files changed, 51 insertions(+), 50 deletions(-) diff --git a/dlls/cabinet/cabinet.h b/dlls/cabinet/cabinet.h index 4cd1f77..3b72ff8 100644 --- a/dlls/cabinet/cabinet.h +++ b/dlls/cabinet/cabinet.h @@ -631,29 +631,27 @@ static const cab_UWORD Zipmask[17] = { 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff \ } -/* EXTRACTdest flags */ +/* SESSION Operation */ #define EXTRACT_FILLFILELIST 0x00000001 #define EXTRACT_EXTRACTFILES 0x00000002 -struct ExtractFileList { - LPSTR filename; - struct ExtractFileList *next; - BOOL flag; -} ; +struct FILELIST{ + LPSTR FileName; + struct FILELIST *next; + BOOL Extracted; +}; -/* the first parameter of the function extract */ typedef struct { - long result1; /* 0x000 */ - long unknown1[3]; /* 0x004 */ - struct ExtractFileList *filelist; /* 0x010 */ - long filecount; /* 0x014 */ - DWORD flags; /* 0x018 */ - char directory[MAX_PATH]; /* 0x01c */ - char lastfile[MAX_PATH]; /* 0x120 */ - char unknown2[MAX_PATH]; /* 0x224 */ - struct ExtractFileList *filterlist; /* 0x328 */ -} EXTRACTdest; - + INT FileSize; + ERF Error; + struct FILELIST *FileList; + INT FileCount; + INT Operation; + CHAR Destination[MAX_PATH]; + CHAR CurrentFile[MAX_PATH]; + CHAR Reserved[MAX_PATH]; + struct FILELIST *FilterList; +} SESSION; /* from fdi.c */ void QTMupdatemodel(struct QTMmodel *model, int sym); diff --git a/dlls/cabinet/cabinet_main.c b/dlls/cabinet/cabinet_main.c index 6483a3f..8b3c621 100644 --- a/dlls/cabinet/cabinet_main.c +++ b/dlls/cabinet/cabinet_main.c @@ -154,20 +154,20 @@ static long fdi_seek(INT_PTR hf, long dist, int seektype) return SetFilePointer(handle, dist, NULL, seektype); } -static void fill_file_node(struct ExtractFileList *pNode, LPCSTR szFilename) +static void fill_file_node(struct FILELIST *pNode, LPCSTR szFilename) { pNode->next = NULL; - pNode->flag = FALSE; + pNode->Extracted = FALSE; - pNode->filename = HeapAlloc(GetProcessHeap(), 0, strlen(szFilename) + 1); - lstrcpyA(pNode->filename, szFilename); + pNode->FileName = HeapAlloc(GetProcessHeap(), 0, strlen(szFilename) + 1); + lstrcpyA(pNode->FileName, szFilename); } -static BOOL file_in_list(const struct ExtractFileList *pNode, LPCSTR szFilename) +static BOOL file_in_list(const struct FILELIST *pNode, LPCSTR szFilename) { while (pNode) { - if (!lstrcmpiA(pNode->filename, szFilename)) + if (!lstrcmpiA(pNode->FileName, szFilename)) return TRUE; pNode = pNode->next; @@ -182,17 +182,17 @@ static INT_PTR fdi_notify_extract(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pf { case fdintCOPY_FILE: { - struct ExtractFileList **fileList; - EXTRACTdest *pDestination = pfdin->pv; + struct FILELIST **fileList; + SESSION *pDestination = pfdin->pv; LPSTR szFullPath, szDirectory; HANDLE hFile = 0; DWORD dwSize; - dwSize = lstrlenA(pDestination->directory) + + dwSize = lstrlenA(pDestination->Destination) + lstrlenA("\\") + lstrlenA(pfdin->psz1) + 1; szFullPath = HeapAlloc(GetProcessHeap(), 0, dwSize); - lstrcpyA(szFullPath, pDestination->directory); + lstrcpyA(szFullPath, pDestination->Destination); lstrcatA(szFullPath, "\\"); lstrcatA(szFullPath, pfdin->psz1); @@ -201,26 +201,26 @@ static INT_PTR fdi_notify_extract(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pf szDirectory = HeapAlloc(GetProcessHeap(), 0, dwSize); lstrcpynA(szDirectory, szFullPath, dwSize); - if (pDestination->flags & EXTRACT_FILLFILELIST) + if (pDestination->Operation & EXTRACT_FILLFILELIST) { - fileList = &pDestination->filelist; + fileList = &pDestination->FileList; while (*fileList) fileList = &((*fileList)->next); *fileList = HeapAlloc(GetProcessHeap(), 0, - sizeof(struct ExtractFileList)); + sizeof(struct FILELIST)); fill_file_node(*fileList, pfdin->psz1); - lstrcpyA(pDestination->lastfile, szFullPath); - pDestination->filecount++; + lstrcpyA(pDestination->CurrentFile, szFullPath); + pDestination->FileCount++; } - if ((pDestination->flags & EXTRACT_EXTRACTFILES) || - file_in_list(pDestination->filterlist, pfdin->psz1)) + if ((pDestination->Operation & EXTRACT_EXTRACTFILES) || + file_in_list(pDestination->FilterList, pfdin->psz1)) { /* skip this file if it is not in the file list */ - if (!file_in_list(pDestination->filelist, pfdin->psz1)) + if (!file_in_list(pDestination->FileList, pfdin->psz1)) return 0; /* create the destination directory if it doesn't exist */ @@ -281,25 +281,28 @@ static INT_PTR fdi_notify_extract(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pf * NOTES * The following members of the dest struct control the operation * of Extract: - * filelist [I] A linked list of filenames. Extract only extracts - * files from the cabinet that are in this list. - * filecount [O] Contains the number of files in filelist on - * completion. - * flags [I] See Operation. - * directory [I] The destination directory. - * lastfile [O] The last file extracted. + * FileSize [O] The size of all files extracted up to CurrentFile. + * Error [O] The error in case the extract operation fails. + * FileList [I] A linked list of filenames. Extract only extracts + * files from the cabinet that are in this list. + * FileCount [O] Contains the number of files in FileList on + * completion. + * Operation [I] See Operation. + * Destination [I] The destination directory. + * CurrentFile [O] The last file extracted. + * FilterList [I] A linked list of files that should not be extracted. * * Operation - * If flags contains EXTRACT_FILLFILELIST, then filelist will be - * filled with all the files in the cabinet. If flags contains - * EXTRACT_EXTRACTFILES, then only the files in the filelist will + * If Operation contains EXTRACT_FILLFILELIST, then FileList will be + * filled with all the files in the cabinet. If Operation contains + * EXTRACT_EXTRACTFILES, then only the files in the FileList will * be extracted from the cabinet. EXTRACT_FILLFILELIST can be called - * by itself, but EXTRACT_EXTRACTFILES must have a valid filelist - * in order to succeed. If flags contains both EXTRACT_FILLFILELIST + * by itself, but EXTRACT_EXTRACTFILES must have a valid FileList + * in order to succeed. If Operation contains both EXTRACT_FILLFILELIST * and EXTRACT_EXTRACTFILES, then all the files in the cabinet * will be extracted. */ -HRESULT WINAPI Extract(EXTRACTdest *dest, LPCSTR szCabName) +HRESULT WINAPI Extract(SESSION *dest, LPCSTR szCabName) { HRESULT res = S_OK; HFDI hfdi; @@ -321,7 +324,7 @@ HRESULT WINAPI Extract(EXTRACTdest *dest, LPCSTR szCabName) if (!hfdi) return E_FAIL; - if (GetFileAttributesA(dest->directory) == INVALID_FILE_ATTRIBUTES) + if (GetFileAttributesA(dest->Destination) == INVALID_FILE_ATTRIBUTES) return S_OK; /* split the cabinet name into path + name */
1
0
0
0
Alexander Nicolaysen Sørnes : wordpad: Don't display full path in save changes dialog.
by Alexandre Julliard
23 Aug '07
23 Aug '07
Module: wine Branch: master Commit: d13541f86c8afdc68e7970337603be8403374314 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d13541f86c8afdc68e7970337…
Author: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> Date: Wed Aug 22 22:52:19 2007 +0200 wordpad: Don't display full path in save changes dialog. --- programs/wordpad/wordpad.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c index 208528a..a8c39d6 100644 --- a/programs/wordpad/wordpad.c +++ b/programs/wordpad/wordpad.c @@ -661,7 +661,7 @@ static BOOL prompt_save_changes(void) if(!wszFileName[0]) displayFileName = wszDefaultFileName; else - displayFileName = wszFileName; + displayFileName = file_basename(wszFileName); text = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(displayFileName)+lstrlenW(wszSaveChanges))*sizeof(WCHAR));
1
0
0
0
Alexander Nicolaysen Sørnes : wordpad: Don't show full path in caption.
by Alexandre Julliard
23 Aug '07
23 Aug '07
Module: wine Branch: master Commit: 219c47338a2c695e5791fda3bd167291a6c3e259 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=219c47338a2c695e5791fda3b…
Author: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> Date: Wed Aug 22 22:44:21 2007 +0200 wordpad: Don't show full path in caption. --- programs/wordpad/wordpad.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c index 767e813..208528a 100644 --- a/programs/wordpad/wordpad.c +++ b/programs/wordpad/wordpad.c @@ -155,6 +155,7 @@ static DWORD CALLBACK stream_out(DWORD_PTR cookie, LPBYTE buffer, LONG cb, LONG return 0; } + static LPWSTR file_basename(LPWSTR path) { LPWSTR pos = path + lstrlenW(path); @@ -182,6 +183,8 @@ static void set_caption(LPCWSTR wszNewFileName) if(!wszNewFileName) wszNewFileName = wszDefaultFileName; + else + wszNewFileName = file_basename((LPWSTR)wszNewFileName); wszCaption = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, lstrlenW(wszNewFileName)*sizeof(WCHAR)+sizeof(wszSeparator)+sizeof(wszAppTitle));
1
0
0
0
Andrew Talbot : rsaenh: Constify some variables.
by Alexandre Julliard
23 Aug '07
23 Aug '07
Module: wine Branch: master Commit: 45c5b11fd6b8d301df22d2e493a0d60ce268f524 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=45c5b11fd6b8d301df22d2e49…
Author: Andrew Talbot <andrew.talbot(a)talbotville.com> Date: Wed Aug 22 22:09:05 2007 +0100 rsaenh: Constify some variables. --- dlls/rsaenh/des.c | 9 ++-- dlls/rsaenh/mpi.c | 110 +++++++++++++++++++++++----------------------- dlls/rsaenh/tomcrypt.h | 114 ++++++++++++++++++++++++------------------------ 3 files changed, 116 insertions(+), 117 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=45c5b11fd6b8d301df22d…
1
0
0
0
Stefan Leichter : oleaut32: Remove 'recursive registry key delete' function .
by Alexandre Julliard
23 Aug '07
23 Aug '07
Module: wine Branch: master Commit: acd48e5b9d83d99fa313eac55a918aba240d2ab6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=acd48e5b9d83d99fa313eac55…
Author: Stefan Leichter <Stefan.Leichter(a)camline.com> Date: Wed Aug 22 21:51:54 2007 +0200 oleaut32: Remove 'recursive registry key delete' function. --- dlls/oleaut32/regsvr.c | 76 ++++-------------------------------------------- 1 files changed, 6 insertions(+), 70 deletions(-) diff --git a/dlls/oleaut32/regsvr.c b/dlls/oleaut32/regsvr.c index b1dd714..a65c109 100644 --- a/dlls/oleaut32/regsvr.c +++ b/dlls/oleaut32/regsvr.c @@ -108,9 +108,6 @@ static LONG register_key_defvalueW(HKEY base, WCHAR const *name, WCHAR const *value); static LONG register_key_defvalueA(HKEY base, WCHAR const *name, char const *value); -static LONG recursive_delete_key(HKEY key); -static LONG recursive_delete_keyA(HKEY base, char const *name); -static LONG recursive_delete_keyW(HKEY base, WCHAR const *name); /*********************************************************************** * register_interfaces @@ -199,7 +196,8 @@ static HRESULT unregister_interfaces(struct regsvr_interface const *list) WCHAR buf[39]; StringFromGUID2(list->iid, buf, 39); - res = recursive_delete_keyW(interface_key, buf); + res = RegDeleteTreeW(interface_key, buf); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; } RegCloseKey(interface_key); @@ -309,11 +307,13 @@ static HRESULT unregister_coclasses(struct regsvr_coclass const *list) WCHAR buf[39]; StringFromGUID2(list->clsid, buf, 39); - res = recursive_delete_keyW(coclass_key, buf); + res = RegDeleteTreeW(coclass_key, buf); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; if (list->progid) { - res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->progid); + res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } } @@ -376,70 +376,6 @@ static LONG register_key_defvalueA( } /*********************************************************************** - * recursive_delete_key - */ -static LONG recursive_delete_key(HKEY key) -{ - LONG res; - WCHAR subkey_name[MAX_PATH]; - DWORD cName; - HKEY subkey; - - for (;;) { - cName = sizeof(subkey_name) / sizeof(WCHAR); - res = RegEnumKeyExW(key, 0, subkey_name, &cName, - NULL, NULL, NULL, NULL); - if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) { - res = ERROR_SUCCESS; /* presumably we're done enumerating */ - break; - } - res = RegOpenKeyExW(key, subkey_name, 0, - KEY_READ | KEY_WRITE, &subkey); - if (res == ERROR_FILE_NOT_FOUND) continue; - if (res != ERROR_SUCCESS) break; - - res = recursive_delete_key(subkey); - RegCloseKey(subkey); - if (res != ERROR_SUCCESS) break; - } - - if (res == ERROR_SUCCESS) res = RegDeleteKeyW(key, 0); - return res; -} - -/*********************************************************************** - * recursive_delete_keyA - */ -static LONG recursive_delete_keyA(HKEY base, char const *name) -{ - LONG res; - HKEY key; - - res = RegOpenKeyExA(base, name, 0, KEY_READ | KEY_WRITE, &key); - if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS; - if (res != ERROR_SUCCESS) return res; - res = recursive_delete_key(key); - RegCloseKey(key); - return res; -} - -/*********************************************************************** - * recursive_delete_keyW - */ -static LONG recursive_delete_keyW(HKEY base, WCHAR const *name) -{ - LONG res; - HKEY key; - - res = RegOpenKeyExW(base, name, 0, KEY_READ | KEY_WRITE, &key); - if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS; - if (res != ERROR_SUCCESS) return res; - res = recursive_delete_key(key); - RegCloseKey(key); - return res; -} - -/*********************************************************************** * coclass list */ static GUID const CLSID_RecordInfo = {
1
0
0
0
Stefan Leichter : quartz: Remove 'recursive registry key delete' function.
by Alexandre Julliard
23 Aug '07
23 Aug '07
Module: wine Branch: master Commit: c13c9e382496a451f4504ecf61ec0c1865c6f8ea URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c13c9e382496a451f4504ecf6…
Author: Stefan Leichter <Stefan.Leichter(a)camline.com> Date: Wed Aug 22 21:44:06 2007 +0200 quartz: Remove 'recursive registry key delete' function. --- dlls/quartz/regsvr.c | 84 ++++++-------------------------------------------- 1 files changed, 10 insertions(+), 74 deletions(-) diff --git a/dlls/quartz/regsvr.c b/dlls/quartz/regsvr.c index 20bc5c4..8b93601 100644 --- a/dlls/quartz/regsvr.c +++ b/dlls/quartz/regsvr.c @@ -172,9 +172,6 @@ static LONG register_key_defvalueA(HKEY base, WCHAR const *name, static LONG register_progid(WCHAR const *clsid, char const *progid, char const *curver_progid, char const *name, char const *extra); -static LONG recursive_delete_key(HKEY key); -static LONG recursive_delete_keyA(HKEY base, char const *name); -static LONG recursive_delete_keyW(HKEY base, WCHAR const *name); /*********************************************************************** * register_interfaces @@ -263,7 +260,8 @@ static HRESULT unregister_interfaces(struct regsvr_interface const *list) WCHAR buf[39]; StringFromGUID2(list->iid, buf, 39); - res = recursive_delete_keyW(interface_key, buf); + res = RegDeleteTreeW(interface_key, buf); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; } RegCloseKey(interface_key); @@ -370,16 +368,19 @@ static HRESULT unregister_coclasses(struct regsvr_coclass const *list) WCHAR buf[39]; StringFromGUID2(list->clsid, buf, 39); - res = recursive_delete_keyW(coclass_key, buf); + res = RegDeleteTreeW(coclass_key, buf); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; if (list->progid) { - res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->progid); + res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } if (list->viprogid) { - res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->viprogid); + res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->viprogid); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } } @@ -521,7 +522,7 @@ static HRESULT unregister_mediatypes_parsing(struct regsvr_mediatype_parsing con if (res != ERROR_SUCCESS) break; StringFromGUID2(list->subtype, buf, 39); - res = recursive_delete_keyW(majortype_key, buf); + res = RegDeleteTreeW(majortype_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; /* Removed majortype key if there is no more subtype key */ @@ -556,7 +557,7 @@ static HRESULT unregister_mediatypes_extension(struct regsvr_mediatype_extension res = ERROR_SUCCESS; else if (res == ERROR_SUCCESS) for (; res == ERROR_SUCCESS && list->majortype; ++list) { - res = recursive_delete_keyA(extensions_root_key, list->extension); + res = RegDeleteTreeA(extensions_root_key, list->extension); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; } @@ -775,71 +776,6 @@ error_close_progid_key: return res; } -/*********************************************************************** - * recursive_delete_key - */ -static LONG recursive_delete_key(HKEY key) -{ - LONG res; - WCHAR subkey_name[MAX_PATH]; - DWORD cName; - HKEY subkey; - - for (;;) { - cName = sizeof(subkey_name) / sizeof(WCHAR); - res = RegEnumKeyExW(key, 0, subkey_name, &cName, - NULL, NULL, NULL, NULL); - if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) { - res = ERROR_SUCCESS; /* presumably we're done enumerating */ - break; - } - res = RegOpenKeyExW(key, subkey_name, 0, - KEY_READ | KEY_WRITE, &subkey); - if (res == ERROR_FILE_NOT_FOUND) continue; - if (res != ERROR_SUCCESS) break; - - res = recursive_delete_key(subkey); - RegCloseKey(subkey); - if (res != ERROR_SUCCESS) break; - } - - if (res == ERROR_SUCCESS) res = RegDeleteKeyW(key, 0); - return res; -} - -/*********************************************************************** - * recursive_delete_keyA - */ -static LONG recursive_delete_keyA(HKEY base, char const *name) -{ - LONG res; - HKEY key; - - res = RegOpenKeyExA(base, name, 0, KEY_READ | KEY_WRITE, &key); - if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS; - if (res != ERROR_SUCCESS) return res; - res = recursive_delete_key(key); - RegCloseKey(key); - return res; -} - -/*********************************************************************** - * recursive_delete_keyW - */ -static LONG recursive_delete_keyW(HKEY base, WCHAR const *name) -{ - LONG res; - HKEY key; - - res = RegOpenKeyExW(base, name, 0, KEY_READ | KEY_WRITE, &key); - if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS; - if (res != ERROR_SUCCESS) return res; - res = recursive_delete_key(key); - RegCloseKey(key); - return res; -} - - static GUID const CLSID_PSFactoryBuffer = { 0x92a3a302, 0xda7c, 0x4a1f, {0xba,0x7e,0x18,0x02,0xbb,0x5d,0x2d,0x02} };
1
0
0
0
Detlef Riekenberg : winspool: Add always the Win9x and the NT printerdriver .
by Alexandre Julliard
23 Aug '07
23 Aug '07
Module: wine Branch: master Commit: 8506125cb96e45f226623663a0ebcfaa81115e7a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8506125cb96e45f226623663a…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Wed Aug 22 20:24:35 2007 +0200 winspool: Add always the Win9x and the NT printerdriver. --- dlls/winspool.drv/info.c | 38 +++++++++++++++++++++----------------- 1 files changed, 21 insertions(+), 17 deletions(-) diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index 56203da..1ed05fd 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -470,31 +470,35 @@ static BOOL add_printer_driver(const char *name) { DRIVER_INFO_3A di3a; - static char driver_path[] = "wineps16", - data_file[] = "<datafile?>", - config_file[] = "wineps16", - help_file[] = "<helpfile?>", - dep_file[] = "<dependent files?>\0", - monitor_name[] = "<monitor name?>", + static char driver_9x[] = "wineps16.drv", + driver_nt[] = "wineps.drv", + env_9x[] = "Windows 4.0", + env_nt[] = "Windows NT x86", + data_file[] = "generic.ppd", default_data_type[] = "RAW"; - di3a.cVersion = (GetVersion() & 0x80000000) ? 0 : 3; /* FIXME: add 1, 2 */ + ZeroMemory(&di3a, sizeof(DRIVER_INFO_3A)); + di3a.cVersion = 3; di3a.pName = (char *)name; - di3a.pEnvironment = NULL; /* NULL means auto */ - di3a.pDriverPath = driver_path; + di3a.pEnvironment = env_nt; + di3a.pDriverPath = driver_nt; di3a.pDataFile = data_file; - di3a.pConfigFile = config_file; - di3a.pHelpFile = help_file; - di3a.pDependentFiles = dep_file; - di3a.pMonitorName = monitor_name; + di3a.pConfigFile = driver_nt; di3a.pDefaultDataType = default_data_type; - if (!AddPrinterDriverA(NULL, 3, (LPBYTE)&di3a)) + if (AddPrinterDriverA(NULL, 3, (LPBYTE)&di3a)) { - ERR("Failed adding driver (%d)\n", GetLastError()); - return FALSE; + di3a.cVersion = 0; + di3a.pEnvironment = env_9x; + di3a.pDriverPath = driver_9x; + di3a.pConfigFile = driver_9x; + if (AddPrinterDriverA(NULL, 3, (LPBYTE)&di3a)) + { + return TRUE; + } } - return TRUE; + ERR("Failed adding driver %s: %u\n", debugstr_a(di3a.pDriverPath), GetLastError()); + return FALSE; } #ifdef SONAME_LIBCUPS
1
0
0
0
← Newer
1
...
24
25
26
27
28
29
30
...
109
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Results per page:
10
25
50
100
200