| 207 | |
| 208 | |
| 209 | void CExt2Attribute::OnOK() |
| 210 | { |
| 211 | NT::NTSTATUS status; |
| 212 | HANDLE Handle = NULL; |
| 213 | CHAR DrvLetter = 0; |
| 214 | CString str; |
| 215 | BOOL rc = FALSE; |
| 216 | BOOL dc = FALSE; |
| 217 | |
| 218 | UpdateData(TRUE); |
| 219 | |
| 220 | if (m_Codepage.IsEmpty()) { |
| 221 | m_Codepage = "default"; |
| 222 | } |
| 223 | |
| 224 | CComboBox *cbCodepage = (CComboBox *)GetDlgItem(IDC_COMBO_CODEPAGE); |
| 225 | if (cbCodepage) { |
| 226 | int rc = cbCodepage->FindStringExact(-1, m_Codepage); |
| 227 | if (rc == CB_ERR) { |
| 228 | AfxMessageBox("Invalid codepage type: "+m_Codepage, MB_OK|MB_ICONWARNING); |
| 229 | return; |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | if (m_EVP->bReadonly && m_EVP->bExt3 && !m_bReadonly) { |
| 234 | str = "Are you sure to enable writing support" |
| 235 | " on this EXT3 volume with Ext2Fsd ?"; |
| 236 | if (AfxMessageBox(str, MB_YESNO) != IDYES) { |
| 237 | m_EVP->bExt3Writable = FALSE; |
| 238 | } else { |
| 239 | m_EVP->bExt3Writable = TRUE; |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | /* initialize structures to communicate with ext2fsd service*/ |
| 244 | m_EVP->Magic = EXT2_VOLUME_PROPERTY_MAGIC; |
| 245 | m_EVP->Command = APP_CMD_SET_PROPERTY3; |
| 246 | m_EVP->Flags = 0; |
| 247 | m_EVP->Flags2 = 0; |
| 248 | m_EVP->bReadonly = (BOOLEAN)m_bReadonly; |
| 249 | memset(m_EVP->Codepage, 0, CODEPAGE_MAXLEN); |
| 250 | strcpy((CHAR *)m_EVP->Codepage, m_Codepage.GetBuffer(CODEPAGE_MAXLEN)); |
| 251 | |
| 252 | /* initialize hiding filter patterns */ |
| 253 | if (m_sPrefix.IsEmpty()) { |
| 254 | m_EVP->bHidingPrefix = FALSE; |
| 255 | memset(m_EVP->sHidingPrefix, 0, HIDINGPAT_LEN); |
| 256 | } else { |
| 257 | strcpy( m_EVP->sHidingPrefix, |
| 258 | m_sPrefix.GetBuffer(m_sPrefix.GetLength())); |
| 259 | m_EVP->bHidingPrefix = TRUE; |
| 260 | } |
| 261 | |
| 262 | if (m_sSuffix.IsEmpty()) { |
| 263 | m_EVP->bHidingSuffix = FALSE; |
| 264 | memset(m_EVP->sHidingSuffix, 0, HIDINGPAT_LEN); |
| 265 | } else { |
| 266 | strcpy(m_EVP->sHidingSuffix, |
nothing calls this directly
no test coverage detected