a b s t r a c tIn this paper, we consider a dual risk process which can be used to model the surplus of a business that invests money constantly and earns gains randomly in both time and amount. The occurrences of the gains and their amounts are assumed follow a semiMarkovian structure (e.g. Reinhard, 1984). We analyze a quantity resembling the Gerber-Shiu expected discounted penalty function (Gerber and Shiu, 1998) that incorporates random variables defined before and after the time of ruin, such as the minimum surplus level before ruin and the time of the first gain after ruin. General properties of the function are studied, and some exact results are derived upon exponential distributional assumptions on either the inter-arrival times or the gain amounts. Applications in a perpetual insurance and the last inter-arrival time containing the time of ruin are given along with some numerical examples.