Primary Objective:~--To determine the intracranial objective response rate (ORR) of niraparib in combination with dostarlimab in patients with brain metastases.~Secondary Objectives:~To determine the duration of intracranial response (DoR) of niraparib in combination with dostarlimab in patients with brain metastases.~To determine the intracranial ORR, defined as assessed by RANO-BM and iRANO.~To assess the systemic antitumor activity of niraparib in combination with dostarlimab in patients with brain metastases as defined by ORR, CBR (Stable Disease [SD]>6m+CR+PR), progression free survival (PFS) and overall survival (OS).~Evaluate the safety and tolerability of niraparib in combination with dostarlimab in patients with brain metastases.~Explorative Objectives:~To assess predictive and pharmacodynamic (PD) markers of response.~To assess the immune-related effects of niraparib and dostarlimab.~To evaluate the effects of niraparib and dostarlimab on steroid, cranial radiation, and opiate pain medication use and seizure reduction.~To assess ctDNA in cerebrospinal fluid (CSF) in all participants, and explore relationship to matched blood and tissue samples, when available.~To explore biomarkers of response and resistance in CSF.~To evaluate niraparib and dostarlimab concentrations or pharmacokinetics (PK)~To screen for the presence of dostarlimab anti-drug antibodies (ADA)
To learn if the combination of niraparib and dostarlimab can help to control advanced cancer that has spread to the brain.