____________________________________________________________
| 1996 | // |
| 1997 | // |
| 1998 | static bool write_header(DESC handle, ULONG backup_buffer_size, bool full_buffer) |
| 1999 | { |
| 2000 | BurpGlobals* tdgbl = BurpGlobals::getSpecific(); |
| 2001 | |
| 2002 | if (backup_buffer_size) |
| 2003 | { |
| 2004 | tdgbl->mvol_io_header = tdgbl->mvol_io_buffer; |
| 2005 | |
| 2006 | put(tdgbl, rec_burp); |
| 2007 | put_numeric(att_backup_format, ATT_BACKUP_FORMAT); |
| 2008 | |
| 2009 | if (tdgbl->gbl_sw_compress) |
| 2010 | put_numeric(att_backup_compress, 1); |
| 2011 | |
| 2012 | if (tdgbl->gbl_sw_transportable) |
| 2013 | put_numeric(att_backup_transportable, 1); |
| 2014 | |
| 2015 | if (tdgbl->gbl_sw_zip) |
| 2016 | put_numeric(att_backup_zip, 1); |
| 2017 | |
| 2018 | put_numeric(att_backup_blksize, backup_buffer_size); |
| 2019 | |
| 2020 | tdgbl->mvol_io_volume = tdgbl->mvol_io_ptr + 2; |
| 2021 | put_numeric(att_backup_volume, tdgbl->mvol_volume_count); |
| 2022 | |
| 2023 | if (tdgbl->gbl_sw_keyname) |
| 2024 | { |
| 2025 | tdgbl->mvol_keyname = tdgbl->gbl_sw_keyname; |
| 2026 | put_asciz(att_backup_keyname, tdgbl->mvol_keyname); |
| 2027 | } |
| 2028 | |
| 2029 | if (tdgbl->gbl_sw_crypt) |
| 2030 | { |
| 2031 | tdgbl->mvol_crypt = tdgbl->gbl_sw_crypt; |
| 2032 | put_asciz(att_backup_crypt, tdgbl->mvol_crypt); |
| 2033 | } |
| 2034 | |
| 2035 | put_asciz(att_backup_file, tdgbl->gbl_database_file_name); |
| 2036 | put_asciz(att_backup_date, tdgbl->gbl_backup_start_time); |
| 2037 | |
| 2038 | if (tdgbl->gbl_sw_keyholder) |
| 2039 | { |
| 2040 | start_crypt(tdgbl); |
| 2041 | fb_assert(tdgbl->gbl_crypt && tdgbl->gbl_crypt->crypt_plugin); |
| 2042 | Firebird::string hash; |
| 2043 | calc_hash(hash, tdgbl->gbl_crypt->crypt_plugin); |
| 2044 | put_asciz(att_backup_hash, hash.c_str()); |
| 2045 | } |
| 2046 | |
| 2047 | put(tdgbl, att_end); |
| 2048 | |
| 2049 | tdgbl->mvol_io_data = (UCHAR*) FB_ALIGN((U_IPTR) tdgbl->mvol_io_ptr, MAX_HEADER_SIZE); |
| 2050 | fb_assert(tdgbl->mvol_io_data == tdgbl->mvol_io_header + MAX_HEADER_SIZE); |
| 2051 | } |
| 2052 | else |
| 2053 | { |
| 2054 | const ULONG vax_value = gds__vax_integer(reinterpret_cast<const UCHAR*>( |
| 2055 | &tdgbl->mvol_volume_count), |
no test coverage detected